User:Ultimate Dark Carnage/chat.js

if (wgCanonicalSpecialPageName == 'Chat'){ var $trigger = $('Actions'); $trigger.on('click', function(event){           event.preventDefault;            if ($(event.target.hash).length) return;            else {                ChatWindow.append(function{ var $blackout = $(' ').attr('id', 'UserActions'), $modal = $(''), $modal_header = $('') .html([                                               $('').text('User Actions'),                                                $('').on('click', function(e){ e.preventDefault; $(e.target.hash).removeClass('show'); })                                           ]),                        $modal_content = $(''), $modal_footer = $(''); $modal_content.html(function{                       var user_list = ' ';                        mainRoom.viewUsers.model.users.models.map(function(userdata){ return userdata.attributes.name; }).sort.forEach(function(name, index){ var limit = 4, limit_indexed = limit - 1, attr = mainRoom.model.users.findByName(name).attributes; if (index % limit === limit_indexed && index !== this.length - 1){ user_list = user_list.concat(' \                                   \                                        \                                        '.concat(name) + '\                                    \                                     \                                '); user_list = user_list.concat(' '); } else { user_list = user_list.concat(' \                                   <label for="item-user-'.concat(index) + '" class="user-item-wrapper user">\                                        <img src="'.concat(attr.avatarSrc) + '" alt="'.concat(name) + '" class="avatar" />\                                        '.concat(name) + '\                                    \                                    <input type="checkbox" class="hidden" value="'.concat(name) + '" id="item-user-'.concat(index) + '" /> \                                </li>'); }                       });                        user_list = user_list.concat('</ul> ');                        return user_list;                    }); $modal_footer.html(function{                       var buttons = [                            $('<a href="#UserActions" class="modal-button button">Close</a>')                                .on('click', function(e){ e.preventDefault; $(e.target.hash).remove; }),                           $('<nav class="modal-button modal-menu-button button" />')                                .html(function{ var $menu = $(' '), $menu_list = $('<ul class="modal-menu-wrapper controls" />'), actions = { 'PM': function(_e_){ _e_.preventDefault; let el = $(_e_.target.hash), selected = []; el.find('.item.selected').each(function(index){                                                   selected[selected.length] = $(this).attr('data-user');                                                }); },                                           'Kick': function(_e_){ _e_.preventDefault; },                                           'Ban': function(_e_){ _e_.preventDefault; }                                       };                                })                        ];                    });                });            }        });        if (!$('#UserActionsTrigger').length) $('#Write .message').append($trigger); } else { window.open('/wiki/Special:Chat', '_blank'); } })(this.mediaWiki, this.jQuery, window, document, ($(document.body).is('.ChatWindow') ? $('.ChatWindow') : $(document.body)));
 * (function(mw, $, window, document, ChatWindow){