User:Toji-san/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CodeQuickLinks/code.js',    ] });

window.customCodeQuickLinks= { replaceAllDefaultLinks: true, linkSet: { siteFiles: [ {               name: "JSPages", href: "/wiki/Special:JSPages" },           {                name: "ImportJS", href: "/wiki/MediaWiki:ImportJS" }       ],        userFiles: [ {               name: "Global.js", href: "//c.wikia.com/wiki/Special:MyPage/global.js" },           {                name: "Global.css", href: "//c.wikia.com/wiki/Special:MyPage/global.css" }       ]    } };

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MultiUpload/code.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:UTCClock/code.js',    ] });

// Display 12 hour time followed by day, month (English, full name) // and year with "(UTC)" at the end window.DisplayClockJS = '%2I:%2M:%2S %p %2d %{January;February;March;April;May;June;July;August;September;October;November;December}m %Y (UTC)';

var MultiUploadoption = { max: 50 };

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:FindAndReplace/code.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:QuickLogs/code.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:RevealAnonIP/usercode.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:QuickCreate.js',    ] });

window.cvGlobalMatching = 'unchecked'; // Global matching, checked by default. window.cvCaseSensitive = 'checked';   // Case sensitive, unchecked by default. window.cvEnableRegex   = 'checked';   // Regular expression, unchecked by default.

$('#my-tools-menu').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: 'Housekeeping: Fixing redlinks', token: token}, function {window.location.reload;});                    }); });   }

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PortableCSSPad/code.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MassRedirect/code.2.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:Standard Edit Summary/code.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:WHAM/code.2.js',    ] });

/* AjaxBatchDelete */ window.batchDeleteDelay = 100; /* Enable MassCategorization for Content Moderators */ window.MassCategorizationGroups = [ 'bot', 'content-moderator', 'sysop' ]; /* MassRename */ massRenameSummary = 'automatic'; /* Imports */ importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxBatchDelete.js',        'u:dev:MediaWiki:AjaxCommentDelete/code.js',        'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',        'u:dev:MediaWiki:FileUsageAuto-update/code.js',        'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:MediaWiki:MassEdit/code.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        'u:dev:MediaWiki:MassProtect/code.js',        'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:PageRenameAuto-update/code.js'    ] });