MediaWiki:Common.js

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

/* Test if an element has a certain class ************************************** * * Description: Uses regular expressions and caching for better performance. * Taken from Wikipedia's Common.js. */ var hasClass = (function {     var reCache = {};     return function (element, className) {         return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);    }; });

/* */

/* Chat Tags */ importScriptPage('ChatTags/code.js', 'dev'); /* External Image Loader */ importScriptPage('ExternalImageLoader/code.js', 'dev');

/* Automatic signature */ importScriptPage('Sine/code.js', 'dev'); /* Voice Dictation */ importScriptPage('Voice_Dictation/voice.js', 'dev'); /* Search Suggest */ importArticles({   type: 'script',    articles: [        'u:dev:SearchSuggest/code.js'    ] }); /* Timed Slider */ importArticles({   type: 'script',    articles: [        'u:dev:TimedSlider/code.js'    ] }); /* Chat Options */ importScriptPage('ChatOptions/code.js', 'dev'); /* Code */ importArticles({   type: 'script',    articles: [        'u:dev:Code/code.js'    ] }); /* Visual Spell Check */ importScriptPage('VisualSpellCheck/code.js','dev'); /* Floating TOC */ importArticles({   type: 'script',    articles: [        'u:dev:FloatingToc/code.js'    ] }); /* Reveal Anonymous IP */ importArticles({   type: "script",    articles: [        "w:c:dev:RevealAnonIP/code.js"    ] });

/* Auto-Refresh for Wiki Activity */ AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; importScriptPage('AjaxRC/code.js', 'dev'); var ajaxPages =["Special:RecentChanges", "Special:WikiActivity"]; /* Back to top button */ importScriptPage('BackToTopButton/code.js', 'dev'); /* Admin List */ importScriptPage('ListAdmins/code.js', 'dev'); /* Collapsible Tables */ importScriptPage('ShowHide/code.js', 'dev'); /* Collapsible Infobox */ importScriptPage('CollapsibleInfobox/code.js', 'dev'); /* Clock */ importScriptPage('DisplayClock/code.js', 'dev'); /* Adds Purge button */ var PurgeButtonText = 'Refresh'; importScriptPage('PurgeButton/code.js', 'dev'); /* Lists of Duplicate images */ importScriptPage('DupImageList/code.js', 'dev'); /* Top Contributor */ importArticles({   type: 'script',    articles: [        'w:dev:TopEditors/code.js'    ] });

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

/* User Tags */ // User Tags window.UserTagsJS = { modules: { inactive: 30, mwGroups: ['bureaucrat', 'chatmoderator', 'rollback', 'sysop', 'bannedfromchat', 'bot', 'bot-global'], autoconfirmed: false, metafilter: { sysop: ['bureaucrat'], chatmoderator: ['sysop'], rollback: ['sysop'], contentmoderator: ['mod'], },			newuser: true,}, tags: { handy: { u: 'handy', order: 2 }, petunia: { u: 'petunia', order: 2 }, flaky: { u: 'flaky', order: 2 }, mime: { u: 'mime', order: 2 }, flippy: { u: 'flippy', order: 2 }, lumpy: { u: 'lumpy', order: 2 }, nutty: {u: 'nutty', order: 1}, mole: { u: 'mole', order: 2 }, lifty: { u: 'lifty', order: 2 }, shifty: { u: 'shifty', order: 2 }, yf: { u: 'flippy the army', order: 3 }, toybonnie: { u: 'toy bonnie', order: 4 }, toychica: { u: 'toy chica', order: 4 }, toyfreddy: { u: 'toy freddy', order: 4}, kenny: { u: 'kenny', order: 4}, wikiresponsibility: { u: 'wiki responsibility', order: 2 }, cuddles: { u: 'cuddles', order: 2 }, toothy: { u: 'toothy', order: 2 }, discobear: { u: 'discobear', order: 1 }, honosysop: { u: 'honorary admin', order: 1}, lapis: { u: 'lapis lazuli', order: 4}, bandmstudios: { u: 'bandmstudios', order: 5}, semiactive: { u: 'semi active bureaucrat', order: 2 }, mod: { u: 'content moderator', order: 1 }, } };

UserTagsJS.modules.custom = { "Lord O' Darkness": ['sysop'], 'Yong feng': ['sysop', 'bureaucrat', 'yf', 'toybonnie', 'semiactive'], 'AnimationFan15': ['sysop', 'bureaucrat', 'mime', 'toychica', 'lapis'], 'Rorosilky5': ['flippy', 'kenny'], 'Sandgar': ['sysop', 'bureaucrat', 'flaky', 'nutty', 'bandmstudios', 'wikiresponsibility'], 'PokemonTDHTF98': ['lifty', 'shifty'], 'AdamISAWESOME': ['lumpy', 'mole'], 'HelloWhatsUp': ['sysop'], 'HTFan': ['sysop'], 'BonnieBunny1987': ['lifty', 'shifty'], 'KennyX1994': ['sysop', 'cuddles', 'flaky', 'bandmstudios' ], 'IThrowLemonsAtLife': ['bandmstudios'], 'Smart zombie': ['sysop'], 'Mr Creeper500': ['sysop', 'cuddles', 'flippy'], 'Flash of Memory': ['mod'], };

UserTagsJS.modules.userfilter = { };

UserTagsJS.modules.mwGroups = ['bureaucrat,sysop']; UserTagsJS.modules.mwGroups = ['rollback']; UserTagsJS.modules.mwGroups = ['contentmoderator']; importArticle({type:'script', article:'w:c:dev:UserTags/code.js'});

if (wgUserName != 'null') { $('.insertusername').html(wgUserName); }

window.MessageWallUserTags = { tagColor: 'black', glow: true, users: { 'username': 'usergroup', "Lord_O'_Darkness": 'Admin', 'Yong_feng': 'Bureaucrat • Semi Active Bureaucrat • Flippy The Army • Toy Bonnie', 'AnimationFan15': 'Bureaucrat • Cuddles • Toy Chica • Lapis Lazuli', 'Rorosilky5': 'Flippy • Kenny', 'Sandgar': 'Bureaucrat • Wiki Responsibility • Flaky • Nutty • BandMStudios', 'PokemonTDHTF98': 'Lifty • Shifty', 'AdamISAWESOME': 'Lumpy • Mole', 'HelloWhatsUp': 'Admin', 'HTFan': 'Admin', 'BonnieBunny1987': 'Lifty • Shifty', 'KennyX1994': 'Admin • Cuddles • Flaky • BandMStudios', 'IThrowLemonsAtLife': 'BandMStudios', 'Smart_zombie': 'Admin', 'Mr_Creeper500': 'Admin • Cuddles • Flippy', 'Flash_of_Memory': 'Content Moderator', } }; importArticles({   type: 'script',    articles: [        //other scripts,        'u:dev:MessageWallUserTags/code.js'    ] });

/* Allow external image linking */ importScriptPage('ExternalImageLoader/code.js', 'dev');

importArticles({   type: 'script',    articles: [        'u:dev:MessageBlock/code.js'    ] });

//Auto Message Blocked var MessageBlock = { title : 'Block.', message : 'You have been killed for $2 for the following reason(s): "$1"', autocheck : false };

importArticles({   type: 'script',    articles: [        // ...        'u:dev:LastEdited/code.js',        // ...    ] });

//LastEdited window.lastEdited = { // avatar: false, size: false, diff: true, comment: true, time: true };

importArticles({	type: "script",	articles: [		"u:dev:DynamicImages/code.js"	] });

importScriptPage('CleanWantedFiles/code.js', 'dev');

window.LockOldBlogs = { expiryDays: 60, expiryMessage: "This blog is considered archived because it hasn\'t been commented on in over  days, please don\'t comment this blog!", nonexpiryCategory: "Never archived blogs" }; importArticles({   type: "script",    articles: [        "w:c:dev:LockOldBlogs/code.js"    ] });