common: include from cwd to work around perl v5.26 security
[sheet.git] / common.inc.plp
index e5292ba46abd1365258e2ca7e812396deed7cc98..68ada33956a5a1dce7116da4d6181323ab8d4e88 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;
@@ -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.10" 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