common: bump version to 1.11
[sheet.git] / common.inc.plp
index 6672bd5010f66ba09b84c809729cf0b3c1e28606..e3316fc439a00246e5454d0f64194b3a1fb460a6 100644 (file)
@@ -34,6 +34,8 @@ BEGIN {
                Alert("<strong>Fatal error</strong>: $html.");
        };
 
+       push @INC, '.';
+
        # user request
        our $Dev = $ENV{HTTP_HOST} =~ /\bdev\./;
        our ($file) = $ENV{SCRIPT_FILENAME} =~ m{ ([^/]+) \.plp$ }x;
@@ -70,7 +72,7 @@ sub stylesheet {
 
        return map { sprintf(
                '<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
-               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.10", $_
+               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.11", $_
        ) } @avail;
 }
 
@@ -105,7 +107,7 @@ sub Html {
        }
 
        # default fallbacks
-       $meta->{stylesheet} ||= [qw'light dark circus mono red terse'];
+       $meta->{stylesheet} ||= [qw( light dark circus mono red )];
        $meta->{charset} ||= 'utf-8';
 
        # convert options to arrays
@@ -117,13 +119,17 @@ sub Html {
                unless $PLP::sentheaders;
        unshift @{ $meta->{raw} }, stylesheet($meta->{stylesheet});
 
+       push @{ $meta->{raw} }, (
+               '<link rel="stylesheet" type="text/css" media="monochrome" href="/mono.css?1.11" title="light">',
+       );
+
        # optional amends
        push @{ $meta->{raw} }, (
                '<!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->',
                '<!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]-->',
                !$showkeys ? '<style> .no {visibility:hidden} </style>' :
                $showkeys eq 'ghost' ? '<style> .no, .alias {opacity:.5} </style>' : (),
-               '<script type="text/javascript" src="/keys.js?1.6"></script>',
+               '<script type="text/javascript" src="/keys.js?1.6" async></script>',
        ) if $meta->{keys};
 
        # leading output
@@ -168,7 +174,7 @@ sub Html {
        created by <a href="http://shiar.nl/" rel="author">Shiar</a> •
        <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html"
         title="Licensed under the GNU Affero General Public License, version 3"
-        rel="license copyright">AGPLv3</a>
+        rel="license">AGPLv3</a>
 EOT
                say sprintf '• %.3fs', Time::HiRes::tv_interval($Time) if $Dev and $Time;
                say '</p>';
@@ -180,6 +186,7 @@ EOT
 sub showlink {
        my ($title, $href, $selected) = @_;
        return sprintf(
+               !$href ? '%s' :
                $selected ? '<strong>%s</strong>' : '<a href="%2$s">%s</a>',
                EscapeHTML($title), EscapeHTML($href)
        );