MediaWiki:DonationFormSandbox.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 13:
donationForm.noRecurringPaypalCountries = [ 'CL', 'CO', 'PE', 'UY', 'BR' ];
donationForm.maxUSD = 25000;▼
donationForm.currencyRates = {
Line 217 ⟶ 215:
'ZWD' : 373
};
donationForm.minimums = donationForm.currencyRates;▼
donationForm.minimums.INR = 10;▼
/* Localize the amount errors. Call when initialising form. */
donationForm.localizeErrors = function() {
var currency = donationForm.currency,
currencyRate = donationForm.currencyRates[ currency ] || 1,▼
minAmount = donationForm.minimums[ currency ],▼
locale = donationForm.getLocale( mw.config.get('wgPageContentLanguage'), donationForm.country );
$('.lp-error-smallamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount(
});
Line 245 ⟶ 234:
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.
.replace( '$2', currency )
.replace( '$3', 'benefactors@wikimedia.org' )
Line 933 ⟶ 922:
donationForm.validateAmount = function() {
var amount = donationForm.getAmount()
if ( amount === null || isNaN(amount) || amount <= 0 || amount <
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').hide();
$('.lp-error-smallamount').show();
return false;
} else if ( amount > donationForm.
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').show();
Line 965 ⟶ 952:
var selectedAmount = donationForm.getAmount(),
feeAmount = donationForm.calculateFee( selectedAmount ),
maxAmount = donationForm.maxUSD * currencyRate,▼
feeText, locale;
Line 973 ⟶ 958:
$('.ptf label span').text( feeText );
if ( selectedAmount + feeAmount <=
$('.ptf').slideDown();
}
Line 1,320 ⟶ 1,305:
}
donationForm.country = mw.util.getParamValue('country').toUpperCase();
// Minimum amount is usually about 1 USD
donationForm.minLocal = Math.ceil( donationForm.minLocal * 100 ) / 100; // Round it up
▲ donationForm.maxUSD = 25000;
▲
// Overrides for India
// Until https://phabricator.wikimedia.org/T370583 fixed?
donationForm.maxLocal = 250000;
}
// Block typing symbols in Other field
|