diff --git a/.gitignore b/.gitignore
index 6bb63d2..928c465 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,5 +11,4 @@ state.json
chatexamples.txt
server.cert
server.key
-www/nonfree/*
-www/nonfree/README.md
\ No newline at end of file
+www/nonfree/*
\ No newline at end of file
diff --git a/src/views/partial/panels/settings.ejs b/src/views/partial/panels/settings.ejs
index ac3cb93..5fd29d7 100644
--- a/src/views/partial/panels/settings.ejs
+++ b/src/views/partial/panels/settings.ejs
@@ -45,5 +45,26 @@ along with this program. If not, see
Aspect-Ratio Lock Chat Width Minimum:
+Play Sound for received PMs:
+ + + +Play sound for sent PMs:
+ + + +Play sound on new PM sesh:
+ + + +Play sound on PM sesh end:
+ + \ No newline at end of file diff --git a/www/js/channel/channel.js b/www/js/channel/channel.js index 523cf6b..9198ee1 100644 --- a/www/js/channel/channel.js +++ b/www/js/channel/channel.js @@ -313,7 +313,11 @@ class channel{ ["syncDelta", 6], ["chatWidthMin", 20], ["userlistHidden", false], - ["cinemaMode", false] + ["cinemaMode", false], + ["rxPMSound", 'unread'], + ["txPMSound", false], + ["newSeshSound", true], + ["endSeshSound", true] ]); } diff --git a/www/js/channel/panels/settingsPanel.js b/www/js/channel/panels/settingsPanel.js index 976afee..d3949ef 100644 --- a/www/js/channel/panels/settingsPanel.js +++ b/www/js/channel/panels/settingsPanel.js @@ -62,6 +62,26 @@ class settingsPanel extends panelObj{ */ this.chatWidthMinimum = this.panelDocument.querySelector("#settings-panel-min-chat-width input"); + /** + * Audible Ping on PM Recieved + */ + this.rxPMSound = this.panelDocument.querySelector("#settings-panel-ping-on-pm-rx select"); + + /** + * Audible Ping on PM Transmit + */ + this.txPMSound = this.panelDocument.querySelector("#settings-panel-ping-on-pm-tx input"); + + /** + * Audible Ping on new PM sesh + */ + this.newSeshSound = this.panelDocument.querySelector("#settings-panel-ping-on-new-sesh input"); + + /** + * Audible Ping on old PM sesh + */ + this.endSeshSound = this.panelDocument.querySelector("#settings-panel-ping-on-end-sesh input"); + this.renderSettings(); this.setupInput(); @@ -79,6 +99,10 @@ class settingsPanel extends panelObj{ this.liveSyncTolerance.addEventListener('change', this.updateLiveSyncTolerance.bind(this)); this.syncDelta.addEventListener('change', this.updateSyncDelta.bind(this)); this.chatWidthMinimum.addEventListener('change', this.updateChatWidthMinimum.bind(this)); + this.rxPMSound.addEventListener('change', this.updateRXPMSound.bind(this)); + this.txPMSound.addEventListener('change', this.updateTXPMSound.bind(this)); + this.newSeshSound.addEventListener('change', this.updateNewPMSeshSound.bind(this)); + this.endSeshSound.addEventListener('change', this.updateEndPMSeshSound.bind(this)); } /** @@ -91,6 +115,10 @@ class settingsPanel extends panelObj{ this.liveSyncTolerance.value = localStorage.getItem("liveSyncTolerance"); this.syncDelta.value = localStorage.getItem("syncDelta"); this.chatWidthMinimum.value = localStorage.getItem("chatWidthMin"); + this.rxPMSound.value = localStorage.getItem('rxPMSound'); + this.txPMSound.checked = localStorage.getItem('txPMSound') == 'true'; + this.newSeshSound.checked = localStorage.getItem('newSeshSound') == 'true'; + this.endSeshSound.checked = localStorage.getItem('endSeshSound') == 'true'; } /** @@ -189,4 +217,32 @@ class settingsPanel extends panelObj{ localStorage.setItem("chatWidthMin", this.chatWidthMinimum.value); client.processConfig("chatWidthMin", this.chatWidthMinimum.value); } + + /** + * Handles changes to RX PM Sound setting + */ + updateRXPMSound(){ + localStorage.setItem('rxPMSound', this.rxPMSound.value); + } + + /** + * Handles changes to TX PM Sound setting + */ + updateTXPMSound(){ + localStorage.setItem('txPMSound', this.txPMSound.checked); + } + + /** + * Handles changes to New PM Sesh Sound setting + */ + updateNewPMSeshSound(){ + localStorage.setItem('newSeshSound', this.newSeshSound.checked); + } + + /** + * Handles changes to Old PM Sesh Sound setting + */ + updateEndPMSeshSound(){ + localStorage.setItem('endSeshSound', this.endSeshSound.checked); + } } \ No newline at end of file