MediaWiki:DonationFormSandbox.js: Difference between revisions
Content deleted Content added
introduce currencyRates, and allow different minimums |
No edit summary |
||
Line 224:
/* Localize the amount errors. Call when initialising form. */
donationForm.localizeErrors = function() {
var currency
currencyRate = donationForm.currencyRates[ currency ] || 1,
minAmount = donationForm.minimums[ currency ],
locale = donationForm.getLocale( mw.config.get('wgPageContentLanguage'), donationForm.country );
Line 244 ⟶ 245:
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.maxUSD *
.replace( '$2', currency )
.replace( '$3', 'benefactors@wikimedia.org' )
Line 932 ⟶ 933:
donationForm.validateAmount = function() {
var amount = donationForm.getAmount()
minAmount = donationForm.minimums[ donationForm.currency ] || 1;
if ( amount === null || isNaN(amount) || amount <= 0 || amount < minAmount ) {
Line 940 ⟶ 942:
$('.lp-error-smallamount').show();
return false;
} else if ( amount > donationForm.maxUSD *
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').show();
Line 963 ⟶ 965:
var selectedAmount = donationForm.getAmount(),
feeAmount = donationForm.calculateFee( selectedAmount ),
maxAmount = donationForm.maxUSD *
feeText, locale;
|