Difference between revisions of "MediaWiki:Common.js"
From QWiki
D0PESK1LLZ (talk | contribs) (Blanked the page) |
|||
Line 1: | Line 1: | ||
+ | /* Any JavaScript here will be loaded for users using the LiquiFlow skin */ | ||
+ | /************************************* | ||
+ | LOAD SCRIPTS FOR VARIOUS TEMPLATES | ||
+ | *************************************/ | ||
+ | |||
+ | var loadPagesFromLocal = []; | ||
+ | var loadPagesFromCommons = []; | ||
+ | |||
+ | /* BRACKETS AND GROUPTABLES */ | ||
+ | if($('.bracket, .grouptable, .matchlist').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Bracket.js'); | ||
+ | } | ||
+ | |||
+ | /* CROSSTABLES */ | ||
+ | if($('.crosstable').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Crosstable.js'); | ||
+ | } | ||
+ | |||
+ | /* TABS */ | ||
+ | if($('.tabs').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Tabs.js'); | ||
+ | } | ||
+ | |||
+ | /* LIQUIPEDIA LINKS */ | ||
+ | if($('.liquipedia-links').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Liquipedia_links.js'); | ||
+ | } | ||
+ | |||
+ | /* PRIZE POOL TABLES */ | ||
+ | if($('.prizepooltable').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Prizepooltable.js'); | ||
+ | } | ||
+ | |||
+ | /* DISMISSABLE SITENOTICE */ | ||
+ | if($('#siteNotice').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/SiteNotice.js'); | ||
+ | } | ||
+ | |||
+ | /* SELECT ALL FOR TEMPLATE COPYPASTES */ | ||
+ | if($('pre.selectall').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Selectall.js'); | ||
+ | } | ||
+ | |||
+ | /* COUNTDOWN */ | ||
+ | if($('.countdown, .datetime').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Countdown.js'); | ||
+ | } | ||
+ | |||
+ | /* LIQUID BOXES */ | ||
+ | if($('.justify-wrap').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Liquid_boxes.js'); | ||
+ | } | ||
+ | |||
+ | /* COLLAPSIBLES */ | ||
+ | if($('.collapsible, .NavFrame').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Collapse.js'); | ||
+ | } | ||
+ | |||
+ | /* INFOBOXES */ | ||
+ | if($('.fo-nttax-infobox-wrapper').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Infobox.js'); | ||
+ | } | ||
+ | |||
+ | /* MAIN PAGE */ | ||
+ | if($('body.page-Main_Page, body.page-Main_Page_LiquiFlow, .share-birthday').length) { | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Mainpage.js'); | ||
+ | } | ||
+ | |||
+ | /* MISCELLANEOUS */ | ||
+ | loadPagesFromCommons.push('MediaWiki:Common.js/Miscellaneous.js'); | ||
+ | |||
+ | /*************************************** | ||
+ | ACTUALLY LOAD THE STUFF WE ASKED FOR | ||
+ | ***************************************/ | ||
+ | |||
+ | /* COMMONS */ | ||
+ | if(loadPagesFromCommons.length) { | ||
+ | mw.loader.load('//wiki.teamliquid.net/commons/load.php?articles=' + loadPagesFromCommons.join('|') + '&only=scripts&mode=articles' + (mw.util.getParamValue('debug') == 'true' ? '&debug=true' : '') + '&*'); | ||
+ | } | ||
+ | |||
+ | /* LOCAL */ | ||
+ | if(loadPagesFromLocal.length) { | ||
+ | mw.loader.load('//wiki.teamliquid.net/rocketleague/load.php?articles=' + loadPagesFromLocal.join('|') + '&only=scripts&mode=articles' + (mw.util.getParamValue('debug') == 'true' ? '&debug=true' : '') + '&*'); | ||
+ | } |
Revision as of 09:35, 8 November 2016
/* Any JavaScript here will be loaded for users using the LiquiFlow skin */ /************************************* LOAD SCRIPTS FOR VARIOUS TEMPLATES *************************************/ var loadPagesFromLocal = []; var loadPagesFromCommons = []; /* BRACKETS AND GROUPTABLES */ if($('.bracket, .grouptable, .matchlist').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Bracket.js'); } /* CROSSTABLES */ if($('.crosstable').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Crosstable.js'); } /* TABS */ if($('.tabs').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Tabs.js'); } /* LIQUIPEDIA LINKS */ if($('.liquipedia-links').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Liquipedia_links.js'); } /* PRIZE POOL TABLES */ if($('.prizepooltable').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Prizepooltable.js'); } /* DISMISSABLE SITENOTICE */ if($('#siteNotice').length) { loadPagesFromCommons.push('MediaWiki:Common.js/SiteNotice.js'); } /* SELECT ALL FOR TEMPLATE COPYPASTES */ if($('pre.selectall').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Selectall.js'); } /* COUNTDOWN */ if($('.countdown, .datetime').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Countdown.js'); } /* LIQUID BOXES */ if($('.justify-wrap').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Liquid_boxes.js'); } /* COLLAPSIBLES */ if($('.collapsible, .NavFrame').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Collapse.js'); } /* INFOBOXES */ if($('.fo-nttax-infobox-wrapper').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Infobox.js'); } /* MAIN PAGE */ if($('body.page-Main_Page, body.page-Main_Page_LiquiFlow, .share-birthday').length) { loadPagesFromCommons.push('MediaWiki:Common.js/Mainpage.js'); } /* MISCELLANEOUS */ loadPagesFromCommons.push('MediaWiki:Common.js/Miscellaneous.js'); /*************************************** ACTUALLY LOAD THE STUFF WE ASKED FOR ***************************************/ /* COMMONS */ if(loadPagesFromCommons.length) { mw.loader.load('//wiki.teamliquid.net/commons/load.php?articles=' + loadPagesFromCommons.join('|') + '&only=scripts&mode=articles' + (mw.util.getParamValue('debug') == 'true' ? '&debug=true' : '') + '&*'); } /* LOCAL */ if(loadPagesFromLocal.length) { mw.loader.load('//wiki.teamliquid.net/rocketleague/load.php?articles=' + loadPagesFromLocal.join('|') + '&only=scripts&mode=articles' + (mw.util.getParamValue('debug') == 'true' ? '&debug=true' : '') + '&*'); }