User:Seddon (WMF)/editcheck
MediaWiki:Centralnotice-shared-common-style-2011 MediaWiki:Centralnotice-shared-button-2011
<style type="text/css">
- centralNotice.collapsed #{{{utm-banner}}}{
display: none;
}
- {{{utm-banner}}} .cn-bottom-right-float {
position: relative !important;
}
- {{{utm-banner}}} {
background-image: url({{{image-url}}}); background-position: bottom right; background-repeat: no-repeat; display: none; // defaulting to none, setting visible when the margins are added as fail-safe and no-go-nuts-safe position: relative; background-color: #CCE7CD; border: none; height:100px; overflow: hidden;
}
- {{{utm-banner}}} a {
text-decoration: none;
}
- {{{utm-banner}}} a:hover {
text-decoration: none;
}
- cn-bold-blue-text:hover {
text-decoration: underline;
}
- cn-blue {
color: blue; }
- cn-blue-underline {
text-decoration: underline;
}
- inlineblue {
text-decoration: underline; color: blue;
}
/* Bigger bold, blue text */
- {{{utm-banner}}} #cn-bold-blue-text {
font-size: 1em; color: #111111; padding: 1em; line-height: 1em; text-align:left; text-direction:⧼Centralnotice-2011translations-dir⧽; padding-bottom: 1.5em; padding-top: 0.5em; height: 100px;
}
body.ltr #{{{utm-banner}}} #cn-bold-blue-text{
padding-right: 20px;
} body.rtl #{{{utm-banner}}} #cn-bold-blue-text{
padding-left: 20px;
}
.banner-column{
padding: 0.5em; padding-right: 1em; padding-left: 1em; max-width: 28%; float: left;
}
</style>
<script type="text/javascript">
var countrySpecific = { Template:2011FR/Multicurrency2 };
function getCountryValue(ii) { return countrySpecific[Geo.country][ii]; }
</script>
<script type="text/javascript">
function addBannerSpace() {
$('#mw-panel').css('top', '260px'); $('#mw-head').css('top', '100px'); $('#{{{utm-banner}}}').css('display', 'block');
}
function removeBannerSpace() {
$('#mw-panel').css('top', '160px'); $('#mw-head').css('top', '0px');
}
$('body').prepend($('#centralNotice'));
var bannerChooseRandom = function(choiceString) {
var choices = choiceString.split(','); if ( choices.length ) { return choices[Math.floor( Math.random() * choices.length )].replace(/^\s+|\s+$/, ); }
}
var bannerRewriteUrl = function() {
$('#variable_lp').attr('href', function() { var baseUrl = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage'; var queryString = $.param( { 'uselang' : wgUserLanguage, 'country' : Geo.country, 'template' : 'Lp-layout-default', // landing page components 'appeal-template' : bannerChooseRandom( '{{{lp-appeal-template}}}' ), 'appeal': bannerChooseRandom( '{{{lp-appeal}}}' ), 'form-template' : bannerChooseRandom( '{{{lp-form-template}}}' ), 'form-countryspecific' : bannerChooseRandom( '{{{lp-form-countryspecific}}}' ), // utm tracking data 'utm_medium' : 'sitenotice', 'utm_source' : '{{{utm-banner}}}' + '_' + Geo.country, 'utm_campaign' : '{{{utm-campaign}}}' + '_' + getCountryValue(0) } ); var fullUrl = baseUrl + '?' + queryString; return fullUrl } );
};
$(document).ready( function () {
if ( wgCanonicalSpecialPageName != "CentralNotice" && wgCanonicalSpecialPageName != "NoticeTemplate" ){ addBannerSpace(); } bannerRewriteUrl();
});
</script>