User:Ultimate Dark Carnage/chat.js

importArticles(/*{   type: 'script',    articles: [        "u:dev:MessageBlocker/code.js",        "u:c:User:Ultimate_Dark_Carnage/commands.js",        "u:c:User:Ultimate_Dark_Carnage/test.js",        "u:c:User:Ultimate_Dark_Carnage/sandbox2.js"    ] }, */{    'type': 'style',    articles: [        'u:c:User:Ultimate_Dark_Carnage/chat2.css'    ] });

/* jQuery(function($){   if (mw.config.get('wgCanonicalSpecialPageName') == "Chat"){        var chatMenu = {            modules: {},            ui: {                colorChanger: function(name, id, elem, colors){                    var changer_html = $(' ', { "class": "colorChangerSection menuUI-item", "data-id": id, html: function{ var content = '' + ' ' + name + ' ' + ' ' + name + ' ' + ' ',                               colors_default = ['#000000', '#000080', '#5f5f5f', '#808080', '#ffffff', '#0000af', '#008080', '#00af80', '#00afaf', '#00ffff']; if (colors.length){ for (var i = 0; i < colors.length; i++){ if (colors_default.indexOf(colors[i]) === -1){ colors_default.push(colors[i]); }                               }                            }                            content += '' + '' + '' + '' + ' ' +                                               '' + ' ' +                                           ' ' +                                                ''; content += (function(c){                               var color_box = color_box || '';                                for (var j = 0; j < colors_default.length; j++){                                    var color = colors_default[j];                                    color_box += ' ' + color + ' ';                                }                                if (color_box.indexOf('#') > -1){                                    return color_box;                                }                            })(colors); content += '' + ' ' +                                   ' ' +                                        'Submit' + ' ' +                               ' ' +                            ' ' +                            ' ';                            return content; }                   });                    $(elem || '.ChatWindow').append(changer_html);                }            },            fn: {                commands: function(target){                }            },            enabled: false,            config: {                commands: function{                }            }        };    } }); function fontAwesome(icon_type){ var icon = null; if (icon_type){ icon = 'fa' + ' ' + icon_type; } else { icon = false; }   return icon; }

$(document).ready(function{   if (wgCanonicalSpecialPageName == "Chat"){        var icon = {            get right{                return 'fa-chevron-right';            },            get left{                return 'fa-chevron-left';            },            get up{                return 'fa-chevron-up';            },            get down{                return 'fa-chevron-down';            },            get gear{                return 'fa-gear';            }        };        for (var i in icon){            icon[i] = fontAwesome(icon[i]);        }        var elem = $(' ', { "class": "ChatMenu chat-menu", "id": "ChatSideMenu", "data-user": wgUserName, html: function{ var u = mainRoom.models.users.findByName(wgUserName), userAvatar = u.attributes.avatarSrc, user = u.attributes.name, html = '' + '' + '' + '<section class="chat-menu-wrapper" id="chat-menu-wrapper">' + '<header class="chat-menu-header" id="chat-menu-header">' + '' + '<h2 class="chat-menu-username" id="chat-menu-username">' + ' ' + u + ' ' + ' ' +                           ' ' +                            ' ' +                                '<nav class="left-column left column" id="left-column"> ' + '<nav class="right-column right column" id="right-column"> ' + ' ' +                       ' ';                return html; }       });        $('.Write').append(elem);    } });