MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
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: | Line 438: | ||
}); |
}); |
||
⚫ | |||
/** |
|||
* Code for fundraising Thank You pages |
|||
⚫ | |||
*/ |
|||
if ( mw.config.get( 'wgTitle' ).split('/')[0] === '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 for fundraising support pages |
|||
'Matching Gifts', 'Support Page', 'FAQ', 'Tax deductibility' ] |
|||
* e.g. https://donate.wikimedia.org/wiki/Problems_donating |
|||
* |
|||
⚫ | |||
*/ |
|||
var supportPages = [ |
|||
'Ways to Give', |
|||
'Problems donating', |
|||
⚫ | |||
'Matching Gifts', |
|||
'Support Page', |
|||
'FAQ', |
|||
'Tax deductibility' |
|||
] |
|||
if ( supportPages.indexOf( mw.config.get( 'wgTitle' ).split('/')[0] ) !== -1 ) { |
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' ); |
mw.loader.load( '/w/index.php?title=MediaWiki:SupportPage.js&action=raw&ctype=text/javascript' ); |
||
} |
} |
||
⚫ | |||
/** |
|||
* Load some tools for editors |
|||
* |
|||
⚫ | |||
*/ |
|||
if ( mw.config.get( 'wgUserName' ) !== null ) { |
if ( mw.config.get( 'wgUserName' ) !== null ) { |
||
mw.loader.load( '/w/index.php?title=MediaWiki:EditTemplates.js&action=raw&ctype=text/javascript' ); |
mw.loader.load( '/w/index.php?title=MediaWiki:EditTemplates.js&action=raw&ctype=text/javascript' ); |