User:Seddon (WMF)/editcheck: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Seddon (WMF) (talk | contribs)
Created page with "{{MediaWiki:Centralnotice-shared-common-style-2011}} {{MediaWiki:Centralnotice-shared-button-2011}} <style type="text/css"> #centralNotice.collapsed #{{{utm-banner}}}{ disp..."
 
Seddon (WMF) (talk | contribs)
No edit summary
Line 38: Line 38:
/* Bigger bold, blue text */
/* Bigger bold, blue text */
#{{{utm-banner}}} #cn-bold-blue-text {
#{{{utm-banner}}} #cn-bold-blue-text {
padding: 30px 80px 0.5em 140px;
font-size: 2.25em;
text-align:center;
text-direction:{{int:Centralnotice-2011translations-dir}};
font-size: 2em;
font-weight: bold;
font-weight: bold;
font-family: Helvetica, Arial, sans-serif;
color: navy;
color: navy;
padding: 0.8em 120px 0.2em 175px;
line-height: 1em;
line-height: 1em;
text-align:center;
}
}

<!-- start of Thermometer styles -->


#{{{utm-banner}}} #thermo-caption {
#{{{utm-banner}}} #thermo-caption {
font-size: 1.5em;
font-size: 1.2em;
font-weight: bold;
font-weight: bold;
font-family: Helvetica, Arial, sans-serif;
color: navy;
color: navy;
padding: 0;
padding-top: 6px;
line-height: 1.5em;
line-height: 1.2em;
text-align:center;
text-align:center;
}
margin: 0 0 0 75px;
}

<!-- start of Thermometer styles -->


#{{{utm-banner}}} #thermometer-wrapper {
#{{{utm-banner}}} #thermometer-wrapper {
Line 160: Line 158:
<div id="cn-bold-blue-text">
<div id="cn-bold-blue-text">
<span id="text-line-1">{{{text-1}}}</span><br />
<span id="text-line-1">{{{text-1}}}</span><br />
<span id="text-line-1">{{{text-2}}}</span><br />
<span id="text-line-1">{{{text-2}}}</span><!--<br /><span id="text-line-1">{{{text-3}}}</span>-->
<span id="text-line-1">{{{text-3}}}</span>
</div>
</div>

<div id="thermometer-wrapper">
<div id="thermometer-wrapper">
<div id="notice-thermometer">
<div id="notice-thermometer">
<div id="notice-thermometer-start"></div>
<div id="notice-thermometer-start"></div>
<div style="width: 450px;" id="notice-thermometer-base"></div>
<div style="width: 400px;" id="notice-thermometer-base"><!--<span id="left-span"></span>--></div>
<!-- <div id="notice-thermometer-recieve"></div> -->
<!-- <div id="notice-thermometer-recieve"></div> -->
<div id="notice-thermometer-end"></div>
<div id="notice-thermometer-end"></div>
<div id="notice-thermometer-togo"><span id="left-span"></span></div>
<div id="notice-thermometer-mercury">
<div id="notice-thermometer-mercury">
<div style="width: 60px;" id="notice-thermometer-fill">€{{MediaWiki:Centralnotice-shared-2011-fundraising-value}}M raised</div>
<div style="width: 60px;" id="notice-thermometer-fill"><span id="raised-span"></span></div>
<div id="notice-thermometer-arrow"></div>
<div id="notice-thermometer-arrow"></div>
</div>
</div>
<div id="notice-thermometer-togo">{{MediaWiki:Centralnotice-shared-2011-fundraising-left}}M left</div>
</div>
</div>
<span id="thermo-caption">{{{caption}}}</span>
<div id="thermo-caption"><span id="goal-span"><span></div>
</div>
</div>
Line 214: Line 212:
} );
} );
};
};

function fixMessage(){
var message1 = '{{{text-1}}}';
message1 = message1.replace('%AMOUNT%',getCountryValue(2) + getCountryValue(4));
document.getElementById('text-line-1').innerHTML = message1;
}

function fixButton(){
if(getCountryValue(1) == 'CAD' || getCountryValue(1) =='AUD' || getCountryValue(1) =='GBP' || getCountryValue(1) =='JPY')
buttonText = "{{int:Centralnotice-2011translations-currency-2}}";
else
buttonText = "{{int:Centralnotice-2011translations-currency-1}}";
buttonText = buttonText.replace('%CURRENCY%',getCountryValue(2) + ' ' + '(' + getCountryValue(1) +')' );
document.getElementById('notice-button-2011-label').innerHTML = buttonText;
if(getCountryValue(1) == 'USD' || getCountryValue(1) == 'EUR')
document.getElementById( 'notice-button-2011-label').innerHTML = '{{int:Centralnotice-2011translations-read-now}}';
}

function fixNumber(rawValue){
if(rawValue/1000>=1)
{
return (getCountryValue(2) + (rawValue/1000).toPrecision(3) + ' B');
}
else if(rawValue*1000<1000)
{
return (getCountryValue(2) + (rawValue*1000).toPrecision(3) + ' K');
}
else
{
return (getCountryValue(2) + (rawValue/1).toPrecision(3) + ' M');
}
}

function fixThermo(){
var togoText = "{{{togo-text}}}";
var raisedText ="{{{raised-text}}}";
var goalText = "{{{goal-text}}}";

var raisedNumber = parseInt(('{{{amount}}}').replace('\,','.'));
if(getCountryValue(1)!='USD')
{
raisedNumber = getCountryValue(6)*raisedNumber/{{MediaWiki:Centralnotice-shared-2011-fundraising-goal}};
}
var goalNumber = getCountryValue(6);
var togoNumber = (goalNumber - raisedNumber);

togoText = togoText.replace('%AMOUNT%',fixNumber(togoNumber));
raisedText = raisedText.replace('%AMOUNT%',fixNumber(raisedNumber));
goalText = goalText.replace('%AMOUNT%',fixNumber(goalNumber));

document.getElementById('left-span').innerHTML = togoText;
document.getElementById('raised-span').innerHTML = raisedText;
document.getElementById('goal-span').innerHTML = goalText;
}

var bannerChooseRandom = function(choiceString) {
var choices = choiceString.split(',');
if ( choices.length ) {
return choices[Math.floor( Math.random() * choices.length )].replace(/^\s+|\s+$/, '');
}
}


// Set thermometer sizes
// Set thermometer sizes
var maxPixels = 450;
var maxPixels = 500;
var range = (parseFloat( '{{MediaWiki:Centralnotice-shared-2011-fundraising-goal}}' )) * 0.78;
var range = parseInt( '{{MediaWiki:Centralnotice-shared-2011-fundraising-goal}}' );
var value = (parseFloat( '{{{amount}}}' ) + parseFloat( '{{MediaWiki:Centralnotice-shared-2011-fundraising-extra}}' )) * 0.78;
var value = parseInt( '{{{amount}}}' );
var left = range - value;
var fill = parseInt( maxPixels * ( ( 1 / range ) * value ) );
var fill = parseInt( maxPixels * ( ( 1 / range ) * value ) );


$(document).ready( function () {
$(document).ready( function () {
bannerRewriteUrl();
bannerRewriteUrl();
//fixButton();
$('#notice-thermometer-fill').html( '€' + value.toFixed(1) + 'M raised' );
fixMessage();
$('#notice-thermometer-togo').html( '€' + left.toFixed(1) + 'M left' );
fixThermo();
$('#notice-thermometer-fill').animate( { width: fill }, 3000 )
$('#notice-thermometer-fill').animate( { width: fill }, 3000 )
});
});

Revision as of 21:37, 28 December 2011

MediaWiki:Centralnotice-shared-common-style-2011 MediaWiki:Centralnotice-shared-button-2011 <style type="text/css">

  1. centralNotice.collapsed #{{{utm-banner}}}{
 display: none;

}

  1. {{{utm-banner}}} {
 position: relative;
 background-image: url({{{image-url}}});
 background-repeat: no-repeat;
 margin-bottom: 0.5em !important;
 background-color:#FFFFFF;
 border: solid 1px silver;
 height:172px;
 overflow: hidden;

} body.ltr #{{{utm-banner}}} {

 background-position: 0px 0px;

} body.rtl #{{{utm-banner}}} {

 background-position: 100% 0%;

}

  1. {{{utm-banner}}} a {
 text-decoration: none;

}

  1. {{{utm-banner}}} a:hover {
 text-decoration: none;

}

  1. cn-bold-blue-text:hover {
 text-decoration: underline;

}

/* Bigger bold, blue text */

  1. {{{utm-banner}}} #cn-bold-blue-text {
 padding: 30px 80px 0.5em 140px;
 text-align:center;
 text-direction:⧼Centralnotice-2011translations-dir⧽;
 font-size: 2em;
 font-weight: bold;
 color: navy;
 line-height: 1em;

}


  1. {{{utm-banner}}} #thermo-caption {
 font-size: 1.2em;
 font-weight: bold;
 color: navy;
 padding-top: 6px;
 line-height: 1.2em;
 text-align:center;

}

  1. {{{utm-banner}}} #thermometer-wrapper {
 position: relative;
 height: 21px;
 width: 800px;
 margin: 0 auto;
 padding: 0;

}

#{{{utm-banner}}} #notice-thermometer,  #{{{utm-banner}}} #notice-thermometer-daily {
 position: relative;
 height: 21px;
 width: 800px;
 margin: 0.75em 0.75em 0.25em 180px;

}

  1. {{{utm-banner}}} #notice-thermometer-start, #{{{utm-banner}}} #notice-thermometer-daily-start {
 float: left;
 background-image: url(//upload.wikimedia.org/wikipedia/foundation/3/3d/Fundraising-2010-thermometer2.png);
 background-position: left top;
 width: 10px;
 height: 21px;

}

  1. {{{utm-banner}}} #notice-thermometer-base, #{{{utm-banner}}} #notice-thermometer-daily-base {
 float: left;
 background-image: url(//upload.wikimedia.org/wikipedia/foundation/3/3d/Fundraising-2010-thermometer2.png);
 background-position: left 63px;
 height: 21px;
 color: #3474b5;
 font-weight: bold;
 text-align: right;
 line-height: 23px;
 overflow: hidden;

}

  1. {{{utm-banner}}} #notice-thermometer-togo, #{{{utm-banner}}} #notice-thermometer-daily-togo {
 float: left;
 height: 21px;
 font-weight: bold;
 line-height: 23px;
 overflow: hidden;
 margin-left: 1em;

}

  1. {{{utm-banner}}} #notice-thermometer-end, #{{{utm-banner}}} #notice-thermometer-daily-end {
 float: left;
 background-image: url(//upload.wikimedia.org/wikipedia/foundation/3/3d/Fundraising-2010-thermometer2.png);
 background-position: right -63px;
 width: 10px;
 height: 21px;

}

  1. {{{utm-banner}}} #notice-thermometer-mercury, #{{{utm-banner}}} #notice-thermometer-daily-mercury {
 position: absolute;
 left: 10px;
 height: 21px;

}

  1. {{{utm-banner}}} #notice-thermometer-fill, #{{{utm-banner}}} #notice-thermometer-daily-fill {
 float: left;
 background-image: url(//upload.wikimedia.org/wikipedia/foundation/3/3d/Fundraising-2010-thermometer2.png);
 background-position: left -21px;
 height: 21px;
 color: #E8E8E8;
 font-weight: bold;
 text-align: right;
 line-height: 23px;
 overflow: hidden;

}

  1. {{{utm-banner}}} #notice-thermometer-arrow, #{{{utm-banner}}} #notice-thermometer-daily-arrow {
 float: left;
 background-image: url(//upload.wikimedia.org/wikipedia/foundation/d/d6/2010-thermometer2-transition.png);
 height: 21px;
 width: 23px;

}

  1. {{{utm-banner}}} #notice-thermometer-recieve, #{{{utm-banner}}} #notice-thermometer-daily-recieve {
 float: left;
 //background-image: url(//upload.wikimedia.org/wikipedia/foundation/d/d6/2010-thermometer2-transition.png);
 background-color: #CCCCCC;
 //background-position: right bottom;
 height: 21px;
 width: 23px;

}


</style>

<script type="text/javascript">

var countrySpecific = { Template:2011FR/MulticurrencyLimited };

function getCountryValue(ii) {

if(typeof(countrySpecific[Geo.country]) === 'undefined')
 return countrySpecific['XX'][ii];
else
 return countrySpecific[Geo.country][ii]; 

}

</script>

 <a id="variable_lp" href="#">
 
   {{{text-1}}}
{{{text-2}}}
⧼Centralnotice-2011translations-read-now⧽
 </a>
   <a href="#" onclick="hideBanner();return false;"><img border="0" src="//bits.wikimedia.org/skins-1.17/common/images/closewindow.png" alt="Close" /></a>

<script type="text/javascript">

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
 } );

};

function fixMessage(){

 var message1 = '{{{text-1}}}';	
 message1 = message1.replace('%AMOUNT%',getCountryValue(2) + getCountryValue(4));	
 document.getElementById('text-line-1').innerHTML = message1;

}

function fixButton(){

 if(getCountryValue(1) == 'CAD' || getCountryValue(1) =='AUD' || getCountryValue(1) =='GBP' || getCountryValue(1) =='JPY')
   buttonText = "⧼Centralnotice-2011translations-currency-2⧽";
 else
   buttonText = "⧼Centralnotice-2011translations-currency-1⧽";
 buttonText = buttonText.replace('%CURRENCY%',getCountryValue(2) + ' ' + '(' + getCountryValue(1) +')' );
 document.getElementById('notice-button-2011-label').innerHTML = buttonText;
 if(getCountryValue(1) == 'USD' || getCountryValue(1) == 'EUR')
   document.getElementById( 'notice-button-2011-label').innerHTML = '⧼Centralnotice-2011translations-read-now⧽';

}

function fixNumber(rawValue){

 if(rawValue/1000>=1)
 {
   return (getCountryValue(2) + (rawValue/1000).toPrecision(3) + ' B');
 }
 else if(rawValue*1000<1000)
 {
   return (getCountryValue(2) + (rawValue*1000).toPrecision(3) + ' K');
 }
 else
 {
   return (getCountryValue(2) + (rawValue/1).toPrecision(3) + ' M');
 }

}

function fixThermo(){

 var togoText = "{{{togo-text}}}";
 var raisedText ="{{{raised-text}}}";
 var goalText = "{{{goal-text}}}";
 var raisedNumber = parseInt(('{{{amount}}}').replace('\,','.'));
 if(getCountryValue(1)!='USD')
 {
   raisedNumber = getCountryValue(6)*raisedNumber/MediaWiki:Centralnotice-shared-2011-fundraising-goal;
 } 
 var goalNumber = getCountryValue(6);
 var togoNumber = (goalNumber - raisedNumber); 
 togoText = togoText.replace('%AMOUNT%',fixNumber(togoNumber));
 raisedText = raisedText.replace('%AMOUNT%',fixNumber(raisedNumber));
 goalText = goalText.replace('%AMOUNT%',fixNumber(goalNumber));
 document.getElementById('left-span').innerHTML = togoText;
 document.getElementById('raised-span').innerHTML = raisedText;
 document.getElementById('goal-span').innerHTML = goalText;

}

var bannerChooseRandom = function(choiceString) {

 var choices = choiceString.split(',');
 if ( choices.length ) {
   return choices[Math.floor( Math.random() * choices.length )].replace(/^\s+|\s+$/, );
 }

}

// Set thermometer sizes var maxPixels = 500; var range = parseInt( 'MediaWiki:Centralnotice-shared-2011-fundraising-goal' ); var value = parseInt( '{{{amount}}}' ); var fill = parseInt( maxPixels * ( ( 1 / range ) * value ) );

$(document).ready( function () {

 bannerRewriteUrl();
 //fixButton();
 fixMessage();
 fixThermo();
 $('#notice-thermometer-fill').animate( { width: fill }, 3000 )

});

</script>