User:Ozuzanna/global.js

/* Imports */ cacheSkip = []; cacheSkipLimit = 1000; importArticles({   type: "script",    articles: [        'u:dev:AjaxBatchDelete/code.js',        'u:dev:AjaxUndo/code.js',        'u:dev:AjaxRC/code.js',        'u:dev:CacheCheck/code.js',        'u:dev:CategoryRenameAuto-update/code.js',        'u:dev:NoImageLightbox/code.js',        'u:dev:NullEditButton/code.js',        'u:dev:OldFilePages/code.js'    ] });

/* Conditional import */ var ug = wgUserGroups.join(' '); if (mw.config.get("wgCanonicalSpecialPageName") === "Contributions" && (ug.indexOf('rollback') + ug.indexOf('sysop') > -2)) { importScriptPage('User:Ozuzanna/annihilate.js','community'); }

/* Create an edit link in Special:MovePage for easy redirecting */ if (mw.config.get('wgPageName').split('/')[0] === 'Special:MovePage') { var linkhref = $('fieldset').find('a').attr('href'); linkhref += '?action=edit'; var editLink = document.createElement('a'); editLink.setAttribute('href', linkhref); editLink.textContent = ' (edit)'; $('fieldset').find('a').after(editLink); }

/* Add quick link to IP location lookup for anon contributors */ if (mw.config.get("wgCanonicalSpecialPageName") === "Contributions" && ($('a:contains("Why create an account?")').length == 1)) { var linkhref = 'http://myip.ms/info/whois/'; linkhref += mw.config.get('wgPageName').split('/')[1]; var lookup = document.createElement('a'); lookup.setAttribute('href', linkhref); lookup.setAttribute('style', 'color:white'); lookup.textContent = '(lookup)'; $('.masthead-info').find('h2').html(lookup); }

/* Show abuse log entries in Special:Log/newusers */ if ("Special:Log/newusers".indexOf(mw.config.get(wgPageName)) !== -1) { $('li.mw-logline-newusers').each(function {     var str = $(this).children('a.new.mw-userlink').attr('href').substring(11);      var linkhref = '/wiki/Special:AbuseLog?wpSearchUser=';      linkhref += str;      var AbL = document.createElement('a');      AbL.setAttribute('href', linkhref);      AbL.textContent = ' (abuse log)';      $(this).append(AbL);   }); }

/* var specialpages = [ "Special:BrokenRedirects", "Special:DoubleRedirects", "Special:DeadendPages", "Special:BrokenRedirects", "Special:LonelyPages", "Special:UnusedFiles", "Special:UnusedTemplates" ]; if (specialpages.indexOf(mw.config.get(wgPageName)) !== -1) { $('#WikiaArticle').prepend(' '); if ("Special:UnusedFiles".indexOf(wgPageName) !== -1) { $('div.thumb img').each(function {       $('#output-box').append('File:'+$(this).attr('data-image-name')+'\n')}); } else { $('ol.special').find('li').each(function {       var text = $(this).find('a').first.text;        document.getElementById('output-box').value += text + '\n';}); } }
 * Display a list of text for certain special pages
 * Written by Shining-Armor
 * Added support for Special:UnusedFiles by Ozuzanna