MediaWiki:MonthlyConvert.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
currency_code for currency
No edit summary
Line 191: Line 191:
currency = params.currency_code,
currency = params.currency_code,
suggestedAmount = mc.getSuggestedAmount( initialAmount, currency ),
suggestedAmount = mc.getSuggestedAmount( initialAmount, currency ),
locale = 'en-US';
locale = 'en-US',
skipMc;


if ( params.recurring ) {
if ( params.recurring ) {
// Already recurring
// Already recurring
callback( params );
skipMc = true;
}
}


if ( donationForm.noRecurringCountries.indexOf( params.country ) !== -1 ) {
if ( donationForm.noRecurringCountries.indexOf( params.country ) !== -1 ) {
// Country where we don't offer any recurring
// Country where we don't offer any recurring
callback( params );
skipMc = true;
}
}


if ( suggestedAmount === 0 ) {
if ( suggestedAmount === 0 ) {
// Amount too low, or we don't have any suggestions
// Amount too low, or we don't have any suggestions
callback( params );
skipMc = true;
}
}


Line 215: Line 216:
// suitable method!
// suitable method!
} else {
} else {
callback( params );
skipMc = true;
}
}

$('.mc-currencycode').text( currency );
$('.mc-amt-initial').text( mc.formatAmount( initialAmount, currency, locale) );
$('.mc-amt-suggest').text( mc.formatAmount( suggestedAmount, currency, locale ) );
if ( skipMc ) {
$('.mc-modal-screen').show();
callback( params )
} else {
$('.mc-currencycode').text( currency );
$('.mc-amt-initial').text( mc.formatAmount( initialAmount, currency, locale) );
$('.mc-amt-suggest').text( mc.formatAmount( suggestedAmount, currency, locale ) );
$('.mc-modal-screen').show();
}


}
}