From e7e43b939915f2c1d168369e5fc117c9d08be0a8 Mon Sep 17 00:00:00 2001 From: elijahr2411 Date: Wed, 25 Jan 2023 20:13:11 -0500 Subject: [PATCH] Add chat sound --- src/common.js | 3 ++- src/index.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common.js b/src/common.js index 5fc8efc..42fb202 100644 --- a/src/common.js +++ b/src/common.js @@ -9,5 +9,6 @@ export const config = { "wss://computernewb.com/collab-vm/vm6", "wss://computernewb.com/collab-vm/vm7", "wss://computernewb.com/collab-vm/vm8", - ] + ], + chatSound: "https://computernewb.com/collab-vm/notify.ogg" } \ No newline at end of file diff --git a/src/index.js b/src/index.js index ca6bdad..defa1b4 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,7 @@ const buttons = { var hasTurn = false; var vm; var connected = false; +const chatsound = new Audio(config.chatSound); // Elements const turnstatus = window.document.getElementById("turnstatus"); const vmlist = window.document.getElementById("vmlist"); @@ -91,6 +92,7 @@ class CollabVMClient { tr.appendChild(td); chatList.appendChild(tr); } + chatsound.play(); chatListDiv.scrollTop = chatListDiv.scrollHeight; break; case "size":