MediaWiki:Resources/landingpage.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
m encode & |
grumble grumble. rv for now, will mess with this again tomorrow |
||
Line 7: | Line 7: | ||
return qs == null ? '' : qs[1]; |
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?title=MediaWiki:FR2013/Resources/PaymentOutages.js%26action=raw', checkPaymentOutages() ); |
|||
$(document).ready(function(){ |
$(document).ready(function(){ |