The official discord link if you wish to join the discord: https://discord.gg/j5RKwCvAFu
Support the wiki on our official Ko-Fi page or Patreon page!
MediaWiki:Common.js: Difference between revisions
From The Codex
Line 24: | Line 24: | ||
window.AjaxRCRefreshText = 'Auto-refresh'; | window.AjaxRCRefreshText = 'Auto-refresh'; | ||
window.AjaxRCRefreshHoverText = 'Automatically refresh the page'; | window.AjaxRCRefreshHoverText = 'Automatically refresh the page'; | ||
window.UserTagsJS = { | window.UserTagsJS = { | ||
Line 187: | Line 183: | ||
'Twilly18': ['former-bureaucrat'] | 'Twilly18': ['former-bureaucrat'] | ||
}; | }; | ||
UserTagsJS.modules.metafilter = { | UserTagsJS.modules.metafilter = { | ||
// Remove inactive from all bureaucrats, sysops, bots, global bots, staff, wikia utility and vstf | // Remove inactive from all bureaucrats, sysops, bots, global bots, staff, wikia utility and vstf | ||
Line 207: | Line 204: | ||
// UserTagsJS.modules.stopblocked = true; //Enabled by default | // UserTagsJS.modules.stopblocked = true; //Enabled by default | ||
//Manually turn off by changing true -> false | //Manually turn off by changing true -> false | ||
// Username script // | // Username script // | ||
(function () { | (function () { | ||
if (wgUserName ! | if (wgUserName != null) $('span.insertusername').text(wgUserName); | ||
})() | })() | ||
// Bureaucrat promotion warning message // | // Bureaucrat promotion warning message // | ||
!function() { | !function() { |
Revision as of 05:30, 8 December 2019
/* Any JavaScript here will be loaded for all users on every page load. */
window.AutoEditDropdownConfig = {
expandedAreaContribute: true,
expandedAreaEdit: false
};
window.ajaxRefresh = 60000;
window.ajaxPages = [
'Special:WikiActivity',
'Special:RecentChanges',
'Special:Contributions',
'Special:Log',
'Special:Log/move',
'Special:AbuseLog',
'Special:NewFiles',
'Special:NewPages',
'Special:Watchlist',
'Special:Statistics',
'Special:ListFiles',
'Category:Speedy_deletion_candidates',
'Category:Speedy_move_candidates'
];
window.AjaxRCRefreshText = 'Auto-refresh';
window.AjaxRCRefreshHoverText = 'Automatically refresh the page';
window.UserTagsJS = {
modules: {},
tags: {
// group: { associated tag data },
founder: {
u: 'Founder',
order: 1
},
bureaucrat: {
u: 'Bureaucrat',
order: 2
},
'former-bureaucrat': {
u: 'Retired Bureaucrat',
order: 3
},
sysop: {
u: 'Administrator',
order: 4
},
'former-sysop': {
u: 'Retired Administrator',
order: 5
},
'bot-global': {
u: 'Global Bot',
order: 7
},
bot: {
u: 'Bot',
order: 8
},
'content-moderator': {
u: 'Content Moderator',
order: 10
},
'former-content-moderator': {
u: 'Retired Content Moderator',
order: 11
},
threadmoderator: {
u: 'Discussion Moderator',
order: 13
},
'former-threadmoderator': {
u: 'Retired Discussion Moderator',
order: 14
},
chatmoderator: {
u: 'Chat Moderator',
order: 16
},
'former-chatmoderator': {
u: 'Retired Chat Moderator',
order: 17
},
rollback: {
u: 'Rollback',
order: 19
},
'former-rollback': {
u: 'Former Rollback',
order: 20
},
calc: {
u: 'Calc Group',
order: 22
},
'former-calc': {
u: 'Retired Calc Group',
order: 23
},
guru: {
u: 'Guru',
order: 40
},
'js-helper': {
u: 'JS Helper',
order: 51
},
'css-helper': {
u: 'CSS Helper',
order: 52
},
'image-helper': {
u: 'Image Helper',
order: 53
},
'template-helper': {
u: 'Templates Helper',
order: 54
},
'human-resources': {
u: 'Human Resources',
order: 55
},
'former-human-resources': {
u: 'Retired Human Resources',
order: 56
},
consultant: {
u: 'Consultant',
order: 100
},
bannedfromchat: {
u: 'Banned from Chat',
order: 500
},
inactive: {
u: 'Inactive',
order: 1 / 0
}
}
};
UserTagsJS.modules.inactive = {
days: 30,
// namespaces: [0, 'Talk', 'User', 'User talk', 'Forum'], // Only articles, talk pages, user pages, user talk pages or forums edits count, other Wikia namespace edits don't count
zeroIsInactive: true // 0 edits = inactive
};
UserTagsJS.modules.nonuser = (mediaWiki.config.get('skin') === 'monobook');
UserTagsJS.modules.autoconfirmed = true; // Switch on Autoconfirmed User check
UserTagsJS.modules.newuser = {
computation: function(days, edits) {
// If the expression is true then they will be marked as a new user
// If the expression is false then they won't.
// In this instance, newuser is removed as soon as the user gets 30
// edits, OR as soon as they have been present for 10 days, whichever
// happens first.
return days < 10 && edits < 30;
}
};
// NOTE: bannedfromchat displays in Oasis but is not a user-identity group so must be checked manually
UserTagsJS.modules.mwGroups = [
'bureaucrat',
'sysop',
'bot',
'bot-global',
'content-moderator',
'threadmoderator',
'chatmoderator',
'patroller',
'rollback',
'bannedfromchat'
];
UserTagsJS.modules.custom = {
'Paralysis_of_Lenuysis': ['former-content-moderator'],
'Sayo_Yasuda': ['sysop'],
'Sera_X': ['former-content-moderator'],
'Hykuu': ['former-content-moderator'],
'Emperoer_but_better': ['former-threadmoderator'],
'Game_Master_Battler': ['former-threadmoderator'],
'HyperNepsy': ['former-threadmoderator'],
'Sayo_Yasuda': ['former-sysop'],
'LukaSolosYourVerse': ['former-sysop'],
'DarkNeon1994': ['former-bureaucrat'],
'Twilly18': ['former-bureaucrat']
};
UserTagsJS.modules.metafilter = {
// Remove inactive from all bureaucrats, sysops, bots, global bots, staff, wikia utility and vstf
'inactive': [
'sysop',
'bureaucrat',
'bot',
'bot-global',
'staff',
'util',
'vstf'
],
'sysop': ['bot', 'bot-global'], // Remove "Administrator" tag from bots and global bots
'content-moderator': ['bureaucrat', 'sysop'], // Remove "Content Moderator" tag from bureaucrats and administrators
'threadmoderator': ['bureaucrat', 'sysop'], // Remove "Discussions Moderator" tag from bureaucrats and administrators
'chatmoderator': ['bureaucrat', 'sysop'], // Remove "Chat Moderator" tag from bureaucrats and administrators
'rollback': ['bureaucrat', 'sysop'] // Remove "Rollback" tag from bureaucrats and administrators
};
// UserTagsJS.modules.stopblocked = true; //Enabled by default
//Manually turn off by changing true -> false
// Username script //
(function () {
if (wgUserName != null) $('span.insertusername').text(wgUserName);
})()
// Bureaucrat promotion warning message //
!function() {
if (wgCanonicalSpecialPageName !== 'Userrights') return;
$('#mw-content-text').on('change', '#wpGroup-bureaucrat', function() {
if ($('#wpGroup-bureaucrat').attr('checked') && !confirm('Do you truly want to appoint a bureaucrat?')) $('#wpGroup-bureaucrat').attr('checked', null);
});
}();