-
Notifications
You must be signed in to change notification settings - Fork 72
How To's
pstadler edited this page Jan 29, 2012
·
3 revisions
// myplugin/candy.js
Candy.View.Event.Roster.onContextMenu = function(args) {
return {
// add a new menu entry with key profile
'profile': {
requiredPermission: function(user, me) {
// don't show if it's myself
// this will also disable the entry in the room's context menu (where moderators can change the subject)
return me.getNick() !== user.getNick();
},
'class' : 'profile',
'label' : 'Show Profile',
'callback' : function(e, roomJid, user) {
// open profile in new window
window.open('http://domain.tld/user/detail/' + user.getNick(), '');
}
}
};
};
/* myplugin/candy.css */
#context-menu .profile {
background-image: url('profile.png');
}
'private': {... // private chat
'ignore': {... // ignore a user
'unignore': {... // unignore a user
'ban': {... // ban a user
'kick': {... // kick a user
'subject': {... // change the room's subject