User:Nerfmaster8/global.js

var fdButtons = []; fdButtons[fdButtons.length] = {'summary': 'vandalism', 'label': 'V'}; fdButtons[fdButtons.length] = {'summary': 'spam', 'label': 'S'}; fdButtons[fdButtons.length] = {'summary': 'Duplicate information', 'label': 'Dup'}; fdButtons[fdButtons.length] = {'summary': 'poor image', 'label': 'image'}; fdButtons[fdButtons.length] = {'summary': 'Disruptive', 'label': 'disrupt'}; fdButtons[fdButtons.length] = {'summary': 'Violation of the ToU', 'label': 'ToU'};

importArticles({	type: 'script',	articles: [	'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',	'u:dev:MediaWiki:MassBlock/code.js',	'u:dev:MediaWiki:MassProtect/code.js',	'u:dev:MediaWiki:MassCategorization/code.js',	'u:dev:MediaWiki:WHAM/code.2.js',	'u:dev:MediaWiki:QuickDelete/code.js',	'u:dev:MediaWiki:FastDelete/code.js',	'u:dev:MediaWiki:MassRename/code.js',	'u:dev:MediaWiki:MassRenameRevert/code.js',	'u:dev:MediaWiki:ListFiles/code.js',	'u:dev:MediaWiki:MarkForDeletion/code.js',	'u:dev:MediaWiki:DisplayClock/code.js',	'u:dev:MediaWiki:AjaxRC/code.js',	'u:dev:MediaWiki:AjaxUndo/code.js',	'u:dev:MediaWiki:ContribsLink/code.js',	'u:dev:MediaWiki:AnchoredRollback/code.js'	] });

// anti-spam $('head').append('#WikiaPage .Chat .message { word-wrap: break-word; } ');

/* Make Visual Editor links load the regular editor instead */ if ($.getUrlVar('veaction') == 'edit') { location.replace(document.URL.replace('veaction','action')); }

/* from User:Ozuzanna */ 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 range calculator and lookup link to Special:Block for IPs */ case "Block": if ($('.mw-ipb-conveniencelinks a').text.indexOf('Contributions for') === -1) { str = c.wgPageName.match(/((?:\d{1,3}\.){3}\d{1,3})/)[0]; $('.visualClear').before(' (lookup | range calc)'); }		$('#mw-input-wpHardBlock').attr('checked','checked'); break; /* Compile list of videos listed on Special:UnusedVideos and Special:UnusedFiles */ case "UnusedVideos": case "Unusedimages": $('.mw-spcontent p:first').after('Compile'); $('#btn-compile').click(function {			array = [];			$('.gallerytext').each(function { if (!/File missing/gi.test($(this).text)) array.push($(this).find('a').attr('title')); });			alert(array.sort.join('\n').trim);		}); break; /* Add IP lookup on anon contribs */ case "Contributions": if (c.wgTitle.split('.').length == 4) $('.masthead-info h2').html('(lookup)'); break;
 * (function($, mw) {

/* 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');

/* Always go to IP contributions, not userpage */ if (c.wgNamespaceNumber == 2 && c.wgTitle.split('.').length == 4) location.replace(articlePath + 'Special:Contributions/' + c.wgTitle);

/* 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); } }) (this.jQuery, this.mediaWiki);