common: development indicator optionally written in html
[sheet.git] / common.inc.plp
index 879381d1e6f925b7dcf3965bfbd34c3a89683884..cabdc90923da2f1715a72175d79edea21c947cc2 100644 (file)
@@ -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,15 @@ 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',
+       ) if $ENV{HTTP_HOST} =~ /\bdev\./;
+
        # prepare trailing output
        PLP_END {
                print <<"EOT";
        # prepare trailing output
        PLP_END {
                print <<"EOT";