MediaWiki:Common.js

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

/* User Tags */ // User Tags window.UserTagsJS = { modules: { inactive: 15, mwGroups: ['bureaucrat', 'chatmoderator', 'rollback', 'sysop', 'bannedfromchat', 'bot', 'bot-global'], autoconfirmed: false, metafilter: { sysop: ['bureaucrat'], chatmoderator: ['sysop'], rollback: ['sysop'], },			newuser: true,}, tags: { tech: { u: 'Technician', order: 0 }, serg: { u: 'Sergeant', order: 2 }, sserg: { u: 'Staff Sergeant', order: 1 }, corp: { u: 'Corporal', order: 3 }, hier: { u: 'Hierarchy', order: 0 }, gm: { u: 'Game Master', order: 0 }, evadmin: { u: 'Demonic', order: 0 }, anadmin: { u: 'Angelic', order: 1 }, lvldesign: { u: 'Level Designer', order: 0 }, seni: { u: 'Senior', order: 5 }, forum: { u: 'Forum Management', order: 6 }, night: { u: 'Nightfall', order: 6 }, } }; UserTagsJS.modules.custom = { 'Lemoness': ['sysop', 'tech', 'evadmin', 'lvldesign', 'seni'], 'ConTraZ VII': ['sysop', 'bureaucrat', 'hier', 'anadmin', 'lvldesign', 'seni'], 'Athener': ['serg', 'night'], 'Vampjrehunter': ['corp'], 'Ireegg96': ['corp'], 'Kyroskoh': ['gm'], 'UserU': ['forum'], 'Orangbiasa': ['seni'] }; UserTagsJS.modules.userfilter = { 'Lemoness': ['bureaucrat'] }; UserTagsJS.modules.mwGroups = ['bureaucrat,sysop']; UserTagsJS.modules.mwGroups = ['rollback']; importArticle({type:'script', article:'w:c:dev:UserTags/code.js'});

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

/* Ajax Patrol by Grunny */ importScriptPage('AjaxPatrol/code.js', 'dev' );

/* Edit count tag */ importArticles({   type: "script",    articles: [        "w:c:dev:EditcountTag/code.js"    ] });

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

/* Spoilers */ SpoilerAlert = { isSpoiler: function { return -1 !== wgCategories.indexOf('Spoiler'); } }; importScriptPage('SpoilerAlert/code.js', 'dev');

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

/* Admin List */ importScriptPage('ListAdmins/code.js', 'dev');

/* 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');

//******************************************************************** // 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); }