User:Ultimate Dark Carnage/chat.js

var mwVars = mw.config.get(['wgUserGroups', 'wgUserName', 'wgCanonicalSpecialPageName', 'wgChatEmoticons']), users = [], Emoticons = {}; checkGroup = function checkGroup(group){ var group_regex = new RegExp(group.replace(/\s+/, '|'), 'g'); return group_regex.test(mwVars.wgUserGroups.join(' ')); },       inGroup = { 'rollback': checkGroup('rollback'), 'chatmoderator': checkGroup('chatmoderator'), 'sysop': checkGroup('sysop'), 'bureaucrat': checkGroup('bureaucrat'), 'cankick': checkGroup('chatmoderator sysop bureaucrat vstf helper staff'), 'canban': inGroup.cankick, 'vstf': checkGroup('vstf'), 'helper': checkGroup('helper'), 'staff': checkGroup('staff') },       Chat = {}; room.model.users.forEach(function(child){       if (child.attribures.name)            users[users.length] = child.attributes.name;    }); Chat.commands = { canonicalCommands: { 'emoticons': function emoticons(child){ var $panel = UI.createPanel('Emoticons', {                   type: 'macros',                    data: Emoticons,                    config: {                        tooltip: true                    },                    handler: {                        item: function($elem, emote){                        }                    }                }); },           'user': function user(event){ if (event.keyCode != 13 || event.which != 13) return; var _user = ' ', $panel = UI.createPanel('Users', {                       type: 'list',                        data: users.sort,                        config: {                            showAvatar: true                        },                        handler: {                            item: function(name){                            }                        }                    }); }       },        init: function init{ for (var name in this.canonicalCommands){ $('[name="message"]').on('keypress', this.canonicalCommands[name]); }       },        regex: /\!([a-zA-z]{1,})/g }; })(this.jQuery, this.mediaWiki, this.mainRoom);
 * (function($, mw, room){