X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/6e999e79e078ca87e22b3474d532b3d570453661..d22e7febda8720bc38069f7061adb43b98143c48:/common.inc.plp diff --git a/common.inc.plp b/common.inc.plp index 6672bd5..e3316fc 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -34,6 +34,8 @@ BEGIN { Alert("Fatal error: $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( '', - $_ 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} }, ( + '', + ); + # optional amends push @{ $meta->{raw} }, ( '', '', !$showkeys ? '' : $showkeys eq 'ghost' ? '' : (), - '', + '', ) if $meta->{keys}; # leading output @@ -168,7 +174,7 @@ sub Html { created by • AGPLv3 + rel="license">AGPLv3 EOT say sprintf '• %.3fs', Time::HiRes::tv_interval($Time) if $Dev and $Time; say '

'; @@ -180,6 +186,7 @@ EOT sub showlink { my ($title, $href, $selected) = @_; return sprintf( + !$href ? '%s' : $selected ? '%s' : '%s', EscapeHTML($title), EscapeHTML($href) );