MediaWiki:Common.js

//************************************************ // Imported Scripts //************************************************ importArticles({	type:'script',	articles: [		'w:c:dev:UserTags/code.js',               'w:c:dev:Countdown/code.js',                'w:c:dev:BackToTopButton/code.js',                'w:c:dev:PurgeButton/code.js',                'w:c:dev:DisableArchiveEdit/code.js',                'w:c:southpark:MediaWiki:Common.js/stdsummaries.js'	] });

//************************************************ // User Tag Config //************************************************ //*** Make New Tags window.UserTagsJS = { modules: {}, tags: { bureaucrat: { link:'South Park Archives:Administrators'}, sysop: { u: 'Administrator', link:'South Park Archives:Administrators', order:1 }, rollback: { u: 'Rollback', order:2 }, chatmoderator: { u: 'Chat Moderator', order:3 }, 'inactivebcrat': { u: 'Inactive Bureaucrat', order:8 }, 'inactiveadmin': { u: 'Inactive Administrator', order:9 }, 'inactive': { u: 'Inactive User', order:10 }, 'fired': { u: 'Fired Administrator', order:-1/0 } } };

//*** Set Custom Tags Per User UserTagsJS.modules.custom = { 'Duwis': ['fired', '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']; //*** 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 // Maintainers: 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 };