Initial commit.
This commit is contained in:
commit
f0c91b4e55
78 changed files with 5054 additions and 0 deletions
47
www/js/channel/channel.js
Normal file
47
www/js/channel/channel.js
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*Canopy - The next generation of stoner streaming software
|
||||
Copyright (C) 2024 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 channel{
|
||||
constructor(){
|
||||
//Establish connetion to the server via socket.io
|
||||
this.connect();
|
||||
//Define socket listeners
|
||||
this.defineListeners();
|
||||
|
||||
//Scrape channel name off URL
|
||||
this.channelName = window.location.pathname.split('/c/')[`1`];
|
||||
|
||||
//Create the Video Player Object
|
||||
this.player = new player(this);
|
||||
//Create the Chat Box Object
|
||||
this.chatBox = new chatBox(this);
|
||||
//Create the User List Object
|
||||
this.userList = new userList(this);
|
||||
}
|
||||
|
||||
connect(){
|
||||
this.socket = io();
|
||||
}
|
||||
|
||||
defineListeners(){
|
||||
//This function should serve mostly to glue functions from channel and it's children to it's socket's listeners.
|
||||
this.socket.on("connect", () => {
|
||||
document.title = `${this.channelName} - Connected`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const client = new channel();
|
||||
Loading…
Add table
Add a link
Reference in a new issue