MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
No edit summary
do the slow CheckPaymentOutages last
Line 337: Line 337:


$(document).ready(function() {
$(document).ready(function() {

// Load list of payment outages from meta, and hide any which are current
$.getScript('//meta.wikimedia.org/w/index.php?' + $.param( { title:'MediaWiki:FR2013/Resources/PaymentOutages.js', action:'raw', ctype:'text/javascript' } ),
function() {
setTimeout(checkPaymentOutages(), 250); // allow time for script to have _executed_ (not just loaded)
});


// Disable submitting form with return key
// Disable submitting form with return key
$( 'form[name="paypalcontribution"]' ).bind( 'keypress', function(e) {
$( 'form[name="paypalcontribution"]' ).bind( 'keypress', function(e) {
var code = ( e.keyCode ? e.keyCode : e.which );
var code = ( e.keyCode ? e.keyCode : e.which );
if ( code == 13 ) return false;
if ( code == 13 ) return false;
});
});


Line 365: Line 359:


$(".frequency-options label").click(function() {
$(".frequency-options label").click(function() {
$(".frequency-options label").removeClass("checked");
$(".frequency-options label").removeClass("checked");
$(this).addClass("checked");
$(this).addClass("checked");
});
});


Line 375: Line 369:


$(".input_amount_other").click(function() {
$(".input_amount_other").click(function() {
$("#input_amount_other_box").focus();
$("#input_amount_other_box").focus();
});
});


Line 387: Line 381:
adjustHPC();
adjustHPC();
adjustOtherVal();
adjustOtherVal();

// Load list of payment outages from meta, and hide any which are current
$.getScript('//meta.wikimedia.org/w/index.php?' + $.param( { title:'MediaWiki:FR2013/Resources/PaymentOutages.js', action:'raw', ctype:'text/javascript' } ),
function() {
setTimeout(checkPaymentOutages(), 250); // allow time for script to have _executed_ (not just loaded)
});


});
});