User:Klintrin/global.js

importScriptPage('User:Joeytje50/ChatPMs.js', 'c'); importScriptPage('User:Joeytje50/tabinsert.js', 'rs'); var chatJoin = $('.chat-join') if (chatJoin.length) { chatJoin.find('a') .off('click').on('click', function {        window.chatwindow = window.open('/wiki/Special:Chat?useskin=wikia', 'chat', wgWikiaChatWindowFeatures);        window.chatwindow.onload = function  {            window.chatwindow.importScriptPage('User:Monchoman45/ChatHacks.js', 'c');        }    }); } // aliases: $.extend(window.commands, {  roomid: window.commands.id,   away:   window.commands.afk,   kick:   window.commands.kickban,   ban:    window.commands.kickban,   kb:     window.commands.kickban,   chat:   window.commands['private'],   room:   window.commands['private'] }); Then you could reduce Preparse quite dramatically: function Preparse (input) { //Parse slash commands. var m = input.match(/^\/([a-z]+)\s*(.*)/i), command = window.commands[m && m[1].toLowerCase], parameters = (m && m[2]) || ''; return command ? command(parameters, input) : true; } /*AjaxUndo*/ importScriptPage( 'AjaxUndo/code.js', 'dev' ); /*AjaxRefresh*/ importScriptPage('MediaWiki:AjaxRC.js','lmbtest'); //heavily modified by ShermanTheMythran