User:Edward Nigma/global.js

importScriptPage('User:Joeytje50/ChatPMs.js', 'c'); importScriptPage('User:Joeytje50/tabinsert.js', 'rs'); importScriptPage('User:Seaside98/normal.js', 'c');

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

/* Sherm's Kicker */

var snap="disabled";function newAlert(text){for(var i in text.split('\n')){mainRoom.viewDiscussion.chatUL.append(''+text.split('\n')[i]+'');}mainRoom.viewDiscussion.scrollToBottom;};$('#Write textarea').keydown(function(e){if($('#Write textarea').val=="/snap"&&e.keyCode==13&&snap=="disabled"){$(this).unbind('keypress').val();if(mainRoom.userMain.attributes.avatarSrc.indexOf('3444778')>=0){newAlert('snap activated');snap="enabled";console.log('quickBan activated');$('.Chat img.avatar').live('dblclick',function(e){quickTarget=$(this).parent('li').attr('data-user');if(e.ctrlKey){mainRoom.socket.send(new models.BanCommand({userToBan:quickTarget,time:'7200',reason:'This user has been quickBanned by '+wgUserName}).xport);console.log(quickTarget+' has been successfully quickBanned');delete quickTarget;}else{mainRoom.socket.send(new models.KickCommand({userToKick:quickTarget}).xport);console.log(quickTarget+' has been successfully quickKicked');delete quickTarget;}});console.log('multiBan activated');var multiNum=0;var multiTarget=null;$('#Rail .public.wordmark').on('dblclick',function(e){multiCount=$('#Rail .User').size;if(multiNum<=multiCount){multiModel=new models.KickCommand({userToKick:multiTarget});multiTarget=$('#Rail .User').eq(multiNum).attr('data-user');mainRoom.socket.send(multiModel.xport);multiNum++;$('#Rail .public.wordmark').dblclick;}else{multiNum=0;multiTarget=null;}});console.log('sideStep activated');function toggleAway(msg){if(!msg){var msg=;}if($('#ChatHeader .User').hasClass('away')==true){mainRoom.setBack;}else {mainRoom.setAway(msg);}};toggleAway.back=function{if($('#ChatHeader .User').hasClass('away')==true){mainRoom.setBack;}};toggleAway.away=function(msg){if(!msg){var msg=;}if($('#ChatHeader .User').hasClass('away')==false){mainRoom.setAway(msg);}};$(window).unbind('mousemove');$('#Write img').on('dblclick',toggleAway);function hack{mainRoom.socket.send(new models.ChatEntry.xport);}$('#Write textarea').keydown(function(e){if($('#Write textarea').val=="/hack"&&e.keyCode==13){$(this).unbind('keypress').val();hack;}if($('#Write textarea').val=="/kick"&&e.keyCode==13){$(this).unbind('keypress').val('');$('#Rail .public.wordmark').dblclick;}});}else{newAlert('you are not authorized to activate this code');}}});