use HTTP::Date;
use Shiar_Sheet::KeySigns qw(%sign);
+$PLP::ERROR = sub {
+ my ($text, $html) = @_;
+ print '<p class="error"><strong>Fatal error</strong>: '.$html."</p>\n\n";
+};
+
our $style;
our $showkeys = !exists $get{keys} ? undef :
($get{keys} ne '0' && ($get{keys} || 'always'));
if (exists $get{style}) {
$style = $styles{ $get{style} };
require CGI::Cookie;
- AddCookie(CGI::Cookie->new(
+ if (my $cookie = CGI::Cookie->new(
-name => 'style',
-value => $style,
-path => '/', # site-wide; current page is confusing to most users
-expires => $style ? '+5y' : '-1d',
- )->as_string);
+ )) {
+ AddCookie($cookie->as_string);
+ }
}
$style ||= exists $cookie{style} && $styles{ $cookie{style} } || $_[0];
return join "\n", map { sprintf(
'<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
- $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.5", $_
+ $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.6", $_
) } @_;
}
!$showkeys ? '<style type="text/css"> .no {visibility:hidden} </style>'
: $showkeys eq 'ghost' ? '<style type="text/css"> .no, .alias {opacity:.5} </style>'
: (),
- '<script type="text/javascript" src="/keys.js"></script>',
+ '<script type="text/javascript" src="/keys.js?1.6"></script>',
) if $meta->{keys};
# flatten arrays