Added 'PM' option to userlist context menu.
This commit is contained in:
parent
ecebcf0d32
commit
dd4d789d9f
|
|
@ -24,7 +24,7 @@ class pmPanel extends panelObj{
|
||||||
* @param {channel} client - Parent client Management Object
|
* @param {channel} client - Parent client Management Object
|
||||||
* @param {Document} panelDocument - Panel Document
|
* @param {Document} panelDocument - Panel Document
|
||||||
*/
|
*/
|
||||||
constructor(client, panelDocument){
|
constructor(client, panelDocument, startSesh){
|
||||||
super(client, "Private Messaging", "/panel/pm", panelDocument);
|
super(client, "Private Messaging", "/panel/pm", panelDocument);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -71,7 +71,17 @@ class pmPanel extends panelObj{
|
||||||
//Tell PMHandler to start tracking this panel
|
//Tell PMHandler to start tracking this panel
|
||||||
this.client.pmHandler.panelList.set(this.uuid, null);
|
this.client.pmHandler.panelList.set(this.uuid, null);
|
||||||
|
|
||||||
|
//Define network related listeners
|
||||||
this.defineListeners();
|
this.defineListeners();
|
||||||
|
|
||||||
|
//If a start sesh was provided
|
||||||
|
if(startSesh != null && startSesh != ""){
|
||||||
|
//Send message out to server
|
||||||
|
this.client.pmSocket.emit("pm", {
|
||||||
|
recipients: startSesh.split(" "),
|
||||||
|
msg: ""
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
closer(){
|
closer(){
|
||||||
|
|
@ -126,7 +136,6 @@ class pmPanel extends panelObj{
|
||||||
this.seshSendButton.addEventListener("click", this.send.bind(this));
|
this.seshSendButton.addEventListener("click", this.send.bind(this));
|
||||||
this.seshBuffer.addEventListener('scroll', this.scrollHandler.bind(this));
|
this.seshBuffer.addEventListener('scroll', this.scrollHandler.bind(this));
|
||||||
this.ownerDoc.defaultView.addEventListener('resize', this.handleAutoScroll.bind(this));
|
this.ownerDoc.defaultView.addEventListener('resize', this.handleAutoScroll.bind(this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startSesh(event){
|
startSesh(event){
|
||||||
|
|
@ -180,6 +189,12 @@ class pmPanel extends panelObj{
|
||||||
* Render out current sesh array to sesh list UI
|
* Render out current sesh array to sesh list UI
|
||||||
*/
|
*/
|
||||||
renderSeshList(){
|
renderSeshList(){
|
||||||
|
//If we don't have a sesh list
|
||||||
|
if(this.seshList == null){
|
||||||
|
//Fuck off, you're not even done building the object yet.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Clear out the sesh list
|
//Clear out the sesh list
|
||||||
this.seshList.innerHTML = "";
|
this.seshList.innerHTML = "";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,8 @@ class userList{
|
||||||
function renderContextMenu(event){
|
function renderContextMenu(event){
|
||||||
//Setup menu map
|
//Setup menu map
|
||||||
let menuMap = new Map([
|
let menuMap = new Map([
|
||||||
["Profile", ()=>{this.client.cPanel.setActivePanel(new panelObj(this.client, `${user.user}`, `/panel/profile?user=${user.user}`))}],
|
["Profile", ()=>{this.client.cPanel.setActivePanel(new panelObj(this.client, user.user, `/panel/profile?user=${user.user}`))}],
|
||||||
|
["PM", ()=>{this.client.cPanel.setActivePanel(new pmPanel(client, undefined, user.user))}],
|
||||||
["Mention", ()=>{this.client.chatBox.catChat(`${user.user} `)}],
|
["Mention", ()=>{this.client.chatBox.catChat(`${user.user} `)}],
|
||||||
["Toke With", ()=>{this.client.chatBox.tokeWith(user.user)}],
|
["Toke With", ()=>{this.client.chatBox.tokeWith(user.user)}],
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue