MediaWiki talk:Chat.js

/* * ChatHacks.js, by Monchoman45. * Version 7.0 *  * Features: *  Ability to clear your chat window *  A host of slash commands *  Ability to create multi user private chats *  Inline alerts every time your away status changes *  Icons next to messages by staff and chat mods in the room *  Pings when someone mentions your name or any other specified phrases */ if ( wgCanonicalSpecialPageName == 'Chat' ) { window.hasFocus = true ; window.dinged = false ; window.ding <span class="sy0" style="color:rgb(51,153,51);">= <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">; window.<span class="me1" style="color:rgb(38,139,210);">titleorig <span class="sy0" style="color:rgb(51,153,51);">= document.<span class="me1" style="color:rgb(38,139,210);">title <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">Unding <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//for fixing the title after you've been dinged document.<span class="me1" style="color:rgb(38,139,210);">getElementsByTagName <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">innerHTML <span class="sy0" style="color:rgb(51,153,51);">= window.<span class="me1" style="color:rgb(38,139,210);">titleorig <span class="sy0" style="color:rgb(51,153,51);">; clearInterval<span class="br0" style="color:rgb(0,153,0);">( window.<span class="me1" style="color:rgb(38,139,210);">ding <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; window.<span class="me1" style="color:rgb(38,139,210);">dinged <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( window<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">bind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'focus' <span class="sy0" style="color:rgb(51,153,51);">, Unding<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( window<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">bind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'focus' <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ window.<span class="me1" style="color:rgb(38,139,210);">hasFocus <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( window<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">bind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'blur' <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ window.<span class="me1" style="color:rgb(38,139,210);">hasFocus <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Function for adding messages to the window NodeChatDiscussion.prototype.<span class="me1" style="color:rgb(38,139,210);">iconPing <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( chat<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var icon <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">models <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">models <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">attributes .<span class="me1" style="color:rgb(38,139,210);">name <span class="sy0" style="color:rgb(51,153,51);">== chat.<span class="me1" style="color:rgb(38,139,210);">attributes .<span class="me1" style="color:rgb(38,139,210);">name <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">models <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">attributes .<span class="me1" style="color:rgb(38,139,210);">isStaff <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ icon <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">' <img class="stafficon" src="http://images2.wikia.nocookie.net/monchbox/images/f/f3/Icon-staff.png">' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">models <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">attributes .<span class="me1" style="color:rgb(38,139,210);">isModerator <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ icon <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">' <img class="modicon" src="http://images2.wikia.nocookie.net/monchbox/images/6/6b/Icon-chatmod.png">' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">break <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( icon<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">last <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.username' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">html <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">last <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.username' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">html <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ icon<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( mainRoom.<span class="me1" style="color:rgb(38,139,210);">isInitialized <span class="sy0" style="color:rgb(51,153,51);">&& chat.<span class="me1" style="color:rgb(38,139,210);">attributes .<span class="me1" style="color:rgb(38,139,210);">name <span class="sy0" style="color:rgb(51,153,51);">!= wgUserName <span class="sy0" style="color:rgb(51,153,51);">&& <span class="sy0" style="color:rgb(51,153,51);">! chat.<span class="me1" style="color:rgb(38,139,210);">attributes .<span class="me1" style="color:rgb(38,139,210);">isInlineAlert <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ window.<span class="me1" style="color:rgb(38,139,210);">dinged <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//resolve HTML <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var text <span class="sy0" style="color:rgb(51,153,51);">= chat.<span class="me1" style="color:rgb(38,139,210);">attributes .<span class="me1" style="color:rgb(38,139,210);">text <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var pings <span class="sy0" style="color:rgb(51,153,51);">= document.<span class="me1" style="color:rgb(38,139,210);">getElementById <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'pings' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">value .<span class="me1" style="color:rgb(38,139,210);">removeTrailing <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="sy0" style="color:rgb(51,153,51);">= <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">< pings.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">; i<span class="sy0" style="color:rgb(51,153,51);">++ <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( text.<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( pings<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">!= <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">|| this <span class="sy0" style="color:rgb(51,153,51);">!= mainRoom.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! window.<span class="me1" style="color:rgb(38,139,210);">hasFocus <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Only annoy people if the window isn't focused document.<span class="me1" style="color:rgb(38,139,210);">getElementById <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'sound' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">innerHTML <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'<audio src="http://images.wikia.com/monchbox/images/0/01/Beep-sound.ogg" autoplay=""> ' <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! window.<span class="me1" style="color:rgb(38,139,210);">dinged <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ window.<span class="me1" style="color:rgb(38,139,210);">ding <span class="sy0" style="color:rgb(51,153,51);">= setInterval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'FlashTitle' <span class="sy0" style="color:rgb(51,153,51);">, <span class="nu0" style="color:rgb(211,54,130);">500 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">scrollToBottom <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this <span class="sy0" style="color:rgb(51,153,51);">== mainRoom.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var ref <span class="sy0" style="color:rgb(51,153,51);">= text.<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( pings<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var phrase <span class="sy0" style="color:rgb(51,153,51);">= text.<span class="me1" style="color:rgb(38,139,210);">slice <span class="br0" style="color:rgb(0,153,0);">( ref<span class="sy0" style="color:rgb(51,153,51);">, ref <span class="sy0" style="color:rgb(51,153,51);">+ pings<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">last <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.message' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">addClass <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'ping' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">break <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Kill emoticons this.<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">last <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">children <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.message img' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">each <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">outerHTML <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'<span onclick="this.outerHTML = decodeURIComponent(<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\' ' <span class="sy0" style="color:rgb(51,153,51);">+ encodeURIComponent<span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">outerHTML <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\' );" style="color:blue; cursor:pointer;" title="' <span class="sy0" style="color:rgb(51,153,51);">+ i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'emote' <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'">' <span class="sy0" style="color:rgb(51,153,51);">+ this.<span class="me1" style="color:rgb(38,139,210);">title <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">' ' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} mainRoom.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">bind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'afteradd' <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ .<span class="me1" style="color:rgb(38,139,210);">proxy <span class="br0" style="color:rgb(0,153,0);">( mainRoom.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">iconPing <span class="sy0" style="color:rgb(51,153,51);">, mainRoom.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Away status functions NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">setAway <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( msg<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! msg<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var msg <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">log <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"Attempting to go away with message: " <span class="sy0" style="color:rgb(51,153,51);">+ msg<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var setStatusCommand <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">SetStatusCommand <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ 			statusState<span class="sy0" style="color:rgb(51,153,51);">: STATUS_STATE_AWAY<span class="sy0" style="color:rgb(51,153,51);">,  			statusMessage<span class="sy0" style="color:rgb(51,153,51);">: msg 		<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'away' <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( setStatusCommand.<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">setBack <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! this.<span class="me1" style="color:rgb(38,139,210);">comingBackFromAway <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// if we have sent this command (but just haven't finished coming back yet), don't keep spamming the server w/this command <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">log <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"Telling the server that I'm back." <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">comingBackFromAway <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var setStatusCommand <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">SetStatusCommand <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ 				statusState<span class="sy0" style="color:rgb(51,153,51);">: STATUS_STATE_PRESENT<span class="sy0" style="color:rgb(51,153,51);">,  				statusMessage<span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">''  			<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'back' <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( setStatusCommand.<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Send message function NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">sendMessage <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( event<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! this.<span class="me1" style="color:rgb(38,139,210);">active <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( event.<span class="me1" style="color:rgb(38,139,210);">which <span class="sy0" style="color:rgb(51,153,51);">== <span class="nu0" style="color:rgb(211,54,130);">13 <span class="sy0" style="color:rgb(51,153,51);">&& <span class="sy0" style="color:rgb(51,153,51);">! event.<span class="me1" style="color:rgb(38,139,210);">shiftKey <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ event.<span class="me1" style="color:rgb(38,139,210);">preventDefault <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; mainRoom.<span class="me1" style="color:rgb(38,139,210);">resetActivityTimer <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var inputField <span class="sy0" style="color:rgb(51,153,51);">= this.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">getTextInput <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var send <span class="sy0" style="color:rgb(51,153,51);">= Preparse.<span class="me1" style="color:rgb(38,139,210);">call <span class="br0" style="color:rgb(0,153,0);">( this<span class="sy0" style="color:rgb(51,153,51);">, inputField.<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( inputField.<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">&& send<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var chatEntry <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">ChatEntry <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ roomId<span class="sy0" style="color:rgb(51,153,51);">: this.<span class="me1" style="color:rgb(38,139,210);">roomId <span class="sy0" style="color:rgb(51,153,51);">, name<span class="sy0" style="color:rgb(51,153,51);">: wgUserName<span class="sy0" style="color:rgb(51,153,51);">, text<span class="sy0" style="color:rgb(51,153,51);">: inputField.<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">isPrivate <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//is prive <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">afterInitQueue .<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">< <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">|| this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">< <span class="nu0" style="color:rgb(211,54,130);">2 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">mainController .<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">privateRoom .<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! this.<span class="me1" style="color:rgb(38,139,210);">isInitialized <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">afterInitQueue .<span class="me1" style="color:rgb(38,139,210);">push <span class="br0" style="color:rgb(0,153,0);">( chatEntry.<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//temp chat entry in case of slow connection time chatEntry.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">set <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ temp <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">, avatarSrc<span class="sy0" style="color:rgb(51,153,51);">: wgAvatarUrl <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">add <span class="br0" style="color:rgb(0,153,0);">( chatEntry<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( chatEntry.<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( chatEntry.<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} event.<span class="me1" style="color:rgb(38,139,210);">preventDefault <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} inputField.<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">log <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'submitting form' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; inputField.<span class="me1" style="color:rgb(38,139,210);">focus <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} mainRoom.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">unbind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'sendMessage' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; mainRoom.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">bind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'sendMessage' <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ .<span class="me1" style="color:rgb(38,139,210);">proxy <span class="br0" style="color:rgb(0,153,0);">( mainRoom.<span class="me1" style="color:rgb(38,139,210);">sendMessage <span class="sy0" style="color:rgb(51,153,51);">, mainRoom<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Functions that have to be changed for interwiki chat NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">openPrivateRoom <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( users<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ users.<span class="me1" style="color:rgb(38,139,210);">push <span class="br0" style="color:rgb(0,153,0);">( wgUserName <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ .<span class="me1" style="color:rgb(38,139,210);">ajax <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ 			type<span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'POST' <span class="sy0" style="color:rgb(51,153,51);">,  			url<span class="sy0" style="color:rgb(51,153,51);">: wgScript <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'?action=ajax&rs=ChatAjax&method=getPrivateRoomID' <span class="sy0" style="color:rgb(51,153,51);">,  			data<span class="sy0" style="color:rgb(51,153,51);">: <span class="br0" style="color:rgb(0,153,0);">{  				users <span class="sy0" style="color:rgb(51,153,51);">: users.<span class="me1" style="color:rgb(38,139,210);">join <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">',' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, success<span class="sy0" style="color:rgb(51,153,51);">: <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ .<span class="me1" style="color:rgb(38,139,210);">proxy <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( data<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ 				<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">log <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"Attempting create private room with users " <span class="sy0" style="color:rgb(51,153,51);">+ users.<span class="me1" style="color:rgb(38,139,210);">join <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">',' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var data <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">OpenPrivateRoom <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ roomId<span class="sy0" style="color:rgb(51,153,51);">: data.<span class="me1" style="color:rgb(38,139,210);">id <span class="sy0" style="color:rgb(51,153,51);">, users<span class="sy0" style="color:rgb(51,153,51);">: users<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">baseOpenPrivateRoom <span class="br0" style="color:rgb(0,153,0);">( data<span class="sy0" style="color:rgb(51,153,51);">, <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">showRoom <span class="br0" style="color:rgb(0,153,0);">( data.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'roomId' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ data.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'roomId' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">isPrivate <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ data.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'roomId' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">init <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//this.socket.send(data.xport); <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, this<span class="br0" style="color:rgb(0,153,0);">) 		<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">viewUsers .<span class="me1" style="color:rgb(38,139,210);">hideMenu <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} NodeRoomController.prototype.<span class="me1" style="color:rgb(38,139,210);">onJoin <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( message<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var joinedUser <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">User <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; joinedUser.<span class="me1" style="color:rgb(38,139,210);">mport <span class="br0" style="color:rgb(0,153,0);">( message.<span class="me1" style="color:rgb(38,139,210);">joinData <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var connectedUser <span class="sy0" style="color:rgb(51,153,51);">= this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">findByName <span class="br0" style="color:rgb(0,153,0);">( joinedUser.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'name' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof connectedUser <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">"undefined" <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">add <span class="br0" style="color:rgb(0,153,0);">( joinedUser<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">fire <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'afterJoin' <span class="sy0" style="color:rgb(51,153,51);">, joinedUser<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//TODO: move it to other class <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! this.<span class="me1" style="color:rgb(38,139,210);">isPrivate <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// Create the inline-alert (on client side so that we only display it if the user actually IS new to the room and not just disconnecting/reconnecting). <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var newChatEntry <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">InlineAlert <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ text<span class="sy0" style="color:rgb(51,153,51);">: <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ .<span class="me1" style="color:rgb(38,139,210);">msg <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'chat-user-joined' <span class="sy0" style="color:rgb(51,153,51);">, <span class="br0" style="color:rgb(0,153,0);">[ joinedUser.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'name' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">add <span class="br0" style="color:rgb(0,153,0);">( newChatEntry<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">disableRoom <span class="br0" style="color:rgb(0,153,0);">( joinedUser<span class="sy0" style="color:rgb(51,153,51);">, <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">// The user is already in the room... just update them (in case they have changed). this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">remove <span class="br0" style="color:rgb(0,153,0);">( connectedUser<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">add <span class="br0" style="color:rgb(0,153,0);">( joinedUser<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} NodeRoomController.prototype.<span class="me1" style="color:rgb(38,139,210);">onPart <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( message<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var partedUser <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">User <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; partedUser.<span class="me1" style="color:rgb(38,139,210);">mport <span class="br0" style="color:rgb(0,153,0);">( message.<span class="me1" style="color:rgb(38,139,210);">data <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var connectedUser <span class="sy0" style="color:rgb(51,153,51);">= this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">findByName <span class="br0" style="color:rgb(0,153,0);">( partedUser.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'name' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof connectedUser <span class="sy0" style="color:rgb(51,153,51);">!= <span class="st0" style="color:rgb(42,161,152);">"undefined" <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//TODO: move it to other class <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! this.<span class="me1" style="color:rgb(38,139,210);">isPrivate <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var newChatEntry <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">InlineAlert <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ text<span class="sy0" style="color:rgb(51,153,51);">: <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ .<span class="me1" style="color:rgb(38,139,210);">msg <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'chat-user-parted' <span class="sy0" style="color:rgb(51,153,51);">, <span class="br0" style="color:rgb(0,153,0);">[ connectedUser.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'name' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">add <span class="br0" style="color:rgb(0,153,0);">( newChatEntry<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">users .<span class="me1" style="color:rgb(38,139,210);">remove <span class="br0" style="color:rgb(0,153,0);">( connectedUser<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">disableRoom <span class="br0" style="color:rgb(0,153,0);">( connectedUser<span class="sy0" style="color:rgb(51,153,51);">, <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} NodeRoomController.prototype.<span class="me1" style="color:rgb(38,139,210);">disableRoom <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( user<span class="sy0" style="color:rgb(51,153,51);">, flag<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">isPrivate <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//TODO: fix it for multiuser priv chat <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var privateUser <span class="sy0" style="color:rgb(51,153,51);">= this.<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">privateUsers .<span class="me1" style="color:rgb(38,139,210);">findByName <span class="br0" style="color:rgb(0,153,0);">( user.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'name' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof privateUser <span class="sy0" style="color:rgb(51,153,51);">!= <span class="st0" style="color:rgb(42,161,152);">"undefined" <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var roomId <span class="sy0" style="color:rgb(51,153,51);">= privateUser.<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">get <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'roomId' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ roomId<span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">!= <span class="st0" style="color:rgb(42,161,152);">"undefined" <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ roomId<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">room .<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">set <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ 						<span class="st0" style="color:rgb(42,161,152);">'blockedMessageInput' <span class="sy0" style="color:rgb(51,153,51);">: flag 					<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//try to reconnect <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( flag <span class="sy0" style="color:rgb(51,153,51);">=== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="sy0" style="color:rgb(51,153,51);">&& this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ roomId<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">> <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ roomId<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">model .<span class="me1" style="color:rgb(38,139,210);">privateRoom .<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">showRoom <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( roomId<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">log <span class="br0" style="color:rgb(0,153,0);">( roomId<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( this.<span class="me1" style="color:rgb(38,139,210);">activeRoom <span class="sy0" style="color:rgb(51,153,51);">== roomId <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">activeRoom <span class="sy0" style="color:rgb(51,153,51);">= roomId<span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( roomId <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'main' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">main .<span class="me1" style="color:rgb(38,139,210);">setActive <span class="br0" style="color:rgb(0,153,0);">( <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">main .<span class="me1" style="color:rgb(38,139,210);">setActive <span class="br0" style="color:rgb(0,153,0);">( <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( i <span class="sy0" style="color:rgb(51,153,51);">== roomId<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">setActive <span class="br0" style="color:rgb(0,153,0);">( <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">setActive <span class="br0" style="color:rgb(0,153,0);">( <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">opens <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( i <span class="sy0" style="color:rgb(51,153,51);">== roomId<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">opens <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">setActive <span class="br0" style="color:rgb(0,153,0);">( <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">opens <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">setActive <span class="br0" style="color:rgb(0,153,0);">( <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">openPublicRoom <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( roomId<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">opens <span class="br0" style="color:rgb(0,153,0);">[ roomId<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new NodeRoomController<span class="br0" style="color:rgb(0,153,0);">( roomId<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">opens <span class="br0" style="color:rgb(0,153,0);">[ roomId<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">mainController <span class="sy0" style="color:rgb(51,153,51);">= this<span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//set main controller for this chat room this.<span class="me1" style="color:rgb(38,139,210);">showRoom <span class="br0" style="color:rgb(0,153,0);">( roomId<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">opens <span class="br0" style="color:rgb(0,153,0);">[ roomId<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">init <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="coMULTI" style="font-style:italic;color:rgb(147,161,161);">/*//For interwiki chatting, a merger of NodeRoomController's private management functions, and NodeChatController's public management functions. NodeInterwikiController = $.createClass(NodeRoomController, { 		constructor: function (roomId) { 			NodeInterwikiController.superclass.constructor.apply(this,arguments); 			this.socket.bind('updateUser', $.proxy(this.onUpdateUser, this)); //Check 			this.bind('afterJoin', $.proxy(this.afterJoin, this)); 			this.viewUsers = new NodeChatUsers({model: this.model, el: $('body')}); 			this.viewUsers.bind('showPrivateMessage', $.proxy(this.privateMessage, this) ); 			this.viewUsers.bind('kickBan', $.proxy(this.kickBan, this) ); 			this.viewUsers.bind('giveChatMod', $.proxy(this.giveChatMod, this) ); 			this.viewUsers.bind('blockPrivateMessage', $.proxy(this.blockPrivate, this) ); //Check 			this.viewUsers.bind('allowPrivateMessage', $.proxy(this.allowPrivate, this) ); //Check 			this.viewUsers.bind('mainListClick', $.proxy(this.mainListClick, this) ); //Check 			this.viewUsers.bind('privateListClick', $.proxy(this.privateListClick, this) ); //Check this.viewUsers.bind('clickAnchor', $.proxy(this.clickAnchor, this) ); //Check this.viewUsers.render; this.viewDiscussion.show; return this; } 	});*/ 	NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{  		<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">append <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<li class="inline-alert">' <span class="sy0" style="color:rgb(51,153,51);">+ text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'</li>' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">scrollToBottom <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">FlashTitle <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( document.<span class="me1" style="color:rgb(38,139,210);">getElementsByTagName <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">innerHTML <span class="sy0" style="color:rgb(51,153,51);">== window.<span class="me1" style="color:rgb(38,139,210);">titleorig <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ document.<span class="me1" style="color:rgb(38,139,210);">getElementsByTagName <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">innerHTML <span class="sy0" style="color:rgb(51,153,51);">= i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'activity' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, wgSiteName<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ document.<span class="me1" style="color:rgb(38,139,210);">getElementsByTagName <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'title' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">innerHTML <span class="sy0" style="color:rgb(51,153,51);">= window.<span class="me1" style="color:rgb(38,139,210);">titleorig <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">Preparse <span class="br0" style="color:rgb(0,153,0);">( input<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Parse slash commands. <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( input.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'/' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var com <span class="sy0" style="color:rgb(51,153,51);">= input.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">= com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var ref <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'.' <span class="sy0" style="color:rgb(51,153,51);">+ com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( window.<span class="me1" style="color:rgb(38,139,210);">commands <span class="br0" style="color:rgb(0,153,0);">[ com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">undefined <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">while <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">!= <span class="st0" style="color:rgb(42,161,152);">'function' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'string' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ ref <span class="sy0" style="color:rgb(51,153,51);">= ref.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, ref.<span class="me1" style="color:rgb(38,139,210);">lastIndexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'.' <span class="sy0" style="color:rgb(51,153,51);">+ eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">continue <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'object' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) .<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">default <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'function' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) .<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">default .<span class="me1" style="color:rgb(38,139,210);">call <span class="br0" style="color:rgb(0,153,0);">( this<span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">, chat<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ ref <span class="sy0" style="color:rgb(51,153,51);">+= <span class="st0" style="color:rgb(42,161,152);">'.' <span class="sy0" style="color:rgb(51,153,51);">+ com<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) .<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">default <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ ref <span class="sy0" style="color:rgb(51,153,51);">+= <span class="st0" style="color:rgb(42,161,152);">'.default' <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'function' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">break <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} com <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">slice <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, com.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">continue <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'undefined' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} com <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">slice <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, com.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">call <span class="br0" style="color:rgb(0,153,0);">( this<span class="sy0" style="color:rgb(51,153,51);">, com.<span class="me1" style="color:rgb(38,139,210);">join <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">, input<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} window.<span class="me1" style="color:rgb(38,139,210);">commands <span class="sy0" style="color:rgb(51,153,51);">= <span class="br0" style="color:rgb(0,153,0);">{ <span class="st0" style="color:rgb(42,161,152);">'away' <span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'afk' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'afk' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#ChatHeader .User' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">hasClass <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'away' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ toggleAway<span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//if you're away, hitting enter has already sent you back <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'clear' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Clear the active chat window this.<span class="me1" style="color:rgb(38,139,210);">clearWindow <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'nc' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Nobody cares <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#Write [name="message"]' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);"> <span class="sy0" style="color:rgb(51,153,51);">+ <span class="br0" style="color:rgb(0,153,0);">( com <span class="sy0" style="color:rgb(51,153,51);">? com <span class="sy0" style="color:rgb(51,153,51);">: i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'nobodycares' <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);"> <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'devoice' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//IRCpwnt <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#Write [name="message"]' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'* ChanServ set channel mode -v ' <span class="sy0" style="color:rgb(51,153,51);">+ <span class="br0" style="color:rgb(0,153,0);">( com <span class="sy0" style="color:rgb(51,153,51);">? com <span class="sy0" style="color:rgb(51,153,51);">: wgUserName<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'coppa' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Too young <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#Write [name="message"]' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'http://coppa.org ' <span class="sy0" style="color:rgb(51,153,51);">+ com<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#Write [name="message"]' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'http://coppa.org ' <span class="sy0" style="color:rgb(51,153,51);">+ i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'coppa' <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'silence' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Idle <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#Write [name="message"]' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">val <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'People idle, enjoy the silence. http://www.youtube.com/watch?v=diT3FvDHMyo' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'kick' <span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'kickban' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'ban' <span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'kickban' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'kb' <span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'kickban' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'kickban' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Kickban a user <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var mod <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">KickBanCommand <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ userToBan<span class="sy0" style="color:rgb(51,153,51);">: com<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( mod.<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'erruser' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'unban' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Unban a user <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ api.<span class="me1" style="color:rgb(38,139,210);">newQuery <span class="br0" style="color:rgb(0,153,0);">( POST<span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'action=userrights&user=' <span class="sy0" style="color:rgb(51,153,51);">+ com <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'&remove=bannedfromchat' <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( result<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ 					<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( result.<span class="me1" style="color:rgb(38,139,210);">userrights .<span class="me1" style="color:rgb(38,139,210);">removed <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'bannedfromchat' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'unbanned' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'notbanned' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; 				api.<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">;  			<span class="br0" style="color:rgb(0,153,0);">}  			<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'erruser' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'mod' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Make a user a mod <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var giveChatModCommand <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new models.<span class="me1" style="color:rgb(38,139,210);">GiveChatModCommand <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ userToPromote<span class="sy0" style="color:rgb(51,153,51);">: com<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">socket .<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( giveChatModCommand.<span class="me1" style="color:rgb(38,139,210);">xport <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'erruser' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'demod' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Remove a user's mod right <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ api.<span class="me1" style="color:rgb(38,139,210);">newQuery <span class="br0" style="color:rgb(0,153,0);">( POST<span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'action=userrights&user=' <span class="sy0" style="color:rgb(51,153,51);">+ com <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'&remove=chatmoderator' <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( result<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ 					<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( result.<span class="me1" style="color:rgb(38,139,210);">userrights .<span class="me1" style="color:rgb(38,139,210);">removed <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'chatmoderator' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'demodded' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'notmod' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; 				api.<span class="me1" style="color:rgb(38,139,210);">send <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">;  			<span class="br0" style="color:rgb(0,153,0);">}  			<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'erruser' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'block' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Block a user from private chatting you <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">blockPrivate <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ name<span class="sy0" style="color:rgb(51,153,51);">: com<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'erruser' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'unblock' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Unblock a user from private chatting you - should merge this into a toggle <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">allowPrivate <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">{ name<span class="sy0" style="color:rgb(51,153,51);">: com<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'erruser' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'chat' <span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'private' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'room' <span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'private' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'private' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Invoke a private room <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var arr <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in arr<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ array<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">= arr<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">removeTrailing <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} mainRoom.<span class="me1" style="color:rgb(38,139,210);">openPrivateChat <span class="br0" style="color:rgb(0,153,0);">( arr<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'erruser' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, text.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="coMULTI" style="font-style:italic;color:rgb(147,161,161);">/*'enter': 'join', 'join': function(com, text) { //Now for a command with chutzpah - join any chat on Wikia //Need to fix this so that joined rooms can be selected if(com) { var data = new models.OpenPrivateRoom({roomId: com}); mainRoom.baseOpenPrivateRoom(data, true); $('.private').before('<h1 id="Room_' + com + '" class="public wordmark" onclick="mainRoom.showRoom(' + com + ')"> ' + com + ' <span id="MsgCount_' + com + '" class="splotch">0 '); mainRoom.showRoom(com); mainRoom.chats.privates[com].init; } 			else {this.inlineAlert(i18n['errroom'].replace(/\$1/g, text.split(' ')[0]));} }, 		'leave': 'part', 'part': function(com, text) { //Leave the room you're looking at, or the room you specify if(!com) {var id = this.roomId; var chat = this;} else {var id = com; var chat = mainRoom.chats.privates[com];} $('#Room_' + id).remove; chat.socket.autoReconnect = false; chat.socket.socket.disconnect; if(!com) {mainRoom.show('main');} },*/ 		<span class="st0" style="color:rgb(42,161,152);">'roomid' <span class="sy0" style="color:rgb(51,153,51);">: <span class="st0" style="color:rgb(42,161,152);">'id' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'id' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'id' <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">': ' <span class="sy0" style="color:rgb(51,153,51);">+ this.<span class="me1" style="color:rgb(38,139,210);">roomId <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'self' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Send a message to yourself <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ newstr <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="sy0" style="color:rgb(51,153,51);">= <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">< com.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">; i<span class="sy0" style="color:rgb(51,153,51);">++ <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">switch <span class="br0" style="color:rgb(0,153,0);">( com.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( i<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">case <span class="st0" style="color:rgb(42,161,152);">'[' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( i <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'[' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var k <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">']' <span class="sy0" style="color:rgb(51,153,51);">, i<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( k <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">']' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var substr <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( i <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">2 <span class="sy0" style="color:rgb(51,153,51);">, k<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( substr.<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'|' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">!= <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var link <span class="sy0" style="color:rgb(51,153,51);">= substr.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, substr.<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'|' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var linktext <span class="sy0" style="color:rgb(51,153,51);">= substr.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( substr.<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'|' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, substr.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var link <span class="sy0" style="color:rgb(51,153,51);">= substr<span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var linktext <span class="sy0" style="color:rgb(51,153,51);">= link<span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var linkspl <span class="sy0" style="color:rgb(51,153,51);">= link.<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; link <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var j <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in linkspl<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ link <span class="sy0" style="color:rgb(51,153,51);">+= linkspl<span class="br0" style="color:rgb(0,153,0);">[ j<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'_' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} link <span class="sy0" style="color:rgb(51,153,51);">= link.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, link.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; newstr <span class="sy0" style="color:rgb(51,153,51);">+= <span class="st0" style="color:rgb(42,161,152);">'<a href="/wiki/' <span class="sy0" style="color:rgb(51,153,51);">+ link <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'">' <span class="sy0" style="color:rgb(51,153,51);">+ linktext <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'</a>' <span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">= k <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( i <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, i <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">8 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'http://' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var k <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">']' <span class="sy0" style="color:rgb(51,153,51);">, i<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var splstr <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( i <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, k<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( splstr <span class="sy0" style="color:rgb(51,153,51);">== com.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( i <span class="sy0" style="color:rgb(51,153,51);">+ <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, k<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var linktext <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'[1]' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var linktext <span class="sy0" style="color:rgb(51,153,51);">= build<span class="br0" style="color:rgb(0,153,0);">( splstr<span class="sy0" style="color:rgb(51,153,51);">, <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} newstr <span class="sy0" style="color:rgb(51,153,51);">+= <span class="st0" style="color:rgb(42,161,152);">'<a href="' <span class="sy0" style="color:rgb(51,153,51);">+ splstr<span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'">' <span class="sy0" style="color:rgb(51,153,51);">+ linktext <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'</a>' <span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">= k<span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">break <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">default <span class="sy0" style="color:rgb(51,153,51);">: newstr <span class="sy0" style="color:rgb(51,153,51);">+= com.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( i<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">break <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">append <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<li><img class="avatar" src="' <span class="sy0" style="color:rgb(51,153,51);">+ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#ChatHeader .User img' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'src' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'"> ' <span class="sy0" style="color:rgb(51,153,51);">+ wgUserName <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">' (' <span class="sy0" style="color:rgb(51,153,51);">+ i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'self' <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">') ' <span class="sy0" style="color:rgb(51,153,51);">+ newstr <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">' </li>' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">append <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<li><img class="avatar" src="' <span class="sy0" style="color:rgb(51,153,51);">+ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#ChatHeader .User img' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">attr <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'src' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'"> ' <span class="sy0" style="color:rgb(51,153,51);">+ wgUserName <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">' (' <span class="sy0" style="color:rgb(51,153,51);">+ i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'self' <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">') </li>' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">scrollToBottom <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'help' <span class="sy0" style="color:rgb(51,153,51);">: <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( com<span class="sy0" style="color:rgb(51,153,51);">, text<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( com<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var ref <span class="sy0" style="color:rgb(51,153,51);">= com.<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">/ <span class="sy0" style="color:rgb(51,153,51);">/ g<span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'.' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var str <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var subcoms <span class="sy0" style="color:rgb(51,153,51);">= <span class="br0" style="color:rgb(0,153,0);">[ <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var subdirs <span class="sy0" style="color:rgb(51,153,51);">= <span class="br0" style="color:rgb(0,153,0);">[ <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">while <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands.' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'string' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ ref.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, ref.<span class="me1" style="color:rgb(38,139,210);">lastIndexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'.' <span class="sy0" style="color:rgb(51,153,51);">+ eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">toLowerCase <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var command <span class="sy0" style="color:rgb(51,153,51);">= eval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'window.commands.' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'help-' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ str <span class="sy0" style="color:rgb(51,153,51);">+= i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'help' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, ref.<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\./g <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$2/g <span class="sy0" style="color:rgb(51,153,51);">, i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'help-' <span class="sy0" style="color:rgb(51,153,51);">+ ref<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'example' <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'exampleuser' <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof command <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'object' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in command<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof command<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'function' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ subcoms.<span class="me1" style="color:rgb(38,139,210);">push <span class="br0" style="color:rgb(0,153,0);">( i<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof command<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'object' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ subdirs.<span class="me1" style="color:rgb(38,139,210);">push <span class="br0" style="color:rgb(0,153,0);">( i<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( subcoms.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">> <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ str <span class="sy0" style="color:rgb(51,153,51);">+= <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="sy0" style="color:rgb(51,153,51);">+ i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'subcoms' <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">': ' <span class="sy0" style="color:rgb(51,153,51);">+ subcoms.<span class="me1" style="color:rgb(38,139,210);">join <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">', ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( subdirs.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">> <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ str <span class="sy0" style="color:rgb(51,153,51);">+= <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="sy0" style="color:rgb(51,153,51);">+ i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'subdirs' <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">': ' <span class="sy0" style="color:rgb(51,153,51);">+ subdirs.<span class="me1" style="color:rgb(38,139,210);">join <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">', ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} str <span class="sy0" style="color:rgb(51,153,51);">= str.<span class="me1" style="color:rgb(38,139,210);">removeTrailing <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( str <span class="sy0" style="color:rgb(51,153,51);">!= <span class="st0" style="color:rgb(42,161,152);">'' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( str<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'nohelp' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, command<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var str <span class="sy0" style="color:rgb(51,153,51);">= <span class="br0" style="color:rgb(0,153,0);">[ <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">in window.<span class="me1" style="color:rgb(38,139,210);">commands <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof window.<span class="me1" style="color:rgb(38,139,210);">commands <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'function' <span class="sy0" style="color:rgb(51,153,51);">|| <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">typeof window.<span class="me1" style="color:rgb(38,139,210);">commands <span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">'object' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ str.<span class="me1" style="color:rgb(38,139,210);">push <span class="br0" style="color:rgb(0,153,0);">( i<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'commands' <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">replace <span class="br0" style="color:rgb(0,153,0);">( <span class="co2" style="font-style:italic;color:rgb(147,161,161);">/\$1/g <span class="sy0" style="color:rgb(51,153,51);">, str.<span class="me1" style="color:rgb(38,139,210);">join <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">', ' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Parser helping function - takes an array of text created with .split(' '), <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//and an index number for where to start, then rebuilds the string. <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Can also accept an index value for where to stop. <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">build <span class="br0" style="color:rgb(0,153,0);">( text<span class="sy0" style="color:rgb(51,153,51);">, index<span class="sy0" style="color:rgb(51,153,51);">, stop<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var newtext <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( stop <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">undefined <span class="sy0" style="color:rgb(51,153,51);">|| stop <span class="sy0" style="color:rgb(51,153,51);">== <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ stop <span class="sy0" style="color:rgb(51,153,51);">= text.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( stop <span class="sy0" style="color:rgb(51,153,51);">< <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ stop <span class="sy0" style="color:rgb(51,153,51);">+= text.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( index <span class="sy0" style="color:rgb(51,153,51);">== stop <span class="sy0" style="color:rgb(51,153,51);">|| index <span class="sy0" style="color:rgb(51,153,51);">== text.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return text<span class="br0" style="color:rgb(0,153,0);">[ index<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="sy0" style="color:rgb(51,153,51);">= index<span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">< stop<span class="sy0" style="color:rgb(51,153,51);">; i<span class="sy0" style="color:rgb(51,153,51);">++ <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ newtext <span class="sy0" style="color:rgb(51,153,51);">+= text<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">' ' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return newtext<span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">toggleAway <span class="br0" style="color:rgb(0,153,0);">( msg<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! msg<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var msg <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#ChatHeader .User' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">hasClass <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'away' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ mainRoom.<span class="me1" style="color:rgb(38,139,210);">setBack <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ mainRoom.<span class="me1" style="color:rgb(38,139,210);">setAway <span class="br0" style="color:rgb(0,153,0);">( msg<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} toggleAway.<span class="me1" style="color:rgb(38,139,210);">back <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Force back status <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#ChatHeader .User' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">hasClass <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'away' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">true <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ mainRoom.<span class="me1" style="color:rgb(38,139,210);">setBack <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} toggleAway.<span class="me1" style="color:rgb(38,139,210);">away <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( msg<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Force away status <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! msg<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var msg <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">'' <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'#ChatHeader .User' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">hasClass <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'away' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">false <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ mainRoom.<span class="me1" style="color:rgb(38,139,210);">setAway <span class="br0" style="color:rgb(0,153,0);">( msg<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} NodeChatController.prototype.<span class="me1" style="color:rgb(38,139,210);">clearWindow <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ this.<span class="me1" style="color:rgb(38,139,210);">viewDiscussion .<span class="me1" style="color:rgb(38,139,210);">chatUL .<span class="me1" style="color:rgb(38,139,210);">html <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; this.<span class="me1" style="color:rgb(38,139,210);">inlineAlert <span class="br0" style="color:rgb(0,153,0);">( i18n<span class="br0" style="color:rgb(0,153,0);">[ <span class="st0" style="color:rgb(42,161,152);">'cleared' <span class="br0" style="color:rgb(0,153,0);">] <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">active <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Returns the NodeChatController for the active window <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( mainRoom.<span class="me1" style="color:rgb(38,139,210);">activeRoom <span class="sy0" style="color:rgb(51,153,51);">&& mainRoom.<span class="me1" style="color:rgb(38,139,210);">activeRoom <span class="sy0" style="color:rgb(51,153,51);">!= <span class="st0" style="color:rgb(42,161,152);">'main' <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return mainRoom.<span class="me1" style="color:rgb(38,139,210);">chats .<span class="me1" style="color:rgb(38,139,210);">privates <span class="br0" style="color:rgb(0,153,0);">[ mainRoom.<span class="me1" style="color:rgb(38,139,210);">activeRoom <span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return mainRoom<span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} String.prototype.<span class="me1" style="color:rgb(38,139,210);">removeTrailing <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="kw5" style="color:rgb(255,0,0);">char <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Remove extraneous characters <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var str <span class="sy0" style="color:rgb(51,153,51);">= this<span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">while <span class="br0" style="color:rgb(0,153,0);">( str.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw5" style="color:rgb(255,0,0);">char <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ str <span class="sy0" style="color:rgb(51,153,51);">= str.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, str.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">while <span class="br0" style="color:rgb(0,153,0);">( str.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( str.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="kw5" style="color:rgb(255,0,0);">char <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ str <span class="sy0" style="color:rgb(51,153,51);">= str.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">, str.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return str<span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">createCookie <span class="br0" style="color:rgb(0,153,0);">( name<span class="sy0" style="color:rgb(51,153,51);">, value<span class="sy0" style="color:rgb(51,153,51);">, days<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( days<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var date <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">new Date<span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; date.<span class="me1" style="color:rgb(38,139,210);">setTime <span class="br0" style="color:rgb(0,153,0);">( date.<span class="me1" style="color:rgb(38,139,210);">getTime <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="br0" style="color:rgb(0,153,0);">( days<span class="sy0" style="color:rgb(51,153,51);">* <span class="nu0" style="color:rgb(211,54,130);">24 <span class="sy0" style="color:rgb(51,153,51);">* <span class="nu0" style="color:rgb(211,54,130);">60 <span class="sy0" style="color:rgb(51,153,51);">* <span class="nu0" style="color:rgb(211,54,130);">60 <span class="sy0" style="color:rgb(51,153,51);">* <span class="nu0" style="color:rgb(211,54,130);">1000 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var expires <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">"; expires=" <span class="sy0" style="color:rgb(51,153,51);">+ date.<span class="me1" style="color:rgb(38,139,210);">toGMTString <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var expires <span class="sy0" style="color:rgb(51,153,51);">= <span class="st0" style="color:rgb(42,161,152);">"" <span class="sy0" style="color:rgb(51,153,51);">; document.<span class="me1" style="color:rgb(38,139,210);">cookie <span class="sy0" style="color:rgb(51,153,51);">= name<span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">"=" <span class="sy0" style="color:rgb(51,153,51);">+ value<span class="sy0" style="color:rgb(51,153,51);">+ expires<span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">"; path=/" <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">readCookie <span class="br0" style="color:rgb(0,153,0);">( name<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var nameEQ <span class="sy0" style="color:rgb(51,153,51);">= name <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">"=" <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var ca <span class="sy0" style="color:rgb(51,153,51);">= document.<span class="me1" style="color:rgb(38,139,210);">cookie .<span class="me1" style="color:rgb(38,139,210);">split <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">';' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i<span class="sy0" style="color:rgb(51,153,51);">= <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">< ca.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">; i<span class="sy0" style="color:rgb(51,153,51);">++ <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var c <span class="sy0" style="color:rgb(51,153,51);">= ca<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">while <span class="br0" style="color:rgb(0,153,0);">( c.<span class="me1" style="color:rgb(38,139,210);">charAt <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) c <span class="sy0" style="color:rgb(51,153,51);">= c.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( <span class="nu0" style="color:rgb(211,54,130);">1 <span class="sy0" style="color:rgb(51,153,51);">, c.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( c.<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( nameEQ<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">== <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return c.<span class="me1" style="color:rgb(38,139,210);">substring <span class="br0" style="color:rgb(0,153,0);">( nameEQ.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">, c.<span class="me1" style="color:rgb(38,139,210);">length <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return <span class="kw2" style="font-weight:bold;color:rgb(181,137,0);">null <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ 		<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="sy0" style="color:rgb(51,153,51);">! importScriptURI<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">importScriptURI <span class="br0" style="color:rgb(0,153,0);">( a<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var b<span class="sy0" style="color:rgb(51,153,51);">= document.<span class="me1" style="color:rgb(38,139,210);">createElement <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"script" <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; b.<span class="me1" style="color:rgb(38,139,210);">setAttribute <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"src" <span class="sy0" style="color:rgb(51,153,51);">, a<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; b.<span class="me1" style="color:rgb(38,139,210);">setAttribute <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"type" <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">"text/javascript" <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; document.<span class="me1" style="color:rgb(38,139,210);">getElementsByTagName <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">"head" <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">[ <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">appendChild <span class="br0" style="color:rgb(0,153,0);">( b<span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">return b<span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} importScriptURI<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'http://c.wikia.com/index.php?title=User:Monchoman45/ChatHacks.js/i18n.js&action=raw&ctype=text/javascript' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; importScriptURI<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'http://monchbox.wikia.com/index.php?title=MediaWiki:APIQuery.js&action=raw&ctype=text/javascript' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//APIQuery for /unban <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'head' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">append <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<style type="text/css"><span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n .stafficon {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t margin-bottom:-4px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t width:14px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t height:14px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n .modicon {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t margin-bottom:-3px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t width:14px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t height:14px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n .UserStatsMenu {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t color:#000;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n .Write [name="message"] {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t width:93%;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n .inline-alert span {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t color:#006CB0;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t cursor:pointer;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n .inline-alert span:hover {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t text-decoration:underline;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n #pingspan {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t position:absolute;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t z-index:5;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t top:23px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t margin-left:15px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t font-size:15px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t font-weight:normal;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t line-height:15px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n #pings {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t resize:none;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t margin-left:0;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t font-size:12px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t height:100px;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t display:block;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n #pingspan div span {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t font-size:55%;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n #ChatHeader {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t z-index:9999;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n #ChatHeader {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t z-index:9999;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n .message.ping {<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n <span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\t color:red;<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n }<span class="es0" style="font-weight:bold;color:rgb(0,0,153);">\n ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Unbind all of the window listeners that set your status to back <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( window<span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">unbind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'mousemove' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">unbind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'focus' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">unbind <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'keypress' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="co1" style="font-style:italic;color:rgb(147,161,161);">//Add the sound space <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'body' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">append <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">' ' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">}  <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">else <span class="br0" style="color:rgb(0,153,0);">{  	<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var a <span class="sy0" style="color:rgb(51,153,51);">= document.<span class="me1" style="color:rgb(38,139,210);">getElementsByTagName <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'a' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">for <span class="br0" style="color:rgb(0,153,0);">( <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">var i <span class="sy0" style="color:rgb(51,153,51);">= <span class="nu0" style="color:rgb(211,54,130);">0 <span class="sy0" style="color:rgb(51,153,51);">; i <span class="sy0" style="color:rgb(51,153,51);">< a.<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">; i<span class="sy0" style="color:rgb(51,153,51);">++ <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( a<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">href <span class="sy0" style="color:rgb(51,153,51);">&& a<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">href .<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'/wiki/Special:Chat' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">!= <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ a<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">addEventListener <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'click' <span class="sy0" style="color:rgb(51,153,51);">, <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( event<span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ event.<span class="me1" style="color:rgb(38,139,210);">preventDefault <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; OpenChatWindow<span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; a<span class="br0" style="color:rgb(0,153,0);">[ i<span class="br0" style="color:rgb(0,153,0);">] .<span class="me1" style="color:rgb(38,139,210);">removeAttribute <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'data-canonical' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( document.<span class="me1" style="color:rgb(38,139,210);">body .<span class="me1" style="color:rgb(38,139,210);">className .<span class="me1" style="color:rgb(38,139,210);">indexOf <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'skin-oasis' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">!= <span class="sy0" style="color:rgb(51,153,51);">- <span class="nu0" style="color:rgb(211,54,130);">1 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ window.<span class="me1" style="color:rgb(38,139,210);">chatcheck <span class="sy0" style="color:rgb(51,153,51);">= setInterval<span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'ChatCheck' <span class="sy0" style="color:rgb(51,153,51);">, <span class="nu0" style="color:rgb(211,54,130);">200 <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; 	<span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">ChatCheck <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{  		<span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">if <span class="br0" style="color:rgb(0,153,0);">( <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.chat-join button' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">length <span class="sy0" style="color:rgb(51,153,51);">!= <span class="nu0" style="color:rgb(211,54,130);">0 <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.chat-join button' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">replaceWith <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'<a class="wikia-button" onclick="OpenChatWindow">' <span class="sy0" style="color:rgb(51,153,51);">+ <span class="kw1" style="font-weight:bold;color:rgb(133,153,0);">$ <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'.chat-join button' <span class="br0" style="color:rgb(0,153,0);">) .<span class="me1" style="color:rgb(38,139,210);">html <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'</a>' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; clearInterval<span class="br0" style="color:rgb(0,153,0);">( window.<span class="me1" style="color:rgb(38,139,210);">chatcheck <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="re0" style="color:rgb(38,139,210);">OpenChatWindow <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ window.<span class="me1" style="color:rgb(38,139,210);">chatwindow <span class="sy0" style="color:rgb(51,153,51);">= window.<span class="me1" style="color:rgb(38,139,210);">open <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'/wiki/Special:Chat?useskin=wikia' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'chat' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; window.<span class="me1" style="color:rgb(38,139,210);">chatwindow .<span class="me1" style="color:rgb(38,139,210);">onload <span class="sy0" style="color:rgb(51,153,51);">= <span class="kw0" style="font-weight:bold;color:rgb(7,54,66);">function <span class="br0" style="color:rgb(0,153,0);">( <span class="br0" style="color:rgb(0,153,0);">) <span class="br0" style="color:rgb(0,153,0);">{ window.<span class="me1" style="color:rgb(38,139,210);">chatwindow .<span class="me1" style="color:rgb(38,139,210);">importScriptPage <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'User:' <span class="sy0" style="color:rgb(51,153,51);">+ wgUserName <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'/global.js' <span class="sy0" style="color:rgb(51,153,51);">, <span class="st0" style="color:rgb(42,161,152);">'c' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; window.<span class="me1" style="color:rgb(38,139,210);">chatwindow .<span class="me1" style="color:rgb(38,139,210);">importScript <span class="br0" style="color:rgb(0,153,0);">( <span class="st0" style="color:rgb(42,161,152);">'User:' <span class="sy0" style="color:rgb(51,153,51);">+ wgUserName <span class="sy0" style="color:rgb(51,153,51);">+ <span class="st0" style="color:rgb(42,161,152);">'/wikia.js' <span class="br0" style="color:rgb(0,153,0);">) <span class="sy0" style="color:rgb(51,153,51);">; <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">} <span class="br0" style="color:rgb(0,153,0);">}