From 829781346b75bdd66e4c964e8bce3b84cf8ed3fc Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 9 Jun 2015 06:17:10 +0200 Subject: [PATCH] common: development indicator optionally written in html Reverts hardcoded indicator in css by commit v1.4-5-g387941691e (2010-12-17) [style: mark development version], instead outputting initial body text if requested subdomain matches "dev". --- base.css | 6 ------ common.inc.plp | 11 +++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/base.css b/base.css index 55d4793..7b8586e 100644 --- a/base.css +++ b/base.css @@ -17,12 +17,6 @@ a:active, a:hover { /* common sections */ -h1 { - background-image: -moz-repeating-linear-gradient(top left -75deg, - rgba(255,0,0,.5), rgba(255,0,0,0) 1ex, - rgba(255,0,0,0) 2ex, rgba(255,0,0,.5) 3ex - ); -} h1, h2 { font-size: 200%; margin: 0; diff --git a/common.inc.plp b/common.inc.plp index 879381d..cabdc90 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -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} }, ( '', @@ -113,6 +115,15 @@ EOT print $_, "\n" for $meta->{raw} || (); print qq{\n\n\n}; + # dev indicator + printf '

beta

', 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"; -- 2.30.0