User:Ultimate Dark Carnage/chat.js

var mwVars = mw.config.get([           'wgUserName',            'wgChatEmoticons',            'wgUserLanguage',            'wgUserGroups',            'wgPageName',            'wgCanonicalSpecialPageName'        ]), config = $.extend(_config, {           version: '0.1.0 alpha',            //emoticons: {},            //i18n: {},            collapsed: true,            compact: false,            vertical: true        }); if (       mwVars.wgPageName == 'Special:Chat' ||        mwVars.wgCanonicalSpecialPageName == 'Chat'    ){ var $emoticons_wrapper = $(''), $emoticons_arrow = $(' '), $emoticons_body = $(''), $emoticons_html = null; // Emoticons Arrow $emoticons_arrow.html(           $('').on('click', function(event){ event.preventDefault; var $menu = $('#emoticon-menu'), $link = $(event.target); if ($menu.hasClass('collapsed')){ $link.find('.icon') .removeClass('ion-chevron-right') .addClass('ion-chevron-left'); if (config.vertical) $menu.animate({                           'left': '0'                        }, 500); else $menu.animate({                           'bottom': '0'                        }, 500); $menu.removeClass('collapsed') } else { $link.find('.icon') .removeClass('ion-chevron-left') .addClass('ion-chevron-right'); if (config.vertical) $menu.animate({                           'left': -$menu.width + 'px'                        }, 500); else $menu.animate({                           'bottom': -$menu.width + 'px'                        }, 500); $menu.addClass('collapsed') }           })        );        // Emoticon Body $emoticons_body.html(function{           var e_mapping = new EmoticonMapping,                $e_header = $(''),                $e_body = $('');            e_mapping.loadFromWikiText(mwVars.wgChatEmoticons);            var $e_html = Object.keys(e_mapping._settings).map(function(emote_src){ var $e_section = $(' '), emotes = e_mapping._settings[emote_src]; $e_section.html(function{                   var $emoticon_image = $(''),                        $emoticon_list = $(''),                        $emoticon_items = emotes.map(function(name){ var $list_item = $(''); $list_item.html(                               $('')                                .text(name)                                .on('click', function(event){ event.preventDefault; var _message = $('#Write .message [name="message"]'), _emote = $(event.target).text; if (_message.val === ''){ _message.val(_emote); } else { _message.val(_message.val + ' ' + _emote); }                               })                            );                            return $list_item; });                   $emoticon_list.html($emoticon_items);                    return [$emoticon_image, $emoticon_list];                }); return $e_section; });           $e_body.append($e_html);            return [$e_header, $e_body];        }); if (config.vertical){ $emoticons_html = [$emoticons_body, $emoticons_arrow]; } else { $emoticons_html = [$emoticons_arrow, $emoticons_body]; }       $emoticons_wrapper.html($emoticons_html); if (!$('#emoticon-menu').exists){ $('.ChatWindow').append($emoticons_wrapper); }   } })(this.mediaWiki, this.jQuery, this.WikiaChat == this.WikiaChat || {});
 * (function(mw, $, _config){