MediaWiki:Common.js: Difference between revisions

Content deleted Content added
tabindex fixes
add CSS class for card types (no effect yet unless Template:Styles/add_ccLogos.css is loaded)
Line 247:
$('#input_amount_other').prop('checked', true);
}
}
}
 
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' : '', -- Adyen, needs CBvma */
'IT' : 'vmaj',
'LU' : 'vmaj',
'LV' : 'vma',
'NL' : 'vmaj',
'PT' : 'vmaj',
'SK' : 'vmaj',
// Others
'DK' : 'vma',
'HU' : 'vma',
'IL' : 'vmad', // Adyen
'JP' : 'vmaj',
'MY' : 'vmaj',
'NO' : 'vma',
'PL' : 'vma',
'RO' : 'vma',
'SE' : 'vma',
'UA' : 'vma', // Adyen
'ZA' : 'vm'
}
if ( frb.cardTypes[country] ) {
$('.paymentmethod-cc').addClass('cctypes-' + frb.cardTypes[country] );
}
}
Line 310 ⟶ 353:
 
if ( document.paypalcontribution ) {
document.paypalcontribution.utm_medium.value = mw.util.getParamValue( 'utm_medium' );
document.paypalcontribution.utm_campaign.value = mw.util.getParamValue( 'utm_campaign' );
document.paypalcontribution.utm_key.value = mw.util.getParamValue( 'utm_key' );
 
// Strip protocol to stop firewall throwing fits
Line 323 ⟶ 366:
$("#cancel-monthly").hide();
}
 
addCardTypesClass(document.paypalcontribution.country.value);
}