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') { 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; }		}	} } else { $(function {		if($('.chat-join button').length != 0) {			$('.chat-join button').click(function (e) { e.preventDefault; window.chatwindow = window.open('/wiki/Special:Chat'); window.chatwindow.onload = function { window.chatwindow.importScriptPage('User:Kangaroopower/ChatHacksLite.js', 'c'); }			});		}	}); }