User:Ultimate Dark Carnage/chat.js

window.EmoticonPanel = window.EmoticonPanel || { init: function init{ this.$body = $(document.body); this.Emoticons = this.parseEmoticons || {}; this._emoticons = mw.config.get('wgChatEmoticons', wgChatEmoticons); this.RecentEmoticons = {}; },   create: function create{ },   createEmote: function createEmote($elem, emote){ var $emote_el = $(' ').addClass('emoticon emote'), $emote_img = $emote_el.find('img'); $emote_img.attr({           'src': Emoticons[emote],            'data-title': emote        }).on('click', function insert(event){            var $txt = $('.Write [name="message"]').last;            $txt.val($txt.val ? $txt.val + ' ' + emote : emote);           if ($('.EmoticonPanel').length) $('.EmoticonPanel').hide;            update_recent_emoticons($elem, emote);        }); if (!$('.panel-emoticons img[src="' + Emoticons[emote] + '"]').length) $('.emoticon-panel').find('.panel-emoticons .panel-main').append($emote_el); },   parseEmoticons: function parseEmoticons{ var emote_split = this._emoticons.split(/\n/gi), Emoticons = {}; $.each(emote_split, function createObj(el, index, arr){           if (el[0] === '*' && el[1] !== '*')                Emoticons[arr[index + 1].substring(2).trim] = el.substring(1).trim;        }); return Emoticons; },   updateRecentEmoticon: function updateRecentEmoticon($elem, emote){ } };

/* window.UpdatedChat = window.UpdatedChat || { enabled: false, init: function init{ if (!this.enabled) return; this.users = this.getUserList; this.emoticons = this.getEmoticons; this.create; },   create: function create{ },   createChatList: function createChatList{ var $chatList = $(''); $chatList.append(''); $chatList.append(' '); if (this.users instanceof Array || typeof this.users == 'object'){ for (var i = 0; i < this.users.length; i++){ var user = this.users[i], user_attribs = mainRoom.model.users.findByName(user).attributes, $user_link = $(' ' + user + ' ').on('click', $.proxy(this.openStatsMenu, user_attribs)); }       }    },    createPanel: function createPanel(config){ var $panel = $(''); $panel.append(' ' + config.name + ' × '); },   openStatsMenu: function openStatsMenu(event){ var user = this.name, editcount = this.editCount, avatar = this.avatarSrc; },   getRights: function getRights(user){ var right = '', attribs = mainRoom.model.users.findByName(user).attributes; if (attribs.canPromoteModerator && attribs.isModerator) right = 'admin'; else if (attribs.isModerator && !attribs.canPromoteModerator) right = 'chat-mod'; else if (attribs.isStaff) right = 'staff'; else right = ''; return ' user-' + right; } };