User:ObsoleteUser/chat.js

var snap = "disabled";

function inlineAlert(text) { mainRoom.model.chats.add(new models.InlineAlert({ text: (text) })); }; $('#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('4091019') >= 0) {            inlineAlert('snap activated');            snap = "enabled";            mainRoom.maxCharacterLimit = 10000;            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) { if(confirm('Kick everyone!?')){ 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;                }                if ($('#Write textarea').val == "/valentines" && e.keyCode == 13 && chatParty == true) {                    $(this).unbind('keypress').val();                    importScriptPage('MediaWiki:ChatParty.js/Valentines.js', 'lmbtest');                }                if ($('#Write textarea').val == "/pattys" && e.keyCode == 13 && chatParty == true) {                    $(this).unbind('keypress').val();                    importScriptPage('MediaWiki:ChatParty.js/Pattys.js', 'lmbtest'); }           });        } else {            inlineAlert('you are not authorized to activate this code');        }    } });