MediaWiki:LMBWChat.js

/* Chat Options - Dev */ importScriptPage('ChatOptions/code.js', 'dev'); importScriptPage('MediaWiki:API.js','lmbtest');

importScriptPage('MediaWiki:ChatParty.js','lmbtest');

/* Chat Skins - by Seaside98 */ importScriptPage('MediaWiki:ChatSkins.js','lmbtest');

/*function sendMessage{inputValue=$('#Write textarea').val;if(inputValue!=){mainRoom.socket.send(new models.ChatEntry({roomId:this.roomId,name:wgUserName,text:inputValue}).xport);$('#Write textarea').val();$('#Write input[type="submit"]').attr('enabled','enabled');console.log('Message sent!');};};$('#Write input[type="submit"]').show.attr({'value':'Send','enabled':'enabled'}).on('click',sendMessage);$('#Write textarea').keyup(function{if($('#Write textarea').val.length==0){$('#Write input[type="submit"]').attr('enabled','enabled');}else{$('#Write input[type="submit"]').removeAttr('enabled');};});*/

/* Word Filter for Wikia chat - Written by Drew1200. */ window.outputWarning = ''; window.badWords = ["test1", "test2", "bfd", "omfg", "penis", "fuck", "shit", "bastard", "bitch", "faggot", "fag", "nigger", "dickface", "whore", "cunt", "wtf", "stfu", "piss", "boobs", "tits", "damn", "masturbate", "slut", "lmao"]; $('#Write textarea').keydown(function(e) {   if(e.keyCode == 13 && wordFilter === true && mainRoom.active === true) {      for(var i = 0; i < window.badWords.length; i++) {        window.outputWarning = $('#Write textarea').val;      }      $("div.Chat>ul").append("WARNING: The message you just posted contains words marked as inappropriate. Are you sure you want to send this message? ~  ~ Yes or Cancel  ");      $(this).unbind('keypress').val('');    } })

function ignoreWarning { postMessage(window.outputWarning); $("#temporary").remove; }

function endMessage { $('#temporary').remove; }

function wordFilter { for(var i = 0; i < window.badWords.length; i++) { if($('#Write textarea').val.toLowerCase.indexOf(window.badWords[i]) !== -1) { return true; } } }

/* Developer Chat Tools - Written by Drew1200. */ $('#Write textarea').keydown(function(e) { if(e.keyCode == 13 && $('#Write textarea').val.indexOf("./") !== -1)  {    var output = $ ('#Write textarea').val.replace(/.\//, "");    var hacks = false;    switch(output) {      case "hacks":        if(hacks === false) {          importScriptPage("User:Monchoman45/ChatHacks.js", "c");          hacks = true;        }        break;      case "help":        inlineAlert("~help~");        break;      case "log":        console.log("log");        if(hacks === false) {          importScriptPage('User:Monchoman45/ChatHacks.js', 'c');          hacks = true;        }        importScriptPage('User:Joeytje50/ChatLogger.js', 'runescape');      default:        eval(output);        break;    }    $(this).unbind('keypress').val('');  } }); console.log("Developer Tools initiated successfully.");