Add chat sound

This commit is contained in:
elijahr2411 2023-01-25 20:13:11 -05:00
parent 37cab87a6f
commit e7e43b9399
2 changed files with 4 additions and 1 deletions

View file

@ -9,5 +9,6 @@ export const config = {
"wss://computernewb.com/collab-vm/vm6", "wss://computernewb.com/collab-vm/vm6",
"wss://computernewb.com/collab-vm/vm7", "wss://computernewb.com/collab-vm/vm7",
"wss://computernewb.com/collab-vm/vm8", "wss://computernewb.com/collab-vm/vm8",
] ],
chatSound: "https://computernewb.com/collab-vm/notify.ogg"
} }

View file

@ -15,6 +15,7 @@ const buttons = {
var hasTurn = false; var hasTurn = false;
var vm; var vm;
var connected = false; var connected = false;
const chatsound = new Audio(config.chatSound);
// Elements // Elements
const turnstatus = window.document.getElementById("turnstatus"); const turnstatus = window.document.getElementById("turnstatus");
const vmlist = window.document.getElementById("vmlist"); const vmlist = window.document.getElementById("vmlist");
@ -91,6 +92,7 @@ class CollabVMClient {
tr.appendChild(td); tr.appendChild(td);
chatList.appendChild(tr); chatList.appendChild(tr);
} }
chatsound.play();
chatListDiv.scrollTop = chatListDiv.scrollHeight; chatListDiv.scrollTop = chatListDiv.scrollHeight;
break; break;
case "size": case "size":