MediaWiki:Resources/landingpage.js: Difference between revisions

Content deleted Content added
grumble grumble. rv for now, will mess with this again tomorrow
use $.param() to avoid &s
Line 7:
return qs == null ? '' : qs[1];
}
 
function checkPaymentOutages() {
/* Check against the scheduled payment method outages
* in global variable "outages" (loaded cross-wiki from meta)
* and hide the relevant button for any which are ongoing.
*/
var outages = outages || []; // don't die if it hasn't loaded...
var now = new Date();
for (var i = outages.length - 1; i >= 0; i--) {
if ( now > outages[i]['start'] ) {
if ( now < outages[i]['end'] ) {
 
if ( outages[i]['country'] ) {
if ( outages[i]['country'] == Geo.country ) {
$('.paymentmethod-' + outages[i]['method']).hide();
}
}
 
}
}
}
}
 
// Pull outages list from meta, then run the function
$.getScript('//meta.wikimedia.org/w/index.php?' + $.param( { title:'MediaWiki:FR2013/Resources/PaymentOutages.js', action:'raw' } ),
checkPaymentOutages() );
 
$(document).ready(function(){