MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

/* Auto-Refresh for Wiki Activity */ AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; importScriptPage('AjaxRC/code.js', 'dev'); var ajaxPages =["Special:WikiActivity"];

/* Custom edit buttons */ importScript('MediaWiki:Common.js/CEB.js'); /* Back to top button */ importScriptPage('BackToTopButton/code.js', 'dev');

/* Countdown timers on the wiki */ importArticles({   type: "script",    articles: [        "w:c:dev:Countdown/code.js"    ] });

/* Collapsible Tables */ importScriptPage('ShowHide/code.js', 'dev');

/* Clock */ importScriptPage('DisplayTimer/code.js', 'dev');

/* Adds Purge button */ var PurgeButtonText = 'Purge'; importScriptPage('PurgeButton/code.js', 'dev'); /* Standard Edit Summaries */ importScriptPage('Standard_Edit_Summary/code.js', 'dev');

/* Lists of Duplicate images */ importScriptPage('DupImageList/code.js', 'dev');

/* Import User Tag */ importScriptPage('UserTags/code.js', 'dev');

/* User Tags */ window.UserTagsJS = { modules: {}, tags: { 'patroller': { link:'w:Help:Recent changes patrol' }, 'newsmoderator': { u:'News Moderator', link:'Blog:News' }, 'chatmoderator': { link:'Bloons Wiki:Chat moderators' }, 'rollback': { link:'Bloons Wiki:Rollback' }, 'sysop': { u:'Admin', link:'Bloons Wiki:Administrators' }, 'bureaucrat': { link:'Bloons Wiki:Bureaucrats' }, 'founder': { link:'w:Help:Founders' }, 'bot': { link:'Bloons Wiki:Bots' }, 'bot-global': { link:'Bloons Wiki:Bot-global' }, 'checkuser': { link:'w:help:checkuser' }, 'checkuser-global': { u:'Global Checkuser', link:'w:help:checkuser' }, 'authenticated': { link:'Bloons Wiki:Authenticated' }, 'util': { link:'Help:User_access_levels#Utilites' }, 'council': { link:'w:Help:Community Council' }, 'vstf': { link:'w:Help:VSTF' }, 'helper': { link:'w:Help:Helpers' }, 'adminmentor': { link:'w:Admin Support:Main Page' }, 'staff': { link:'w:Community Central:Staff' }, 'inactive': { link:'Special:ActiveUsers' }, 'nonuser': { link:'Special:ActiveUsers' }, 'newuser': { link:'Bloons Wiki:Users' }, 'notautoconfirmed': { link:'Bloons Wiki:Users' }, 'bannedfromchat': { link:'Bloons Wiki:Chat' }, 'blocked': { link:'Bloons Wiki:Policies' } 'sergeant': { u:'Sergeant' } 'ssergeant': { u:'Staff Sergeant' } 'corporal': { u:'Corporal' } 'layouteditor': { u:'Layout Editor' } } }; UserTagsJS.modules.nonuser = true; // mark users with no edits UserTagsJS.modules.autoconfirmed = true; // mark autoconfirmed users UserTagsJS.modules.isblocked = true; // mark blocked users on MonoBook //UserTagsJS.modules.newuser = true; // mark new users - probably not needed when the line below works UserTagsJS.modules.newuser = { //	days: 7, // must have been on the Wiki for X days //	edits: 15, // and have at least X edits to remove the tag namespace: 0, // edits must be made to articles to count computation: function(days, edits) { // Return false = not newuser, return true = newuser return edits < 20 && (edits < 10 || days < 7) && days < 21; }	// NOTE: Computation would be mutually exclusive with days/edits, those params would stop working when you define your own function. }; UserTagsJS.modules.inactive = { days: 15, namespaces: [0], zeroIsInactive: false // 0 article edits = inactive }; UserTagsJS.modules.mwGroups = ['bureaucrat', 'chatmoderator', 'rollback', 'sysop', 'bannedfromchat', 'bot', 'bot-global', 'checkuser', 'checkuser-global', 'util', 'council', 'vstf', 'helper', 'adminmentor', 'staff']; // add corresponding tags to users // adding tags to users UserTagsJS.modules.custom = { 'Lemoness': ['sysop','layouteditor'], 'ConTraZ_VII': ['bureaucrat','sysop'], }; // removing tags to users UserTagsJS.modules.userfilter = { //	'somebody': ['inactive'] // 'somebody' is never marked as inactive, even when he is }; UserTagsJS.modules.metafilter = { 'sysop': ['bot'], // remove sysop tag from bots 'bot': ['bot-global'], // remove bot tag from global bots 'inactive': ['bot', 'bot-global', 'util', 'council', 'vstf', 'helper', 'staff', 'adminmentor'], // remove inactive tag from bots & global users 'newuser': ['bot', 'bot-global', 'util', 'council', 'vstf', 'helper', 'staff', 'adminmentor'] // remove newuser tag from bots & global users };

//******************************************************************** // Added SiteNotice Functionality, credits to RuneScape wiki // // Functions: //  * Moves the dismiss link into the SiteNotice table. //  * Saves the show/hide status of the SiteNotice in a cookie. //  * Automatically expands the SiteNotice when the ID is updated. //******************************************************************** var dCookieName = "dismissSiteNotice="; var msgClose = "dismiss"; var hCookieName = "hideSiteNotice="; var hCookiePos = document.cookie.indexOf(hCookieName); var hCookieValue = ""; function editSiteNotice { var snbox = document.getElementById('mw-dismissable-notice'); if (snbox != null) { if (hCookiePos > -1) { hCookiePos = hCookiePos + hCookieName.length; var hideEndPos = document.cookie.indexOf(";", hCookiePos); if (hideEndPos > -1) { hCookieValue = document.cookie.substring(hCookiePos, hideEndPos); } else { hCookieValue = document.cookie.substring(hCookiePos); }       }        var newLink = document.createElement('a'); newLink.setAttribute('href', "javascript:dismissNotice;"); newLink.setAttribute('title', 'Dismiss this notice.'); newLink.innerHTML = msgClose; var newSpan = document.createElement('span'); newSpan.id = 'siteNoticeDismiss'; newSpan.appendChild(document.createTextNode(' [')); newSpan.appendChild(newLink); newSpan.appendChild(document.createTextNode(']')); var hideLink = document.getElementById("collapseButton" + "0"); hideLink.href = "javascript:hideSiteNotice;" hideLink.parentNode.style.width = "12em"; hideLink.parentNode.appendChild(newSpan); if (hCookieValue != siteNoticeID && hideLink.innerHTML == "show") { collapseTable(0); }       if (hCookieValue == siteNoticeID && hideLink.innerHTML == "hide") { collapseTable(0); }   } } function hideSiteNotice { var hideLink = document.getElementById("collapseButton" + "0"); var date = new Date; if (hideLink.innerHTML == 'hide') { date.setTime(date.getTime + 30 * 86400 * 1000); } else { date.setTime(date.getTime - 30 * 86400 * 1000); }   document.cookie = hCookieName + siteNoticeID + "; expires=" + date.toGMTString + "; path=/"; collapseTable(0); } if (skin == 'oasis') { addOnloadHook(editSiteNotice); }

/* Username replace feature * Inserts viewing user's name into * Put text inside the spans to be viewed by logged out users * Originally by Splarka, then by Spang, * This (jQuery) version by wikia:User:Joeyaa, written to be backwards compatible */ if (wgUserName != 'null') { $('.insertusername').html(wgUserName); }