User:Zzuuzz/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Zzuuzz/common.css. |
// [[MediaWiki:Gadget-popups.js]]
var popupHideDelay = 0.1;
// [[MediaWiki:Gadget-markblocked.js]]
var mbTempStyle = 'opacity: 0.9; text-decoration: wavy underline';
var mbIndefStyle = 'opacity: 0.9; font-style: italic; text-decoration: wavy underline';
function loadLocalJS(s) {
mw.loader.load(mw.config.get('wgServer') + mw.config.get('wgScript')
+ '?action=raw&ctype=text/javascript&title=' + s);
}
$.when(mw.loader.using('mediawiki.util'), $.ready).then(function () {
if (mw.config.get('wgUserGroups').indexOf('checkuser') !== -1) {
$('.mw-contributions-link-check-user-initiator').parent().hide();
}
if (mw.config.get('wgUserGroups').indexOf('sysop') !== -1) {
loadLocalJS("User:Zzuuzz/scripts/blockreasons.js"); // [[User:Zzuuzz/blockreasons.js]]
loadLocalJS("User:Zzuuzz/scripts/deletionreasons.js"); // [[User:Zzuuzz/deletionreasons.js]]
loadLocalJS("User:Zzuuzz/scripts/protectionreasons.js"); // [[User:Zzuuzz/protectionreasons.js]]
loadLocalJS("User:Zzuuzz/scripts/spamblacklistblock.js"); // [[User:Zzuuzz/spamblacklistblock.js]]
loadLocalJS("User:Writ Keeper/Scripts/massRevdel.js"); // [[User:Writ Keeper/Scripts/massRevdel.js]]
}
// loadLocalJS("User:Galobtter/scripts/adminhighlighter.js"); // [[User:Galobtter/scripts/adminhighlighter.js]]
loadLocalJS("User:Zzuuzz/scripts/badimagelist.js"); // [[User:Zzuuzz/scripts/badimagelist.js]]
loadLocalJS("User:Timotheus Canens/spihelper.js"); // [[User:Timotheus Canens/spihelper.js]]
// loadLocalJS("User:Writ Keeper/Scripts/sectionLinkShortener.js"); // [[User:Writ Keeper/Scripts/sectionLinkShortener.js]]
// navigation
mw.util.addPortletLink('p-navigation', '/wiki/Wikipedia:Administrator intervention against vandalism#Reports', 'AIV', 'n-linkaiv', 'Administrator intervention against vandalism');
mw.util.addPortletLink('p-navigation', '/wiki/Wikipedia:Requests for page protection#toc', 'RFPP', 'n-linkrfpp', 'Protection requests');
mw.util.addPortletLink('p-navigation', '/wiki/Wikipedia:Usernames for administrator attention#Bot-reported', 'Usernames', 'n-linkuaa', 'Usernames for administrator attention');
mw.util.addPortletLink('p-navigation', '/wiki/Category:Candidates for speedy deletion#Subcategories', 'Speedy', 'n-linkcsd', 'Candidates for speedy deletion');
mw.util.addPortletLink('p-navigation', '/wiki/Category:SPI cases awaiting a CheckUser', 'CU SPI', 'n-linkcuspi', 'SPI cases awaiting a CheckUser');
mw.util.addPortletLink('p-navigation', '/wiki/Category:Requests for checkuser', 'RFCU', 'n-linkrfcu', 'Requests for checkuser');
mw.util.addPortletLink('p-navigation', '/wiki/Special:PendingChanges', 'Pending', 'n-linkpc', 'Pending changes');
// special pages
if (mw.config.get('wgNamespaceNumber') === -1) {
// portals vary by skin
var myTopTab = null;
switch (mw.config.get('skin')) {
case 'vector':
myTopTab = 'p-namespaces';
break;
default:
myTopTab = 'p-cactions';
}
// Special page talk pages
// mw.util.addPortletLink( myTopTab, mw.config.get( 'wgScript' ) + '?title=Wikipedia talk:' + mw.config.get( 'wgPageName' ).split('/')[0], 'Special Talk', 'ca-specialtalk', 'Discussion about this special page (' + mw.config.get( 'wgPageName' ).split( '/' )[0] + ').' );
// mw.util.addPortletLink( myTopTab, mw.config.get( 'wgScript' ) + '?title=Wikipedia talk:' + mw.config.get( 'wgPageName' ).split('/')[0] + '&action=edit§ion=new', '+', 'ca-addsection', 'Start a new section on the discussion page for ' + mw.config.get( 'wgPageName' ).split( '/' )[0] + '.' );
// watchlist items
if ('Watchlist' === mw.config.get('wgCanonicalSpecialPageName')) {
mw.util.addPortletLink(myTopTab, '/wiki/Special:Log/newusers', 'New users', 'ca-newusers', 'New user log');
mw.util.addPortletLink(myTopTab, '/wiki/Special:AbuseFilter/history', 'Filter', 'ca-filterlog', 'Abuse filter');
mw.util.addPortletLink(myTopTab, '/wiki/Special:Log/spamblacklist', 'SBL Log', 'ca-sbllog', 'Spam Blacklist log');
if (mw.config.get('wgUserGroups').indexOf('checkuser') !== -1) {
mw.util.addPortletLink(myTopTab, '/wiki/Special:CheckUserLog', 'CU Log', 'ca-culog', 'CheckUser log');
mw.util.addPortletLink(myTopTab, 'https://checkuser.wikimedia.org/wiki/Special:RecentChanges', 'CUWiki', 'ca-cuwiki', 'Wikimedia Checkuser Wiki');
}
mw.util.addPortletLink(myTopTab, '/wiki/m:Special:Watchlist', 'Meta', 'ca-meta', 'Wikimedia Meta-Wiki');
mw.util.addPortletLink(myTopTab, '/wiki/c:Special:Watchlist', 'Commons', 'ca-commons', 'Wikimedia Commons');
}
}
});