MediaWiki:Common.js

From QWiki
Revision as of 14:17, 6 November 2016 by D0PESK1LLZ (talk | contribs) (Created page with "→‎Any JavaScript here will be loaded for users using the LiquiFlow skin: /************************************* LOAD SCRIPTS FOR VARIOUS TEMPLATES **********************...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* 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');

/*  CALENDAR  */
if($('.calendar').length) {
	loadPagesFromLocal.push('MediaWiki:Common.js/Calendar.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/starcraft2/load.php?articles=' + loadPagesFromLocal.join('|') + '&only=scripts&mode=articles' + (mw.util.getParamValue('debug') == 'true' ? '&debug=true' : '') + '&*');
}