MediaWiki:Common.js: Difference between revisions

Content deleted Content added
load MediaWiki:EditTemplates.js by default for logged in users
split thank you page js to own page MediaWiki:ThankYouPage.js, clean up comments for other inclusions
Line 438:
});
 
// Code for Thank *You Editpages at- https://donate.wikimedia.org/wiki/MediaWiki:SupportPageThankYouPage.js
/**
* Code for fundraising Thank You pages
* e.g. https://donate.wikimedia.org/wiki/Thank_You
*/
if ( mw.config.get( 'wgTitle' ).split('/')[0] === 'Thank You' ) {
mw.loader.load( '/w/index.php?title=MediaWiki:ThankYouPage.js&action=raw&ctype=text/javascript' );
 
mw.loader.using( 'mediawiki.util', function() {
 
var paymentMethod = mw.util.getParamValue('payment_method'),
country = mw.util.getParamValue('country');
 
if ( paymentMethod === 'bt' ) {
document.getElementById('ty-banktransfer').style.display = 'block';
}
if ( paymentMethod === 'bitcoin' ) {
document.getElementById('ty-bitcoin').style.display = 'block';
}
if ( paymentMethod === 'bpay' ) {
document.getElementById('ty-bpay').style.display = 'block';
}
 
if ( country === 'US' || country === 'CA' ) {
document.getElementById('ty-store').style.display = 'block';
}
 
});
 
}
 
// *Code e.g.for support pages - https://donate.wikimedia.org/wiki/Thank_YouMediaWiki:SupportPage.js
/**
var supportPages = [ 'Ways to Give', 'Problems donating', 'Cancel or change recurring giving',
* Code for fundraising support pages
'Matching Gifts', 'Support Page', 'FAQ', 'Tax deductibility' ]
* e.g. https://donate.wikimedia.org/wiki/Problems_donating
*
* Edit at https://donate.wikimedia.org/wiki/MediaWiki:SupportPage.js
*/
var supportPages = [
'Ways to Give',
'Problems donating',
'Cancel or change recurring giving',
'Matching Gifts',
'Support Page',
'FAQ',
'Tax deductibility'
]
if ( supportPages.indexOf( mw.config.get( 'wgTitle' ).split('/')[0] ) !== -1 ) {
mw.loader.load( '/w/index.php?title=MediaWiki:SupportPage.js&action=raw&ctype=text/javascript' );
}
 
// *Load Editsome attools for editors - https://donate.wikimedia.org/wiki/MediaWiki:EditTemplates.js
/**
* Load some tools for editors
*
* Edit at https://donate.wikimedia.org/wiki/MediaWiki:EditTemplates.js
*/
if ( mw.config.get( 'wgUserName' ) !== null ) {
mw.loader.load( '/w/index.php?title=MediaWiki:EditTemplates.js&action=raw&ctype=text/javascript' );