MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
split out donation form code Tag: Replaced |
only load when DOM is ready |
||
Line 3: | Line 3: | ||
**/ |
**/ |
||
⚫ | |||
// Code for donation forms - https://donate.wikimedia.org/wiki/MediaWiki:DonationForm.js |
// Code for donation forms - https://donate.wikimedia.org/wiki/MediaWiki:DonationForm.js |
||
if ( document.paypalcontribution ) { |
if ( document.paypalcontribution ) { |
||
mw.loader.load( '/w/index.php?title=MediaWiki:DonationForm.js&action=raw&ctype=text/javascript' ) |
mw.loader.load( '/w/index.php?title=MediaWiki:DonationForm.js&action=raw&ctype=text/javascript' ); |
||
} |
|||
} |
|||
// Code for Thank You pages - https://donate.wikimedia.org/wiki/MediaWiki:ThankYouPage.js |
// Code for Thank You pages - https://donate.wikimedia.org/wiki/MediaWiki:ThankYouPage.js |
||
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.load( '/w/index.php?title=MediaWiki:ThankYouPage.js&action=raw&ctype=text/javascript' ); |
||
} |
|||
} |
|||
// Code for support pages - https://donate.wikimedia.org/wiki/MediaWiki:SupportPage.js |
// Code for support pages - https://donate.wikimedia.org/wiki/MediaWiki:SupportPage.js |
||
var supportPages = [ 'Ways to Give', 'Problems donating', 'Cancel or change recurring giving', |
var supportPages = [ 'Ways to Give', 'Problems donating', 'Cancel or change recurring giving', |
||
'Matching Gifts', 'Support Page', 'FAQ', 'Tax deductibility' ] |
'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 - https://donate.wikimedia.org/wiki/MediaWiki:EditTemplates.js |
// Load some tools for editors - https://donate.wikimedia.org/wiki/MediaWiki:EditTemplates.js |
||
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' ); |
||
} |
|||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
TODO: Make suitable for multiple scripts. Or figure out a better way to do this. |
TODO: Make suitable for multiple scripts. Or figure out a better way to do this. |
||
*/ |
*/ |