git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
writing: indicate writing system for asl (l)anguage
[sheet.git]
/
common.inc.plp
diff --git
a/common.inc.plp
b/common.inc.plp
index 563c0e48ba5bdfa8986592c91fb46f65d7287732..313c18fdc23511b0f7a1a31ec66ca4171d869da2 100644
(file)
--- a/
common.inc.plp
+++ b/
common.inc.plp
@@
-23,15
+23,15
@@
$header{content_type} = 'text/html; charset=utf-8';
sub stylesheet {
my %styles = map {$_ => $_} @_;
sub stylesheet {
my %styles = map {$_ => $_} @_;
- if (
exists $get{style}
) {
- $style = $styles{ $
get{style}
};
+ if (
defined( my $setstyle = $get{style} )
) {
+ $style = $styles{ $
setstyle
};
eval {
require CGI::Cookie;
my $cookie = CGI::Cookie->new(
-name => 'style',
eval {
require CGI::Cookie;
my $cookie = CGI::Cookie->new(
-name => 'style',
- -value => $s
tyle
,
+ -value => $s
etstyle || ''
,
-path => '/', # site-wide; current page is confusing to most users
-path => '/', # site-wide; current page is confusing to most users
- -expires => $style ? '+5y' : '-1d',
+ -expires => $s
ets
tyle ? '+5y' : '-1d',
) or die "empty object returned\n";
AddCookie($cookie->as_string);
} or warn "Unable to create style cookie: $@";
) or die "empty object returned\n";
AddCookie($cookie->as_string);
} or warn "Unable to create style cookie: $@";
@@
-41,7
+41,7
@@
sub stylesheet {
return join "\n", map { sprintf(
'<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
return join "\n", map { sprintf(
'<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
- $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.
6
", $_
+ $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css?1.
7
", $_
) } @_;
}
) } @_;
}
@@
-77,6
+77,8
@@
sub Html {
$meta->{stylesheet} ||= [qw'light dark circus mono red terse'];
$meta->{charset} ||= 'utf-8';
$meta->{stylesheet} ||= [qw'light dark circus mono red terse'];
$meta->{charset} ||= 'utf-8';
+ ref $_ eq 'ARRAY' or $_ = [$_] for $meta->{raw};
+
# optional amends
push @{ $meta->{raw} }, (
'<!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->',
# optional amends
push @{ $meta->{raw} }, (
'<!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->',
@@
-113,6
+115,17
@@
EOT
print $_, "\n" for $meta->{raw} || ();
print qq{</head>\n\n<body id="$file">\n};
print $_, "\n" for $meta->{raw} || ();
print qq{</head>\n\n<body id="$file">\n};
+ # dev indicator
+ printf '<p style="%s">beta</p>', join('; ',
+ 'position: fixed',
+ 'right: 1em',
+ 'opacity: .5',
+ 'border: 1ex solid red',
+ 'border-width: 1ex 0',
+ 'z-index: 1',
+ 'background: inherit',
+ ) if $ENV{HTTP_HOST} =~ /\bdev\./;
+
# prepare trailing output
PLP_END {
print <<"EOT";
# prepare trailing output
PLP_END {
print <<"EOT";