User:KnazO/global.js

/* Imports */ importArticles({	type: "script",	articles: [		'u:dev:AjaxBatchDelete/code.2.js',		'u:dev:AjaxUndo/code.js',		'u:dev:AjaxRC/code.js',		'u:dev:AjaxRedirect/code.js',		'u:dev:AnchoredRollback/code.js',		'u:dev:CacheCheck/code.js',		'u:dev:ContribsLink/code.js',		'u:dev:EditBio/code.js',		'u:dev:MassBlock/code.js',		'u:dev:MassCategorization/code.js',		'u:dev:MassNullEdit/code.js',		'u:dev:MassProtect/code.js',		'u:dev:MassUserRights/code.js',		'u:dev:MinorEditTimeout/code.js',		'u:dev:NoImageLightbox/code.js',		'u:dev:Nuke/code.js',		'u:dev:OldFilePages/code.js',		'u:dev:RedirectManagement/code.js',		'u:dev:Rollback/code.js',		'u:dev:ViewRemoved/code.js',		'u:dev:WHAM/code.2.js'	] });

/* Main */ mw.loader.using('mediawiki.util', function {	/* Cache Config */	var conf = mw.config.get( [ 'wgAction', 'wgCanonicalSpecialPageName', 'wgPageName', 'wgTitle', 'wgSiteName' ] ),	escapedPageName = encodeURIComponent(conf.wgPageName);	/* Remove obnoxious intrusive videos */	if ($('.featured-video-wrapper').length)		$('.featured-video-wrapper').remove;

/* Remove pointless document title text */ document.title = document.title.replace("| FANDOM powered by Wikia",""); /* Remove Help:Contents from user drop-down */ var helpLi = $('.wds-global-navigation__user-menu div:nth-child(2) ul li').length - 1; $('.wds-global-navigation__user-menu div:nth-child(2) ul li:nth-child(' + helpLi + ')').remove; /* Multi RC button */ if ($('#my-tools-menu').length) { $('#my-tools-menu').prepend(' List Dupe Files').prepend(' Multiple RC'); }	/* START Special page code */ switch (conf.wgCanonicalSpecialPageName) { case "Blankpage": /* START Blank page code */ switch ($.getUrlVar('blankspecial')) { /* Duplicate Files */ case "listdupefiles": document.title = 'Duplicate files | ' + conf.wgSiteName; $('.header-title h1').text('Duplicate files'); $('#mw-content-text').html(' '); importScriptPage('DupImageList/code.js', 'dev'); break; /* Multiple RC */ case "recentchangesmultiple": document.title = 'Multiple recent changes | ' + conf.wgSiteName; $('.page-header__title').text('Multiple recent changes'); $('#mw-content-text').html(' \						\							answers.wikia.com\							community.wikia.com\							dev.wikia.com\							oldschoolrunescape.wikia.com\						\					 '); importScriptPage('RecentChangesMultiple/code.2.js', 'dev'); break; }			/* END Blank page code */ break; /* IP lookup on contributions */ case "Contributions": var username = conf.wgTitle.split('/')[1]; if (mw.util.isIPv4Address(username) || mw.util.isIPv6Address(username)) $('.masthead-info h2').html('(lookup)</a>'); break; }	/* List all titles on UncategorizedFiles and similar pages */ if (conf.wgCanonicalSpecialPageName !== false && $('.gallerytext').length) { $('#mw-content-text').prepend('<textarea id="name-output" readonly="readonly" style="width:500px"/>'); var titles = []; $('.gallerytext a').each(function {			titles.push($(this).attr('title').trim);		}); $('#name-output').append(titles.sort.join('\n')); }	/* No redirect when moving files */ if (conf.wgPageName.indexOf("Special:MovePage/File:") != -1 && document.getElementById('wpLeaveRedirect').checked) $('#wpLeaveRedirect').removeAttr('checked'); /* END Special page code */ /* START Action related code */ /* Convert Visual Editor to Source Editor */ if ($.getUrlVar('veaction') == 'edit') location.replace(document.URL.replace('veaction','action')); /* END Action related code */ });