MediaWiki:DonationFormSandbox.js: Difference between revisions

Content deleted Content added
try and use currencyDisplay: 'narrowSymbol' if browser supports it
copy from main
Line 24:
*/
donationForm.getLocale = function( language, country ) {
// Sometimes in email testing links the uselang is a variable contiaining %
// In that case fall back to English so locale code doesn't break form
if ( language.match('%') ) {
language = 'en';
}
if ( language === 'en-gb' ) {
language = 'en';
Line 40 ⟶ 45:
 
// Don't offer recurring at all in these countries
donationForm.noRecurringCountries = [ 'AR', 'IN' ]; // is this still needed?
 
donationForm.noRecurringPaypalCountries = [ 'CL', 'CO', 'PE', 'UY', 'BR' ];
Line 334 ⟶ 339:
 
var currency = donationForm.currency;
var language = mw.config.get('wgPageContentLanguage');
 
// If changing, please update https://docs.google.com/spreadsheets/d/1e02TsZ_bKDAS1BMVBCdyo9D7RGln_wCGnkg7IF5kU5s/edit
Line 1,088 ⟶ 1,092:
'UAH' : 10,
'ZAR' : 5,
// Latin America // Updated 20232024-0108-1722 to approx 0.35 USD equivalent
'BRL' : 1.75,
'ARS' : 32300,
'CLP' : 322300,
'COP' : 13851400,
'MXN' : 6,
'PEN' : 1.32,
'UYU' : 13.714
};
 
Line 1,416 ⟶ 1,420:
 
// Only show Amazon for links from Ways to give
// TODO: remove utm_source when Ways to give has been updated
if (
mw.util.getParamValue( 'wmf_source' ) === 'Waystogive' ||
Line 1,457 ⟶ 1,460:
&& mw.util.getParamValue('monthly') !== '0'
&& donationForm.noRecurringCountries.indexOf( donationForm.country ) === -1
&& mw.util.getParamValue('utm_medium') !== 'endowment'
&& mw.util.getParamValue('wmf_medium') !== 'endowment'
) {
$('#frequency_monthly').click();