Commit: 987ad6d2c25a53a1e27f28332e47dfcc3428ecfc Author: Paul Dragoonis <[email protected]> Fri, 21 Jun 2013 18:55:45 +0100 Parents: 22fa8508f6ffedd89818c5dbb8053345957599d5 Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=987ad6d2c25a53a1e27f28332e47dfcc3428ecfc Log: [beta site] Adding a new beta message to the live website softly making all live users aware of the new beta site. Changed paths: M include/layout.inc M styles/site.css Diff: diff --git a/include/layout.inc b/include/layout.inc index 511ff4f..0d0a829 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -224,6 +224,13 @@ function site_header($title = '', $config = array()) </head> <body{$onload}> +<div id="head-beta-warning"> + <a id="beta-warning" href="?beta=1"> + <span class="dismiss" href="#">dismiss</span> + <span class="blurb">Step into the future! Click here to switch to the beta php.net site</span> + </a> +</div> + <div id="headnav"> <a href="/" rel="home"><img src="{$_SERVER['STATIC_ROOT']}/images/php.gif" alt="PHP" width="120" height="67" id="phplogo" /></a> @@ -353,15 +360,50 @@ function site_footer($config = array()) Last updated: {$last_updated} </div> </div> + +<script src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> +<script type="text/javascript"> +jQuery(document).ready(function($) { + function showBetaWarning() { + return document.cookie.indexOf("BetaWarning=") == -1; + } + + // ----- BETA WARNING CODE ----- + var headBetaWarning = $('#head-beta-warning'); + + // Wire up the beta warning. + headBetaWarning.find('.dismiss').click(function(e) { + e.preventDefault(); + $('body').css('margin-top', 0); + headBetaWarning.slideUp("fast"); + + // Hide it for a month by default. + var expiry = new Date(); + expiry.setTime(expiry.getTime() + (30 * 24 * 60 * 60 * 1000)); + + document.cookie = "BetaWarning=off; expires=" + expiry.toGMTString() + "; path=/"; + }); + + if (showBetaWarning()) { + headBetaWarning.show(); + $('body').css('margin-top', '25px'); + $('#beta-warning').slideDown(300, function() { + $(this).find('.blurb').fadeIn('slow'); + }); + } + +}); +</script> + <!--[if IE 6]> <script type="text/javascript"> - /*Load jQuery if not already loaded*/ if(typeof jQuery == 'undefined'){ document.write("<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\"></"+"script>"); var __noconflict = true; } var IE6UPDATE_OPTIONS = { icons_path: "/ie6update/images/" } </script> <script type="text/javascript" src="/ie6update/ie6update.js"></script> <![endif]--> + </body> </html> END_FOOTER; diff --git a/styles/site.css b/styles/site.css index 709e058..2d2bdda 100644 --- a/styles/site.css +++ b/styles/site.css @@ -1167,6 +1167,56 @@ div.soft-deprecation-notice blockquote.sidebar { background: transparent; } +/* Temporary BETA notice */ + +#beta-warning-close { + background-color: #99C; +} + +#head-beta-warning { + background-color: #333; + display: none; + position: fixed; + top: 0px; + left: 0px; + width: 100%; + z-index: 100; +} + +#beta-warning { + margin: 0 auto; + padding: 0.3em; + width: 65%; + display: none; + text-decoration: none; +} + +#head-beta-warning .dismiss { + font-size: 0.8em; + color: #9999CC; +} + +#beta-warning .blurb { + font-size: 1.1em; + line-height: 1.0em; + vertical-align: middle; + color: #EEE; + display: none; + margin-left: 12px; +} + +#beta-warning .blurb:hover { + color: #9999CC; +} + +#beta-warning .blurb a { + color: #99C; +} + +#beta-warning .blurb strong { + color: #99C; +} + /* * vim: noet */ -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
