Started work on emotes panel

This commit is contained in:
rainbow napkin 2024-12-21 13:43:28 -05:00
parent 6a10bf3dea
commit 633884534c
9 changed files with 242 additions and 7 deletions

View file

@ -69,11 +69,16 @@ class cPanel{
this.activePanelTitle.textContent = this.activePanel.name;
//Call panel initialization function
this.activePanel.panelInit();
this.activePanel.panelDocument = this.activePanelDoc;
this.activePanel.docSwitch();
}
hideActivePanel(){
//Hide the panel
this.activePanelDiv.style.display = "none";
//Clear out the panel
this.activePanelDoc.innerHTML = '';
//Set active panel to null
this.activePanel = null;
}
@ -101,7 +106,8 @@ class cPanel{
this.pinnedPanelDiv.style.display = "flex";
//Call panel initialization function
this.pinnedPanel.panelInit();
this.pinnedPanel.panelDocument = this.pinnedPanelDoc;
this.pinnedPanel.docSwitch();
//Resize to window/content
this.pinnedPanelDragger.fixCutoff();
@ -131,10 +137,11 @@ class cPanel{
}
class panelObj{
constructor(name = "Placeholder Panel", pageURL = "/panel/placeholder", panelDocument = window.document){
constructor(client, name = "Placeholder Panel", pageURL = "/panel/placeholder", panelDocument = window.document){
this.name = name;
this.pageURL = pageURL;
this.panelDocument = panelDocument;
this.client = client;
}
async getPage(){
@ -145,7 +152,7 @@ class panelObj{
return await response.text();
}
panelInit(){
docSwitch(){
}
}
@ -195,10 +202,15 @@ class poppedPanel{
//Set Window Title
this.window.document.title = this.window.document.title.replace("NULL_POPOUT", `${this.panel.name} (${client.channelName})`);
//Set Panel Content
this.panelTitle.innerText = this.panel.name;
this.panelDoc.innerHTML = this.panelBody;
//Set panel object document and call the related function
this.panel.panelDocument = this.window.document;
this.panel.docSwitch();
this.setupInput();
}
@ -215,11 +227,14 @@ class poppedPanel{
unpop(){
//Set active panel
this.cPanel.setActivePanel(this.panel, this.panelDoc.innerHTML);
//Close the popped window
this.window.close();
}
pin(){
this.cPanel.setPinnedPanel(this.panel, this.panelDoc.innerHTML);
this.window.close();
}