MediaWiki:FandomizedChat/menu.js

$(document).ready(function{   var $chat_message = $('#Chat_' + mainRoom.viewDiscussion.roomId + ' li[data-user]');    function showMenu(event){        var $menu = $(' ', { 'class': 'ChatMenu chat-actions', 'id': 'ChatMenu' }),           $message = (function(event){ var $target = null; if ($(event.target).is('li[data-user]')) $target = $(event.target); else $target = $(event.target).parents('li[data-user]'); return $target; })(event),           actions = {                'Normal Actions': {                    'Profile': '/wiki/User:' + $message.data('user'),                    'Contributions': '/wiki/Special:Contributons/' + $message.data('user'),                    'Private Message': function(user){                        FandomizedChat.PrivateMessage(user);                    }                },                'Moderator Actions': {                    'Kick': function(user){                        var KickConfirm = new FandomizedChat.modal({ type: 'confirm', title: 'Kick', message: 'Are you sure that you want to kick ' + user + ' ?', id: 'kick-modal', buttons: { cancel: 'Cancel', confirm: 'Kick' }                           });                        KickConfirm.confirm(function(event){ FandomizedChat.KickUser(user); });                   },                    'Ban': function(user){                        var BanModal = new FandomizedChat.modal({ type: 'chatban', title: 'Ban', html: '', id: 'ban-modal', buttons: { cancel: 'Cancel', confirm: 'Ban' }                           });                        BanModal.submit(function(event, settings){ FandomizedChat.banUser(user, settings); });                   },                    'Promote': function(user){                        var PromoteModal = new FandomizedChat.modal({ type: 'modal', title: 'Promote User', html: '', id: 'promote-modal', buttons: { cancel: 'Cancel', confirm: 'Promote' }                       });                        PromoteModal.submit(function(event, settings){ FandomizedChat.promoteUser(user, settings); });                   }                }            };        $menu.html( $(' ', {               'class': 'ChatMenuWrapper chat-actions-wrapper',                'id': 'ChatMenuWrapper'            }).html([            ]) );   } });