MediaWiki:Common.js

//************************************************ // Imported Scripts //************************************************ importScriptPage('MediaWiki:Translator/Translator.js', 'dev'); importArticles({	type:'script',	articles: [		'u:dev:UserTags/code.js',       'u:dev:Countdown/code.js',        'u:dev:BackToTopButton/code.js',        'u:dev:PurgeButton/code.js',        'u:dev:ReferencePopups/code.js',        'u:dev:LockOldBlogs/code.js',        'u:dev:WikiaNotification/code.js',        'u:dev:DiscussionsFeed.js',        'MediaWiki:Common.js/stdsummaries.js',        'MediaWiki:Common.js/Date.js',        'MediaWiki:Common.js/Nav.js',        'u:dev:MediaWiki:DiscordIntegrator/code.js'	] }); ((window.dev = window.dev || {}).ReferencePopups = dev.ReferencePopups || {}).lockdown = true; //************************************************ // User Tag Config //************************************************ //*** Make New Tags window.UserTagsJS = { modules: {}, tags: { bureaucrat: { link:'South Park Archives:Administrators'}, bot: { link:'South Park Archives', order:1 }, sysop: { u: 'Administrator', link:'South Park Archives:Administrators', order:2 }, rollback: { u: 'Rollback', order:3 }, chatmoderator: { u: 'Moderator', order:4 }, inactivebcrat: { u: 'Inactive Bureaucrat', order:8 }, inactiveadmin: { u: 'Inactive Administrator', order:9 }, inactive: { u: 'Inactive User', order:10 }, fired: { u: 'Fired Administrator', order:11 } } };

//*** Custom Set Tags UserTagsJS.modules.custom = { 'Forsbern': ['fired'], 'VadimZ': ['fired'] };

//*** Remove tags from users UserTagsJS.modules.userfilter = { 'Manic The Hedgehog': ['inactive'] };

//*** Tags New Accounts UserTagsJS.modules.autoconfirmed = true;

//*** Tags New Users - <10 Days or <30 Edits UserTagsJS.modules.newuser = { namespace: 0, computation: function(days, edits) { return days < 10 && edits < 30; } };

//*** Tags Inactive Users - >=30 Days UserTagsJS.modules.inactive = { days: 30, namespaces: [0] };

UserTagsJS.modules.mwGroups = ['bureaucrat', 'sysop', 'chatmoderator', 'rollback', 'bannedfromchat', 'bot']; //*** Combine Multiple Tags UserTagsJS.modules.implode = { 'inactivebcrat': ['bureaucrat', 'inactive'], //+inactivebcrat -bureaucrat -inactive 'inactiveadmin': ['sysop', 'inactive'] //+inactiveadmin -sysop - inactive }; //************************************************ // Username Template //************************************************ function UserNameReplace { if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return; $("span.insertusername").html(wgUserName); } addOnloadHook(UserNameReplace);

//************************************************ // Wanted Files Tweak //************************************************ $(function {   if ("Special" == wgCanonicalNamespace && "WantedFiles" == wgCanonicalSpecialPageName) {        $('ol.special a.new').each(function { var m = $(this).attr('href').match(/title=File:([^&]+)/); if (m) { $(this).attr({                   href: '/wiki/Special:Upload?wpDestFile=' + m[1],                    title: 'Upload ' + m[1]                }); }       });    } });

//************************************************ // Adds Button to Edit Message Wall Greeting //************************************************ function EditGreeting { if (wgCanonicalNamespace == 'Message_Wall' && wgAction != 'history') { if (wgTitle == wgUserName) { $('.WikiaMainContent').prepend('  Edit greeting	 '); }	} }

addOnloadHook(EditGreeting);

//************************************************ // Test if an element has a certain class // Credit: Mike Dillon, R. Koot, SG //************************************************ var hasClass = (function {   var reCache = {};   return function (element, className) {      return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);  }; });

//************************************************ // Disable Archive Edit Config //************************************************ var DisableArchiveEditConfig = { archiveSubpage: 'Archive', disableCompletely: true, textColor: '#D9D9D9', userLang: true };

//************************************************ // Archive Old Blog Posts //************************************************ window.LockOldBlogs = { expiryDays: 30, expiryMessage: "This blog is considered archived because it hasn\'t been commented on in over  days, please don\'t bump this blog!" };

//************************************************ // Wikia Notification Configuration //************************************************ var WikiaNotificationMessage = "What did you think about Season 20? Voice your opinion today! Click here for more info! "; var WikiaNotificationexpiry = 10;