Donate
donatewiki
https://donate.wikimedia.org/wiki/Special:FundraiserRedirector
MediaWiki 1.47.0-wmf.16
first-letter
Media
Special
Talk
User
User talk
Donate
Donate talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
Campaign
Campaign talk
TimedText
TimedText talk
Module
Module talk
MediaWiki:DonationForm.js
8
7993
42997
42986
2026-08-19T18:04:08Z
Pcoombe
5
test edit
42997
javascript
text/javascript
/* jshint strict:false */
/** MediaWiki:DonationForm.js - loaded on all donation forms
* TODO: lots of cleanup
*/
var donationForm = {};
donationForm.loadedTime = Date.now();
donationForm.extraData = {
'vw' : window.innerWidth,
'vh' : window.innerHeight
};
donationForm.country = mw.util.getParamValue('country').toUpperCase();
try {
donationForm.currency = document.forms.donateForm.currency_code.value;
} catch (error) {
donationForm.currency = 'USD';
}
/**
* Make language and country into a standard javascript Intl locale identifier
*
* @param {string} language
* @param {string} country
* @return {string} locale identifier e.g. en-GB
*/
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';
}
// MediaWiki allows some language codes like en-gb, en-ca, pt-br
// We don't want these for a javascript locale, so drop anything after '-'
language = language.split('-')[0];
return language + '-' + country;
};
donationForm.locale = donationForm.getLocale( mw.config.get('wgPageContentLanguage'), donationForm.country );
// Don't offer recurring at all in these countries
donationForm.noRecurringCountries = [ 'AR', 'IN' ];
donationForm.noRecurringPaypalCountries = [ 'CL', 'CO', 'PE', 'UY', 'BR' ];
donationForm.currencyRates = {
// From https://github.com/wikimedia/wikimedia-fundraising-SmashPig/blob/master/PaymentData/ReferenceData/CurrencyRates.php
// Updated 2025-11-03
'ADF' : 5.69,
'ADP' : 144,
'AED' : 3.67,
'AFA' : 66,
'AFN' : 66,
'ALL' : 83,
'AMD' : 374,
'ANG' : 1.79,
'AOA' : 912,
'AON' : 912,
'ARS' : 1457,
'ATS' : 12,
'AUD' : 1.53,
'AWG' : 1.79,
'AZM' : 8500,
'AZN' : 1.7,
'BAM' : 1.7,
'BBD' : 2,
'BDT' : 121,
'BEF' : 35,
'BGL' : 1.7,
'BGN' : 1.7,
'BHD' : 0.37401652162054,
'BIF' : 2923,
'BMD' : 1,
'BND' : 1.3,
'BOB' : 6.76,
'BRL' : 5.37,
'BSD' : 1,
'BTN' : 89,
'BWP' : 13,
'BYR' : 34102,
'BZD' : 1.98,
'CAD' : 1.4,
'CDF' : 2224,
'CHF' : 0.80650783228772,
'CLP' : 940,
'CNY' : 7.12,
'COP' : 3853,
'CRC' : 496,
'CUC' : 1,
'CUP' : 25,
'CVE' : 96,
'CYP' : 0.50784522451156,
'CZK' : 21,
'DEM' : 1.7,
'DJF' : 178,
'DKK' : 6.48,
'DOP' : 64,
'DZD' : 130,
'ECS' : 24094,
'EEK' : 14,
'EGP' : 47,
'ESP' : 144,
'ETB' : 153,
'EUR' : 0.86770508259643,
'FIM' : 5.16,
'FJD' : 2.27,
'FKP' : 0.76116218937783,
'FRF' : 5.69,
'GBP' : 0.76116218937783,
'GEL' : 2.68,
'GHC' : 108957,
'GHS' : 11,
'GIP' : 0.76116218937783,
'GMD' : 71,
'GNF' : 8637,
'GRD' : 296,
'GTQ' : 7.55,
'GYD' : 205,
'HKD' : 7.77,
'HNL' : 26,
'HRK' : 6.54,
'HTG' : 130,
'HUF' : 336,
'IDR' : 16671,
'IEP' : 0.68337328567002,
'ILS' : 3.25,
'INR' : 89,
'IQD' : 1292,
'IRR' : 42020,
'ISK' : 126,
'ITL' : 1680,
'JMD' : 159,
'JOD' : 0.70900000000001,
'JPY' : 154,
'KES' : 128,
'KGS' : 87,
'KHR' : 3971,
'KMF' : 427,
'KPW' : 135,
'KRW' : 1429,
'KWD' : 0.30641816376358,
'KYD' : 0.83333299999999,
'KZT' : 526,
'LAK' : 21568,
'LBP' : 89680,
'LKR' : 303,
'LRD' : 182,
'LSL' : 17,
'LTL' : 3,
'LUF' : 35,
'LVL' : 0.60982660286911,
'LYD' : 5.44,
'MAD' : 9.19,
'MDL' : 17,
'MGA' : 4474,
'MGF' : 9150,
'MKD' : 53,
'MMK' : 2093,
'MNT' : 2620,
'MOP' : 8.01,
'MRO' : 395,
'MTL' : 0.37250579195865,
'MUR' : 45,
'MVR' : 15,
'MWK' : 1730,
'MXN' : 19,
'MYR' : 4.2,
'MZM' : 63200,
'MZN' : 63,
'NAD' : 17,
'NGN' : 1446,
'NIO' : 36,
'NLG' : 1.91,
'NOK' : 10,
'NPR' : 141,
'NZD' : 1.75,
'OMR' : 0.38352905117543,
'PAB' : 1,
'PEN' : 3.35,
'PGK' : 4.17,
'PHP' : 59,
'PKR' : 282,
'PLN' : 3.69,
'PTE' : 174,
'PYG' : 6991,
'QAR' : 3.6,
'ROL' : 44083,
'RON' : 4.41,
'RSD' : 101,
'RUB' : 81,
'RWF' : 1446,
'SAR' : 3.75,
'SBD' : 8.21,
'SCR' : 14,
'SDD' : 59715,
'SDG' : 597,
'SDP' : 2261,
'SEK' : 9.49,
'SGD' : 1.3,
'SHP' : 0.76116218937783,
'SIT' : 208,
'SKK' : 26,
'SLL' : 19750,
'SOS' : 550,
'SRD' : 39,
'SRG' : 38521,
'STD' : 21169,
'SVC' : 8.75,
'SYP' : 513,
'SZL' : 17,
'THB' : 32,
'TJS' : 9.15,
'TMM' : 16757,
'TMT' : 3.35,
'TND' : 2.93,
'TOP' : 2.4,
'TRL' : 42048152,
'TRY' : 42,
'TTD' : 6.69,
'TWD' : 31,
'TZS' : 2442,
'UAH' : 42,
'UGX' : 3463,
'USD' : 1,
'UYU' : 40,
'UZS' : 11982,
'VEB' : 22204414173,
'VEF' : 22204414,
'VND' : 26302,
'VUV' : 112,
'WST' : 2.71,
'XAF' : 569,
'XAG' : 0.020582109674161,
'XAU' : 0.000249595454823,
'XCD' : 2.7,
'XEU' : 0.86770508259643,
'XOF' : 569,
'XPD' : 0.00068810810716198,
'XPF' : 104,
'XPT' : 0.00063604563466001,
'YER' : 238,
'YUN' : 101,
'ZAR' : 17,
'ZMK' : 5176,
'ZWD' : 373
};
/* Amount and currency formatting */
let formatters = {
// Amounts without currency symbol
amountFraction: new Intl.NumberFormat( donationForm.locale,
{ minimumFractionDigits: 2, maximumFractionDigits: 2 }
),
amountWhole: new Intl.NumberFormat( donationForm.locale,
{}
)
};
// currencyDisplay: 'narrowSymbol' fixes some issues like en-CO showing the ISO code
// but browser support is lacking, so wrap in a try/catch
try {
formatters.currencyFraction = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, currencyDisplay: 'narrowSymbol' }
);
formatters.currencyWhole = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, currencyDisplay: 'narrowSymbol', minimumFractionDigits: 0 }
);
} catch(e) {
formatters.currencyFraction = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency }
);
formatters.currencyWhole = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, minimumFractionDigits: 0 }
);
}
donationForm.formatCurrency = function( amount ) {
if ( amount % 1 !== 0 ) { // Not a whole number
return formatters.currencyFraction.format( amount );
} else {
return formatters.currencyWhole.format( amount );
}
};
donationForm.formatAmount = function( amount ) {
var formatterOptions, output;
if ( amount % 1 !== 0 ) { // Not a whole number
return formatters.amountFraction.format( amount );
} else {
return formatters.amountWhole.format( amount );
}
};
/* Localize the amount errors. Call when initialising form. */
donationForm.localizeErrors = function() {
var currency = donationForm.currency;
$('.lp-error-smallamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.minLocal ) + '\xa0' + currency );
});
if ( currency === 'USD' ) {
// we don't need to include the conversion
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '($1 $2) ', '' )
.replace( '($1 $2) ', '' );
});
}
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.maxLocal ) )
.replace( '$2', currency )
.replace( '$3', 'benefactors@wikimedia.org' )
.replace( '$4', donationForm.formatAmount( donationForm.maxUSD ) );
});
};
function adjustMinAmounts() {
// Amounts spreadsheet https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
// Defining lookup table here. Using mw.loader.getScript was visibly too slow for the user (amounts flashing)
const minPlusLookup = {
// US - Canada - UK - EUR - Australia - New Zealand
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
USD: {
amount1: { from: 2.75, to: 4.50 },
amount2: { from: 5, to: 7 },
},
GBP: {
amount1: { from: 2, to: 4 },
amount2: { from: 5, to: 7 },
},
EUR: {
amount1: { from: 2.50, to: 4.50 },
amount2: { from: 5, to: 7 },
},
// English Bundle
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=891721479#gid=891721479
HUF: {
amount1: { from: 500, to: 750 },
},
MYR: {
amount1: { from: 10, to: 20 },
amount2: { from: 30, to: 40 },
},
RON: {
amount1: { from: 10, to: 30 },
},
// Other
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1865233115#gid=1865233115
CZK: {
amount1: { from: 50, to: 100 },
amount2: { from: 100, to: 150 },
},
DKK: {
amount1: { from: 20, to: 40 },
amount2: { from: 75, to: 80 },
},
JPY: {
amount1: { from: 500, to: 1000 },
amount2: { from: 1000, to: 2000 },
amount3: { from: 2000, to: 3000 },
amount4: { from: 2500, to: 4000 },
amount5: { from: 4000, to: 5000 },
amount6: { from: 5000, to: 10000 },
amount7: { from: 10000, to: 15000 },
},
ZAR: {
amount1: { from: 30, to: 50 },
amount2: { from: 50, to: 75 },
},
NOK: {
amount1: { from: 30, to: 50 },
},
SEK: {
amount1: { from: 30, to: 50 },
amount2: { from: 50, to: 70 },
},
ILS: {
amount1: { from: 10, to: 20 },
},
PLN: {
amount1: { from: 10, to: 20 },
amount2: { from: 20, to: 30 },
},
CHF: {
amount1: { from: 20, to: 30 },
},
THB: {
amount1: { from: 100, to: 150 },
amount2: { from: 200, to: 250 },
},
};
// CAD, AUD, NZD = USD amounts
minPlusLookup.CAD = minPlusLookup.USD;
minPlusLookup.AUD = minPlusLookup.USD;
minPlusLookup.NZD = minPlusLookup.USD;
if ( mw.util.getParamValue( 'minPlus' ) === '1' || mw.util.getParamValue( 'minPlus' ) === 'true' ) {
const currencyEntry = minPlusLookup[ donationForm.currency ];
// Currency not in lookup table. No swapping.
if ( !currencyEntry ) return null;
const amountKeys = Object.keys( currencyEntry ); // ["amount1", "amount2"] or however many keys in lookup
amountKeys.forEach( (amount, index) => {
const $radio = $( `#input_amount_${index}` );
const $label = $( `label[for='input_amount_${index}` );
// If the button's amount is equal to "from" in the lookup, perform the swap.
// Guards from hpc adjusted amounts as those values won't be present in the lookup.
if ( currencyEntry[amount].from === parseFloat( $radio.val() ) ) {
$radio.val( currencyEntry[amount].to );
$label.text( donationForm.formatCurrency( currencyEntry[amount].to ) );
}
});
}
}
function adjustHPC() {
/* Adjust amounts based on highest previous contribution (hpc)
or most recent contribution (mrc) parameter. Used for emails.
TODO: split data out? */
var hpcSet = mw.util.getParamValue('hpcSet');
// Look for 'hpc' parameter, then 'mrc'
var hpc = parseFloat( mw.util.getParamValue('hpc') );
if( isNaN(hpc) ) {
hpc = parseFloat( mw.util.getParamValue('mrc') );
if( isNaN(hpc) ) {
if ( hpcSet ) {
// Allow using hpcSet even without hpc, for MG appeals
hpc = 0;
} else {
return;
}
}
}
var currency = donationForm.currency;
// https://phabricator.wikimedia.org/T381437
var hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== currency ) {
console.log('Highest previous contribution currency does not match form currency, using default amounts');
return;
}
// Consult this sheet for amounts: https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
var radioAmountsData = {
"USD" : { // also used for CAD, AUD, NZD
"default" : [
[ 0, [ 2.75, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2.75, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
// Direct Mail - fixed amounts
"directmail" : [
[ 0, [ 25, 35, 50, 100, 150, 250, 300 ] ]
],
"directmail250" : [
[ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ]
]
},
"EUR" : {
"default" : [
[ 0, [ 2.50, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2.50, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
},
"GBP" : {
"default" : [
[ 0, [ 2, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
},
"JPY" : [
[ 0, [ 500, 1000, 2000, 2500, 4000, 5000, 10000 ] ],
[ 1000, [ 1000, 1500, 2500, 4000, 5000, 10000, 15000 ] ],
[ 1500, [ 1500, 2000, 3000, 4000, 5000, 10000, 15000 ] ],
[ 2000, [ 2000, 2500, 3500, 5000, 7500, 10000, 25000 ] ],
[ 2500, [ 2500, 3500, 5000, 7500, 10000, 15000, 25000 ] ],
[ 3000, [ 3000, 4000, 5000, 7500, 10000, 15000, 25000 ] ],
[ 5000, [ 5000, 10000, 15000, 20000, 35000, 50000, 100000 ] ],
[ 10000, [ 10000, 25000, 50000, 75000, 100000, 150000, 200000 ] ]
],
"SEK" : [
[ 0, [ 30, 50, 100, 150, 200, 300, 500 ] ],
[ 50, [ 50, 100, 150, 200, 300, 500, 750 ] ],
[ 200, [ 200, 300, 500, 750, 1000, 1500, 2000 ] ]
]
};
radioAmountsData.AUD = radioAmountsData.USD;
radioAmountsData.CAD = radioAmountsData.USD;
radioAmountsData.NZD = radioAmountsData.USD;
// Major gifts appeals, hacky but this is easier than adding a load of new forms to maintain
var currencyList = [ 'USD', 'CAD', 'AUD', 'NZD', 'GBP', 'EUR' ]; // close enough
for ( let i = 0; i < currencyList.length; i++ ) {
// FY2425 hpcSets
// Major Gifts hpcSets
radioAmountsData[ currencyList[i] ].MG_2024_500 = [ [ 0, [ 500, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2024_650 = [ [ 0, [ 650, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
// FY2526 hpcSets
// Direct Mail hpcSets
radioAmountsData[ currencyList[i] ].DM_2526_15 = [ [ 0, [ 15, 25, 35, 50, 100, 200, 250 ] ] ];
radioAmountsData[ currencyList[i] ].DM_2526_250 = [ [ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].DM_2526_5000 = [ [ 0, [ 5000, 7500, 10000, 12500, 15000, 17500, 20000 ] ] ];
// Major Gifts hpcSets
radioAmountsData[ currencyList[i] ].MG_2526_500_9999 = [
[ 0, [ 750, 850, 1000, 1250, 1500, 1750, 2000 ] ],
[ 1000, [ 1500, 2000, 2500, 3000, 3750, 4500, 5000 ] ],
[ 3000, [ 4000, 5000, 6000, 7000, 8000, 9000, 10000 ] ]
];
radioAmountsData[ currencyList[i] ].MG_2526_10K = [ [ 0, [ 5000, 7500, 10000, 12500, 15000, 17500, 20000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_250_399 = [ [ 0, [ 500, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_400_499 = [ [ 0, [ 650, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_HNWI_250 = [ [ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_HNWI_350 = [ [ 0, [ 350, 400, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_2500 = [ [ 0, [ 2500, 3000, 5000, 7500, 10000, 15000, 25000 ] ] ];
}
var appealAmountsData = {
"USD" : [ // also used for CAD, AUD, NZD, GBP, EUR
[ 0, [ 5, 10, 20 ] ],
[ 10, [ 10, 20, 50 ] ],
[ 20, [ 20, 30, 50 ] ],
[ 35, [ 20, 30, 50 ] ],
[ 50, [ 20, 50, 100 ] ],
[ 75, [ 50, 75, 100 ] ],
[ 100, [ 75, 100, 150 ] ],
[ 150, [ 75, 100, 200 ] ],
[ 200, [ 100, 200, 300 ] ]
],
"JPY" : [
[ 0, [ 300, 500, 1000 ] ],
[ 3, [ 500, 1000, 1500 ] ],
[ 5, [ 1000, 1500, 2000 ] ],
[ 10, [ 1500, 2000, 5000 ] ],
[ 20, [ 2000, 3000, 5000 ] ],
[ 50, [ 2000, 5000, 10000 ] ],
[ 100, [ 5000, 10000, 15000 ] ]
],
"SEK" : [
[ 0, [ 20, 50, 100 ] ],
[ 3, [ 30, 50, 100 ] ],
[ 5, [ 50, 100, 150 ] ],
[ 15, [ 100, 150, 200 ] ],
[ 23, [ 100, 200, 300 ] ],
[ 38, [ 100, 200, 500 ] ],
[ 75, [ 100, 500, 750 ] ],
[ 112, [ 100, 500, 1000 ] ]
]
};
appealAmountsData.AUD = appealAmountsData.USD;
appealAmountsData.CAD = appealAmountsData.USD;
appealAmountsData.GBP = appealAmountsData.USD;
appealAmountsData.NZD = appealAmountsData.USD;
appealAmountsData.EUR = appealAmountsData.USD;
// Radio button amounts
var radioAmounts = pickAmountArray( radioAmountsData, currency, hpc, hpcSet );
if ( radioAmounts.length ) {
donationForm.setAmountOptions( radioAmounts );
}
// Appeal amounts
var appealAmounts = pickAmountArray( appealAmountsData, currency, hpc, hpcSet );
if ( appealAmounts.length ) {
var appealAmountString = appealAmounts.map( donationForm.formatCurrency ).join( ', ');
$('.consider-amounts').html(appealAmountString);
}
}
function pickAmountArray( data, currency, hpc, hpcSet ) {
/**
* Choose the amounts for radio buttons / appeal based on hpc
* @param {Object} data
* @param {String} currency
* @param {Number} hpc
* @param {String} hpcSet
* @return {Array} Array of amounts (as numbers)
*/
var set, amounts;
if ( !(currency in data) ) {
return [];
}
if ( $.isArray(data[currency]) ) {
// No variant sets
set = data[currency];
} else {
// We need to go deeper. Check the variants.
if ( hpcSet in data[currency] ) {
set = data[currency][hpcSet];
} else {
set = data[currency]['default'];
}
}
// Find correct amount array for this hpc
for (var i = 0; i < set.length; i++) {
if ( set[i][0] > hpc ) {
break;
}
amounts = set[i][1];
}
return amounts;
}
function preSelect() {
/* Check for a 'preSelect' url parameter, and select that option.
If there isn't an option, add it to the "Other" box and select that */
var preSelectAmount = parseFloat( mw.util.getParamValue('preSelect') || mw.util.getParamValue('preselect') );
if ( preSelectAmount > 0 ) {
let hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== donationForm.currency ) {
console.log('Highest previous contribution currency does not match form currency, not doing preselection');
return;
}
var $preSelectOption = $('input[name="amount"][value="' + preSelectAmount + '"]');
if ( $preSelectOption.length ) {
// Select existing input
$preSelectOption.prop('checked', true);
} else {
$('#input_amount_other_box').val( preSelectAmount );
$('#input_amount_other').prop('checked', true);
}
donationForm.updateFeeDisplay();
}
}
function preSelectBox() {
/* Check for a 'preSelectBox' url parameter, and select that numbered option.
If the value provided is invalid or doesn't exist, exit. Valid choices are 1 to 7 (8 is "Other").
If 'preSelect' exists, ignore this function. */
if(!mw.util.getParamValue('preSelect')){
// Check hpcCurrency first before running preselection.
let hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== donationForm.currency ) {
console.log('Highest previous contribution currency does not match form currency, not preselecting box.');
return;
}
// If hpc & hpcCurrency provided are okay OR hpc wasn't provided then continue.
var preSelectBoxNumber = parseInt( mw.util.getParamValue('preSelectBox') );
if (preSelectBoxNumber >= 1 && preSelectBoxNumber <= 7) {
var $preSelectOption = $('input[id="input_amount_' + (preSelectBoxNumber - 1) + '"]');
if ( $preSelectOption.length ) {
$preSelectOption.prop('checked', true);
donationForm.updateFeeDisplay();
}
}
}
}
function addCardTypesClass(country) {
/**
* Add card types class to credit card button, so we can show correct logos
* Banner equivalent: https://meta.wikimedia.org/wiki/MediaWiki:FundraisingBanners/LocalizeJS-2017.js
* @param {String} country ISO code
*/
var cardTypes = {
// Big 6
'US' : 'vmad',
'CA' : 'vma',
'GB' : 'vmaj',
'IE' : 'vmaj',
'AU' : 'vmaj',
'NZ' : 'vma',
// Euro countries
'AT' : 'vmaj',
'BE' : 'vmaj',
'ES' : 'vmaj',
'FR' : 'vma',
'IT' : 'vmaj',
'LU' : 'vmaj',
'LV' : 'vma',
'NL' : 'vmaj',
'PT' : 'vmaj',
'SK' : 'vmaj',
'GR' : 'vma',
// Others
'CZ' : 'vmad',
'DK' : 'vma',
'HU' : 'vma',
'IL' : 'vmad',
// 'JP' : 'vmaj', - use text only as there were complaints about Diners Club not being included
'MY' : 'vmaj',
'NO' : 'vma',
'PL' : 'vma',
'RO' : 'vma',
'SE' : 'vma',
'UA' : 'vma',
'ZA' : 'vm',
'ZZ' : 'vmad' // For testing
};
if ( cardTypes[country] ) {
$('.paymentmethod-cc').addClass('cctypes-' + cardTypes[country] );
$('.cc-text-label').addClass('sr-only');
}
}
/* Form functions */
function clearOther(box) {
document.getElementById('input_amount_other').checked = true;
box.value = "";
}
function selectOther() {
document.getElementById('input_amount_other').checked = true;
}
function selectAmount() {
$('#input_amount_other_box').val('');
}
/* -- Moved from Template:2012FR/Form-section/Processing/Default -- */
/**
* Validate form, and prep most of the parameters
*
* @param {string} paymentMethod - method e.g. 'cc', 'paypal'
* @param {string} paymentSubMethod - submethod e.g. 'rtbt_ideal' (a submethod of 'rtbt')
* @param {string} skipAmountValidation - skip validating amount for PayPal forced to USD
*/
donationForm.redirectPayment = function( paymentMethod, paymentSubMethod, skipAmountValidation ) {
if ( donationForm.validate( skipAmountValidation ) ) {
var params = {};
params.currency = donationForm.currency;
params.country = donationForm.country;
// Overrides for specific gateways
if ( paymentMethod === 'cc-adyen' ) {
params.payment_method = 'cc';
params.gateway = 'adyen';
} else if ( paymentMethod === 'cc-dlocal' ) {
params.payment_method = 'cc';
params.gateway = 'dlocal';
} else if ( paymentMethod === 'trustly' ) {
params.payment_method = 'dd';
params.payment_submethod = 'ach';
params.gateway = 'gravy';
} else if ( paymentSubMethod === 'sepadirectdebit' ) {
params.payment_method = 'rtbt';
params.payment_submethod = 'sepadirectdebit';
params.gateway = 'gravy';
} else if ( paymentMethod === 'bt' && params.country === 'CZ' ) {
params.payment_method = 'bt';
params.gateway = 'gravy';
} else if ( paymentSubMethod === 'vipps' ) {
params.payment_method = 'ew';
params.payment_submethod = 'vipps';
params.gateway = 'gravy';
} else {
params.payment_method = paymentMethod;
}
// dlocal
let dlocalCountries = [ 'AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY', 'ZA' ],
dlocalMethods = [ 'cc', 'bt', 'cash', 'cash_boleto', 'pix' ];
if ( dlocalCountries.includes( params.country ) && dlocalMethods.includes( params.payment_method ) ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'cc' && params.gateway === undefined ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'paypal' ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'rtbt' && paymentSubMethod === 'rtbt_ideal' ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'apple' || params.payment_method === 'google' ) {
params.gateway = 'gravy';
}
if ( paymentSubMethod ) {
params.payment_submethod = paymentSubMethod;
}
let frequency = donationForm.getFrequency();
if ( frequency === 'monthly' ) {
params.recurring = '1';
params.frequency_unit = 'month';
} else if ( frequency === 'annual' ) {
params.recurring = '1';
params.frequency_unit = 'year';
}
params.uselang = mw.config.get('wgPageContentLanguage'); // see T281285 for why not wgUserLanguage
if ( params.uselang === 'pt' && params.country === 'BR' ) {
params.uselang = 'pt-br';
}
if ( params.uselang === 'es' &&
( params.country === 'AR' || params.country === 'CL' ||
params.country === 'CO' || params.country === 'MX' ||
params.country === 'PE' || params.country === 'UY' ||
params.country === 'US' )
) {
params.uselang = 'es-419';
}
var amount = donationForm.getAmount();
if ( $('#ptf-checkbox').prop('checked') ) {
amount = amount + donationForm.calculateFee( amount );
donationForm.extraData.ptf = 1;
}
params.amount = amount;
// Email optin
if ( $('input[name="opt_in"]').length > 0 ) {
var opt_inValue = $('input[name="opt_in"]:checked').val();
params.opt_in = opt_inValue; // donationForm.validate() already checked it's 1 or 0
}
if ( mw.util.getParamValue( 'pym_variant' ) ) {
params.variant = mw.util.getParamValue( 'pym_variant' );
}
if ( params.recurring && params.variant && params.variant.match( /monthlyConvert/ ) ) {
// Post-payments monthly convert makes no sense if it's already recurring
// Avoid things like T312905
delete params.variant;
}
if ( mw.util.getParamValue( 'pym_appeal' ) ) {
params.appeal = mw.util.getParamValue( 'pym_appeal' );
}
// Pass through specified parameters to payments unchanged
const passThroughParams = [
'contact_id', 'contact_hash', // https://phabricator.wikimedia.org/T381405
'checksum', 'contribution_recur_id', // https://phabricator.wikimedia.org/T396271
'recipient_id', // SMS
'app_install_id' // https://phabricator.wikimedia.org/T411535
];
passThroughParams.forEach( ( param ) => {
const value = mw.util.getParamValue( param );
if ( value ) {
params[ param ] = value;
}
} );
// Monthly convert
if ( mc ) { // check just in-case this wasn't loaded for some reason
mc.main( params, donationForm.finalStep );
} else {
donationForm.finalStep( params );
}
} else {
donationForm.extraData.validateError = 1; // Flag they had an error, even if fixed later
}
return false; // don't submit if called by a button
};
/**
* Build final tracking parameters, and submit to payments
* @param {Object} params
*/
donationForm.finalStep = function( params ) {
var url = new URL('https://payments.wikimedia.org/index.php/Special:GatewayChooser');
// Skip form chooser for Venmo
if ( params.payment_method === 'venmo' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
// Skip form chooser for Pix
if ( params.payment_method === 'cash' && params.payment_submethod === 'pix' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
// And Yape
if ( params.payment_method === 'ew' && params.payment_submethod === 'yape' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
donationForm.extraData.time = Math.round( (Date.now() - donationForm.loadedTime)/1000 );
// Tracking data
params.wmf_medium = mw.util.getParamValue( 'wmf_medium' ) || mw.util.getParamValue( 'utm_medium' );
params.wmf_campaign = mw.util.getParamValue( 'wmf_campaign' ) || mw.util.getParamValue( 'utm_campaign' );
params.wmf_source = donationForm.buildTrackingSource( params );
params.wmf_key = donationForm.buildTrackingKey( donationForm.extraData );
if ( document.referrer ) { // TODO: do we need this?
// Strip protocol to stop firewall complaining
params.referrer = document.referrer.replace(/https?:\/\//i, '');
}
for ( var key of Object.keys( params ) ) {
url.searchParams.set( key, params[key] );
}
if ( window.top !== window.self ) {
// In a frame, open payments in a new tab
window.open( url.toString() );
} else {
window.location.href = url.toString();
}
};
/**
* Build a wmf_source value, including the landing page info.
*
* Own function so it can be overriden for weird tests
*
* @param {Object} params
* @return {string} wmf_source
*/
donationForm.buildTrackingSource = function( params ) {
var wmf_source = mw.util.getParamValue( 'wmf_source' ) || mw.util.getParamValue( 'utm_source' );
wmf_source += '.';
var fullDottedPaymentMethod = params.payment_method;
if ( params.recurring ) {
fullDottedPaymentMethod = 'r' + fullDottedPaymentMethod;
}
if ( params.payment_submethod ) {
fullDottedPaymentMethod = fullDottedPaymentMethod + '.' + params.payment_submethod;
}
/* Get URL parameter, but remove parts using old format. Allow fallback to a default value */
var getParam = function( param, removeText, dflt ) {
if ( mw.util.getParamValue( param ) ) {
return mw.util.getParamValue( param ).replace( removeText, '' );
} else {
return dflt;
}
};
/* The landing page info, separated by ~. This mostly exists for legacy reasons */
wmf_source += getParam( 'template' , 'Lp-layout' , 'default' ) + '~';
wmf_source += getParam( 'appeal-template' , 'Appeal-template-' , 'default' ) + '~';
wmf_source += getParam( 'appeal' , 'Appeal-' , 'default' ) + '~';
wmf_source += getParam( 'form-template' , 'Form-template-' , 'default' ) + '~';
wmf_source += getParam( 'form-countryspecific', 'Form-countryspecific-', 'control' );
wmf_source += '.' + fullDottedPaymentMethod;
return wmf_source;
};
/**
* Build a string for wmf_key from extra tracking data
*
* @param {Object} data
* @return {string} wmf_key
*/
donationForm.buildTrackingKey = function(data) {
var existingKey = mw.util.getParamValue( 'wmf_key' ) || mw.util.getParamValue( 'utm_key' ),
dataArray = [];
if ( existingKey ) {
dataArray.push( existingKey );
}
for (var key in data) {
if (data.hasOwnProperty(key)) {
dataArray.push( key + '_' + data[key] );
}
}
return dataArray.join('~');
};
/* Return amount selected or input */
donationForm.getAmount = function() {
var form = document.forms.donateForm,
amount = null;
donationForm.extraData.otherAmt = 0;
// If there are some amount radio buttons, then look for the checked one
if ( form.amount ) {
for ( var i = 0; i < form.amount.length; i++ ) {
if ( form.amount[i].checked ) {
amount = parseFloat( form.amount[i].value );
}
}
}
// Check the "other" amount box
if ( document.getElementById('input_amount_other').checked ) {
amount = donationForm.parseOtherAmount( form.input_amount_other_box.value );
donationForm.extraData.otherAmt = 1;
}
return amount;
};
/**
* Parse Other field value into amount
*
* Does some awful regex stuff to rm symbols and turn the string into a number
* Remember some locales flip . & , for decimal point/thousands separator
*
* @param {string} value Value of "Other" field
* @return {float} Float with amount, or 0 if NaN
*/
donationForm.parseOtherAmount = function( value ) {
var amount;
value = value.replace(/[,.](\d)$/, '\:$10');
value = value.replace(/[,.](\d)(\d)$/, '\:$1$2');
value = value.replace(/[\$£€¥,.]/g, '');
value = value.replace(/:/, '.');
amount = parseFloat( value );
if ( isNaN( amount ) ) {
return 0;
} else {
return amount;
}
};
/**
* Validate the form.
*/
donationForm.validate = function( skipAmountValidation ) {
var error = false;
var form = document.forms.donateForm;
// Reset all errors
$('.lp-haserror').removeClass('lp-haserror');
$('.lp-error').hide();
if ( !skipAmountValidation && !donationForm.validateAmount() ) {
error = true;
}
if ( form.opt_in ) {
if ( $('input[name="opt_in"]:checked').val() === undefined ) {
$('#error-optin').show().focus();
error = true;
} else {
$('#error-optin').hide();
}
}
return !error;
};
/**
* Check if selected amount is valid i.e. a positive number, between minimum and maximum.
* If not, show an error and return false.
*/
donationForm.validateAmount = function() {
var amount = donationForm.getAmount();
if ( amount === null || isNaN(amount) || amount <= 0 || amount < donationForm.minLocal ) {
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').hide();
$('.lp-error-smallamount').show().focus();
return false;
} else if ( amount > donationForm.maxLocal ) {
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').show().focus();
return false;
} else {
$('.amount-options').removeClass('lp-haserror');
$('.lp-error-smallamount, .lp-error-bigamount').hide();
return true;
}
};
donationForm.getFrequency = function() {
return document.forms.donateForm.dataset.frequency || 'onetime';
};
donationForm.setFrequency = function( frequency ) {
// TODO: add some validation to reject invalid frequency values
let form = document.forms.donateForm;
form.frequency.value = frequency; // change input
form.dataset.frequency = frequency;
};
/* Wrapper for compatibility with old forms */
donationForm.toggleMonthly = function( monthly ) {
if ( monthly ) {
donationForm.setFrequency( 'monthly' );
} else {
donationForm.setFrequency( 'onetime' );
}
};
donationForm.updateFeeDisplay = function() {
var selectedAmount = donationForm.getAmount(),
feeAmount = donationForm.calculateFee( selectedAmount ),
feeText;
feeText = donationForm.formatCurrency( feeAmount );
$('.ptf label span').text( feeText );
if ( selectedAmount + feeAmount <= donationForm.maxLocal ) {
$('.ptf').slideDown();
}
};
/**
* Calculate approximate transaction fee on given amount
* @param {number} amount
* @return {number} Rounded to 2 decimal places
*/
donationForm.calculateFee = function( amount ) {
// Minimum fee/PTF amounts. Default is 0.35.
// Updated 2019-05-21 to approx 0.35 USD equivalent
var feeMinimums = {
'DKK' : 2,
'HUF' : 100,
'ILS' : 1.2,
'INR' : 4,
'JPY' : 35,
'KHR' : 1000,
'MYR' : 1,
'NOK' : 3,
'PLN' : 1.35,
'CZK' : 7.5,
'RON' : 1.5,
'SEK' : 3,
'UAH' : 10,
'ZAR' : 5,
// Latin America // Updated 2025-06-10 to approx 0.35 USD equivalent
'BRL' : 2,
'ARS' : 415,
'CLP' : 325,
'COP' : 1450,
'MXN' : 6.75,
'PEN' : 1.28,
'UYU' : 14.5
};
var feeMultiplier = 0.04,
feeMinimum = feeMinimums[ donationForm.currency ] || 0.35,
feeAmount = amount * feeMultiplier;
if ( feeAmount < feeMinimum ) {
feeAmount = feeMinimum;
}
return parseFloat( feeAmount.toFixed(2) );
};
donationForm.initOptin = function() {
$('.optin-options').on('change', function(e) {
$('#error-optin').hide();
// Only do all this if we have translated prompts
if ( $('.optin-no-prompt').data('is-translated') === 'yes' ) {
if ( e.target.id === 'optin-no' ) {
$('.optin-no-prompt').removeClass('is-positive');
if ( !$('.optin-no-prompt').is(':visible') ) {
$('.optin-no-prompt').slideDown();
}
} else {
$('.optin-no-prompt').addClass('is-positive');
}
}
});
};
/**
* Block typing letters and symbols in given input. Used for Other amount inputs
*
* If we don't do this, Safari allows typing them and then chokes on submit
* https://phabricator.wikimedia.org/T118741, https://phabricator.wikimedia.org/T173431
*
* @param {Element} inputElement The element to block typing on
*/
donationForm.otherInputControl = function( inputElement ) {
if ( inputElement ) {
inputElement.onkeypress = function(e) {
// Allow special keys in Firefox
if ((e.code == 'ArrowLeft') || (e.code == 'ArrowRight') ||
(e.code == 'ArrowUp') || (e.code == 'ArrowDown') ||
(e.code == 'Delete') || (e.code == 'Backspace')) {
return;
}
var chr = String.fromCharCode(e.which);
if ( !'0123456789., '.includes(chr) ) {
return false;
}
};
}
};
/**
* Should we show Apple Pay?
*
* Note there is a ~500ms delay in Safari when checking, so only call this if needed
*
* @param {string} country
* @return {boolean}
*/
donationForm.shouldShowApplePay = function ( country ) {
if ( location.search.match('forceApplePay') ) {
return true;
}
if ( window.screen.width >= 640 && country !== 'JP' ) { // T397002
// On a desktop browser, people can scan with their iphone
return true;
} else if ( window.ApplePaySession ) {
// On mobile, check if Apple Pay is available natively
if ( ApplePaySession.canMakePayments() ) {
return true;
}
}
return false;
};
/**
* Determine if the annual option should be shown on the donation form, and show it if so
*
* @returns {boolean} true if the annual option is enabled
*/
donationForm.initAnnualRecurring = function() {
/*
Before adding a language here, please check that we have annual translations in-place for:
- the button here on donatewiki ([[MediaWiki:Frequency-Annual]])
- the thank you receipt email
- donor relations macros
- the thank you page (optional if it has no recurring-specific messaging)
*/
const annualLanguages = [
'%%isolang%%', '%25%25ISOLANG%25%25', '%25%25isolang%25%25', // for certain issues in email links
'en', 'en-ca', 'en-gb', 'en-us',
'ca', 'cs', 'da', 'de', 'el', 'es-419', 'es', 'fr', 'hu', 'it',
'ja', 'nb', 'nl', 'pl', 'pt-br', 'pt', 'sv',
];
const annualInput = document.getElementById( 'frequency_annual' );
if ( !annualInput ) { // old form without required input
return false;
}
let annualEnabled = annualLanguages.includes( mw.config.get( 'wgPageContentLanguage' ) );
// Allow overriding with URL params
if (
mw.util.getParamValue( 'form-countryspecific' ) === 'Form-countryspecific-annual' // compatibility with old method
|| mw.util.getParamValue( 'annual_enabled' ) === '1'
) {
annualEnabled = true;
}
if ( mw.util.getParamValue( 'annual_enabled' ) === '0' ) {
annualEnabled = false;
}
annualInput.parentNode.style.display = annualEnabled ? 'block' : 'none';
if ( annualEnabled ) {
document.forms.donateForm.classList.add( 'annual-enabled' );
}
return annualEnabled;
};
/**
* Change the amount options on the donation form
* @param {array} newAmounts
*/
donationForm.setAmountOptions = function( newAmounts ) {
for (var j = 0; j < newAmounts.length; j++) {
var $radio = $( `#input_amount_${j}` );
var $label = $( `label[for="input_amount_${j}"]` );
$radio.val( newAmounts[j] );
$label.text( donationForm.formatCurrency( newAmounts[j] ) );
}
};
/**
* Get the current amount options e.g. to store original amounts before changing them
* @returns {array} Array of amounts as numbers
*/
donationForm.getAmountOptions = function() {
let amounts = [];
document.querySelectorAll('input[name="amount"]').forEach( (input) => {
let amount = parseFloat( input.value );
if ( !isNaN( amount ) ) {
amounts.push( amount );
}
} );
return amounts;
};
/*
Based on github:braintree/braintree-web/src/venmo/shared/supports-venmo.js
See also on meta: MediaWiki:FundraisingBanners/VenmoBrowserCheck.js
*/
donationForm.isVenmoSupported = function(options) {
var options = options || {
allowNewBrowserTab: false,
allowWebviews: true,
allowDesktop: true,
allowDesktopWebLogin: true
};
var ua = window.navigator.userAgent;
var merchantAllowsReturningToNewBrowserTab,
merchantAllowsWebviews,
merchantAllowsDesktopBrowsers;
var isMobileDevice = isAndroid() || isIos();
var isAndroidChrome = isAndroid() && isChrome();
var isMobileDeviceThatSupportsReturnToSameTab = isIosSafari() || isAndroidChrome;
var isKnownUnsupportedMobileBrowser = isIosChrome() || isFacebookOwnedBrowserOnAndroid() || isSamsung();
options = options || {};
// NEXT_MAJOR_VERSION allowDesktop will default to true, but can be opted out
merchantAllowsDesktopBrowsers =
(options.allowDesktopWebLogin || options.allowDesktop) === true;
merchantAllowsReturningToNewBrowserTab = options.hasOwnProperty(
"allowNewBrowserTab"
)
? options.allowNewBrowserTab
: true;
// NEXT_MAJOR_VERSION webviews are not supported, except for the case where
// the merchant themselves is presenting venmo in a webview using the deep
// link url to get back to their app. For the next major version, we should
// just not have this option and instead require the merchant to determine
// if the venmo button should be displayed when presenting it in the
// merchant's app via a webview.
merchantAllowsWebviews = options.hasOwnProperty("allowWebviews")
? options.allowWebviews
: true;
if (isKnownUnsupportedMobileBrowser) {
return false;
}
if (
!merchantAllowsWebviews &&
(isAndroidWebview() || isIosWebview())
) {
return false;
}
if (!isMobileDevice) {
return merchantAllowsDesktopBrowsers;
}
if (!merchantAllowsReturningToNewBrowserTab) {
return isMobileDeviceThatSupportsReturnToSameTab;
}
return isMobileDevice;
/* -- functions mostly from github:braintree/browser-detection library -- */
function isAndroid() {
return /Android/i.test(ua);
}
function isIos(checkIpadOS = true) {
const iOsTest = /iPhone|iPod|iPad/i.test(ua);
return checkIpadOS ? iOsTest || isIpadOS() : iOsTest;
}
function isIpadOS() {
// "ontouchend" is used to determine if a browser is on an iPad, otherwise
// user-agents for iPadOS behave/identify as a desktop browser
return /Mac|iPad/i.test(ua) && "ontouchend" in window.document;
}
function isEdge() {
return ua.indexOf("Edge/") !== -1 || ua.indexOf("Edg/") !== -1;
}
function isSamsung() {
return /SamsungBrowser/i.test(ua);
}
function isDuckDuckGo() {
return ua.indexOf("DuckDuckGo/") !== -1;
}
function isOpera() {
return (
ua.indexOf("OPR/") !== -1 ||
ua.indexOf("Opera/") !== -1 ||
ua.indexOf("OPT/") !== -1
);
}
function isSilk() {
return ua.indexOf("Silk/") !== -1;
}
function isChrome() {
return (
(ua.indexOf("Chrome") !== -1 || ua.indexOf("CriOS") !== -1) &&
!isEdge() &&
!isSamsung() &&
!isDuckDuckGo() &&
!isOpera() &&
!isSilk()
);
}
function isIosFirefox() {
return /FxiOS/i.test(ua);
}
function isWebkit() {
const webkitRegexp = /webkit/i;
return webkitRegexp.test(ua);
}
function isIosChrome() {
return ua.indexOf("CriOS") > -1;
}
function isFacebook() {
return ua.indexOf("FBAN") > -1;
}
function isIosSafari() {
return (
isIos() &&
isWebkit() &&
!isIosChrome() &&
!isIosFirefox() &&
!isFacebook()
);
}
function isFacebookOwnedBrowserOnAndroid() {
var e = ua.toLowerCase();
return -1 < e.indexOf("huawei") && -1 < e.indexOf("fban") || isAndroid() && (-1 < e.indexOf("fb_iab") || -1 < e.indexOf("instagram"));
}
function isSamsungBrowser() {
return /SamsungBrowser/i.test(ua);
}
function isAndroidWebview() {
return isAndroid() && -1 < ua.toLowerCase().indexOf("wv");
}
function isGoogleSearchApp() {
return /\bGSA\b/.test(ua);
}
function isIosGoogleSearchApp() {
return isIos() && isGoogleSearchApp();
}
function isIosWebview() {
if (isIos()) {
// The Google Search iOS app is technically a webview and doesn't support popups.
if (isIosGoogleSearchApp()) {
return true;
}
// Historically, a webview could be identified by the presence of AppleWebKit and _no_ presence of Safari after.
return /.+AppleWebKit(?!.*Safari)/i.test(ua);
}
return false;
}
};
/* End form functions */
$(document).ready(function() {
mw.loader.using( ['mediawiki.util'] ).done( function() {
var form = document.forms.donateForm;
// Minimum amount is usually about 1 USD
donationForm.minLocal = donationForm.currencyRates[ donationForm.currency ];
donationForm.minLocal = Math.ceil( donationForm.minLocal * 100 ) / 100; // Round it up
donationForm.maxUSD = 25000;
donationForm.maxLocal = Math.floor( donationForm.currencyRates[ donationForm.currency ] * donationForm.maxUSD );
// Overrides for India
if ( donationForm.currency === 'INR' ) {
donationForm.minLocal = 10;
// Until https://phabricator.wikimedia.org/T370583 fixed?
donationForm.maxUSD = 3000;
donationForm.maxLocal = 250000;
}
// Block typing symbols in Other field
donationForm.otherInputControl( document.getElementById('input_amount_other_box') );
// Clear errors and update fee when selected/entered
$('.amount-options').on( 'input change', function() {
// Ideally we would validate the amount, but this causes issues with focus
$('.amount-options .lp-error').hide();
donationForm.updateFeeDisplay();
});
// Disable submitting form with Enter key
$('form[name="donateForm"]').on('keypress', function(e) {
var code = ( e.keyCode ? e.keyCode : e.which );
if ( code == 13 ) {
e.preventDefault();
}
});
// But allow Enter on buttons
$('.payment-method-button').keyup(function(e) {
if (event.keyCode === 13) {
e.target.click();
}
});
if ( form ) {
donationForm.initAnnualRecurring();
// hide frequency options for some countries
if ( donationForm.noRecurringCountries.includes( donationForm.country ) ) {
$('#frequency_onetime').prop('checked', true);
$('.frequency-options, #cancel-monthly, #donate-recurring-smallprint').hide();
}
if ( donationForm.noRecurringPaypalCountries.includes( donationForm.country ) ) {
$( '.paymentmethod-pp, .paymentmethod-pp-usd' ).addClass( 'not-monthly-capable' );
}
// Format amounts on buttons
$( '.amount-options li' ).each( function( index ) {
let amount = this.querySelector( 'input' ).value;
if ( amount !== 'Other' ) {
this.querySelector( 'label' ).innerText = donationForm.formatCurrency( amount );
}
});
addCardTypesClass( donationForm.country );
// Only show Amazon for links from Ways to give
if (
mw.util.getParamValue( 'wmf_source' ) === 'Waystogive' ||
mw.util.getParamValue( 'wmf_source' ) === 'Ways_to_Give'
) {
$('.paymentmethod-amazon').show();
}
// Only show DAF for certain Major Gifts links
if ( mw.util.getParamValue( 'wmf_campaign' ) === 'MG2WIR25' ) {
$('.paymentmethod-daf').show();
} else {
$('.paymentmethod-daf').hide();
}
// Apple Pay
if ( $('.paymentmethod-applepay').length > 0 ) {
if ( !donationForm.shouldShowApplePay( donationForm.country ) ) {
$('.paymentmethod-applepay').remove();
}
}
// Venmo browser check
if ( $('.paymentmethod-venmo').length > 0 ) {
if ( !donationForm.isVenmoSupported() || donationForm.country !== 'US' ) {
$('.paymentmethod-venmo').remove();
}
}
// Hide Google Pay if people are coming from iOS app https://phabricator.wikimedia.org/T411504
if ( mw.util.getParamValue('wmf_campaign') === 'iOS' ) {
$('.paymentmethod-google').remove();
}
}
// Links open in new tab
$('.links-in-new-tab a').attr('target', '_blank');
// Disable logo link
$('#p-logo a').attr( { href: '#', title: '' } );
// These don't need to be tabbable on the landing page
$('#searchInput, .mw-jump-link').attr('tabindex', '-1');
$('.input_amount_other').click(function() {
$('#input_amount_other_box').focus();
});
// Allow preselecting frequency if possible
if (
!donationForm.noRecurringCountries.includes( donationForm.country )
&& mw.util.getParamValue( 'utm_medium' ) !== 'endowment'
&& mw.util.getParamValue( 'wmf_medium' ) !== 'endowment'
) {
if ( mw.util.getParamValue( 'frequency' ) ) {
donationForm.setFrequency( mw.util.getParamValue( 'frequency' ) );
} else if ( mw.util.getParamValue('monthly') && mw.util.getParamValue('monthly') !== '0' ) {
// old method with "monthly=" parameter
donationForm.setFrequency( 'monthly' );
} else {
donationForm.setFrequency( 'onetime' );
}
}
// If we are emailing them and they have a contact_id, then we can assume they have opted in,
// unless this is a "Remind Me Later" email, or they are in a stricter country
let hasContactId = mw.util.getParamValue( 'contact_id' ) !== null;
let isRML = mw.util.getParamValue( 'wmf_campaign' ) && mw.util.getParamValue( 'wmf_campaign' ).includes( 'RMLEmail' );
let isStrictCountry = [ 'AT', 'IT' ].includes( donationForm.country );
if ( document.getElementById('optin-yes') && hasContactId && !isRML && !isStrictCountry ) {
document.getElementById('optin-yes').checked = true;
document.querySelector('.optin-options').style.display = 'none';
}
donationForm.initOptin();
try {
adjustHPC();
adjustMinAmounts();
// Store original amounts to switch back later if needed
donationForm.originalAmounts = donationForm.getAmountOptions();
preSelect(); // Make sure to do this *after* other fiddling with values
preSelectBox();
donationForm.localizeErrors();
}
finally {
$('.frb-monthly-pitch, .frb-monthly-pitch-thanks, .frb-recurring-pitch').appendTo('.frequency-options');
$('.ptf').appendTo('.amount-options');
$('.optin-options').insertAfter('.amount-options');
$('.consider-amounts').show();
$('#actual-form').show();
$('#actual-form-loading').hide();
}
});
});
ofg81gkeubwcs1dn6o9gjqfhhms336y
42998
42997
2026-08-19T18:04:23Z
Pcoombe
5
test
42998
javascript
text/javascript
/* jshint strict:false */
/** MediaWiki:DonationForm.js - loaded on all donation forms
* TODO: lots of cleanup
*/
var donationForm = {};
donationForm.loadedTime = Date.now();
donationForm.extraData = {
'vw' : window.innerWidth,
'vh' : window.innerHeight
};
donationForm.country = mw.util.getParamValue('country').toUpperCase();
try {
donationForm.currency = document.forms.donateForm.currency_code.value;
} catch (error) {
donationForm.currency = 'USD';
}
/**
* Make language and country into a standard javascript Intl locale identifier
*
* @param {string} language
* @param {string} country
* @return {string} locale identifier e.g. en-GB
*/
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';
}
// MediaWiki allows some language codes like en-gb, en-ca, pt-br
// We don't want these for a javascript locale, so drop anything after '-'
language = language.split('-')[0];
return language + '-' + country;
};
donationForm.locale = donationForm.getLocale( mw.config.get('wgPageContentLanguage'), donationForm.country );
// Don't offer recurring at all in these countries
donationForm.noRecurringCountries = [ 'AR', 'IN' ];
donationForm.noRecurringPaypalCountries = [ 'CL', 'CO', 'PE', 'UY', 'BR' ];
donationForm.currencyRates = {
// From https://github.com/wikimedia/wikimedia-fundraising-SmashPig/blob/master/PaymentData/ReferenceData/CurrencyRates.php
// Updated 2025-11-03
'ADF' : 5.69,
'ADP' : 144,
'AED' : 3.67,
'AFA' : 66,
'AFN' : 66,
'ALL' : 83,
'AMD' : 374,
'ANG' : 1.79,
'AOA' : 912,
'AON' : 912,
'ARS' : 1457,
'ATS' : 12,
'AUD' : 1.53,
'AWG' : 1.79,
'AZM' : 8500,
'AZN' : 1.7,
'BAM' : 1.7,
'BBD' : 2,
'BDT' : 121,
'BEF' : 35,
'BGL' : 1.7,
'BGN' : 1.7,
'BHD' : 0.37401652162054,
'BIF' : 2923,
'BMD' : 1,
'BND' : 1.3,
'BOB' : 6.76,
'BRL' : 5.37,
'BSD' : 1,
'BTN' : 89,
'BWP' : 13,
'BYR' : 34102,
'BZD' : 1.98,
'CAD' : 1.4,
'CDF' : 2224,
'CHF' : 0.80650783228772,
'CLP' : 940,
'CNY' : 7.12,
'COP' : 3853,
'CRC' : 496,
'CUC' : 1,
'CUP' : 25,
'CVE' : 96,
'CYP' : 0.50784522451156,
'CZK' : 21,
'DEM' : 1.7,
'DJF' : 178,
'DKK' : 6.48,
'DOP' : 64,
'DZD' : 130,
'ECS' : 24094,
'EEK' : 14,
'EGP' : 47,
'ESP' : 144,
'ETB' : 153,
'EUR' : 0.86770508259643,
'FIM' : 5.16,
'FJD' : 2.27,
'FKP' : 0.76116218937783,
'FRF' : 5.69,
'GBP' : 0.76116218937783,
'GEL' : 2.68,
'GHC' : 108957,
'GHS' : 11,
'GIP' : 0.76116218937783,
'GMD' : 71,
'GNF' : 8637,
'GRD' : 296,
'GTQ' : 7.55,
'GYD' : 205,
'HKD' : 7.77,
'HNL' : 26,
'HRK' : 6.54,
'HTG' : 130,
'HUF' : 336,
'IDR' : 16671,
'IEP' : 0.68337328567002,
'ILS' : 3.25,
'INR' : 89,
'IQD' : 1292,
'IRR' : 42020,
'ISK' : 126,
'ITL' : 1680,
'JMD' : 159,
'JOD' : 0.70900000000001,
'JPY' : 154,
'KES' : 128,
'KGS' : 87,
'KHR' : 3971,
'KMF' : 427,
'KPW' : 135,
'KRW' : 1429,
'KWD' : 0.30641816376358,
'KYD' : 0.83333299999999,
'KZT' : 526,
'LAK' : 21568,
'LBP' : 89680,
'LKR' : 303,
'LRD' : 182,
'LSL' : 17,
'LTL' : 3,
'LUF' : 35,
'LVL' : 0.60982660286911,
'LYD' : 5.44,
'MAD' : 9.19,
'MDL' : 17,
'MGA' : 4474,
'MGF' : 9150,
'MKD' : 53,
'MMK' : 2093,
'MNT' : 2620,
'MOP' : 8.01,
'MRO' : 395,
'MTL' : 0.37250579195865,
'MUR' : 45,
'MVR' : 15,
'MWK' : 1730,
'MXN' : 19,
'MYR' : 4.2,
'MZM' : 63200,
'MZN' : 63,
'NAD' : 17,
'NGN' : 1446,
'NIO' : 36,
'NLG' : 1.91,
'NOK' : 10,
'NPR' : 141,
'NZD' : 1.75,
'OMR' : 0.38352905117543,
'PAB' : 1,
'PEN' : 3.35,
'PGK' : 4.17,
'PHP' : 59,
'PKR' : 282,
'PLN' : 3.69,
'PTE' : 174,
'PYG' : 6991,
'QAR' : 3.6,
'ROL' : 44083,
'RON' : 4.41,
'RSD' : 101,
'RUB' : 81,
'RWF' : 1446,
'SAR' : 3.75,
'SBD' : 8.21,
'SCR' : 14,
'SDD' : 59715,
'SDG' : 597,
'SDP' : 2261,
'SEK' : 9.49,
'SGD' : 1.3,
'SHP' : 0.76116218937783,
'SIT' : 208,
'SKK' : 26,
'SLL' : 19750,
'SOS' : 550,
'SRD' : 39,
'SRG' : 38521,
'STD' : 21169,
'SVC' : 8.75,
'SYP' : 513,
'SZL' : 17,
'THB' : 32,
'TJS' : 9.15,
'TMM' : 16757,
'TMT' : 3.35,
'TND' : 2.93,
'TOP' : 2.4,
'TRL' : 42048152,
'TRY' : 42,
'TTD' : 6.69,
'TWD' : 31,
'TZS' : 2442,
'UAH' : 42,
'UGX' : 3463,
'USD' : 1,
'UYU' : 40,
'UZS' : 11982,
'VEB' : 22204414173,
'VEF' : 22204414,
'VND' : 26302,
'VUV' : 112,
'WST' : 2.71,
'XAF' : 569,
'XAG' : 0.020582109674161,
'XAU' : 0.000249595454823,
'XCD' : 2.7,
'XEU' : 0.86770508259643,
'XOF' : 569,
'XPD' : 0.00068810810716198,
'XPF' : 104,
'XPT' : 0.00063604563466001,
'YER' : 238,
'YUN' : 101,
'ZAR' : 17,
'ZMK' : 5176,
'ZWD' : 373
};
/* Amount and currency formatting */
let formatters = {
// Amounts without currency symbol
amountFraction: new Intl.NumberFormat( donationForm.locale,
{ minimumFractionDigits: 2, maximumFractionDigits: 2 }
),
amountWhole: new Intl.NumberFormat( donationForm.locale,
{}
)
};
// currencyDisplay: 'narrowSymbol' fixes some issues like en-CO showing the ISO code
// but browser support is lacking, so wrap in a try/catch
try {
formatters.currencyFraction = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, currencyDisplay: 'narrowSymbol' }
);
formatters.currencyWhole = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, currencyDisplay: 'narrowSymbol', minimumFractionDigits: 0 }
);
} catch(e) {
formatters.currencyFraction = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency }
);
formatters.currencyWhole = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, minimumFractionDigits: 0 }
);
}
donationForm.formatCurrency = function( amount ) {
if ( amount % 1 !== 0 ) { // Not a whole number
return formatters.currencyFraction.format( amount );
} else {
return formatters.currencyWhole.format( amount );
}
};
donationForm.formatAmount = function( amount ) {
var formatterOptions, output;
if ( amount % 1 !== 0 ) { // Not a whole number
return formatters.amountFraction.format( amount );
} else {
return formatters.amountWhole.format( amount );
}
};
/* Localize the amount errors. Call when initialising form. */
donationForm.localizeErrors = function() {
var currency = donationForm.currency;
$('.lp-error-smallamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.minLocal ) + '\xa0' + currency );
});
if ( currency === 'USD' ) {
// we don't need to include the conversion
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '($1 $2) ', '' )
.replace( '($1 $2) ', '' );
});
}
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.maxLocal ) )
.replace( '$2', currency )
.replace( '$3', 'benefactors@wikimedia.org' )
.replace( '$4', donationForm.formatAmount( donationForm.maxUSD ) );
});
};
function adjustMinAmounts() {
// Amounts spreadsheet https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
// Defining lookup table here. Using mw.loader.getScript was visibly too slow for the user (amounts flashing)
const minPlusLookup = {
// US - Canada - UK - EUR - Australia - New Zealand
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
USD: {
amount1: { from: 2.75, to: 4.50 },
amount2: { from: 5, to: 7 },
},
GBP: {
amount1: { from: 2, to: 4 },
amount2: { from: 5, to: 7 },
},
EUR: {
amount1: { from: 2.50, to: 4.50 },
amount2: { from: 5, to: 7 },
},
// English Bundle
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=891721479#gid=891721479
HUF: {
amount1: { from: 500, to: 750 },
},
MYR: {
amount1: { from: 10, to: 20 },
amount2: { from: 30, to: 40 },
},
RON: {
amount1: { from: 10, to: 30 },
},
// Other
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1865233115#gid=1865233115
CZK: {
amount1: { from: 50, to: 100 },
amount2: { from: 100, to: 150 },
},
DKK: {
amount1: { from: 20, to: 40 },
amount2: { from: 75, to: 80 },
},
JPY: {
amount1: { from: 500, to: 1000 },
amount2: { from: 1000, to: 2000 },
amount3: { from: 2000, to: 3000 },
amount4: { from: 2500, to: 4000 },
amount5: { from: 4000, to: 5000 },
amount6: { from: 5000, to: 10000 },
amount7: { from: 10000, to: 15000 },
},
ZAR: {
amount1: { from: 30, to: 50 },
amount2: { from: 50, to: 75 },
},
NOK: {
amount1: { from: 30, to: 50 },
},
SEK: {
amount1: { from: 30, to: 50 },
amount2: { from: 50, to: 70 },
},
ILS: {
amount1: { from: 10, to: 20 },
},
PLN: {
amount1: { from: 10, to: 20 },
amount2: { from: 20, to: 30 },
},
CHF: {
amount1: { from: 20, to: 30 },
},
THB: {
amount1: { from: 100, to: 150 },
amount2: { from: 200, to: 250 },
},
};
// CAD, AUD, NZD = USD amounts
minPlusLookup.CAD = minPlusLookup.USD;
minPlusLookup.AUD = minPlusLookup.USD;
minPlusLookup.NZD = minPlusLookup.USD;
if ( mw.util.getParamValue( 'minPlus' ) === '1' || mw.util.getParamValue( 'minPlus' ) === 'true' ) {
const currencyEntry = minPlusLookup[ donationForm.currency ];
// Currency not in lookup table. No swapping.
if ( !currencyEntry ) return null;
const amountKeys = Object.keys( currencyEntry ); // ["amount1", "amount2"] or however many keys in lookup
amountKeys.forEach( (amount, index) => {
const $radio = $( `#input_amount_${index}` );
const $label = $( `label[for='input_amount_${index}` );
// If the button's amount is equal to "from" in the lookup, perform the swap.
// Guards from hpc adjusted amounts as those values won't be present in the lookup.
if ( currencyEntry[amount].from === parseFloat( $radio.val() ) ) {
$radio.val( currencyEntry[amount].to );
$label.text( donationForm.formatCurrency( currencyEntry[amount].to ) );
}
});
}
}
function adjustHPC() {
/* Adjust amounts based on highest previous contribution (hpc)
or most recent contribution (mrc) parameter. Used for emails.
TODO: split data out? */
var hpcSet = mw.util.getParamValue('hpcSet');
// Look for 'hpc' parameter, then 'mrc'
var hpc = parseFloat( mw.util.getParamValue('hpc') );
if( isNaN(hpc) ) {
hpc = parseFloat( mw.util.getParamValue('mrc') );
if( isNaN(hpc) ) {
if ( hpcSet ) {
// Allow using hpcSet even without hpc, for MG appeals
hpc = 0;
} else {
return;
}
}
}
var currency = donationForm.currency;
// https://phabricator.wikimedia.org/T381437
var hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== currency ) {
console.log('Highest previous contribution currency does not match form currency, using default amounts');
return;
}
// Consult this sheet for amounts: https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
var radioAmountsData = {
"USD" : { // also used for CAD, AUD, NZD
"default" : [
[ 0, [ 2.75, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2.75, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
// Direct Mail - fixed amounts
"directmail" : [
[ 0, [ 25, 35, 50, 100, 150, 250, 300 ] ]
],
"directmail250" : [
[ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ]
]
},
"EUR" : {
"default" : [
[ 0, [ 2.50, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2.50, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
},
"GBP" : {
"default" : [
[ 0, [ 2, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
},
"JPY" : [
[ 0, [ 500, 1000, 2000, 2500, 4000, 5000, 10000 ] ],
[ 1000, [ 1000, 1500, 2500, 4000, 5000, 10000, 15000 ] ],
[ 1500, [ 1500, 2000, 3000, 4000, 5000, 10000, 15000 ] ],
[ 2000, [ 2000, 2500, 3500, 5000, 7500, 10000, 25000 ] ],
[ 2500, [ 2500, 3500, 5000, 7500, 10000, 15000, 25000 ] ],
[ 3000, [ 3000, 4000, 5000, 7500, 10000, 15000, 25000 ] ],
[ 5000, [ 5000, 10000, 15000, 20000, 35000, 50000, 100000 ] ],
[ 10000, [ 10000, 25000, 50000, 75000, 100000, 150000, 200000 ] ]
],
"SEK" : [
[ 0, [ 30, 50, 100, 150, 200, 300, 500 ] ],
[ 50, [ 50, 100, 150, 200, 300, 500, 750 ] ],
[ 200, [ 200, 300, 500, 750, 1000, 1500, 2000 ] ]
]
};
radioAmountsData.AUD = radioAmountsData.USD;
radioAmountsData.CAD = radioAmountsData.USD;
radioAmountsData.NZD = radioAmountsData.USD;
// Major gifts appeals, hacky but this is easier than adding a load of new forms to maintain
var currencyList = [ 'USD', 'CAD', 'AUD', 'NZD', 'GBP', 'EUR' ]; // close enough
for ( let i = 0; i < currencyList.length; i++ ) {
// FY2425 hpcSets
// Major Gifts hpcSets
radioAmountsData[ currencyList[i] ].MG_2024_500 = [ [ 0, [ 500, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2024_650 = [ [ 0, [ 650, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
// FY2526 hpcSets
// Direct Mail hpcSets
radioAmountsData[ currencyList[i] ].DM_2526_15 = [ [ 0, [ 15, 25, 35, 50, 100, 200, 250 ] ] ];
radioAmountsData[ currencyList[i] ].DM_2526_250 = [ [ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].DM_2526_5000 = [ [ 0, [ 5000, 7500, 10000, 12500, 15000, 17500, 20000 ] ] ];
// Major Gifts hpcSets
radioAmountsData[ currencyList[i] ].MG_2526_500_9999 = [
[ 0, [ 750, 850, 1000, 1250, 1500, 1750, 2000 ] ],
[ 1000, [ 1500, 2000, 2500, 3000, 3750, 4500, 5000 ] ],
[ 3000, [ 4000, 5000, 6000, 7000, 8000, 9000, 10000 ] ]
];
radioAmountsData[ currencyList[i] ].MG_2526_10K = [ [ 0, [ 5000, 7500, 10000, 12500, 15000, 17500, 20000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_250_399 = [ [ 0, [ 500, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_400_499 = [ [ 0, [ 650, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_HNWI_250 = [ [ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_HNWI_350 = [ [ 0, [ 350, 400, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_2500 = [ [ 0, [ 2500, 3000, 5000, 7500, 10000, 15000, 25000 ] ] ];
}
var appealAmountsData = {
"USD" : [ // also used for CAD, AUD, NZD, GBP, EUR
[ 0, [ 5, 10, 20 ] ],
[ 10, [ 10, 20, 50 ] ],
[ 20, [ 20, 30, 50 ] ],
[ 35, [ 20, 30, 50 ] ],
[ 50, [ 20, 50, 100 ] ],
[ 75, [ 50, 75, 100 ] ],
[ 100, [ 75, 100, 150 ] ],
[ 150, [ 75, 100, 200 ] ],
[ 200, [ 100, 200, 300 ] ]
],
"JPY" : [
[ 0, [ 300, 500, 1000 ] ],
[ 3, [ 500, 1000, 1500 ] ],
[ 5, [ 1000, 1500, 2000 ] ],
[ 10, [ 1500, 2000, 5000 ] ],
[ 20, [ 2000, 3000, 5000 ] ],
[ 50, [ 2000, 5000, 10000 ] ],
[ 100, [ 5000, 10000, 15000 ] ]
],
"SEK" : [
[ 0, [ 20, 50, 100 ] ],
[ 3, [ 30, 50, 100 ] ],
[ 5, [ 50, 100, 150 ] ],
[ 15, [ 100, 150, 200 ] ],
[ 23, [ 100, 200, 300 ] ],
[ 38, [ 100, 200, 500 ] ],
[ 75, [ 100, 500, 750 ] ],
[ 112, [ 100, 500, 1000 ] ]
]
};
appealAmountsData.AUD = appealAmountsData.USD;
appealAmountsData.CAD = appealAmountsData.USD;
appealAmountsData.GBP = appealAmountsData.USD;
appealAmountsData.NZD = appealAmountsData.USD;
appealAmountsData.EUR = appealAmountsData.USD;
// Radio button amounts
var radioAmounts = pickAmountArray( radioAmountsData, currency, hpc, hpcSet );
if ( radioAmounts.length ) {
donationForm.setAmountOptions( radioAmounts );
}
// Appeal amounts
var appealAmounts = pickAmountArray( appealAmountsData, currency, hpc, hpcSet );
if ( appealAmounts.length ) {
var appealAmountString = appealAmounts.map( donationForm.formatCurrency ).join( ', ');
$('.consider-amounts').html(appealAmountString);
}
}
function pickAmountArray( data, currency, hpc, hpcSet ) {
/**
* Choose the amounts for radio buttons / appeal based on hpc
* @param {Object} data
* @param {String} currency
* @param {Number} hpc
* @param {String} hpcSet
* @return {Array} Array of amounts (as numbers)
*/
var set, amounts;
if ( !(currency in data) ) {
return [];
}
if ( $.isArray(data[currency]) ) {
// No variant sets
set = data[currency];
} else {
// We need to go deeper. Check the variants.
if ( hpcSet in data[currency] ) {
set = data[currency][hpcSet];
} else {
set = data[currency]['default'];
}
}
// Find correct amount array for this hpc
for (var i = 0; i < set.length; i++) {
if ( set[i][0] > hpc ) {
break;
}
amounts = set[i][1];
}
return amounts;
}
function preSelect() {
/* Check for a 'preSelect' url parameter, and select that option.
If there isn't an option, add it to the "Other" box and select that */
var preSelectAmount = parseFloat( mw.util.getParamValue('preSelect') || mw.util.getParamValue('preselect') );
if ( preSelectAmount > 0 ) {
let hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== donationForm.currency ) {
console.log('Highest previous contribution currency does not match form currency, not doing preselection');
return;
}
var $preSelectOption = $('input[name="amount"][value="' + preSelectAmount + '"]');
if ( $preSelectOption.length ) {
// Select existing input
$preSelectOption.prop('checked', true);
} else {
$('#input_amount_other_box').val( preSelectAmount );
$('#input_amount_other').prop('checked', true);
}
donationForm.updateFeeDisplay();
}
}
function preSelectBox() {
/* Check for a 'preSelectBox' url parameter, and select that numbered option.
If the value provided is invalid or doesn't exist, exit. Valid choices are 1 to 7 (8 is "Other").
If 'preSelect' exists, ignore this function. */
if(!mw.util.getParamValue('preSelect')){
// Check hpcCurrency first before running preselection.
let hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== donationForm.currency ) {
console.log('Highest previous contribution currency does not match form currency, not preselecting box.');
return;
}
// If hpc & hpcCurrency provided are okay OR hpc wasn't provided then continue.
var preSelectBoxNumber = parseInt( mw.util.getParamValue('preSelectBox') );
if (preSelectBoxNumber >= 1 && preSelectBoxNumber <= 7) {
var $preSelectOption = $('input[id="input_amount_' + (preSelectBoxNumber - 1) + '"]');
if ( $preSelectOption.length ) {
$preSelectOption.prop('checked', true);
donationForm.updateFeeDisplay();
}
}
}
}
function addCardTypesClass(country) {
/**
* Add card types class to credit card button, so we can show correct logos
* Banner equivalent: https://meta.wikimedia.org/wiki/MediaWiki:FundraisingBanners/LocalizeJS-2017.js
* @param {String} country ISO code
*/
var cardTypes = {
// Big 6
'US' : 'vmad',
'CA' : 'vma',
'GB' : 'vmaj',
'IE' : 'vmaj',
'AU' : 'vmaj',
'NZ' : 'vma',
// Euro countries
'AT' : 'vmaj',
'BE' : 'vmaj',
'ES' : 'vmaj',
'FR' : 'vma',
'IT' : 'vmaj',
'LU' : 'vmaj',
'LV' : 'vma',
'NL' : 'vmaj',
'PT' : 'vmaj',
'SK' : 'vmaj',
'GR' : 'vma',
// Others
'CZ' : 'vmad',
'DK' : 'vma',
'HU' : 'vma',
'IL' : 'vmad',
// 'JP' : 'vmaj', - use text only as there were complaints about Diners Club not being included
'MY' : 'vmaj',
'NO' : 'vma',
'PL' : 'vma',
'RO' : 'vma',
'SE' : 'vma',
'UA' : 'vma',
'ZA' : 'vm',
'ZZ' : 'vmad' // For testing
};
if ( cardTypes[country] ) {
$('.paymentmethod-cc').addClass('cctypes-' + cardTypes[country] );
$('.cc-text-label').addClass('sr-only');
}
}
/* Form functions */
function clearOther(box) {
document.getElementById('input_amount_other').checked = true;
box.value = "";
}
function selectOther() {
document.getElementById('input_amount_other').checked = true;
}
function selectAmount() {
$('#input_amount_other_box').val('');
}
/* -- Moved from Template:2012FR/Form-section/Processing/Default -- */
/**
* Validate form, and prep most of the parameters
*
* @param {string} paymentMethod - method e.g. 'cc', 'paypal'
* @param {string} paymentSubMethod - submethod e.g. 'rtbt_ideal' (a submethod of 'rtbt')
* @param {string} skipAmountValidation - skip validating amount for PayPal forced to USD
*/
donationForm.redirectPayment = function( paymentMethod, paymentSubMethod, skipAmountValidation ) {
if ( donationForm.validate( skipAmountValidation ) ) {
var params = {};
params.currency = donationForm.currency;
params.country = donationForm.country;
// Overrides for specific gateways
if ( paymentMethod === 'cc-adyen' ) {
params.payment_method = 'cc';
params.gateway = 'adyen';
} else if ( paymentMethod === 'cc-dlocal' ) {
params.payment_method = 'cc';
params.gateway = 'dlocal';
} else if ( paymentMethod === 'trustly' ) {
params.payment_method = 'dd';
params.payment_submethod = 'ach';
params.gateway = 'gravy';
} else if ( paymentSubMethod === 'sepadirectdebit' ) {
params.payment_method = 'rtbt';
params.payment_submethod = 'sepadirectdebit';
params.gateway = 'gravy';
} else if ( paymentMethod === 'bt' && params.country === 'CZ' ) {
params.payment_method = 'bt';
params.gateway = 'gravy';
} else if ( paymentSubMethod === 'vipps' ) {
params.payment_method = 'ew';
params.payment_submethod = 'vipps';
params.gateway = 'gravy';
} else {
params.payment_method = paymentMethod;
}
// dlocal
let dlocalCountries = [ 'AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY', 'ZA' ],
dlocalMethods = [ 'cc', 'bt', 'cash', 'cash_boleto', 'pix' ];
if ( dlocalCountries.includes( params.country ) && dlocalMethods.includes( params.payment_method ) ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'cc' && params.gateway === undefined ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'paypal' ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'rtbt' && paymentSubMethod === 'rtbt_ideal' ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'apple' || params.payment_method === 'google' ) {
params.gateway = 'gravy';
}
if ( paymentSubMethod ) {
params.payment_submethod = paymentSubMethod;
}
let frequency = donationForm.getFrequency();
if ( frequency === 'monthly' ) {
params.recurring = '1';
params.frequency_unit = 'month';
} else if ( frequency === 'annual' ) {
params.recurring = '1';
params.frequency_unit = 'year';
}
params.uselang = mw.config.get('wgPageContentLanguage'); // see T281285 for why not wgUserLanguage
if ( params.uselang === 'pt' && params.country === 'BR' ) {
params.uselang = 'pt-br';
}
if ( params.uselang === 'es' &&
( params.country === 'AR' || params.country === 'CL' ||
params.country === 'CO' || params.country === 'MX' ||
params.country === 'PE' || params.country === 'UY' ||
params.country === 'US' )
) {
params.uselang = 'es-419';
}
var amount = donationForm.getAmount();
if ( $('#ptf-checkbox').prop('checked') ) {
amount = amount + donationForm.calculateFee( amount );
donationForm.extraData.ptf = 1;
}
params.amount = amount;
// Email optin
if ( $('input[name="opt_in"]').length > 0 ) {
var opt_inValue = $('input[name="opt_in"]:checked').val();
params.opt_in = opt_inValue; // donationForm.validate() already checked it's 1 or 0
}
if ( mw.util.getParamValue( 'pym_variant' ) ) {
params.variant = mw.util.getParamValue( 'pym_variant' );
}
if ( params.recurring && params.variant && params.variant.match( /monthlyConvert/ ) ) {
// Post-payments monthly convert makes no sense if it's already recurring
// Avoid things like T312905
delete params.variant;
}
if ( mw.util.getParamValue( 'pym_appeal' ) ) {
params.appeal = mw.util.getParamValue( 'pym_appeal' );
}
// Pass through specified parameters to payments unchanged
const passThroughParams = [
'contact_id', 'contact_hash', // https://phabricator.wikimedia.org/T381405
'checksum', 'contribution_recur_id', // https://phabricator.wikimedia.org/T396271
'recipient_id', // SMS
'app_install_id' // https://phabricator.wikimedia.org/T411535
];
passThroughParams.forEach( ( param ) => {
const value = mw.util.getParamValue( param );
if ( value ) {
params[ param ] = value;
}
} );
// Monthly convert
if ( mc ) { // check just in-case this wasn't loaded for some reason
mc.main( params, donationForm.finalStep );
} else {
donationForm.finalStep( params );
}
} else {
donationForm.extraData.validateError = 1; // Flag they had an error, even if fixed later
}
return false; // don't submit if called by a button
};
/**
* Build final tracking parameters, and submit to payments
* @param {Object} params
*/
donationForm.finalStep = function( params ) {
var url = new URL('https://payments.wikimedia.org/index.php/Special:GatewayChooser');
// Skip form chooser for Venmo
if ( params.payment_method === 'venmo' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
// Skip form chooser for Pix
if ( params.payment_method === 'cash' && params.payment_submethod === 'pix' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
// And Yape
if ( params.payment_method === 'ew' && params.payment_submethod === 'yape' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
donationForm.extraData.time = Math.round( (Date.now() - donationForm.loadedTime)/1000 );
// Tracking data
params.wmf_medium = mw.util.getParamValue( 'wmf_medium' ) || mw.util.getParamValue( 'utm_medium' );
params.wmf_campaign = mw.util.getParamValue( 'wmf_campaign' ) || mw.util.getParamValue( 'utm_campaign' );
params.wmf_source = donationForm.buildTrackingSource( params );
params.wmf_key = donationForm.buildTrackingKey( donationForm.extraData );
if ( document.referrer ) { // TODO: do we need this?
// Strip protocol to stop firewall complaining
params.referrer = document.referrer.replace(/https?:\/\//i, '');
}
for ( var key of Object.keys( params ) ) {
url.searchParams.set( key, params[key] );
}
if ( window.top !== window.self ) {
// In a frame, open payments in a new tab
window.open( url.toString() );
} else {
window.location.href = url.toString();
}
};
/**
* Build a wmf_source value, including the landing page info.
*
* Own function so it can be overriden for weird tests
*
* @param {Object} params
* @return {string} wmf_source
*/
donationForm.buildTrackingSource = function( params ) {
var wmf_source = mw.util.getParamValue( 'wmf_source' ) || mw.util.getParamValue( 'utm_source' );
wmf_source += '.';
var fullDottedPaymentMethod = params.payment_method;
if ( params.recurring ) {
fullDottedPaymentMethod = 'r' + fullDottedPaymentMethod;
}
if ( params.payment_submethod ) {
fullDottedPaymentMethod = fullDottedPaymentMethod + '.' + params.payment_submethod;
}
/* Get URL parameter, but remove parts using old format. Allow fallback to a default value */
var getParam = function( param, removeText, dflt ) {
if ( mw.util.getParamValue( param ) ) {
return mw.util.getParamValue( param ).replace( removeText, '' );
} else {
return dflt;
}
};
/* The landing page info, separated by ~. This mostly exists for legacy reasons */
wmf_source += getParam( 'template' , 'Lp-layout' , 'default' ) + '~';
wmf_source += getParam( 'appeal-template' , 'Appeal-template-' , 'default' ) + '~';
wmf_source += getParam( 'appeal' , 'Appeal-' , 'default' ) + '~';
wmf_source += getParam( 'form-template' , 'Form-template-' , 'default' ) + '~';
wmf_source += getParam( 'form-countryspecific', 'Form-countryspecific-', 'control' );
wmf_source += '.' + fullDottedPaymentMethod;
return wmf_source;
};
/**
* Build a string for wmf_key from extra tracking data
*
* @param {Object} data
* @return {string} wmf_key
*/
donationForm.buildTrackingKey = function(data) {
var existingKey = mw.util.getParamValue( 'wmf_key' ) || mw.util.getParamValue( 'utm_key' ),
dataArray = [];
if ( existingKey ) {
dataArray.push( existingKey );
}
for (var key in data) {
if (data.hasOwnProperty(key)) {
dataArray.push( key + '_' + data[key] );
}
}
return dataArray.join('~');
};
/* Return amount selected or input */
donationForm.getAmount = function() {
var form = document.forms.donateForm,
amount = null;
donationForm.extraData.otherAmt = 0;
// If there are some amount radio buttons, then look for the checked one
if ( form.amount ) {
for ( var i = 0; i < form.amount.length; i++ ) {
if ( form.amount[i].checked ) {
amount = parseFloat( form.amount[i].value );
}
}
}
// Check the "other" amount box
if ( document.getElementById('input_amount_other').checked ) {
amount = donationForm.parseOtherAmount( form.input_amount_other_box.value );
donationForm.extraData.otherAmt = 1;
}
return amount;
};
/**
* Parse Other field value into amount
*
* Does some awful regex stuff to rm symbols and turn the string into a number
* Remember some locales flip . & , for decimal point/thousands separator
*
* @param {string} value Value of "Other" field
* @return {float} Float with amount, or 0 if NaN
*/
donationForm.parseOtherAmount = function( value ) {
var amount;
value = value.replace(/[,.](\d)$/, '\:$10');
value = value.replace(/[,.](\d)(\d)$/, '\:$1$2');
value = value.replace(/[\$£€¥,.]/g, '');
value = value.replace(/:/, '.');
amount = parseFloat( value );
if ( isNaN( amount ) ) {
return 0;
} else {
return amount;
}
};
/**
* Validate the form.
*/
donationForm.validate = function( skipAmountValidation ) {
var error = false;
var form = document.forms.donateForm;
// Reset all errors
$('.lp-haserror').removeClass('lp-haserror');
$('.lp-error').hide();
if ( !skipAmountValidation && !donationForm.validateAmount() ) {
error = true;
}
if ( form.opt_in ) {
if ( $('input[name="opt_in"]:checked').val() === undefined ) {
$('#error-optin').show().focus();
error = true;
} else {
$('#error-optin').hide();
}
}
return !error;
};
/**
* Check if selected amount is valid i.e. a positive number, between minimum and maximum.
* If not, show an error and return false.
*/
donationForm.validateAmount = function() {
var amount = donationForm.getAmount();
if ( amount === null || isNaN(amount) || amount <= 0 || amount < donationForm.minLocal ) {
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').hide();
$('.lp-error-smallamount').show().focus();
return false;
} else if ( amount > donationForm.maxLocal ) {
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').show().focus();
return false;
} else {
$('.amount-options').removeClass('lp-haserror');
$('.lp-error-smallamount, .lp-error-bigamount').hide();
return true;
}
};
donationForm.getFrequency = function() {
return document.forms.donateForm.dataset.frequency || 'onetime';
};
donationForm.setFrequency = function( frequency ) {
// TODO: add some validation to reject invalid frequency values
let form = document.forms.donateForm;
form.frequency.value = frequency; // change input
form.dataset.frequency = frequency;
};
/* Wrapper for compatibility with old forms */
donationForm.toggleMonthly = function( monthly ) {
if ( monthly ) {
donationForm.setFrequency( 'monthly' );
} else {
donationForm.setFrequency( 'onetime' );
}
};
donationForm.updateFeeDisplay = function() {
var selectedAmount = donationForm.getAmount(),
feeAmount = donationForm.calculateFee( selectedAmount ),
feeText;
feeText = donationForm.formatCurrency( feeAmount );
$('.ptf label span').text( feeText );
if ( selectedAmount + feeAmount <= donationForm.maxLocal ) {
$('.ptf').slideDown();
}
};
/**
* Calculate approximate transaction fee on given amount
* @param {number} amount
* @return {number} Rounded to 2 decimal places
*/
donationForm.calculateFee = function( amount ) {
// Minimum fee/PTF amounts. Default is 0.35.
// Updated 2019-05-21 to approx 0.35 USD equivalent
var feeMinimums = {
'DKK' : 2,
'HUF' : 100,
'ILS' : 1.2,
'INR' : 4,
'JPY' : 35,
'KHR' : 1000,
'MYR' : 1,
'NOK' : 3,
'PLN' : 1.35,
'CZK' : 7.5,
'RON' : 1.5,
'SEK' : 3,
'UAH' : 10,
'ZAR' : 5,
// Latin America // Updated 2025-06-10 to approx 0.35 USD equivalent
'BRL' : 2,
'ARS' : 415,
'CLP' : 325,
'COP' : 1450,
'MXN' : 6.75,
'PEN' : 1.28,
'UYU' : 14.5
};
var feeMultiplier = 0.04,
feeMinimum = feeMinimums[ donationForm.currency ] || 0.35,
feeAmount = amount * feeMultiplier;
if ( feeAmount < feeMinimum ) {
feeAmount = feeMinimum;
}
return parseFloat( feeAmount.toFixed(2) );
};
donationForm.initOptin = function() {
$('.optin-options').on('change', function(e) {
$('#error-optin').hide();
// Only do all this if we have translated prompts
if ( $('.optin-no-prompt').data('is-translated') === 'yes' ) {
if ( e.target.id === 'optin-no' ) {
$('.optin-no-prompt').removeClass('is-positive');
if ( !$('.optin-no-prompt').is(':visible') ) {
$('.optin-no-prompt').slideDown();
}
} else {
$('.optin-no-prompt').addClass('is-positive');
}
}
});
};
/**
* Block typing letters and symbols in given input. Used for Other amount inputs
*
* If we don't do this, Safari allows typing them and then chokes on submit
* https://phabricator.wikimedia.org/T118741, https://phabricator.wikimedia.org/T173431
*
* @param {Element} inputElement The element to block typing on
*/
donationForm.otherInputControl = function( inputElement ) {
if ( inputElement ) {
inputElement.onkeypress = function(e) {
// Allow special keys in Firefox
if ((e.code == 'ArrowLeft') || (e.code == 'ArrowRight') ||
(e.code == 'ArrowUp') || (e.code == 'ArrowDown') ||
(e.code == 'Delete') || (e.code == 'Backspace')) {
return;
}
var chr = String.fromCharCode(e.which);
if ( !'0123456789., '.includes(chr) ) {
return false;
}
};
}
};
/**
* Should we show Apple Pay?
*
* Note there is a ~500ms delay in Safari when checking, so only call this if needed
*
* @param {string} country
* @return {boolean}
*/
donationForm.shouldShowApplePay = function ( country ) {
if ( location.search.match('forceApplePay') ) {
return true;
}
if ( window.screen.width >= 640 && country !== 'JP' ) { // T397002
// On a desktop browser, people can scan with their iphone
return true;
} else if ( window.ApplePaySession ) {
// On mobile, check if Apple Pay is available natively
if ( ApplePaySession.canMakePayments() ) {
return true;
}
}
return false;
};
/**
* Determine if the annual option should be shown on the donation form, and show it if so
*
* @returns {boolean} true if the annual option is enabled
*/
donationForm.initAnnualRecurring = function() {
/*
Before adding a language here, please check that we have annual translations in-place for:
- the button here on donatewiki ([[MediaWiki:Frequency-Annual]])
- the thank you receipt email
- donor relations macros
- the thank you page (optional if it has no recurring-specific messaging)
*/
const annualLanguages = [
'%%isolang%%', '%25%25ISOLANG%25%25', '%25%25isolang%25%25', // for certain issues in email links
'en', 'en-ca', 'en-gb', 'en-us',
'ca', 'cs', 'da', 'de', 'el', 'es-419', 'es', 'fr', 'hu', 'it',
'ja', 'nb', 'nl', 'pl', 'pt-br', 'pt', 'sv',
];
const annualInput = document.getElementById( 'frequency_annual' );
if ( !annualInput ) { // old form without required input
return false;
}
let annualEnabled = annualLanguages.includes( mw.config.get( 'wgPageContentLanguage' ) );
// Allow overriding with URL params
if (
mw.util.getParamValue( 'form-countryspecific' ) === 'Form-countryspecific-annual' // compatibility with old method
|| mw.util.getParamValue( 'annual_enabled' ) === '1'
) {
annualEnabled = true;
}
if ( mw.util.getParamValue( 'annual_enabled' ) === '0' ) {
annualEnabled = false;
}
annualInput.parentNode.style.display = annualEnabled ? 'block' : 'none';
if ( annualEnabled ) {
document.forms.donateForm.classList.add( 'annual-enabled' );
}
return annualEnabled;
};
/**
* Change the amount options on the donation form
* @param {array} newAmounts
*/
donationForm.setAmountOptions = function( newAmounts ) {
for (var j = 0; j < newAmounts.length; j++) {
var $radio = $( `#input_amount_${j}` );
var $label = $( `label[for="input_amount_${j}"]` );
$radio.val( newAmounts[j] );
$label.text( donationForm.formatCurrency( newAmounts[j] ) );
}
};
/**
* Get the current amount options e.g. to store original amounts before changing them
* @returns {array} Array of amounts as numbers
*/
donationForm.getAmountOptions = function() {
let amounts = [];
document.querySelectorAll('input[name="amount"]').forEach( (input) => {
let amount = parseFloat( input.value );
if ( !isNaN( amount ) ) {
amounts.push( amount );
}
} );
return amounts;
};
/*
Based on github:braintree/braintree-web/src/venmo/shared/supports-venmo.js
See also on meta: MediaWiki:FundraisingBanners/VenmoBrowserCheck.js
*/
donationForm.isVenmoSupported = function(options) {
var options = options || {
allowNewBrowserTab: false,
allowWebviews: true,
allowDesktop: true,
allowDesktopWebLogin: true
};
var ua = window.navigator.userAgent;
var merchantAllowsReturningToNewBrowserTab,
merchantAllowsWebviews,
merchantAllowsDesktopBrowsers;
var isMobileDevice = isAndroid() || isIos();
var isAndroidChrome = isAndroid() && isChrome();
var isMobileDeviceThatSupportsReturnToSameTab = isIosSafari() || isAndroidChrome;
var isKnownUnsupportedMobileBrowser = isIosChrome() || isFacebookOwnedBrowserOnAndroid() || isSamsung();
options = options || {};
// NEXT_MAJOR_VERSION allowDesktop will default to true, but can be opted out
merchantAllowsDesktopBrowsers =
(options.allowDesktopWebLogin || options.allowDesktop) === true;
merchantAllowsReturningToNewBrowserTab = options.hasOwnProperty(
"allowNewBrowserTab"
)
? options.allowNewBrowserTab
: true;
// NEXT_MAJOR_VERSION webviews are not supported, except for the case where
// the merchant themselves is presenting venmo in a webview using the deep
// link url to get back to their app. For the next major version, we should
// just not have this option and instead require the merchant to determine
// if the venmo button should be displayed when presenting it in the
// merchant's app via a webview.
merchantAllowsWebviews = options.hasOwnProperty("allowWebviews")
? options.allowWebviews
: true;
if (isKnownUnsupportedMobileBrowser) {
return false;
}
if (
!merchantAllowsWebviews &&
(isAndroidWebview() || isIosWebview())
) {
return false;
}
if (!isMobileDevice) {
return merchantAllowsDesktopBrowsers;
}
if (!merchantAllowsReturningToNewBrowserTab) {
return isMobileDeviceThatSupportsReturnToSameTab;
}
return isMobileDevice;
/* -- functions mostly from github:braintree/browser-detection library -- */
function isAndroid() {
return /Android/i.test(ua);
}
function isIos(checkIpadOS = true) {
const iOsTest = /iPhone|iPod|iPad/i.test(ua);
return checkIpadOS ? iOsTest || isIpadOS() : iOsTest;
}
function isIpadOS() {
// "ontouchend" is used to determine if a browser is on an iPad, otherwise
// user-agents for iPadOS behave/identify as a desktop browser
return /Mac|iPad/i.test(ua) && "ontouchend" in window.document;
}
function isEdge() {
return ua.indexOf("Edge/") !== -1 || ua.indexOf("Edg/") !== -1;
}
function isSamsung() {
return /SamsungBrowser/i.test(ua);
}
function isDuckDuckGo() {
return ua.indexOf("DuckDuckGo/") !== -1;
}
function isOpera() {
return (
ua.indexOf("OPR/") !== -1 ||
ua.indexOf("Opera/") !== -1 ||
ua.indexOf("OPT/") !== -1
);
}
function isSilk() {
return ua.indexOf("Silk/") !== -1;
}
function isChrome() {
return (
(ua.indexOf("Chrome") !== -1 || ua.indexOf("CriOS") !== -1) &&
!isEdge() &&
!isSamsung() &&
!isDuckDuckGo() &&
!isOpera() &&
!isSilk()
);
}
function isIosFirefox() {
return /FxiOS/i.test(ua);
}
function isWebkit() {
const webkitRegexp = /webkit/i;
return webkitRegexp.test(ua);
}
function isIosChrome() {
return ua.indexOf("CriOS") > -1;
}
function isFacebook() {
return ua.indexOf("FBAN") > -1;
}
function isIosSafari() {
return (
isIos() &&
isWebkit() &&
!isIosChrome() &&
!isIosFirefox() &&
!isFacebook()
);
}
function isFacebookOwnedBrowserOnAndroid() {
var e = ua.toLowerCase();
return -1 < e.indexOf("huawei") && -1 < e.indexOf("fban") || isAndroid() && (-1 < e.indexOf("fb_iab") || -1 < e.indexOf("instagram"));
}
function isSamsungBrowser() {
return /SamsungBrowser/i.test(ua);
}
function isAndroidWebview() {
return isAndroid() && -1 < ua.toLowerCase().indexOf("wv");
}
function isGoogleSearchApp() {
return /\bGSA\b/.test(ua);
}
function isIosGoogleSearchApp() {
return isIos() && isGoogleSearchApp();
}
function isIosWebview() {
if (isIos()) {
// The Google Search iOS app is technically a webview and doesn't support popups.
if (isIosGoogleSearchApp()) {
return true;
}
// Historically, a webview could be identified by the presence of AppleWebKit and _no_ presence of Safari after.
return /.+AppleWebKit(?!.*Safari)/i.test(ua);
}
return false;
}
};
/* End form functions */
$(document).ready(function() {
mw.loader.using( ['mediawiki.util'] ).done( function() {
var form = document.forms.donateForm;
// Minimum amount is usually about 1 USD
donationForm.minLocal = donationForm.currencyRates[ donationForm.currency ];
donationForm.minLocal = Math.ceil( donationForm.minLocal * 100 ) / 100; // Round it up
donationForm.maxUSD = 25000;
donationForm.maxLocal = Math.floor( donationForm.currencyRates[ donationForm.currency ] * donationForm.maxUSD );
// Overrides for India
if ( donationForm.currency === 'INR' ) {
donationForm.minLocal = 10;
// Until https://phabricator.wikimedia.org/T370583 fixed?
donationForm.maxUSD = 3000;
donationForm.maxLocal = 250000;
}
// Block typing symbols in Other field
donationForm.otherInputControl( document.getElementById('input_amount_other_box') );
// Clear errors and update fee when selected/entered
$('.amount-options').on( 'input change', function() {
// Ideally we would validate the amount, but this causes issues with focus
$('.amount-options .lp-error').hide();
donationForm.updateFeeDisplay();
});
// Disable submitting form with Enter key
$('form[name="donateForm"]').on('keypress', function(e) {
var code = ( e.keyCode ? e.keyCode : e.which );
if ( code == 13 ) {
e.preventDefault();
}
});
// But allow Enter on buttons
$('.payment-method-button').keyup(function(e) {
if (event.keyCode === 13) {
e.target.click();
}
});
if ( form ) {
donationForm.initAnnualRecurring();
// hide frequency options for some countries
if ( donationForm.noRecurringCountries.includes( donationForm.country ) ) {
$('#frequency_onetime').prop('checked', true);
$('.frequency-options, #cancel-monthly, #donate-recurring-smallprint').hide();
}
if ( donationForm.noRecurringPaypalCountries.includes( donationForm.country ) ) {
$( '.paymentmethod-pp, .paymentmethod-pp-usd' ).addClass( 'not-monthly-capable' );
}
// Format amounts on buttons
$( '.amount-options li' ).each( function( index ) {
let amount = this.querySelector( 'input' ).value;
if ( amount !== 'Other' ) {
this.querySelector( 'label' ).innerText = donationForm.formatCurrency( amount );
}
});
addCardTypesClass( donationForm.country );
// Only show Amazon for links from Ways to give
if (
mw.util.getParamValue( 'wmf_source' ) === 'Waystogive' ||
mw.util.getParamValue( 'wmf_source' ) === 'Ways_to_Give'
) {
$('.paymentmethod-amazon').show();
}
// Only show DAF for certain Major Gifts links
if ( mw.util.getParamValue( 'wmf_campaign' ) === 'MG2WIR25' ) {
$('.paymentmethod-daf').show();
} else {
$('.paymentmethod-daf').hide();
}
// Apple Pay
if ( $('.paymentmethod-applepay').length > 0 ) {
if ( !donationForm.shouldShowApplePay( donationForm.country ) ) {
$('.paymentmethod-applepay').remove();
}
}
// Venmo browser check
if ( $('.paymentmethod-venmo').length > 0 ) {
if ( !donationForm.isVenmoSupported() || donationForm.country !== 'US' ) {
$('.paymentmethod-venmo').remove();
}
}
// Hide Google Pay if people are coming from iOS app https://phabricator.wikimedia.org/T411504
if ( mw.util.getParamValue('wmf_campaign') === 'iOS' ) {
$('.paymentmethod-google').remove();
}
}
// Links open in new tab
$('.links-in-new-tab a').attr('target', '_blank');
// Disable logo link
$('#p-logo a').attr( { href: '#', title: '' } );
// These don't need to be tabbable on the landing page
$('#searchInput, .mw-jump-link').attr('tabindex', '-1');
$('.input_amount_other').click(function() {
$('#input_amount_other_box').focus();
});
// Allow preselecting frequency if possible
if (
!donationForm.noRecurringCountries.includes( donationForm.country )
&& mw.util.getParamValue( 'utm_medium' ) !== 'endowment'
&& mw.util.getParamValue( 'wmf_medium' ) !== 'endowment'
) {
if ( mw.util.getParamValue( 'frequency' ) ) {
donationForm.setFrequency( mw.util.getParamValue( 'frequency' ) );
} else if ( mw.util.getParamValue('monthly') && mw.util.getParamValue('monthly') !== '0' ) {
// old method with "monthly=" parameter
donationForm.setFrequency( 'monthly' );
} else {
donationForm.setFrequency( 'onetime' );
}
}
// If we are emailing them and they have a contact_id, then we can assume they have opted in,
// unless this is a "Remind Me Later" email, or they are in a stricter country
let hasContactId = mw.util.getParamValue( 'contact_id' ) !== null;
let isRML = mw.util.getParamValue( 'wmf_campaign' ) && mw.util.getParamValue( 'wmf_campaign' ).includes( 'RMLEmail' );
let isStrictCountry = [ 'AT', 'IT' ].includes( donationForm.country );
if ( document.getElementById('optin-yes') && hasContactId && !isRML && !isStrictCountry ) {
document.getElementById('optin-yes').checked = true;
document.querySelector('.optin-options').style.display = 'none';
}
donationForm.initOptin();
try {
adjustHPC();
adjustMinAmounts();
// Store original amounts to switch back later if needed
donationForm.originalAmounts = donationForm.getAmountOptions();
preSelect(); // Make sure to do this *after* other fiddling with values
preSelectBox();
donationForm.localizeErrors();
}
finally {
$('.frb-monthly-pitch, .frb-monthly-pitch-thanks, .frb-recurring-pitch').appendTo('.frequency-options');
$('.ptf').appendTo('.amount-options');
$('.optin-options').insertAfter('.amount-options');
$('.consider-amounts').show();
$('#actual-form').show();
$('#actual-form-loading').hide();
}
});
});
56p2yj6wbli23ixc2crq9ttche62azn
43007
42998
2026-08-20T11:34:43Z
PPenloglou-WMF
52
Creating "MinPlus5-75" hpcSet for FY2627 en6C Email1 T9 test. https://docs.google.com/document/d/17VIovid0Wds2zpvxu2tL4p3ngY7dmc4s5a1klXjf6EU/edit?tab=t.jpnn7rmghuar#heading=h.8k0nus7clfh
43007
javascript
text/javascript
/* jshint strict:false */
/** MediaWiki:DonationForm.js - loaded on all donation forms
* TODO: lots of cleanup
*/
var donationForm = {};
donationForm.loadedTime = Date.now();
donationForm.extraData = {
'vw' : window.innerWidth,
'vh' : window.innerHeight
};
donationForm.country = mw.util.getParamValue('country').toUpperCase();
try {
donationForm.currency = document.forms.donateForm.currency_code.value;
} catch (error) {
donationForm.currency = 'USD';
}
/**
* Make language and country into a standard javascript Intl locale identifier
*
* @param {string} language
* @param {string} country
* @return {string} locale identifier e.g. en-GB
*/
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';
}
// MediaWiki allows some language codes like en-gb, en-ca, pt-br
// We don't want these for a javascript locale, so drop anything after '-'
language = language.split('-')[0];
return language + '-' + country;
};
donationForm.locale = donationForm.getLocale( mw.config.get('wgPageContentLanguage'), donationForm.country );
// Don't offer recurring at all in these countries
donationForm.noRecurringCountries = [ 'AR', 'IN' ];
donationForm.noRecurringPaypalCountries = [ 'CL', 'CO', 'PE', 'UY', 'BR' ];
donationForm.currencyRates = {
// From https://github.com/wikimedia/wikimedia-fundraising-SmashPig/blob/master/PaymentData/ReferenceData/CurrencyRates.php
// Updated 2025-11-03
'ADF' : 5.69,
'ADP' : 144,
'AED' : 3.67,
'AFA' : 66,
'AFN' : 66,
'ALL' : 83,
'AMD' : 374,
'ANG' : 1.79,
'AOA' : 912,
'AON' : 912,
'ARS' : 1457,
'ATS' : 12,
'AUD' : 1.53,
'AWG' : 1.79,
'AZM' : 8500,
'AZN' : 1.7,
'BAM' : 1.7,
'BBD' : 2,
'BDT' : 121,
'BEF' : 35,
'BGL' : 1.7,
'BGN' : 1.7,
'BHD' : 0.37401652162054,
'BIF' : 2923,
'BMD' : 1,
'BND' : 1.3,
'BOB' : 6.76,
'BRL' : 5.37,
'BSD' : 1,
'BTN' : 89,
'BWP' : 13,
'BYR' : 34102,
'BZD' : 1.98,
'CAD' : 1.4,
'CDF' : 2224,
'CHF' : 0.80650783228772,
'CLP' : 940,
'CNY' : 7.12,
'COP' : 3853,
'CRC' : 496,
'CUC' : 1,
'CUP' : 25,
'CVE' : 96,
'CYP' : 0.50784522451156,
'CZK' : 21,
'DEM' : 1.7,
'DJF' : 178,
'DKK' : 6.48,
'DOP' : 64,
'DZD' : 130,
'ECS' : 24094,
'EEK' : 14,
'EGP' : 47,
'ESP' : 144,
'ETB' : 153,
'EUR' : 0.86770508259643,
'FIM' : 5.16,
'FJD' : 2.27,
'FKP' : 0.76116218937783,
'FRF' : 5.69,
'GBP' : 0.76116218937783,
'GEL' : 2.68,
'GHC' : 108957,
'GHS' : 11,
'GIP' : 0.76116218937783,
'GMD' : 71,
'GNF' : 8637,
'GRD' : 296,
'GTQ' : 7.55,
'GYD' : 205,
'HKD' : 7.77,
'HNL' : 26,
'HRK' : 6.54,
'HTG' : 130,
'HUF' : 336,
'IDR' : 16671,
'IEP' : 0.68337328567002,
'ILS' : 3.25,
'INR' : 89,
'IQD' : 1292,
'IRR' : 42020,
'ISK' : 126,
'ITL' : 1680,
'JMD' : 159,
'JOD' : 0.70900000000001,
'JPY' : 154,
'KES' : 128,
'KGS' : 87,
'KHR' : 3971,
'KMF' : 427,
'KPW' : 135,
'KRW' : 1429,
'KWD' : 0.30641816376358,
'KYD' : 0.83333299999999,
'KZT' : 526,
'LAK' : 21568,
'LBP' : 89680,
'LKR' : 303,
'LRD' : 182,
'LSL' : 17,
'LTL' : 3,
'LUF' : 35,
'LVL' : 0.60982660286911,
'LYD' : 5.44,
'MAD' : 9.19,
'MDL' : 17,
'MGA' : 4474,
'MGF' : 9150,
'MKD' : 53,
'MMK' : 2093,
'MNT' : 2620,
'MOP' : 8.01,
'MRO' : 395,
'MTL' : 0.37250579195865,
'MUR' : 45,
'MVR' : 15,
'MWK' : 1730,
'MXN' : 19,
'MYR' : 4.2,
'MZM' : 63200,
'MZN' : 63,
'NAD' : 17,
'NGN' : 1446,
'NIO' : 36,
'NLG' : 1.91,
'NOK' : 10,
'NPR' : 141,
'NZD' : 1.75,
'OMR' : 0.38352905117543,
'PAB' : 1,
'PEN' : 3.35,
'PGK' : 4.17,
'PHP' : 59,
'PKR' : 282,
'PLN' : 3.69,
'PTE' : 174,
'PYG' : 6991,
'QAR' : 3.6,
'ROL' : 44083,
'RON' : 4.41,
'RSD' : 101,
'RUB' : 81,
'RWF' : 1446,
'SAR' : 3.75,
'SBD' : 8.21,
'SCR' : 14,
'SDD' : 59715,
'SDG' : 597,
'SDP' : 2261,
'SEK' : 9.49,
'SGD' : 1.3,
'SHP' : 0.76116218937783,
'SIT' : 208,
'SKK' : 26,
'SLL' : 19750,
'SOS' : 550,
'SRD' : 39,
'SRG' : 38521,
'STD' : 21169,
'SVC' : 8.75,
'SYP' : 513,
'SZL' : 17,
'THB' : 32,
'TJS' : 9.15,
'TMM' : 16757,
'TMT' : 3.35,
'TND' : 2.93,
'TOP' : 2.4,
'TRL' : 42048152,
'TRY' : 42,
'TTD' : 6.69,
'TWD' : 31,
'TZS' : 2442,
'UAH' : 42,
'UGX' : 3463,
'USD' : 1,
'UYU' : 40,
'UZS' : 11982,
'VEB' : 22204414173,
'VEF' : 22204414,
'VND' : 26302,
'VUV' : 112,
'WST' : 2.71,
'XAF' : 569,
'XAG' : 0.020582109674161,
'XAU' : 0.000249595454823,
'XCD' : 2.7,
'XEU' : 0.86770508259643,
'XOF' : 569,
'XPD' : 0.00068810810716198,
'XPF' : 104,
'XPT' : 0.00063604563466001,
'YER' : 238,
'YUN' : 101,
'ZAR' : 17,
'ZMK' : 5176,
'ZWD' : 373
};
/* Amount and currency formatting */
let formatters = {
// Amounts without currency symbol
amountFraction: new Intl.NumberFormat( donationForm.locale,
{ minimumFractionDigits: 2, maximumFractionDigits: 2 }
),
amountWhole: new Intl.NumberFormat( donationForm.locale,
{}
)
};
// currencyDisplay: 'narrowSymbol' fixes some issues like en-CO showing the ISO code
// but browser support is lacking, so wrap in a try/catch
try {
formatters.currencyFraction = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, currencyDisplay: 'narrowSymbol' }
);
formatters.currencyWhole = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, currencyDisplay: 'narrowSymbol', minimumFractionDigits: 0 }
);
} catch(e) {
formatters.currencyFraction = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency }
);
formatters.currencyWhole = new Intl.NumberFormat( donationForm.locale,
{ style: 'currency', currency: donationForm.currency, minimumFractionDigits: 0 }
);
}
donationForm.formatCurrency = function( amount ) {
if ( amount % 1 !== 0 ) { // Not a whole number
return formatters.currencyFraction.format( amount );
} else {
return formatters.currencyWhole.format( amount );
}
};
donationForm.formatAmount = function( amount ) {
var formatterOptions, output;
if ( amount % 1 !== 0 ) { // Not a whole number
return formatters.amountFraction.format( amount );
} else {
return formatters.amountWhole.format( amount );
}
};
/* Localize the amount errors. Call when initialising form. */
donationForm.localizeErrors = function() {
var currency = donationForm.currency;
$('.lp-error-smallamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.minLocal ) + '\xa0' + currency );
});
if ( currency === 'USD' ) {
// we don't need to include the conversion
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '($1 $2) ', '' )
.replace( '($1 $2) ', '' );
});
}
$('.lp-error-bigamount').text( function( index, oldText ) {
return oldText.replace( '$1', donationForm.formatAmount( donationForm.maxLocal ) )
.replace( '$2', currency )
.replace( '$3', 'benefactors@wikimedia.org' )
.replace( '$4', donationForm.formatAmount( donationForm.maxUSD ) );
});
};
function adjustMinAmounts() {
// Amounts spreadsheet https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
// Defining lookup table here. Using mw.loader.getScript was visibly too slow for the user (amounts flashing)
const minPlusLookup = {
// US - Canada - UK - EUR - Australia - New Zealand
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
USD: {
amount1: { from: 2.75, to: 4.50 },
amount2: { from: 5, to: 7 },
},
GBP: {
amount1: { from: 2, to: 4 },
amount2: { from: 5, to: 7 },
},
EUR: {
amount1: { from: 2.50, to: 4.50 },
amount2: { from: 5, to: 7 },
},
// English Bundle
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=891721479#gid=891721479
HUF: {
amount1: { from: 500, to: 750 },
},
MYR: {
amount1: { from: 10, to: 20 },
amount2: { from: 30, to: 40 },
},
RON: {
amount1: { from: 10, to: 30 },
},
// Other
// https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1865233115#gid=1865233115
CZK: {
amount1: { from: 50, to: 100 },
amount2: { from: 100, to: 150 },
},
DKK: {
amount1: { from: 20, to: 40 },
amount2: { from: 75, to: 80 },
},
JPY: {
amount1: { from: 500, to: 1000 },
amount2: { from: 1000, to: 2000 },
amount3: { from: 2000, to: 3000 },
amount4: { from: 2500, to: 4000 },
amount5: { from: 4000, to: 5000 },
amount6: { from: 5000, to: 10000 },
amount7: { from: 10000, to: 15000 },
},
ZAR: {
amount1: { from: 30, to: 50 },
amount2: { from: 50, to: 75 },
},
NOK: {
amount1: { from: 30, to: 50 },
},
SEK: {
amount1: { from: 30, to: 50 },
amount2: { from: 50, to: 70 },
},
ILS: {
amount1: { from: 10, to: 20 },
},
PLN: {
amount1: { from: 10, to: 20 },
amount2: { from: 20, to: 30 },
},
CHF: {
amount1: { from: 20, to: 30 },
},
THB: {
amount1: { from: 100, to: 150 },
amount2: { from: 200, to: 250 },
},
};
// CAD, AUD, NZD = USD amounts
minPlusLookup.CAD = minPlusLookup.USD;
minPlusLookup.AUD = minPlusLookup.USD;
minPlusLookup.NZD = minPlusLookup.USD;
if ( mw.util.getParamValue( 'minPlus' ) === '1' || mw.util.getParamValue( 'minPlus' ) === 'true' ) {
const currencyEntry = minPlusLookup[ donationForm.currency ];
// Currency not in lookup table. No swapping.
if ( !currencyEntry ) return null;
const amountKeys = Object.keys( currencyEntry ); // ["amount1", "amount2"] or however many keys in lookup
amountKeys.forEach( (amount, index) => {
const $radio = $( `#input_amount_${index}` );
const $label = $( `label[for='input_amount_${index}` );
// If the button's amount is equal to "from" in the lookup, perform the swap.
// Guards from hpc adjusted amounts as those values won't be present in the lookup.
if ( currencyEntry[amount].from === parseFloat( $radio.val() ) ) {
$radio.val( currencyEntry[amount].to );
$label.text( donationForm.formatCurrency( currencyEntry[amount].to ) );
}
});
}
}
function adjustHPC() {
/* Adjust amounts based on highest previous contribution (hpc)
or most recent contribution (mrc) parameter. Used for emails.
TODO: split data out? */
var hpcSet = mw.util.getParamValue('hpcSet');
// Look for 'hpc' parameter, then 'mrc'
var hpc = parseFloat( mw.util.getParamValue('hpc') );
if( isNaN(hpc) ) {
hpc = parseFloat( mw.util.getParamValue('mrc') );
if( isNaN(hpc) ) {
if ( hpcSet ) {
// Allow using hpcSet even without hpc, for MG appeals
hpc = 0;
} else {
return;
}
}
}
var currency = donationForm.currency;
// https://phabricator.wikimedia.org/T381437
var hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== currency ) {
console.log('Highest previous contribution currency does not match form currency, using default amounts');
return;
}
// Consult this sheet for amounts: https://docs.google.com/spreadsheets/d/1oJGy5ZxBL0HYl5pwbEORkl_VXy3SEjmT7ZOVYQdBsXQ/edit?gid=1360915542#gid=1360915542
var radioAmountsData = {
"USD" : { // also used for CAD, AUD, NZD
"default" : [
[ 0, [ 2.75, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2.75, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"MinPlus5-75" : [
[ 0, [ 5.75, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
// Direct Mail - fixed amounts
"directmail" : [
[ 0, [ 25, 35, 50, 100, 150, 250, 300 ] ]
],
"directmail250" : [
[ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ]
]
},
"EUR" : {
"default" : [
[ 0, [ 2.50, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5.50, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2.50, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"MinPlus5-75" : [
[ 0, [ 5.75, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
},
"GBP" : {
"default" : [
[ 0, [ 2, 5, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_Annual" : [
[ 0, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 5, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 10, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus" : [
[ 0, [ 4, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus5-50" : [
[ 0, [ 5, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_MinPlus6" : [
[ 0, [ 6, 10, 15, 20, 25, 35, 50 ] ],
[ 5, [ 8, 12, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"FY2526_AvgGiftPlus" : [
[ 0, [ 2, 5, 10, 15, 20, 35, 50 ] ],
[ 5, [ 5, 10, 20, 25, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 35, 40, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 40, 50, 100, 150 ] ],
[ 25, [ 25, 35, 50, 60, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
"MinPlus5-75" : [
[ 0, [ 5.75, 7, 10, 20, 25, 35, 50 ] ],
[ 5, [ 5, 10, 15, 20, 35, 50, 100 ] ],
[ 10, [ 10, 15, 20, 25, 35, 50, 100 ] ],
[ 15, [ 15, 20, 25, 35, 50, 75, 100 ] ],
[ 20, [ 20, 25, 35, 50, 75, 100, 150 ] ],
[ 25, [ 25, 30, 40, 50, 75, 100, 150 ] ],
[ 35, [ 35, 50, 75, 100, 125, 150, 250 ] ],
[ 50, [ 50, 75, 85, 100, 125, 150, 250 ] ],
[ 75, [ 75, 100, 115, 125, 150, 200, 250 ] ],
[ 100, [ 100, 125, 150, 175, 200, 250, 500 ] ],
[ 125, [ 125, 150, 175, 200, 250, 300, 500 ] ],
[ 150, [ 150, 175, 200, 225, 275, 500, 750 ] ],
[ 175, [ 175, 200, 225, 250, 350, 500, 750 ] ],
[ 200, [ 200, 225, 250, 275, 350, 500, 750 ] ],
[ 225, [ 225, 250, 275, 300, 400, 500, 750 ] ],
[ 250, [ 200, 300, 500, 750, 1000, 2500, 5000 ] ],
[ 500, [ 500, 750, 1000, 2500, 5000, 7500, 10000 ] ],
[ 1000, [ 1000, 2000, 3000, 4000, 5000, 7500, 10000 ] ],
[ 3000, [ 3000, 4000, 5000, 6000, 7500, 10000, 12000 ] ]
],
},
"JPY" : [
[ 0, [ 500, 1000, 2000, 2500, 4000, 5000, 10000 ] ],
[ 1000, [ 1000, 1500, 2500, 4000, 5000, 10000, 15000 ] ],
[ 1500, [ 1500, 2000, 3000, 4000, 5000, 10000, 15000 ] ],
[ 2000, [ 2000, 2500, 3500, 5000, 7500, 10000, 25000 ] ],
[ 2500, [ 2500, 3500, 5000, 7500, 10000, 15000, 25000 ] ],
[ 3000, [ 3000, 4000, 5000, 7500, 10000, 15000, 25000 ] ],
[ 5000, [ 5000, 10000, 15000, 20000, 35000, 50000, 100000 ] ],
[ 10000, [ 10000, 25000, 50000, 75000, 100000, 150000, 200000 ] ]
],
"SEK" : [
[ 0, [ 30, 50, 100, 150, 200, 300, 500 ] ],
[ 50, [ 50, 100, 150, 200, 300, 500, 750 ] ],
[ 200, [ 200, 300, 500, 750, 1000, 1500, 2000 ] ]
]
};
radioAmountsData.AUD = radioAmountsData.USD;
radioAmountsData.CAD = radioAmountsData.USD;
radioAmountsData.NZD = radioAmountsData.USD;
// Major gifts appeals, hacky but this is easier than adding a load of new forms to maintain
var currencyList = [ 'USD', 'CAD', 'AUD', 'NZD', 'GBP', 'EUR' ]; // close enough
for ( let i = 0; i < currencyList.length; i++ ) {
// FY2425 hpcSets
// Major Gifts hpcSets
radioAmountsData[ currencyList[i] ].MG_2024_500 = [ [ 0, [ 500, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2024_650 = [ [ 0, [ 650, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
// FY2526 hpcSets
// Direct Mail hpcSets
radioAmountsData[ currencyList[i] ].DM_2526_15 = [ [ 0, [ 15, 25, 35, 50, 100, 200, 250 ] ] ];
radioAmountsData[ currencyList[i] ].DM_2526_250 = [ [ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].DM_2526_5000 = [ [ 0, [ 5000, 7500, 10000, 12500, 15000, 17500, 20000 ] ] ];
// Major Gifts hpcSets
radioAmountsData[ currencyList[i] ].MG_2526_500_9999 = [
[ 0, [ 750, 850, 1000, 1250, 1500, 1750, 2000 ] ],
[ 1000, [ 1500, 2000, 2500, 3000, 3750, 4500, 5000 ] ],
[ 3000, [ 4000, 5000, 6000, 7000, 8000, 9000, 10000 ] ]
];
radioAmountsData[ currencyList[i] ].MG_2526_10K = [ [ 0, [ 5000, 7500, 10000, 12500, 15000, 17500, 20000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_250_399 = [ [ 0, [ 500, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_400_499 = [ [ 0, [ 650, 750, 1000, 1250, 1500, 1750, 2000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_HNWI_250 = [ [ 0, [ 250, 300, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_HNWI_350 = [ [ 0, [ 350, 400, 500, 750, 1000, 2500, 5000 ] ] ];
radioAmountsData[ currencyList[i] ].MG_2526_2500 = [ [ 0, [ 2500, 3000, 5000, 7500, 10000, 15000, 25000 ] ] ];
}
var appealAmountsData = {
"USD" : [ // also used for CAD, AUD, NZD, GBP, EUR
[ 0, [ 5, 10, 20 ] ],
[ 10, [ 10, 20, 50 ] ],
[ 20, [ 20, 30, 50 ] ],
[ 35, [ 20, 30, 50 ] ],
[ 50, [ 20, 50, 100 ] ],
[ 75, [ 50, 75, 100 ] ],
[ 100, [ 75, 100, 150 ] ],
[ 150, [ 75, 100, 200 ] ],
[ 200, [ 100, 200, 300 ] ]
],
"JPY" : [
[ 0, [ 300, 500, 1000 ] ],
[ 3, [ 500, 1000, 1500 ] ],
[ 5, [ 1000, 1500, 2000 ] ],
[ 10, [ 1500, 2000, 5000 ] ],
[ 20, [ 2000, 3000, 5000 ] ],
[ 50, [ 2000, 5000, 10000 ] ],
[ 100, [ 5000, 10000, 15000 ] ]
],
"SEK" : [
[ 0, [ 20, 50, 100 ] ],
[ 3, [ 30, 50, 100 ] ],
[ 5, [ 50, 100, 150 ] ],
[ 15, [ 100, 150, 200 ] ],
[ 23, [ 100, 200, 300 ] ],
[ 38, [ 100, 200, 500 ] ],
[ 75, [ 100, 500, 750 ] ],
[ 112, [ 100, 500, 1000 ] ]
]
};
appealAmountsData.AUD = appealAmountsData.USD;
appealAmountsData.CAD = appealAmountsData.USD;
appealAmountsData.GBP = appealAmountsData.USD;
appealAmountsData.NZD = appealAmountsData.USD;
appealAmountsData.EUR = appealAmountsData.USD;
// Radio button amounts
var radioAmounts = pickAmountArray( radioAmountsData, currency, hpc, hpcSet );
if ( radioAmounts.length ) {
donationForm.setAmountOptions( radioAmounts );
}
// Appeal amounts
var appealAmounts = pickAmountArray( appealAmountsData, currency, hpc, hpcSet );
if ( appealAmounts.length ) {
var appealAmountString = appealAmounts.map( donationForm.formatCurrency ).join( ', ');
$('.consider-amounts').html(appealAmountString);
}
}
function pickAmountArray( data, currency, hpc, hpcSet ) {
/**
* Choose the amounts for radio buttons / appeal based on hpc
* @param {Object} data
* @param {String} currency
* @param {Number} hpc
* @param {String} hpcSet
* @return {Array} Array of amounts (as numbers)
*/
var set, amounts;
if ( !(currency in data) ) {
return [];
}
if ( $.isArray(data[currency]) ) {
// No variant sets
set = data[currency];
} else {
// We need to go deeper. Check the variants.
if ( hpcSet in data[currency] ) {
set = data[currency][hpcSet];
} else {
set = data[currency]['default'];
}
}
// Find correct amount array for this hpc
for (var i = 0; i < set.length; i++) {
if ( set[i][0] > hpc ) {
break;
}
amounts = set[i][1];
}
return amounts;
}
function preSelect() {
/* Check for a 'preSelect' url parameter, and select that option.
If there isn't an option, add it to the "Other" box and select that */
var preSelectAmount = parseFloat( mw.util.getParamValue('preSelect') || mw.util.getParamValue('preselect') );
if ( preSelectAmount > 0 ) {
let hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== donationForm.currency ) {
console.log('Highest previous contribution currency does not match form currency, not doing preselection');
return;
}
var $preSelectOption = $('input[name="amount"][value="' + preSelectAmount + '"]');
if ( $preSelectOption.length ) {
// Select existing input
$preSelectOption.prop('checked', true);
} else {
$('#input_amount_other_box').val( preSelectAmount );
$('#input_amount_other').prop('checked', true);
}
donationForm.updateFeeDisplay();
}
}
function preSelectBox() {
/* Check for a 'preSelectBox' url parameter, and select that numbered option.
If the value provided is invalid or doesn't exist, exit. Valid choices are 1 to 7 (8 is "Other").
If 'preSelect' exists, ignore this function. */
if(!mw.util.getParamValue('preSelect')){
// Check hpcCurrency first before running preselection.
let hpcCurrency = mw.util.getParamValue('hpcCurrency');
if ( hpcCurrency && hpcCurrency !== donationForm.currency ) {
console.log('Highest previous contribution currency does not match form currency, not preselecting box.');
return;
}
// If hpc & hpcCurrency provided are okay OR hpc wasn't provided then continue.
var preSelectBoxNumber = parseInt( mw.util.getParamValue('preSelectBox') );
if (preSelectBoxNumber >= 1 && preSelectBoxNumber <= 7) {
var $preSelectOption = $('input[id="input_amount_' + (preSelectBoxNumber - 1) + '"]');
if ( $preSelectOption.length ) {
$preSelectOption.prop('checked', true);
donationForm.updateFeeDisplay();
}
}
}
}
function addCardTypesClass(country) {
/**
* Add card types class to credit card button, so we can show correct logos
* Banner equivalent: https://meta.wikimedia.org/wiki/MediaWiki:FundraisingBanners/LocalizeJS-2017.js
* @param {String} country ISO code
*/
var cardTypes = {
// Big 6
'US' : 'vmad',
'CA' : 'vma',
'GB' : 'vmaj',
'IE' : 'vmaj',
'AU' : 'vmaj',
'NZ' : 'vma',
// Euro countries
'AT' : 'vmaj',
'BE' : 'vmaj',
'ES' : 'vmaj',
'FR' : 'vma',
'IT' : 'vmaj',
'LU' : 'vmaj',
'LV' : 'vma',
'NL' : 'vmaj',
'PT' : 'vmaj',
'SK' : 'vmaj',
'GR' : 'vma',
// Others
'CZ' : 'vmad',
'DK' : 'vma',
'HU' : 'vma',
'IL' : 'vmad',
// 'JP' : 'vmaj', - use text only as there were complaints about Diners Club not being included
'MY' : 'vmaj',
'NO' : 'vma',
'PL' : 'vma',
'RO' : 'vma',
'SE' : 'vma',
'UA' : 'vma',
'ZA' : 'vm',
'ZZ' : 'vmad' // For testing
};
if ( cardTypes[country] ) {
$('.paymentmethod-cc').addClass('cctypes-' + cardTypes[country] );
$('.cc-text-label').addClass('sr-only');
}
}
/* Form functions */
function clearOther(box) {
document.getElementById('input_amount_other').checked = true;
box.value = "";
}
function selectOther() {
document.getElementById('input_amount_other').checked = true;
}
function selectAmount() {
$('#input_amount_other_box').val('');
}
/* -- Moved from Template:2012FR/Form-section/Processing/Default -- */
/**
* Validate form, and prep most of the parameters
*
* @param {string} paymentMethod - method e.g. 'cc', 'paypal'
* @param {string} paymentSubMethod - submethod e.g. 'rtbt_ideal' (a submethod of 'rtbt')
* @param {string} skipAmountValidation - skip validating amount for PayPal forced to USD
*/
donationForm.redirectPayment = function( paymentMethod, paymentSubMethod, skipAmountValidation ) {
if ( donationForm.validate( skipAmountValidation ) ) {
var params = {};
params.currency = donationForm.currency;
params.country = donationForm.country;
// Overrides for specific gateways
if ( paymentMethod === 'cc-adyen' ) {
params.payment_method = 'cc';
params.gateway = 'adyen';
} else if ( paymentMethod === 'cc-dlocal' ) {
params.payment_method = 'cc';
params.gateway = 'dlocal';
} else if ( paymentMethod === 'trustly' ) {
params.payment_method = 'dd';
params.payment_submethod = 'ach';
params.gateway = 'gravy';
} else if ( paymentSubMethod === 'sepadirectdebit' ) {
params.payment_method = 'rtbt';
params.payment_submethod = 'sepadirectdebit';
params.gateway = 'gravy';
} else if ( paymentMethod === 'bt' && params.country === 'CZ' ) {
params.payment_method = 'bt';
params.gateway = 'gravy';
} else if ( paymentSubMethod === 'vipps' ) {
params.payment_method = 'ew';
params.payment_submethod = 'vipps';
params.gateway = 'gravy';
} else {
params.payment_method = paymentMethod;
}
// dlocal
let dlocalCountries = [ 'AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY', 'ZA' ],
dlocalMethods = [ 'cc', 'bt', 'cash', 'cash_boleto', 'pix' ];
if ( dlocalCountries.includes( params.country ) && dlocalMethods.includes( params.payment_method ) ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'cc' && params.gateway === undefined ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'paypal' ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'rtbt' && paymentSubMethod === 'rtbt_ideal' ) {
params.gateway = 'gravy';
}
if ( params.payment_method === 'apple' || params.payment_method === 'google' ) {
params.gateway = 'gravy';
}
if ( paymentSubMethod ) {
params.payment_submethod = paymentSubMethod;
}
let frequency = donationForm.getFrequency();
if ( frequency === 'monthly' ) {
params.recurring = '1';
params.frequency_unit = 'month';
} else if ( frequency === 'annual' ) {
params.recurring = '1';
params.frequency_unit = 'year';
}
params.uselang = mw.config.get('wgPageContentLanguage'); // see T281285 for why not wgUserLanguage
if ( params.uselang === 'pt' && params.country === 'BR' ) {
params.uselang = 'pt-br';
}
if ( params.uselang === 'es' &&
( params.country === 'AR' || params.country === 'CL' ||
params.country === 'CO' || params.country === 'MX' ||
params.country === 'PE' || params.country === 'UY' ||
params.country === 'US' )
) {
params.uselang = 'es-419';
}
var amount = donationForm.getAmount();
if ( $('#ptf-checkbox').prop('checked') ) {
amount = amount + donationForm.calculateFee( amount );
donationForm.extraData.ptf = 1;
}
params.amount = amount;
// Email optin
if ( $('input[name="opt_in"]').length > 0 ) {
var opt_inValue = $('input[name="opt_in"]:checked').val();
params.opt_in = opt_inValue; // donationForm.validate() already checked it's 1 or 0
}
if ( mw.util.getParamValue( 'pym_variant' ) ) {
params.variant = mw.util.getParamValue( 'pym_variant' );
}
if ( params.recurring && params.variant && params.variant.match( /monthlyConvert/ ) ) {
// Post-payments monthly convert makes no sense if it's already recurring
// Avoid things like T312905
delete params.variant;
}
if ( mw.util.getParamValue( 'pym_appeal' ) ) {
params.appeal = mw.util.getParamValue( 'pym_appeal' );
}
// Pass through specified parameters to payments unchanged
const passThroughParams = [
'contact_id', 'contact_hash', // https://phabricator.wikimedia.org/T381405
'checksum', 'contribution_recur_id', // https://phabricator.wikimedia.org/T396271
'recipient_id', // SMS
'app_install_id' // https://phabricator.wikimedia.org/T411535
];
passThroughParams.forEach( ( param ) => {
const value = mw.util.getParamValue( param );
if ( value ) {
params[ param ] = value;
}
} );
// Monthly convert
if ( mc ) { // check just in-case this wasn't loaded for some reason
mc.main( params, donationForm.finalStep );
} else {
donationForm.finalStep( params );
}
} else {
donationForm.extraData.validateError = 1; // Flag they had an error, even if fixed later
}
return false; // don't submit if called by a button
};
/**
* Build final tracking parameters, and submit to payments
* @param {Object} params
*/
donationForm.finalStep = function( params ) {
var url = new URL('https://payments.wikimedia.org/index.php/Special:GatewayChooser');
// Skip form chooser for Venmo
if ( params.payment_method === 'venmo' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
// Skip form chooser for Pix
if ( params.payment_method === 'cash' && params.payment_submethod === 'pix' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
// And Yape
if ( params.payment_method === 'ew' && params.payment_submethod === 'yape' ) {
url = new URL('https://payments.wikimedia.org/index.php/Special:GravyGateway');
}
donationForm.extraData.time = Math.round( (Date.now() - donationForm.loadedTime)/1000 );
// Tracking data
params.wmf_medium = mw.util.getParamValue( 'wmf_medium' ) || mw.util.getParamValue( 'utm_medium' );
params.wmf_campaign = mw.util.getParamValue( 'wmf_campaign' ) || mw.util.getParamValue( 'utm_campaign' );
params.wmf_source = donationForm.buildTrackingSource( params );
params.wmf_key = donationForm.buildTrackingKey( donationForm.extraData );
if ( document.referrer ) { // TODO: do we need this?
// Strip protocol to stop firewall complaining
params.referrer = document.referrer.replace(/https?:\/\//i, '');
}
for ( var key of Object.keys( params ) ) {
url.searchParams.set( key, params[key] );
}
if ( window.top !== window.self ) {
// In a frame, open payments in a new tab
window.open( url.toString() );
} else {
window.location.href = url.toString();
}
};
/**
* Build a wmf_source value, including the landing page info.
*
* Own function so it can be overriden for weird tests
*
* @param {Object} params
* @return {string} wmf_source
*/
donationForm.buildTrackingSource = function( params ) {
var wmf_source = mw.util.getParamValue( 'wmf_source' ) || mw.util.getParamValue( 'utm_source' );
wmf_source += '.';
var fullDottedPaymentMethod = params.payment_method;
if ( params.recurring ) {
fullDottedPaymentMethod = 'r' + fullDottedPaymentMethod;
}
if ( params.payment_submethod ) {
fullDottedPaymentMethod = fullDottedPaymentMethod + '.' + params.payment_submethod;
}
/* Get URL parameter, but remove parts using old format. Allow fallback to a default value */
var getParam = function( param, removeText, dflt ) {
if ( mw.util.getParamValue( param ) ) {
return mw.util.getParamValue( param ).replace( removeText, '' );
} else {
return dflt;
}
};
/* The landing page info, separated by ~. This mostly exists for legacy reasons */
wmf_source += getParam( 'template' , 'Lp-layout' , 'default' ) + '~';
wmf_source += getParam( 'appeal-template' , 'Appeal-template-' , 'default' ) + '~';
wmf_source += getParam( 'appeal' , 'Appeal-' , 'default' ) + '~';
wmf_source += getParam( 'form-template' , 'Form-template-' , 'default' ) + '~';
wmf_source += getParam( 'form-countryspecific', 'Form-countryspecific-', 'control' );
wmf_source += '.' + fullDottedPaymentMethod;
return wmf_source;
};
/**
* Build a string for wmf_key from extra tracking data
*
* @param {Object} data
* @return {string} wmf_key
*/
donationForm.buildTrackingKey = function(data) {
var existingKey = mw.util.getParamValue( 'wmf_key' ) || mw.util.getParamValue( 'utm_key' ),
dataArray = [];
if ( existingKey ) {
dataArray.push( existingKey );
}
for (var key in data) {
if (data.hasOwnProperty(key)) {
dataArray.push( key + '_' + data[key] );
}
}
return dataArray.join('~');
};
/* Return amount selected or input */
donationForm.getAmount = function() {
var form = document.forms.donateForm,
amount = null;
donationForm.extraData.otherAmt = 0;
// If there are some amount radio buttons, then look for the checked one
if ( form.amount ) {
for ( var i = 0; i < form.amount.length; i++ ) {
if ( form.amount[i].checked ) {
amount = parseFloat( form.amount[i].value );
}
}
}
// Check the "other" amount box
if ( document.getElementById('input_amount_other').checked ) {
amount = donationForm.parseOtherAmount( form.input_amount_other_box.value );
donationForm.extraData.otherAmt = 1;
}
return amount;
};
/**
* Parse Other field value into amount
*
* Does some awful regex stuff to rm symbols and turn the string into a number
* Remember some locales flip . & , for decimal point/thousands separator
*
* @param {string} value Value of "Other" field
* @return {float} Float with amount, or 0 if NaN
*/
donationForm.parseOtherAmount = function( value ) {
var amount;
value = value.replace(/[,.](\d)$/, '\:$10');
value = value.replace(/[,.](\d)(\d)$/, '\:$1$2');
value = value.replace(/[\$£€¥,.]/g, '');
value = value.replace(/:/, '.');
amount = parseFloat( value );
if ( isNaN( amount ) ) {
return 0;
} else {
return amount;
}
};
/**
* Validate the form.
*/
donationForm.validate = function( skipAmountValidation ) {
var error = false;
var form = document.forms.donateForm;
// Reset all errors
$('.lp-haserror').removeClass('lp-haserror');
$('.lp-error').hide();
if ( !skipAmountValidation && !donationForm.validateAmount() ) {
error = true;
}
if ( form.opt_in ) {
if ( $('input[name="opt_in"]:checked').val() === undefined ) {
$('#error-optin').show().focus();
error = true;
} else {
$('#error-optin').hide();
}
}
return !error;
};
/**
* Check if selected amount is valid i.e. a positive number, between minimum and maximum.
* If not, show an error and return false.
*/
donationForm.validateAmount = function() {
var amount = donationForm.getAmount();
if ( amount === null || isNaN(amount) || amount <= 0 || amount < donationForm.minLocal ) {
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').hide();
$('.lp-error-smallamount').show().focus();
return false;
} else if ( amount > donationForm.maxLocal ) {
$('.amount-options').addClass('lp-haserror');
$('.lp-error-bigamount').show().focus();
return false;
} else {
$('.amount-options').removeClass('lp-haserror');
$('.lp-error-smallamount, .lp-error-bigamount').hide();
return true;
}
};
donationForm.getFrequency = function() {
return document.forms.donateForm.dataset.frequency || 'onetime';
};
donationForm.setFrequency = function( frequency ) {
// TODO: add some validation to reject invalid frequency values
let form = document.forms.donateForm;
form.frequency.value = frequency; // change input
form.dataset.frequency = frequency;
};
/* Wrapper for compatibility with old forms */
donationForm.toggleMonthly = function( monthly ) {
if ( monthly ) {
donationForm.setFrequency( 'monthly' );
} else {
donationForm.setFrequency( 'onetime' );
}
};
donationForm.updateFeeDisplay = function() {
var selectedAmount = donationForm.getAmount(),
feeAmount = donationForm.calculateFee( selectedAmount ),
feeText;
feeText = donationForm.formatCurrency( feeAmount );
$('.ptf label span').text( feeText );
if ( selectedAmount + feeAmount <= donationForm.maxLocal ) {
$('.ptf').slideDown();
}
};
/**
* Calculate approximate transaction fee on given amount
* @param {number} amount
* @return {number} Rounded to 2 decimal places
*/
donationForm.calculateFee = function( amount ) {
// Minimum fee/PTF amounts. Default is 0.35.
// Updated 2019-05-21 to approx 0.35 USD equivalent
var feeMinimums = {
'DKK' : 2,
'HUF' : 100,
'ILS' : 1.2,
'INR' : 4,
'JPY' : 35,
'KHR' : 1000,
'MYR' : 1,
'NOK' : 3,
'PLN' : 1.35,
'CZK' : 7.5,
'RON' : 1.5,
'SEK' : 3,
'UAH' : 10,
'ZAR' : 5,
// Latin America // Updated 2025-06-10 to approx 0.35 USD equivalent
'BRL' : 2,
'ARS' : 415,
'CLP' : 325,
'COP' : 1450,
'MXN' : 6.75,
'PEN' : 1.28,
'UYU' : 14.5
};
var feeMultiplier = 0.04,
feeMinimum = feeMinimums[ donationForm.currency ] || 0.35,
feeAmount = amount * feeMultiplier;
if ( feeAmount < feeMinimum ) {
feeAmount = feeMinimum;
}
return parseFloat( feeAmount.toFixed(2) );
};
donationForm.initOptin = function() {
$('.optin-options').on('change', function(e) {
$('#error-optin').hide();
// Only do all this if we have translated prompts
if ( $('.optin-no-prompt').data('is-translated') === 'yes' ) {
if ( e.target.id === 'optin-no' ) {
$('.optin-no-prompt').removeClass('is-positive');
if ( !$('.optin-no-prompt').is(':visible') ) {
$('.optin-no-prompt').slideDown();
}
} else {
$('.optin-no-prompt').addClass('is-positive');
}
}
});
};
/**
* Block typing letters and symbols in given input. Used for Other amount inputs
*
* If we don't do this, Safari allows typing them and then chokes on submit
* https://phabricator.wikimedia.org/T118741, https://phabricator.wikimedia.org/T173431
*
* @param {Element} inputElement The element to block typing on
*/
donationForm.otherInputControl = function( inputElement ) {
if ( inputElement ) {
inputElement.onkeypress = function(e) {
// Allow special keys in Firefox
if ((e.code == 'ArrowLeft') || (e.code == 'ArrowRight') ||
(e.code == 'ArrowUp') || (e.code == 'ArrowDown') ||
(e.code == 'Delete') || (e.code == 'Backspace')) {
return;
}
var chr = String.fromCharCode(e.which);
if ( !'0123456789., '.includes(chr) ) {
return false;
}
};
}
};
/**
* Should we show Apple Pay?
*
* Note there is a ~500ms delay in Safari when checking, so only call this if needed
*
* @param {string} country
* @return {boolean}
*/
donationForm.shouldShowApplePay = function ( country ) {
if ( location.search.match('forceApplePay') ) {
return true;
}
if ( window.screen.width >= 640 && country !== 'JP' ) { // T397002
// On a desktop browser, people can scan with their iphone
return true;
} else if ( window.ApplePaySession ) {
// On mobile, check if Apple Pay is available natively
if ( ApplePaySession.canMakePayments() ) {
return true;
}
}
return false;
};
/**
* Determine if the annual option should be shown on the donation form, and show it if so
*
* @returns {boolean} true if the annual option is enabled
*/
donationForm.initAnnualRecurring = function() {
/*
Before adding a language here, please check that we have annual translations in-place for:
- the button here on donatewiki ([[MediaWiki:Frequency-Annual]])
- the thank you receipt email
- donor relations macros
- the thank you page (optional if it has no recurring-specific messaging)
*/
const annualLanguages = [
'%%isolang%%', '%25%25ISOLANG%25%25', '%25%25isolang%25%25', // for certain issues in email links
'en', 'en-ca', 'en-gb', 'en-us',
'ca', 'cs', 'da', 'de', 'el', 'es-419', 'es', 'fr', 'hu', 'it',
'ja', 'nb', 'nl', 'pl', 'pt-br', 'pt', 'sv',
];
const annualInput = document.getElementById( 'frequency_annual' );
if ( !annualInput ) { // old form without required input
return false;
}
let annualEnabled = annualLanguages.includes( mw.config.get( 'wgPageContentLanguage' ) );
// Allow overriding with URL params
if (
mw.util.getParamValue( 'form-countryspecific' ) === 'Form-countryspecific-annual' // compatibility with old method
|| mw.util.getParamValue( 'annual_enabled' ) === '1'
) {
annualEnabled = true;
}
if ( mw.util.getParamValue( 'annual_enabled' ) === '0' ) {
annualEnabled = false;
}
annualInput.parentNode.style.display = annualEnabled ? 'block' : 'none';
if ( annualEnabled ) {
document.forms.donateForm.classList.add( 'annual-enabled' );
}
return annualEnabled;
};
/**
* Change the amount options on the donation form
* @param {array} newAmounts
*/
donationForm.setAmountOptions = function( newAmounts ) {
for (var j = 0; j < newAmounts.length; j++) {
var $radio = $( `#input_amount_${j}` );
var $label = $( `label[for="input_amount_${j}"]` );
$radio.val( newAmounts[j] );
$label.text( donationForm.formatCurrency( newAmounts[j] ) );
}
};
/**
* Get the current amount options e.g. to store original amounts before changing them
* @returns {array} Array of amounts as numbers
*/
donationForm.getAmountOptions = function() {
let amounts = [];
document.querySelectorAll('input[name="amount"]').forEach( (input) => {
let amount = parseFloat( input.value );
if ( !isNaN( amount ) ) {
amounts.push( amount );
}
} );
return amounts;
};
/*
Based on github:braintree/braintree-web/src/venmo/shared/supports-venmo.js
See also on meta: MediaWiki:FundraisingBanners/VenmoBrowserCheck.js
*/
donationForm.isVenmoSupported = function(options) {
var options = options || {
allowNewBrowserTab: false,
allowWebviews: true,
allowDesktop: true,
allowDesktopWebLogin: true
};
var ua = window.navigator.userAgent;
var merchantAllowsReturningToNewBrowserTab,
merchantAllowsWebviews,
merchantAllowsDesktopBrowsers;
var isMobileDevice = isAndroid() || isIos();
var isAndroidChrome = isAndroid() && isChrome();
var isMobileDeviceThatSupportsReturnToSameTab = isIosSafari() || isAndroidChrome;
var isKnownUnsupportedMobileBrowser = isIosChrome() || isFacebookOwnedBrowserOnAndroid() || isSamsung();
options = options || {};
// NEXT_MAJOR_VERSION allowDesktop will default to true, but can be opted out
merchantAllowsDesktopBrowsers =
(options.allowDesktopWebLogin || options.allowDesktop) === true;
merchantAllowsReturningToNewBrowserTab = options.hasOwnProperty(
"allowNewBrowserTab"
)
? options.allowNewBrowserTab
: true;
// NEXT_MAJOR_VERSION webviews are not supported, except for the case where
// the merchant themselves is presenting venmo in a webview using the deep
// link url to get back to their app. For the next major version, we should
// just not have this option and instead require the merchant to determine
// if the venmo button should be displayed when presenting it in the
// merchant's app via a webview.
merchantAllowsWebviews = options.hasOwnProperty("allowWebviews")
? options.allowWebviews
: true;
if (isKnownUnsupportedMobileBrowser) {
return false;
}
if (
!merchantAllowsWebviews &&
(isAndroidWebview() || isIosWebview())
) {
return false;
}
if (!isMobileDevice) {
return merchantAllowsDesktopBrowsers;
}
if (!merchantAllowsReturningToNewBrowserTab) {
return isMobileDeviceThatSupportsReturnToSameTab;
}
return isMobileDevice;
/* -- functions mostly from github:braintree/browser-detection library -- */
function isAndroid() {
return /Android/i.test(ua);
}
function isIos(checkIpadOS = true) {
const iOsTest = /iPhone|iPod|iPad/i.test(ua);
return checkIpadOS ? iOsTest || isIpadOS() : iOsTest;
}
function isIpadOS() {
// "ontouchend" is used to determine if a browser is on an iPad, otherwise
// user-agents for iPadOS behave/identify as a desktop browser
return /Mac|iPad/i.test(ua) && "ontouchend" in window.document;
}
function isEdge() {
return ua.indexOf("Edge/") !== -1 || ua.indexOf("Edg/") !== -1;
}
function isSamsung() {
return /SamsungBrowser/i.test(ua);
}
function isDuckDuckGo() {
return ua.indexOf("DuckDuckGo/") !== -1;
}
function isOpera() {
return (
ua.indexOf("OPR/") !== -1 ||
ua.indexOf("Opera/") !== -1 ||
ua.indexOf("OPT/") !== -1
);
}
function isSilk() {
return ua.indexOf("Silk/") !== -1;
}
function isChrome() {
return (
(ua.indexOf("Chrome") !== -1 || ua.indexOf("CriOS") !== -1) &&
!isEdge() &&
!isSamsung() &&
!isDuckDuckGo() &&
!isOpera() &&
!isSilk()
);
}
function isIosFirefox() {
return /FxiOS/i.test(ua);
}
function isWebkit() {
const webkitRegexp = /webkit/i;
return webkitRegexp.test(ua);
}
function isIosChrome() {
return ua.indexOf("CriOS") > -1;
}
function isFacebook() {
return ua.indexOf("FBAN") > -1;
}
function isIosSafari() {
return (
isIos() &&
isWebkit() &&
!isIosChrome() &&
!isIosFirefox() &&
!isFacebook()
);
}
function isFacebookOwnedBrowserOnAndroid() {
var e = ua.toLowerCase();
return -1 < e.indexOf("huawei") && -1 < e.indexOf("fban") || isAndroid() && (-1 < e.indexOf("fb_iab") || -1 < e.indexOf("instagram"));
}
function isSamsungBrowser() {
return /SamsungBrowser/i.test(ua);
}
function isAndroidWebview() {
return isAndroid() && -1 < ua.toLowerCase().indexOf("wv");
}
function isGoogleSearchApp() {
return /\bGSA\b/.test(ua);
}
function isIosGoogleSearchApp() {
return isIos() && isGoogleSearchApp();
}
function isIosWebview() {
if (isIos()) {
// The Google Search iOS app is technically a webview and doesn't support popups.
if (isIosGoogleSearchApp()) {
return true;
}
// Historically, a webview could be identified by the presence of AppleWebKit and _no_ presence of Safari after.
return /.+AppleWebKit(?!.*Safari)/i.test(ua);
}
return false;
}
};
/* End form functions */
$(document).ready(function() {
mw.loader.using( ['mediawiki.util'] ).done( function() {
var form = document.forms.donateForm;
// Minimum amount is usually about 1 USD
donationForm.minLocal = donationForm.currencyRates[ donationForm.currency ];
donationForm.minLocal = Math.ceil( donationForm.minLocal * 100 ) / 100; // Round it up
donationForm.maxUSD = 25000;
donationForm.maxLocal = Math.floor( donationForm.currencyRates[ donationForm.currency ] * donationForm.maxUSD );
// Overrides for India
if ( donationForm.currency === 'INR' ) {
donationForm.minLocal = 10;
// Until https://phabricator.wikimedia.org/T370583 fixed?
donationForm.maxUSD = 3000;
donationForm.maxLocal = 250000;
}
// Block typing symbols in Other field
donationForm.otherInputControl( document.getElementById('input_amount_other_box') );
// Clear errors and update fee when selected/entered
$('.amount-options').on( 'input change', function() {
// Ideally we would validate the amount, but this causes issues with focus
$('.amount-options .lp-error').hide();
donationForm.updateFeeDisplay();
});
// Disable submitting form with Enter key
$('form[name="donateForm"]').on('keypress', function(e) {
var code = ( e.keyCode ? e.keyCode : e.which );
if ( code == 13 ) {
e.preventDefault();
}
});
// But allow Enter on buttons
$('.payment-method-button').keyup(function(e) {
if (event.keyCode === 13) {
e.target.click();
}
});
if ( form ) {
donationForm.initAnnualRecurring();
// hide frequency options for some countries
if ( donationForm.noRecurringCountries.includes( donationForm.country ) ) {
$('#frequency_onetime').prop('checked', true);
$('.frequency-options, #cancel-monthly, #donate-recurring-smallprint').hide();
}
if ( donationForm.noRecurringPaypalCountries.includes( donationForm.country ) ) {
$( '.paymentmethod-pp, .paymentmethod-pp-usd' ).addClass( 'not-monthly-capable' );
}
// Format amounts on buttons
$( '.amount-options li' ).each( function( index ) {
let amount = this.querySelector( 'input' ).value;
if ( amount !== 'Other' ) {
this.querySelector( 'label' ).innerText = donationForm.formatCurrency( amount );
}
});
addCardTypesClass( donationForm.country );
// Only show Amazon for links from Ways to give
if (
mw.util.getParamValue( 'wmf_source' ) === 'Waystogive' ||
mw.util.getParamValue( 'wmf_source' ) === 'Ways_to_Give'
) {
$('.paymentmethod-amazon').show();
}
// Only show DAF for certain Major Gifts links
if ( mw.util.getParamValue( 'wmf_campaign' ) === 'MG2WIR25' ) {
$('.paymentmethod-daf').show();
} else {
$('.paymentmethod-daf').hide();
}
// Apple Pay
if ( $('.paymentmethod-applepay').length > 0 ) {
if ( !donationForm.shouldShowApplePay( donationForm.country ) ) {
$('.paymentmethod-applepay').remove();
}
}
// Venmo browser check
if ( $('.paymentmethod-venmo').length > 0 ) {
if ( !donationForm.isVenmoSupported() || donationForm.country !== 'US' ) {
$('.paymentmethod-venmo').remove();
}
}
// Hide Google Pay if people are coming from iOS app https://phabricator.wikimedia.org/T411504
if ( mw.util.getParamValue('wmf_campaign') === 'iOS' ) {
$('.paymentmethod-google').remove();
}
}
// Links open in new tab
$('.links-in-new-tab a').attr('target', '_blank');
// Disable logo link
$('#p-logo a').attr( { href: '#', title: '' } );
// These don't need to be tabbable on the landing page
$('#searchInput, .mw-jump-link').attr('tabindex', '-1');
$('.input_amount_other').click(function() {
$('#input_amount_other_box').focus();
});
// Allow preselecting frequency if possible
if (
!donationForm.noRecurringCountries.includes( donationForm.country )
&& mw.util.getParamValue( 'utm_medium' ) !== 'endowment'
&& mw.util.getParamValue( 'wmf_medium' ) !== 'endowment'
) {
if ( mw.util.getParamValue( 'frequency' ) ) {
donationForm.setFrequency( mw.util.getParamValue( 'frequency' ) );
} else if ( mw.util.getParamValue('monthly') && mw.util.getParamValue('monthly') !== '0' ) {
// old method with "monthly=" parameter
donationForm.setFrequency( 'monthly' );
} else {
donationForm.setFrequency( 'onetime' );
}
}
// If we are emailing them and they have a contact_id, then we can assume they have opted in,
// unless this is a "Remind Me Later" email, or they are in a stricter country
let hasContactId = mw.util.getParamValue( 'contact_id' ) !== null;
let isRML = mw.util.getParamValue( 'wmf_campaign' ) && mw.util.getParamValue( 'wmf_campaign' ).includes( 'RMLEmail' );
let isStrictCountry = [ 'AT', 'IT' ].includes( donationForm.country );
if ( document.getElementById('optin-yes') && hasContactId && !isRML && !isStrictCountry ) {
document.getElementById('optin-yes').checked = true;
document.querySelector('.optin-options').style.display = 'none';
}
donationForm.initOptin();
try {
adjustHPC();
adjustMinAmounts();
// Store original amounts to switch back later if needed
donationForm.originalAmounts = donationForm.getAmountOptions();
preSelect(); // Make sure to do this *after* other fiddling with values
preSelectBox();
donationForm.localizeErrors();
}
finally {
$('.frb-monthly-pitch, .frb-monthly-pitch-thanks, .frb-recurring-pitch').appendTo('.frequency-options');
$('.ptf').appendTo('.amount-options');
$('.optin-options').insertAfter('.amount-options');
$('.consider-amounts').show();
$('#actual-form').show();
$('#actual-form-loading').hide();
}
});
});
jfguce87rqtwaq44s4ec6pzjhk6ru1d
Template:MonthlyPitchText
10
9504
43003
41122
2026-08-20T10:52:36Z
PPenloglou-WMF
52
Table update
43003
wikitext
text/x-wiki
{| class="wikitable"
|- style="position: sticky; top: 0;"
! lang
! Pitch
! OurAsk
! Thanks
|-
| en || {{MonthlyPitchText/Pitch}} || {{MonthlyPitchText/OurAsk}} || {{MonthlyPitchText/Thanks}}
|-
| cs || {{MonthlyPitchText/Pitch/cs}} || || {{MonthlyPitchText/Thanks/cs}}
|-
| fr || {{MonthlyPitchText/Pitch/fr}} || || {{MonthlyPitchText/Thanks/fr}}
|-
| it || {{MonthlyPitchText/Pitch/it}} || || {{MonthlyPitchText/Thanks/it}}
|-
| ja || {{MonthlyPitchText/Pitch/ja}} || || {{MonthlyPitchText/Thanks/ja}}
|-
| nl || {{MonthlyPitchText/Pitch/nl}} || || {{MonthlyPitchText/Thanks/nl}}
|-
| sv || {{MonthlyPitchText/Pitch/sv}} || || {{MonthlyPitchText/Thanks/sv}}
|}
{{subpages}}
qgnw9twx2fzgu0edq8wly2ce0jwfy70
43006
43003
2026-08-20T11:02:35Z
PPenloglou-WMF
52
Table update (include el)
43006
wikitext
text/x-wiki
{| class="wikitable"
|- style="position: sticky; top: 0;"
! lang
! Pitch
! OurAsk
! Thanks
|-
| en || {{MonthlyPitchText/Pitch}} || {{MonthlyPitchText/OurAsk}} || {{MonthlyPitchText/Thanks}}
|-
| cs || {{MonthlyPitchText/Pitch/cs}} || || {{MonthlyPitchText/Thanks/cs}}
|-
| el || {{MonthlyPitchText/Pitch/el}} || || {{MonthlyPitchText/Thanks/el}}
|-
| fr || {{MonthlyPitchText/Pitch/fr}} || || {{MonthlyPitchText/Thanks/fr}}
|-
| it || {{MonthlyPitchText/Pitch/it}} || || {{MonthlyPitchText/Thanks/it}}
|-
| ja || {{MonthlyPitchText/Pitch/ja}} || || {{MonthlyPitchText/Thanks/ja}}
|-
| nl || {{MonthlyPitchText/Pitch/nl}} || || {{MonthlyPitchText/Thanks/nl}}
|-
| sv || {{MonthlyPitchText/Pitch/sv}} || || {{MonthlyPitchText/Thanks/sv}}
|}
{{subpages}}
nzlwvlth0sw8kh9dvhblx8sbxi4nrc2
Template:MonthlyPitch/OurAsk
10
10458
42999
2026-08-20T10:26:55Z
PPenloglou-WMF
52
Primarily created for FY2627 en6C Email 1 T7 Test: https://docs.google.com/document/d/17VIovid0Wds2zpvxu2tL4p3ngY7dmc4s5a1klXjf6EU/edit?tab=t.jpnn7rmghuar#heading=h.3o3cje9jvbm3. Hardcoding copy pitch "Our ask to all supporters today" as this will be served in English only for the moment.
42999
wikitext
text/x-wiki
{{#ifeq:{{IsTranslated|Template:MonthlyPitchText/Pitch|{{int:lang}}}}|yes|
<html>
<style>
/* latin */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/7/75/Caveat-brush-v6-latin-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/5/51/Caveat-brush-v6-latin-ext-regular.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* greek (Mynerve) */
@font-face {
font-family: 'Mynerve';
font-style: normal;
font-weight: 400;
font-display: block;
src: url(https://upload.wikimedia.org/wikipedia/donate/6/6a/Mynerve-Greek.woff2) format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
.frb-recurring-pitch {
margin-top: 8px;
min-height: 24px;
}
.frb-recurring-pitch-message,
.frb-recurring-pitch-thanks {
display: flex;
width: auto;
padding: 0 16px;
justify-content: center;
gap: 4px;
font-size: 18px;
line-height: 1;
color: #3e54b7;
font-family: 'Caveat Brush', sans-serif;
text-align: center;
}
html[lang="el"] .frb-recurring-pitch-message,
html[lang="el"] .frb-recurring-pitch-thanks {
font-family: 'Mynerve', sans-serif;
font-size: 16px;
}
.frb-recurring-pitch-thanks {
display: none;
}
form.annual-enabled .frb-recurring-pitch-message {
width: 66%;
margin-left: auto;
}
.frb-recurring-pitch-thanks-heart {
width: 25px;
height: 25px;
flex: 0 0 25px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left,
.frb-recurring-pitch-arrow-right {
flex: 0 0 18px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left {
display: none;
transform: scale(-1,1);
}
form.annual-enabled .frb-recurring-pitch-arrow-left {
display: inline;
}
form:not([data-frequency="onetime"]) .frb-recurring-pitch-message { display: none; }
form:not([data-frequency="onetime"]) .frb-recurring-pitch-thanks { display: flex; }
</style>
<div class="frb-recurring-pitch">
<div class="frb-recurring-pitch-message">
<svg class="frb-recurring-pitch-arrow-left" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
<span></html>Our ask to all supporters today<html></span>
<svg class="frb-recurring-pitch-arrow-right" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
</div>
<div class="frb-recurring-pitch-thanks">
<svg class="frb-recurring-pitch-thanks-heart" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 31">
<circle fill="#e8e9eb" cx="15.5" cy="15.5" r="15"></circle>
<path fill="#ff3079" d="M26.71 16.039h-1.756a.618.618 0 0 1 0-1.237h1.756a.618.618 0 0 1 0 1.237zm-3.332 7.92a.618.618 0 0 1-.433-.18l-1.237-1.236a.618.618 0 1 1 .878-.872l1.237 1.237a.618.618 0 0 1-.439 1.057l-.006-.006zM22.333 9.41a.618.618 0 0 1-.445-.191.618.618 0 0 1 0-.872l1.236-1.237a.645.645 0 0 1 .897.928l-1.237 1.236a.618.618 0 0 1-.451.136zM5.96 16.113H4.204a.618.618 0 0 1 0-1.237H5.96a.618.618 0 0 1 0 1.237zm2.82-6.684a.618.618 0 0 1-.44-.18L7.105 8.014a.618.618 0 1 1 .872-.878l1.237 1.237c.24.24.24.63 0 .872a.618.618 0 0 1-.433.185zm-1.46 14.53a.618.618 0 0 1-.426-1.082l1.237-1.237a.619.619 0 0 1 .859.89l-1.237 1.237a.618.618 0 0 1-.432.192z"></path>
<path fill="#336bf2" d="M18.462 10.765c-1.923.222-2.776 2.077-2.961 2.553a.043.043 0 1 1-.087 0c-.185-.476-1.039-2.33-2.962-2.553-1.28-.155-3.66.513-3.66 3.95 0 4.329 6.251 7.797 6.647 8.038a.037.037 0 0 0 .037 0c.396-.216 6.647-3.666 6.647-8.038 0-3.437-2.38-4.105-3.66-3.95Z"></path>
</svg>
<span></html>{{Translated|Template:MonthlyPitchText/Thanks}}<html></span>
</div>
</div>
</html>
|}}
o3kfkvc42e7c69eblbohhhzykoj1dwi
43000
42999
2026-08-20T10:41:26Z
PPenloglou-WMF
52
CSS adjustments
43000
wikitext
text/x-wiki
{{#ifeq:{{IsTranslated|Template:MonthlyPitchText/Pitch|{{int:lang}}}}|yes|
<html>
<style>
/* latin */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/7/75/Caveat-brush-v6-latin-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/5/51/Caveat-brush-v6-latin-ext-regular.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* greek (Mynerve) */
@font-face {
font-family: 'Mynerve';
font-style: normal;
font-weight: 400;
font-display: block;
src: url(https://upload.wikimedia.org/wikipedia/donate/6/6a/Mynerve-Greek.woff2) format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
.frb-recurring-pitch {
margin-top: 8px;
min-height: 24px;
display:flex;
justify-content: center;
}
.frb-recurring-pitch-message,
.frb-recurring-pitch-thanks {
display: flex;
/* width: auto; */
/* padding: 0 16px; */
justify-content: center;
gap: 4px;
font-size: 18px;
line-height: 1;
color: #3e54b7;
font-family: 'Caveat Brush', sans-serif;
text-align: center;
}
html[lang="el"] .frb-recurring-pitch-message,
html[lang="el"] .frb-recurring-pitch-thanks {
font-family: 'Mynerve', sans-serif;
font-size: 16px;
}
.frb-recurring-pitch-thanks {
display: none;
}
form.annual-enabled .frb-recurring-pitch-message {
width: 66%;
margin-left: auto;
}
.frb-recurring-pitch-thanks-heart {
width: 25px;
height: 25px;
flex: 0 0 25px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left,
.frb-recurring-pitch-arrow-right {
flex: 0 0 18px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left {
display: none;
transform: scale(-1,1);
}
form.annual-enabled .frb-recurring-pitch-arrow-left {
display: inline;
}
form:not([data-frequency="onetime"]) .frb-recurring-pitch-message { display: none; }
form:not([data-frequency="onetime"]) .frb-recurring-pitch-thanks { display: flex; }
</style>
<div class="frb-recurring-pitch">
<div class="frb-recurring-pitch-message">
<svg class="frb-recurring-pitch-arrow-left" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
<span></html>Our ask to all supporters today<html></span>
<svg class="frb-recurring-pitch-arrow-right" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
</div>
<div class="frb-recurring-pitch-thanks">
<svg class="frb-recurring-pitch-thanks-heart" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 31">
<circle fill="#e8e9eb" cx="15.5" cy="15.5" r="15"></circle>
<path fill="#ff3079" d="M26.71 16.039h-1.756a.618.618 0 0 1 0-1.237h1.756a.618.618 0 0 1 0 1.237zm-3.332 7.92a.618.618 0 0 1-.433-.18l-1.237-1.236a.618.618 0 1 1 .878-.872l1.237 1.237a.618.618 0 0 1-.439 1.057l-.006-.006zM22.333 9.41a.618.618 0 0 1-.445-.191.618.618 0 0 1 0-.872l1.236-1.237a.645.645 0 0 1 .897.928l-1.237 1.236a.618.618 0 0 1-.451.136zM5.96 16.113H4.204a.618.618 0 0 1 0-1.237H5.96a.618.618 0 0 1 0 1.237zm2.82-6.684a.618.618 0 0 1-.44-.18L7.105 8.014a.618.618 0 1 1 .872-.878l1.237 1.237c.24.24.24.63 0 .872a.618.618 0 0 1-.433.185zm-1.46 14.53a.618.618 0 0 1-.426-1.082l1.237-1.237a.619.619 0 0 1 .859.89l-1.237 1.237a.618.618 0 0 1-.432.192z"></path>
<path fill="#336bf2" d="M18.462 10.765c-1.923.222-2.776 2.077-2.961 2.553a.043.043 0 1 1-.087 0c-.185-.476-1.039-2.33-2.962-2.553-1.28-.155-3.66.513-3.66 3.95 0 4.329 6.251 7.797 6.647 8.038a.037.037 0 0 0 .037 0c.396-.216 6.647-3.666 6.647-8.038 0-3.437-2.38-4.105-3.66-3.95Z"></path>
</svg>
<span></html>{{Translated|Template:MonthlyPitchText/Thanks}}<html></span>
</div>
</div>
</html>
|}}
4cvtkukd0s3plutnlwjyf9nndmv5qsl
43001
43000
2026-08-20T10:43:33Z
PPenloglou-WMF
52
CSS adjustments [1]
43001
wikitext
text/x-wiki
{{#ifeq:{{IsTranslated|Template:MonthlyPitchText/Pitch|{{int:lang}}}}|yes|
<html>
<style>
/* latin */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/7/75/Caveat-brush-v6-latin-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/5/51/Caveat-brush-v6-latin-ext-regular.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* greek (Mynerve) */
@font-face {
font-family: 'Mynerve';
font-style: normal;
font-weight: 400;
font-display: block;
src: url(https://upload.wikimedia.org/wikipedia/donate/6/6a/Mynerve-Greek.woff2) format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
.frb-recurring-pitch {
margin-top: 8px;
min-height: 24px;
}
.frb-recurring-pitch-message,
.frb-recurring-pitch-thanks {
display: flex;
/* width: auto; */
/* padding: 0 16px; */
justify-content: center;
gap: 4px;
font-size: 18px;
line-height: 1;
color: #3e54b7;
font-family: 'Caveat Brush', sans-serif;
text-align: center;
}
html[lang="el"] .frb-recurring-pitch-message,
html[lang="el"] .frb-recurring-pitch-thanks {
font-family: 'Mynerve', sans-serif;
font-size: 16px;
}
.frb-recurring-pitch-thanks {
display: none;
}
form.annual-enabled .frb-recurring-pitch-message {
width: 66%;
margin-left: auto;
}
.frb-recurring-pitch-thanks-heart {
width: 25px;
height: 25px;
flex: 0 0 25px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left,
.frb-recurring-pitch-arrow-right {
flex: 0 0 18px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left {
display: none;
transform: scale(-1,1);
}
form.annual-enabled .frb-recurring-pitch-arrow-left {
display: inline;
}
form:not([data-frequency="onetime"]) .frb-recurring-pitch-message { display: none; }
form:not([data-frequency="onetime"]) .frb-recurring-pitch-thanks { display: flex; }
</style>
<div class="frb-recurring-pitch">
<div class="frb-recurring-pitch-message">
<svg class="frb-recurring-pitch-arrow-left" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
<span></html>Our ask to all supporters today<html></span>
<svg class="frb-recurring-pitch-arrow-right" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
</div>
<div class="frb-recurring-pitch-thanks">
<svg class="frb-recurring-pitch-thanks-heart" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 31">
<circle fill="#e8e9eb" cx="15.5" cy="15.5" r="15"></circle>
<path fill="#ff3079" d="M26.71 16.039h-1.756a.618.618 0 0 1 0-1.237h1.756a.618.618 0 0 1 0 1.237zm-3.332 7.92a.618.618 0 0 1-.433-.18l-1.237-1.236a.618.618 0 1 1 .878-.872l1.237 1.237a.618.618 0 0 1-.439 1.057l-.006-.006zM22.333 9.41a.618.618 0 0 1-.445-.191.618.618 0 0 1 0-.872l1.236-1.237a.645.645 0 0 1 .897.928l-1.237 1.236a.618.618 0 0 1-.451.136zM5.96 16.113H4.204a.618.618 0 0 1 0-1.237H5.96a.618.618 0 0 1 0 1.237zm2.82-6.684a.618.618 0 0 1-.44-.18L7.105 8.014a.618.618 0 1 1 .872-.878l1.237 1.237c.24.24.24.63 0 .872a.618.618 0 0 1-.433.185zm-1.46 14.53a.618.618 0 0 1-.426-1.082l1.237-1.237a.619.619 0 0 1 .859.89l-1.237 1.237a.618.618 0 0 1-.432.192z"></path>
<path fill="#336bf2" d="M18.462 10.765c-1.923.222-2.776 2.077-2.961 2.553a.043.043 0 1 1-.087 0c-.185-.476-1.039-2.33-2.962-2.553-1.28-.155-3.66.513-3.66 3.95 0 4.329 6.251 7.797 6.647 8.038a.037.037 0 0 0 .037 0c.396-.216 6.647-3.666 6.647-8.038 0-3.437-2.38-4.105-3.66-3.95Z"></path>
</svg>
<span></html>{{Translated|Template:MonthlyPitchText/Thanks}}<html></span>
</div>
</div>
</html>
|}}
b01jepecat6lsh47k6qw3rct8430wzt
43004
43001
2026-08-20T10:55:07Z
PPenloglou-WMF
52
Checking for OurAsk & Thanks translations
43004
wikitext
text/x-wiki
{{#ifeq:{{IsTranslated|Template:MonthlyPitchText/OurAsk|{{int:lang}}}}|yes|
{{#ifeq:{{IsTranslated|Template:MonthlyPitchText/Thanks|{{int:lang}}}}|yes|
<html>
<style>
/* latin */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/7/75/Caveat-brush-v6-latin-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/5/51/Caveat-brush-v6-latin-ext-regular.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* greek (Mynerve) */
@font-face {
font-family: 'Mynerve';
font-style: normal;
font-weight: 400;
font-display: block;
src: url(https://upload.wikimedia.org/wikipedia/donate/6/6a/Mynerve-Greek.woff2) format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
.frb-recurring-pitch {
margin-top: 8px;
min-height: 24px;
}
.frb-recurring-pitch-message,
.frb-recurring-pitch-thanks {
display: flex;
/* width: auto; */
/* padding: 0 16px; */
justify-content: center;
gap: 4px;
font-size: 18px;
line-height: 1;
color: #3e54b7;
font-family: 'Caveat Brush', sans-serif;
text-align: center;
}
html[lang="el"] .frb-recurring-pitch-message,
html[lang="el"] .frb-recurring-pitch-thanks {
font-family: 'Mynerve', sans-serif;
font-size: 16px;
}
.frb-recurring-pitch-thanks {
display: none;
}
form.annual-enabled .frb-recurring-pitch-message {
width: 66%;
margin-left: auto;
}
.frb-recurring-pitch-thanks-heart {
width: 25px;
height: 25px;
flex: 0 0 25px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left,
.frb-recurring-pitch-arrow-right {
flex: 0 0 18px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left {
display: none;
transform: scale(-1,1);
}
form.annual-enabled .frb-recurring-pitch-arrow-left {
display: inline;
}
form:not([data-frequency="onetime"]) .frb-recurring-pitch-message { display: none; }
form:not([data-frequency="onetime"]) .frb-recurring-pitch-thanks { display: flex; }
</style>
<div class="frb-recurring-pitch">
<div class="frb-recurring-pitch-message">
<svg class="frb-recurring-pitch-arrow-left" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
<span></html>Our ask to all supporters today<html></span>
<svg class="frb-recurring-pitch-arrow-right" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
</div>
<div class="frb-recurring-pitch-thanks">
<svg class="frb-recurring-pitch-thanks-heart" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 31">
<circle fill="#e8e9eb" cx="15.5" cy="15.5" r="15"></circle>
<path fill="#ff3079" d="M26.71 16.039h-1.756a.618.618 0 0 1 0-1.237h1.756a.618.618 0 0 1 0 1.237zm-3.332 7.92a.618.618 0 0 1-.433-.18l-1.237-1.236a.618.618 0 1 1 .878-.872l1.237 1.237a.618.618 0 0 1-.439 1.057l-.006-.006zM22.333 9.41a.618.618 0 0 1-.445-.191.618.618 0 0 1 0-.872l1.236-1.237a.645.645 0 0 1 .897.928l-1.237 1.236a.618.618 0 0 1-.451.136zM5.96 16.113H4.204a.618.618 0 0 1 0-1.237H5.96a.618.618 0 0 1 0 1.237zm2.82-6.684a.618.618 0 0 1-.44-.18L7.105 8.014a.618.618 0 1 1 .872-.878l1.237 1.237c.24.24.24.63 0 .872a.618.618 0 0 1-.433.185zm-1.46 14.53a.618.618 0 0 1-.426-1.082l1.237-1.237a.619.619 0 0 1 .859.89l-1.237 1.237a.618.618 0 0 1-.432.192z"></path>
<path fill="#336bf2" d="M18.462 10.765c-1.923.222-2.776 2.077-2.961 2.553a.043.043 0 1 1-.087 0c-.185-.476-1.039-2.33-2.962-2.553-1.28-.155-3.66.513-3.66 3.95 0 4.329 6.251 7.797 6.647 8.038a.037.037 0 0 0 .037 0c.396-.216 6.647-3.666 6.647-8.038 0-3.437-2.38-4.105-3.66-3.95Z"></path>
</svg>
<span></html>{{Translated|Template:MonthlyPitchText/Thanks}}<html></span>
</div>
</div>
</html>
|}}
}}
jzpq43n18clotetrinc3ov0ag794ghp
43005
43004
2026-08-20T10:58:18Z
PPenloglou-WMF
52
Changed my mind and running via "Translated" to ensure other locales don't show this if not available.
43005
wikitext
text/x-wiki
{{#ifeq:{{IsTranslated|Template:MonthlyPitchText/OurAsk|{{int:lang}}}}|yes|
{{#ifeq:{{IsTranslated|Template:MonthlyPitchText/Thanks|{{int:lang}}}}|yes|
<html>
<style>
/* latin */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/7/75/Caveat-brush-v6-latin-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: 'Caveat Brush';
font-style: normal;
font-weight: 400;
font-display: block;
src: url('https://upload.wikimedia.org/wikipedia/donate/5/51/Caveat-brush-v6-latin-ext-regular.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* greek (Mynerve) */
@font-face {
font-family: 'Mynerve';
font-style: normal;
font-weight: 400;
font-display: block;
src: url(https://upload.wikimedia.org/wikipedia/donate/6/6a/Mynerve-Greek.woff2) format('woff2');
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
.frb-recurring-pitch {
margin-top: 8px;
min-height: 24px;
}
.frb-recurring-pitch-message,
.frb-recurring-pitch-thanks {
display: flex;
/* width: auto; */
/* padding: 0 16px; */
justify-content: center;
gap: 4px;
font-size: 18px;
line-height: 1;
color: #3e54b7;
font-family: 'Caveat Brush', sans-serif;
text-align: center;
}
html[lang="el"] .frb-recurring-pitch-message,
html[lang="el"] .frb-recurring-pitch-thanks {
font-family: 'Mynerve', sans-serif;
font-size: 16px;
}
.frb-recurring-pitch-thanks {
display: none;
}
form.annual-enabled .frb-recurring-pitch-message {
width: 66%;
margin-left: auto;
}
.frb-recurring-pitch-thanks-heart {
width: 25px;
height: 25px;
flex: 0 0 25px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left,
.frb-recurring-pitch-arrow-right {
flex: 0 0 18px;
margin-top: -4px;
}
.frb-recurring-pitch-arrow-left {
display: none;
transform: scale(-1,1);
}
form.annual-enabled .frb-recurring-pitch-arrow-left {
display: inline;
}
form:not([data-frequency="onetime"]) .frb-recurring-pitch-message { display: none; }
form:not([data-frequency="onetime"]) .frb-recurring-pitch-thanks { display: flex; }
</style>
<div class="frb-recurring-pitch">
<div class="frb-recurring-pitch-message">
<svg class="frb-recurring-pitch-arrow-left" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
<span></html>{{Translated|Template:MonthlyPitchText/OurAsk}}<html></span>
<svg class="frb-recurring-pitch-arrow-right" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 57.3 50.8">
<path fill="currentColor" d="M-.1 46.2c0 2.1 1.7 3.8 3.9 4 3.4.3 6.8.5 10.2.5 2.2 0 4.4-.1 6.5-.2 2.8-.2 5.2-.4 7.4-.7 2.7-.4 4.7-1.2 6.4-2.7 3.3-2.9 4-7.5 4.4-11.5.7-6.5.9-13.2.7-20 3.5 3.8 7.3 7.4 11.1 10.8 1.7 1.4 4.1 1.4 5.6-.1.8-.8 1.2-1.9 1.2-3s-.5-2-1.2-2.7C49.8 15 43.8 8.8 38.2 2.3c-.3-.7-.9-1.4-1.6-1.8-1.8-1-4.2-.4-5.4 1.4-2.4 3.7-5.1 7.1-8.1 10.3-.8.8-1.7 1.6-2.6 2.5-2.4 2.3-4.8 4.5-6.2 7.6-.9 2-.3 4.2 1.5 5.3.9.5 2.2.7 3.3.3 1-.3 1.8-1 2.2-1.9.7-1.6 1.9-2.8 3.2-4.1 1.5-1.4 3.2-3 4.7-4.7l2.1-2.4c.1 2.3.1 4.6.1 6.9-.1 4.4-.3 8.8-.7 13.2v.5c-.2 2-.5 5.2-2.1 6.1-.9.5-2.3.6-3.6.7-.4 0-.7.1-1 .1-2.1.2-4.3.3-6.5.4-4.3.1-8.8 0-13.3-.4-1-.1-2 .3-2.8 1-.7.8-1.3 1.9-1.5 2.9z"></path>
</svg>
</div>
<div class="frb-recurring-pitch-thanks">
<svg class="frb-recurring-pitch-thanks-heart" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 31">
<circle fill="#e8e9eb" cx="15.5" cy="15.5" r="15"></circle>
<path fill="#ff3079" d="M26.71 16.039h-1.756a.618.618 0 0 1 0-1.237h1.756a.618.618 0 0 1 0 1.237zm-3.332 7.92a.618.618 0 0 1-.433-.18l-1.237-1.236a.618.618 0 1 1 .878-.872l1.237 1.237a.618.618 0 0 1-.439 1.057l-.006-.006zM22.333 9.41a.618.618 0 0 1-.445-.191.618.618 0 0 1 0-.872l1.236-1.237a.645.645 0 0 1 .897.928l-1.237 1.236a.618.618 0 0 1-.451.136zM5.96 16.113H4.204a.618.618 0 0 1 0-1.237H5.96a.618.618 0 0 1 0 1.237zm2.82-6.684a.618.618 0 0 1-.44-.18L7.105 8.014a.618.618 0 1 1 .872-.878l1.237 1.237c.24.24.24.63 0 .872a.618.618 0 0 1-.433.185zm-1.46 14.53a.618.618 0 0 1-.426-1.082l1.237-1.237a.619.619 0 0 1 .859.89l-1.237 1.237a.618.618 0 0 1-.432.192z"></path>
<path fill="#336bf2" d="M18.462 10.765c-1.923.222-2.776 2.077-2.961 2.553a.043.043 0 1 1-.087 0c-.185-.476-1.039-2.33-2.962-2.553-1.28-.155-3.66.513-3.66 3.95 0 4.329 6.251 7.797 6.647 8.038a.037.037 0 0 0 .037 0c.396-.216 6.647-3.666 6.647-8.038 0-3.437-2.38-4.105-3.66-3.95Z"></path>
</svg>
<span></html>{{Translated|Template:MonthlyPitchText/Thanks}}<html></span>
</div>
</div>
</html>
|}}
}}
25vd3ww9ussgqd8cv65wd2cydop0d4t
Template:MonthlyPitchText/OurAsk
10
10459
43002
2026-08-20T10:50:33Z
PPenloglou-WMF
52
FY2627 en6C Email 1 T7 Test: https://docs.google.com/document/d/17VIovid0Wds2zpvxu2tL4p3ngY7dmc4s5a1klXjf6EU/edit?tab=t.jpnn7rmghuar#heading=h.3o3cje9jvbm3.
43002
wikitext
text/x-wiki
Our ask to all supporters today
895nn1dyrwtsbtmmhnok5kxfi2vw695