User:Ozank Cx/global.js

/* Configs */ OFPoptions = {'showlinks': false}; /* Imports */ importArticles({	type: "script",	articles: [		'u:answers:MediaWiki:Gadget-HotCat.js',		'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',		'u:dev:MediaWiki:AjaxUndo/code.js',		'u:dev:MediaWiki:AjaxRC/code.js',		'u:dev:MediaWiki:AjaxRedirect/code.js',		'u:dev:MediaWiki:AnchoredRollback/code.js',		'u:dev:MediaWiki:CacheCheck/code.js',		'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',		'u:dev:MediaWiki:CleanWantedFiles/code.js',		'u:dev:MediaWiki:ContribsLink/code.js',		'u:dev:MediaWiki:FileUsageAuto-update/code.js',		'u:dev:MediaWiki:MassBlock/code.js',		'u:dev:MediaWiki:MassCategorization/code.js',		'u:dev:MediaWiki:MassNullEdit/code.js',		'u:dev:MediaWiki:MassProtect/code.js',		'u:dev:MediaWiki:MassUserRights/code.js',		'u:dev:MediaWiki:NoImageLightbox/code.js',		'u:dev:MediaWiki:Nuke/code.js',		'u:dev:MediaWiki:OldFilePages/code.js',		'u:dev:MediaWiki:RelocateEditDiscussionButtons/code.js', 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:ViewRemoved/code.js', 'u:dev:MediaWiki:WHAM/code.2.js', 'u:ozank:MediaWiki:Chatconnect.js', 'u:runescape:MediaWiki:Common.js/spreport.js' ] }); var c = mw.config.get( [ 'wgAction', 'wgArticlePath', 'wgCanonicalNamespace', 'wgCanonicalSpecialPageName', 'wgNamespaceNumber', 'wgPageName', 'wgUserGroups', 'wgSiteName', 'skin', 'wgTitle' ] ), articlePath = c.wgArticlePath.slice(0,-2), escapedPage = encodeURIComponent(c.wgPageName), str, array = []; switch (c.wgCanonicalSpecialPageName) {	/* Add IP lookup on anon contribs */	case "Contributions":		if (c.wgTitle.split('.').length == 4)			$('.masthead-info h2').html('(lookup)');	break;	/* Add edit link to Special:WhatLinksHere listings */	case "Whatlinkshere":		$('#mw-whatlinkshere-list li').find('a:first').each(function { $(this).parent.find('a:last').before('edit | '); });	 	break;	/* Special:SearchDigest better functionality */	case "SearchDigest":		$('#mw-content-text ul li').each(function { if ($(this).find('a').attr('title').indexOf('(page does not exist)') === -1) $(this).remove; });	break;
 * (function($, mw) {

/* Make sure when using CheckUser on IPs, it always has users selected by default rather than edits */ case "CheckUser": if ($.getUrlVar('user').split('.').length == 4) $('#subipusers').attr('checked','checked'); break; } /* Unchecks redirects when moving files */ if (c.wgPageName.indexOf("Special:MovePage/File:") != -1) $('#wpLeaveRedirect').removeAttr('checked'); /* Show abuse log entries in Special:Log/newusers */ if ("Special:Log/newusers".indexOf(c.wgPageName) != -1) { $('.mw-logline-newusers').each(function {		$(this).find('.mw-usertoollinks').find('a:last').after(' | abuse');	}); } /* Revision Delete */ if (c.wgAction == 'revisiondelete' || c.wgCanonicalSpecialPageName == 'Revisiondelete') { $('#wpHidePrimary,#wpHideComment,#wpHideUser').attr('checked','checked'); $('#wpReason').val('spam'); } /* Make Visual Editor links load the regular editor instead */ if ($.getUrlVar('veaction') == 'edit') location.replace(document.URL.replace('veaction','action')); /* Add link to chatconnect per banned user for MLP chat ban log */ if ("Special:Log/chatban".indexOf(c.wgPageName) !== -1 && c.wgSiteName == "My Little Pony Friendship is Magic Wiki") { $('.mw-logline-chatban').each(function {		$(this).find('.mw-usertoollinks:last').find('a:last').after(' | connect');	}); } /* Remove Help:Contents from dropdown */ if ($('#globalNavigation').length) $('.user-menu.subnav li:nth-child(3),.hubs-entry-point').remove; /* Create toolbar links */ if ($('.toolbar > .tools').length) { $.each(["&allowuserjs=0|No User JS","&allowusercss=0|No User CSS","&useskin=monobook|Monobook",	"&usesitejs=0|No Site JS","&usesitecss=0|No Site CSS","&useskin=qqx|MediaWiki Sources"], function (i,v) {		$('.toolbar > .tools > li:last').after( $('').append('' + v.split("|")[1] + '') );	}); } /* Create dupe file list button */ if ($('#my-tools-menu').length) $('#my-tools-menu').prepend(' List Dupe Files'); /* Untick minor edit box after 10 seconds when editing */ if (["edit","submit"].indexOf(c.wgAction) != -1) { setTimeout(function {		if ($('#wpMinoredit').attr('Checked')) 			$('#wpMinoredit').removeAttr('checked');	}, 10000); } /* Add "show most recent" notice to message notifications when not on the same wiki */ if ($('#WikiaNotifications li div[data-type="1"]').length && $('#WikiaNotifications li div[data-type="1"] a:last').attr('href').slice(0,6) != "/wiki/") $('#WikiaNotifications li div[data-type="1"]').append(' (show most recent)'); }) (this.jQuery, this.mediaWiki);