MediaWiki:Common.js: Difference between revisions
Content deleted Content added
No edit summary |
rv all until I have time to look more closely |
||
Line 290:
/* End form functions */
document.paypalcontribution.utm_medium.value = mw.util.getParamValue( 'utm_medium' );▼
document.paypalcontribution.utm_campaign.value = mw.util.getParamValue( 'utm_campaign' );▼
document.paypalcontribution.utm_key.value = mw.util.getParamValue( 'utm_key' );▼
mw.loader.using( ['mediawiki.util'] ).done( function() {▼
// Strip protocol to stop firewall throwing fits▼
document.paypalcontribution.referrer.value = document.referrer.replace(/https?:\/\//i, "");▼
//
// https://phabricator.wikimedia.org/T118741▼
if (document.paypalcontribution.country.value === 'IN') {▼
document.getElementById('input_amount_other_box').onkeypress = function(e) {▼
$("#frequency_onetime").prop('checked', true);▼
}
};▼
// Disable submitting form with return key▼
$( 'form[name="paypalcontribution"]' ).bind( 'keypress', function(e) {
▲ // https://phabricator.wikimedia.org/T118741
var code = ( e.keyCode ? e.keyCode : e.which );▼
▲ document.getElementById('input_amount_other_box').onkeypress = function(e) {
});▼
return false;▼
▲ }
▲ // Disable submitting form with return key
▲ document.paypalcontribution.utm_campaign.value = mw.util.getParamValue( 'utm_campaign' );
▲ var code = ( e.keyCode ? e.keyCode : e.which );
▲ document.paypalcontribution.
▲ });
▲ // Strip protocol to stop firewall throwing fits
// Disable logo link▼
▲ document.paypalcontribution.referrer.value = document.referrer.replace(/https?:\/\//i, "");
$("#p-logo a").attr("href", "#");▼
// hide frequency options in India, where we can only handle one-time donations
// This is 1 by default, make it 0▼
$('#searchInput').attr('tabindex', 0);▼
▲ $("#frequency_onetime").prop('checked', true);
$(".frequency-options").hide();
}
}▼
▲ // Disable logo link
$(".input_amount_other").click(function() {▼
$("#
});▼
▲ // This is 1 by default, make it 0
// Allow preselecting monthly▼
▲ $('#searchInput').attr('tabindex', 0);
$('#frequency_monthly').click();▼
▲ }
▲ $(".input_amount_other").click(function() {
try {▼
▲ });
preSelect(); // Make sure to do this *after* other fiddling with values▼
}▼
finally {▼
$('.consider-amounts').show();▼
$('#actual-form').show();▼
▲ $('#actual-form-loading').hide();
}▼
// Load list of payment outages from meta, and hide any which are current▼
▲ // Allow preselecting monthly
$.getScript('//meta.wikimedia.org/w/index.php?' + $.param( { title:'MediaWiki:FR2013/Resources/PaymentOutages.js', action:'raw', ctype:'text/javascript' } ),▼
▲ $('#frequency_monthly').click();
setTimeout(checkPaymentOutages(), 250); // allow time for script to have _executed_ (not just loaded)▼
}
▲ try {
▲ preSelect(); // Make sure to do this *after* other fiddling with values
▲ }
▲ finally {
▲ $('.consider-amounts').show();
▲ $('#actual-form').show();
$('#actual-form-loading').hide();
▲ }
▲ // 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)
});
▲ mw.loader.using( ['mediawiki.util'] ).done( function() {
});
|