User:Thundermare/global.js

/* Imports */ importArticles({	type: "script",	articles: [		'u:kocka:AjaxThreadDelete/code.js',       'u:answers:MediaWiki:Gadget-HotCat.js',		'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',		'u:dev:MediaWiki:AjaxDiff/code.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:MultiUpload/code.js',		'u:dev:MediaWiki:ExpandGlobalNavDropdownsOnHover/code.js',		'u:dev:MediaWiki:FileUsageAuto-update/code.js',		'u:dev:MediaWiki:GlobalEditcount/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) {	/* Create an edit link on Special:MovePage */		case "Movepage":		$('#mw-movepage-table').find('a').first.after(' (edit)');	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;	/* Dupe file list markup */	case "Blankpage":		if ($.getUrlVar('blankspecial') === 'listdupefiles') {			document.title = 'Duplicate Files';			$('#mw-content-text').html(' ');			importScriptPage('MediaWiki:DupImageList/code.js', 'dev');		}	break;	/* Add confirmation window when making users bureaucrats due to unable to undo */	case "Userrights":		var bcratBefore = $('#wpGroup-bureaucrat:checked').length;		$('input[name="saveusergroups"]').click(function(e) { if (!bcratBefore && $('#wpGroup-bureaucrat:checked').length) { e.preventDefault; $.showCustomModal('Confirm', 'You are making this user a bureaucrat. Please ensure this is what you intended before confirming, as it cannot be undone.', {					id: 'bureaucrat-confirm',					width: 660,					buttons: [{						message: 'Confirm',						defaultButton: true,						handler: function {							$('#mw-userrights-form2').submit;							$('#bureaucrat-confirm').closeModal;						}					},{		 						message: 'Cancel',						handler: function {							$('#bureaucrat-confirm').closeModal;						}					}]				}); }		});	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'); }
 * (function($, mw) {

/* Remove Help:Contents from dropdown thing */ 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] + '') );	}); } /* Auto-submit bugged pages for deletion */ if (c.wgAction == "delete" && $('#ca-edit').text.trim == "Create") $('#mw-img-deleteconfirm,#deleteconfirm').submit; /* Create dupe file list button */ if (c.skin === 'monobook') { mw.util.addPortletLink('p-tb', '/index.php?title=Special:BlankPage&blankspecial=listdupefiles', 'List Dupe Files', 't-ld'); } else { $('#my-tools-menu').prepend(' List Dupe Files'); } /* Untick minor edit box after 10 seconds when editing */ if (c.wgAction === 'edit' || c.wgAction === 'submit') { 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);