MediaWiki:Resources/landingpage.js: Difference between revisions

Content deleted Content added
Undo revision 25504 by Pcoombe (talk)
add code to hide payment methods based on meta list
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 || null; // 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'] && now < outages[i]['end'] ) {
if (outages[i]['country'] && 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?title=MediaWiki:FR2013/Resources/PaymentOutages.js&action=raw', checkPaymentOutages() );
 
$(document).ready(function(){