common: bump version to 1.8
[sheet.git] / common.inc.plp
index f6cd6a6f7a93452a66346a7fdef08af0f5a7da43..fe2a2878a6a09d8c5e7861b2bb6e7d12452e89d7 100644 (file)
@@ -41,7 +41,7 @@ sub stylesheet {
 
        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.8", $_
        ) } @_;
 }
 
@@ -77,6 +77,8 @@ sub Html {
        $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]-->',
@@ -107,19 +109,31 @@ sub Html {
 <title>$meta->{title}</title>
 <meta name="description" content="$meta->{description}">
 <meta name="keywords" content="$meta->{keywords}">
+<meta name="viewport" content="width=device-width, initial-scale=1">
 <link rel="icon" type="image/png" href="/clip.png">
 EOT
        print $_, "\n" for $meta->{stylesheet} || ();
        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";
 <p class="footer">
        <a href="/" rel="start">sheet.shiar.nl</a>/$file.<a href="/source/$file.plp"
         rel="source" title="Written in Perl">plp</a>
-       <a href="http://git.shiar.nl/sheet.git/history/HEAD:/$file.plp"
+       version <a href="http://git.shiar.nl/sheet.git/history/HEAD:/$file.plp"
         rel="vcs-git" title="Git repository">$meta->{version}</a>
        created by <a href="http://shiar.nl/" rel="author">Shiar</a> •
        <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="license copyright"