MediaWiki:DonationForm.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
using slightly better syntax for accessing form
renaming form from paypalcontribution to donateForm
Line 210:
/* Localize the amount errors. Call when initialising form. */
donationForm.localizeErrors = function() {
var form = document.forms['paypalcontributiondonateForm'];
var currency = form.currency_code.value;
var minAmount = donationForm.minimums[ currency ];
Line 678:
donationForm.redirectPayment = function( paymentMethod, paymentSubMethod, skipAmountValidation ) {
 
var form = document.forms['paypalcontributiondonateForm']; // we should really change this some day
 
if ( donationForm.validate( skipAmountValidation ) ) {
Line 806:
/* Return amount selected or input */
donationForm.getAmount = function() {
var form = document.forms['paypalcontributiondonateForm'];
var amount = null;
donationForm.extraData.otherAmt = 0;
Line 848:
 
var error = false;
var form = document.forms['paypalcontributiondonateForm'];
 
// Reset all errors
Line 876:
donationForm.validateAmount = function() {
 
var form = document.forms['paypalcontributiondonateForm'];
var amount = donationForm.getAmount();
var currency = form.currency_code.value;
Line 924:
donationForm.calculateFee = function( amount ) {
 
var form = document.forms['paypalcontributiondonateForm'];
 
// Minimum fee/PTF amounts. Default is 0.35.
Line 987:
mw.loader.using( ['mediawiki.util'] ).done( function() {
 
var form = document.forms['paypalcontributiondonateForm'];
 
// Block typing symbols in input field, otherwise Safari allows them and then chokes
Line 1,014:
 
// Disable submitting form with Enter key
$('form[name="paypalcontributiondonateForm"]').on('keypress', function(e) {
var code = ( e.keyCode ? e.keyCode : e.which );
if ( code == 13 ) {