User:Ultimate Dark Carnage/chat.js

var UserList = [], Module = $(''), _length = 4, _imageSize = 40, _headerHTML = ' Users ', _listHTML = ''; Module.attr({       'id': 'UserList',        'data-name': 'UserList'    }); mainRoom.model.users.forEach(function(child, index){       var user_obj = child || {},            name = child.attributes.name;        if (name !== '') UserList[UserList.length] = name;    }); Array.prototype.sort.call(UserList); _listHTML = _listHTML.concat(''); _listHTML = _listHTML.concat(Array.prototype.map.call(UserList, function(user, index){ let userdata = mainRoom.model.users.findByName(user); let item_html = ''; item_html = item_html.concat(''.concat('' + user) + ''); item_html = item_html.concat(''); if (index % _length === 1 && index !== UserList.length - 1) item_html = item_html.concat(''); return item_html; }).join('')); _listHTML = _listHTML.concat(' '); Module.html([_headerHTML, _listHTML]); $(window).on('click', function(event){       if (event.ctrlKey && event.shiftKey){            if (!$('.GlobalModule').length) $(document.body).append(Module);            else $('#UserList').remove;        } else {            if ($(event.target).is('#UserList, #UserList *')){                let $userlist = $('#UserList');                $userlist.addClass('focused');            } else {                let $userlist = $('#UserList');                if ($userlist.hasClass('focused')){                    $userlist.removeClass('focused');                } else {                    $userlist.remove;                }            }        }    }); })(this.jQuery, this.mediaWiki, (document.defaultView || window).Test);
 * (function($, mw, config){