User:Ultimate Dark Carnage/ChatConsole

Script  (function(mw, $, config){   if (mw.config.get('wgPageName') == "Special:Chat" || mw.config.get('wgCanonicalSpecialPageName') == "Chat"){        if ($('#Write .message').children('textarea').length){            var codeActive = codeActive || false;            window.onload = function{                if (this.location.href.indexOf("Special:Chat") > -1){                    codeActive = true;                }            };

if (codeActive === true){ $(document).ready(function{                   if (!$("#ChatCodeInputButton").length){                        var w = $("#Write");                        w.append(function{ function action{ var message = w.children('.message'), cActive = cActive || false; if (cActive === false){ message.children('textarea').hide; if (!$('#ChatCode').length){ message.append(function{                                            var el = $(' ', { "class": "ChatCode GESHi source-chatcode", "id": "ChatCode", "contenteditable": true, });                                        });                                     }                                     cActive = true; } else { message.children('textarea').show; $('#ChatCode').remove; cActive = false; }                            }                             var el = $('', {                                 "class": "ChatCodeInputButton ChatCodeButton",                                 "id": "ChatCodeButton",                                 "href": "javascript:void(0);",                                 on: {                                     "click": function{                                         action;                                     }                                 },                                 text: "Toggle"                             }); return el; });                   }                });            }        }    } })(mediaWiki, jQuery, window.chatCode);