MediaWiki:DonationForm T201415.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
update with recent fixes |
clean trailing spaces |
||
Line 362: | Line 362: | ||
[ 175, [ 175, 200, 300, 400, 500, 750, 1000 ] ], |
[ 175, [ 175, 200, 300, 400, 500, 750, 1000 ] ], |
||
[ 200, [ 200, 225, 300, 400, 500, 750, 1000 ] ], |
[ 200, [ 200, 225, 300, 400, 500, 750, 1000 ] ], |
||
], |
], |
||
'2018control' : [ |
'2018control' : [ |
||
[ 0, [ 5, 10, 20, 25, 35, 50, 100 ] ], |
[ 0, [ 5, 10, 20, 25, 35, 50, 100 ] ], |
||
Line 674: | Line 674: | ||
/** |
/** |
||
* Validate form, and if it looks good submit to payments |
* Validate form, and if it looks good submit to payments |
||
* |
* |
||
* @param {string} paymentMethod - method e.g. 'cc', 'paypal' |
* @param {string} paymentMethod - method e.g. 'cc', 'paypal' |
||
* @param {string} paymentSubMethod - submethod e.g. 'rtbt_ideal' (a submethod of 'rtbt') |
* @param {string} paymentSubMethod - submethod e.g. 'rtbt_ideal' (a submethod of 'rtbt') |
||
Line 700: | Line 700: | ||
form.ffname.value = 'adyen'; |
form.ffname.value = 'adyen'; |
||
} |
} |
||
// dLocal override for cc |
// dLocal override for cc |
||
if ( paymentMethod === 'cc-dlocal' ) { |
if ( paymentMethod === 'cc-dlocal' ) { |
||
Line 744: | Line 744: | ||
form.method = 'GET'; |
form.method = 'GET'; |
||
form.submit(); |
form.submit(); |
||
} else { |
} else { |
||
donationForm.extraData.validateError = 1; // Flag they had an error, even if fixed later |
donationForm.extraData.validateError = 1; // Flag they had an error, even if fixed later |
||
Line 792: | Line 792: | ||
var existingUtmKey = mw.util.getParamValue('utm_key'), |
var existingUtmKey = mw.util.getParamValue('utm_key'), |
||
dataArray = []; |
dataArray = []; |
||
if ( existingUtmKey ) { |
if ( existingUtmKey ) { |
||
dataArray.push( existingUtmKey ); |
dataArray.push( existingUtmKey ); |
||
Line 964: | Line 964: | ||
donationForm.initOptin = function() { |
donationForm.initOptin = function() { |
||
$('.optin-options').on('change', function(e) { |
$('.optin-options').on('change', function(e) { |
||
$('#error-optin').hide(); |
$('#error-optin').hide(); |
||
Line 1,060: | Line 1,060: | ||
// Allow preselecting monthly |
// Allow preselecting monthly |
||
if( mw.util.getParamValue('monthly') |
if( mw.util.getParamValue('monthly') |
||
&& donationForm.noRecurringCountries.indexOf( form.country.value ) === -1 ) { |
&& donationForm.noRecurringCountries.indexOf( form.country.value ) === -1 ) { |
||
$('#frequency_monthly').click(); |
$('#frequency_monthly').click(); |