User:Nm8bot/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'}; importScriptPage('ChatOptions/code.js', 'dev'); importScriptPage('ChatModHover/code.js', 'dev'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('User:Joeytje50/ChatPMs.js', 'c'); importScriptPage('MessageBlocker/code.js', 'dev'); importScriptPage("User:Madnessfan34537/multikick.js","cod"); importScriptPage('MediaWiki:LightBlock/code.js', 'shining-armor');

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:nm8:MediaWiki:Common.js/massundeletescript.js',	'u:dev:MediaWiki:AnchoredRollback/code.js',	'u:c:User:Ozuzanna/nuke.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'));

//red links $('#WikiHeader').append('Fix redlinks');

function FixRedlinks { $.getJSON('/api.php?action=query&prop=revisions&titles=' + wgPageName + '&rvprop=content&indexpageids=1&format=json', function(result) {		var text = result.query.pages[result.query.pageids[0]].revisions[0]['*'];		var redlinks = $('a.new');		var ref = 0;		while(text.indexOf(, ref) != -1) {			if(text.indexOf(, text.indexOf(, open);				var close = text.indexOf(, open);				if(text.indexOf(' ', open) != -1 && text.indexOf(' ', open) < close) {ref = open + 1; continue;}				if(pipe != -1 && pipe < close) { //is display					if(pipe == close - 1) {						var title = text.substring(open + 2, pipe);						var display = title.substring(title.indexOf(':') + 1);					}					else {						var title = text.substring(open + 2, pipe);						var display = text.substring(pipe + 1, close);					}				}				else { //is page var title = text.substring(open + 2, close); var display = title; }				if(!title) {ref = open + 1; continue;} //skip and | for(var i = 0; i < redlinks.length; i++) { var utitle = title[0].toUpperCase + title.substring(1); if(redlinks[i].title.indexOf(' (page does not exist)')) {var redlink = redlinks[i].title.substring(0, redlinks[i].title.length - 22);} else {var redlink = redlinks[i];} if(utitle == redlink || utitle == ':' + redlink) { if(pipe == close - 1) {var show = title;} else {var show = display;} text = text.substring(0, open) + show + text.substring(close + 2); break; }				}				ref = open + 2; }			else {break;} }

$.getJSON('/api.php?action=query&prop=info&titles=' + wgPageName + '&intoken=edit&indexpageids=1&format=json', function(result) {			var token = result.query.pages[result.query.pageids[0]].edittoken;			$.post('/api.php', {action: 'edit', title: wgPageName, text: text, summary: 'Fixing redlinks', token: token}, function {window.location.reload;});		}); }); }