User:Kangaroopower/ChatHacksLite.js

/* * ChatHacks Lite. Basically Chathacks with a lot less stuff in it * So it works with the rest of my js and only has stuff I'll use. */

if(wgCanonicalSpecialPageName == 'Chat') { $.getScript('http://monchbox.wikia.com/wiki/MediaWiki:ChatSocket.js?action=raw&ctype=text/javascript', function {		document.getElementsByName('message')[0].onkeypress = function(e) {		if (e.which == 32) {			switch(this.value) {				case '/me':					this.value = '* '+wgUserName;					break;				case '/nc':					this.value = 'Nobody Cares';					break;				case '/id':					$('.Chat ul').append('ID: ' + this.roomId+'');					break;			}		}	}

var toggleAway = function { var myChat = new ChatSocket; if($('#ChatHeader .User').hasClass('away') == true) { myChat.socket.sendCommand('setstatus', '"statusState":"here","statusMessage":""'); }		else { myChat.socket.sendCommand('setstatus', '"statusState":"away","statusMessage":""'); }	}

var groupPM= function { var users = prompt('Enter comma seperated list of users to start a PM with',''), users = users.split(','); mainRoom.openPrivateChat(users); }	$(function {		$('#Write').append('AFKPM');		//Unbind all of the window listeners that set your status to back		$(window).unbind('mousemove').unbind('focus').unbind('keypress');	}); }); } else {	$(function { if($('.chat-join button').length != 0) { $('.chat-join button').replaceWith('' + $('.chat-join button').html + ''); clearInterval(window.chatcheck); $('#Chatlink').click(function {				window.chatwindow = window.open('/index.php?title=Special:Chat&useskin=wikia');				window.chatwindow.onload = function  {					window.chatwindow.importScriptURI('http://community.wikia.com/index.php?title=User:Kangaroopower/ChatHacksLite.js&action=raw&ctype=text/javascript');				}			}); }	}); }