Started work on PM Panel layout
This commit is contained in:
parent
67edef9035
commit
e19ae74412
|
|
@ -45,6 +45,10 @@ class pmHandler{
|
|||
this.namespace.on("connection", this.handleConnection.bind(this) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles global server-side initialization for new connections to the private messaging system
|
||||
* @param {Socket} socket - Requesting Socket
|
||||
*/
|
||||
async handleConnection(socket){
|
||||
try{
|
||||
//ensure unbanned ip and valid CSRF token
|
||||
|
|
|
|||
20
src/controllers/panel/pmController.js
Normal file
20
src/controllers/panel/pmController.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*Canopy - The next generation of stoner streaming software
|
||||
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||
|
||||
//root index functions
|
||||
module.exports.get = async function(req, res){
|
||||
res.render('partial/panels/pm', {});
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@ const popoutContainerController = require("../controllers/panel/popoutContainerC
|
|||
const profileController = require("../controllers/panel/profileController");
|
||||
const queueController = require("../controllers/panel/queueController");
|
||||
const settingsController = require("../controllers/panel/settingsController");
|
||||
const pmController = require("../controllers/panel/pmController");
|
||||
//Validators
|
||||
const accountValidator = require("../validators/accountValidator");
|
||||
|
||||
|
|
@ -38,5 +39,6 @@ router.get('/popoutContainer', popoutContainerController.get);
|
|||
router.get('/profile', accountValidator.user(), profileController.get);
|
||||
router.get('/queue', queueController.get);
|
||||
router.get('/settings', settingsController.get);
|
||||
router.get('/pm', pmController.get);
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
|
|
@ -47,12 +47,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
|||
<script src="/js/channel/userlist.js"></script>
|
||||
<script src="/js/channel/mediaHandler.js"></script>
|
||||
<script src="/js/channel/player.js"></script>
|
||||
<script src="/js/channel/pmHandler.js"></script>
|
||||
<script src="/js/channel/cpanel.js"></script>
|
||||
<%# panels %>
|
||||
<script src="/js/channel/panels/emotePanel.js"></script>
|
||||
<script src="/js/channel/panels/queuePanel/playlistManager.js"></script>
|
||||
<script src="/js/channel/panels/queuePanel/queuePanel.js"></script>
|
||||
<script src="/js/channel/panels/settingsPanel.js"></script>
|
||||
<script src="/js/channel/panels/pmPanel.js"></script>
|
||||
<%# main client %>
|
||||
<script src="/js/channel/channel.js"></script>
|
||||
</footer>
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
|||
</div>
|
||||
<div class="chat-panel control-prompt" id="chat-panel-control-div">
|
||||
<i class="chat-panel chat-panel-control control-prompt bi-gear-fill" id="chat-panel-settings-icon"></i>
|
||||
<i class="chat-panel chat-panel-control control-prompt bi-chat-left-quote-fill" id="chat-panel-pm-icon"></i>
|
||||
<i class="chat-panel chat-panel-control control-prompt bi-magic" id="chat-panel-admin-icon"></i>
|
||||
<i class="chat-panel chat-panel-control control-prompt bi-images" id="chat-panel-emote-icon"></i>
|
||||
<span id="chat-panel-prompt-span">
|
||||
|
|
|
|||
37
src/views/partial/panels/pm.ejs
Normal file
37
src/views/partial/panels/pm.ejs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<%# Canopy - The next generation of stoner streaming software
|
||||
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||
<link rel="stylesheet" type="text/css" href="/css/panel/pm.css">
|
||||
<div id="pm-panel-main-div">
|
||||
<div id="pm-panel-sesh-list-container">
|
||||
<div class="interactive" id="pm-panel-start-sesh">
|
||||
<i class="bi-person-plus-fill"></i>
|
||||
<span>Start Sesh</span>
|
||||
</div>
|
||||
<div id="pm-panel-sesh-list">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="pm-panel-sesh-container">
|
||||
<div id="pm-panel-sesh-buffer">
|
||||
|
||||
</div>
|
||||
<div class="control-prompt" id="pm-panel-sesh-control-div">
|
||||
<input class="control-prompt" id="pm-panel-message-prompt" placeholder="Chat...">
|
||||
<button class="positive-button" id="pm-panel-send-button">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
54
www/css/panel/pm.css
Normal file
54
www/css/panel/pm.css
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*Canopy - The next generation of stoner streaming software
|
||||
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||
#pm-panel-main-div{
|
||||
display: flex;
|
||||
flex-direction: horizontal;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#pm-panel-sesh-list-container{
|
||||
flex: 1;
|
||||
max-width: 10em;
|
||||
}
|
||||
|
||||
#pm-panel-sesh-container{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
height: calc(100% - 0.25em);
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#pm-panel-start-sesh{
|
||||
width: calc(100% - 1.25em);
|
||||
margin-left: 0.25em;
|
||||
padding: 0 0.5em;
|
||||
text-wrap: nowrap;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#pm-panel-start-sesh span{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#pm-panel-sesh-buffer{
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
#pm-panel-sesh-control-div{
|
||||
margin: 0.5em;
|
||||
}
|
||||
|
|
@ -103,6 +103,14 @@ a:active, i:active:not(button i), .interactive:active{
|
|||
text-shadow: var(--focus-glow0-alt0);
|
||||
}
|
||||
|
||||
div.interactive:hover{
|
||||
background-color: var(--bg2);
|
||||
}
|
||||
|
||||
div.interactive:active{
|
||||
background-color: var(--bg1);
|
||||
}
|
||||
|
||||
button i{
|
||||
margin: 0.05em;
|
||||
text-wrap: nowrap;
|
||||
|
|
@ -610,6 +618,15 @@ div.archived p{
|
|||
border-left: var(--accent1-alt0) solid 1px;
|
||||
}
|
||||
|
||||
/* PM Panel */
|
||||
#pm-panel-sesh-container{
|
||||
border-left: 1px solid var(--accent0);
|
||||
}
|
||||
|
||||
#pm-panel-start-sesh{
|
||||
border-bottom: 1px solid var(--accent0);
|
||||
}
|
||||
|
||||
/* altcha theming*/
|
||||
div.altcha{
|
||||
box-shadow: 4px 4px 1px var(--bg1-alt0) inset;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@ class channel{
|
|||
* Child User List Object
|
||||
*/
|
||||
this.userList = new userList(this);
|
||||
|
||||
/**
|
||||
* Child PM Handler
|
||||
*/
|
||||
this.pmHandler = new pmHandler(this);
|
||||
|
||||
/**
|
||||
* Child Canopy Panel Object
|
||||
|
|
|
|||
43
www/js/channel/panels/pmPanel.js
Normal file
43
www/js/channel/panels/pmPanel.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*Canopy - The next generation of stoner streaming software
|
||||
Copyright (C) 2024-2025 Rainbownapkin and the TTN Community
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||
|
||||
/**
|
||||
* Class representing the settings panel
|
||||
* @extends panelObj
|
||||
*/
|
||||
class pmPanel extends panelObj{
|
||||
/**
|
||||
* Instantiates a new Panel Object
|
||||
* @param {channel} client - Parent client Management Object
|
||||
* @param {Document} panelDocument - Panel Document
|
||||
*/
|
||||
constructor(client, panelDocument){
|
||||
super(client, "Private Messaging", "/panel/pm", panelDocument);
|
||||
}
|
||||
|
||||
closer(){
|
||||
}
|
||||
|
||||
docSwitch(){
|
||||
this.setupInput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines input-related event handlers
|
||||
*/
|
||||
setupInput(){
|
||||
}
|
||||
}
|
||||
|
|
@ -20,5 +20,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
class pmHandler{
|
||||
constructor(client){
|
||||
this.client = client;
|
||||
|
||||
this.pmIcon = document.querySelector('#chat-panel-pm-icon');
|
||||
|
||||
this.defineListeners();
|
||||
this.setupInput();
|
||||
}
|
||||
|
||||
defineListeners(){
|
||||
|
||||
}
|
||||
|
||||
setupInput(){
|
||||
this.pmIcon.addEventListener("click", ()=>{this.client.cPanel.setActivePanel(new pmPanel(client))});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue