diff --git a/src/views/partial/panels/settings.ejs b/src/views/partial/panels/settings.ejs index c0f23ae..9e3c996 100644 --- a/src/views/partial/panels/settings.ejs +++ b/src/views/partial/panels/settings.ejs @@ -54,6 +54,10 @@ along with this program. If not, see . %>

Disable Portrait/Mobile Layout:

+ +

Hide chat prompt send button:

+ +

Notification Settings

Play Sound for received PMs:

diff --git a/www/js/channel/channel.js b/www/js/channel/channel.js index 69aeffe..e771ddc 100644 --- a/www/js/channel/channel.js +++ b/www/js/channel/channel.js @@ -312,6 +312,19 @@ class channel{ //Toggle portrait mode this.chatBox.togglePortrait(); return; + case 'disableSendButton': + //if the send button isn't loaded + if(this.chatBox.sendButton == null){ + //we're fuckin' done here + return; + } + + console.log(value); + console.log((value == true || value == "true") ? "none" : "unset"); + + //Convert string to bool and use it to set visibility of send button + this.chatBox.sendButton.style.display = (value == true || value == "true") ? "none" : "unset"; + return; case 'userlistHidden': //If the userlist class isn't loaded in yet if(this.userList == null){ @@ -346,13 +359,14 @@ class channel{ ["syncDelta", 6], ["theme", "Movie Night"], ["chatWidthMin", 20], + ["disablePortrait", false], + ["disableSendButton", false], ["userlistHidden", false], ["cinemaMode", false], ["rxPMSound", 'unread'], ["txPMSound", false], ["newSeshSound", true], - ["endSeshSound", true], - ["disablePortrait", false] + ["endSeshSound", true] ]); } diff --git a/www/js/channel/panels/settingsPanel.js b/www/js/channel/panels/settingsPanel.js index 794e1af..5df8369 100644 --- a/www/js/channel/panels/settingsPanel.js +++ b/www/js/channel/panels/settingsPanel.js @@ -72,6 +72,11 @@ class settingsPanel extends panelObj{ */ this.disablePortrait = this.panelDocument.querySelector("#settings-panel-disable-portrait input"); + /** + * Disable Send Button + */ + this.disableSendButton = this.panelDocument.querySelector("#settings-panel-disable-send-button input"); + /** * Audible Ping on PM Recieved */ @@ -131,6 +136,7 @@ class settingsPanel extends panelObj{ this.theme.addEventListener('change', this.updateTheme.bind(this)); this.chatWidthMinimum.addEventListener('change', this.updateChatWidthMinimum.bind(this)); this.disablePortrait.addEventListener('change', this.updateDisablePortrait.bind(this)); + this.disableSendButton.addEventListener('change', this.updateDisableSendButton.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)); @@ -269,6 +275,16 @@ class settingsPanel extends panelObj{ client.processConfig("disablePortrait", this.disablePortrait.checked); } + /** + * Handles change toggle of disable/enable send buttton + */ + updateDisableSendButton(){ + console.log(this.disableSendButton); + console.log(this.disableSendButton.checked); + localStorage.setItem('disableSendButton', this.disableSendButton.checked); + client.processConfig("disableSendButton", this.disableSendButton.checked); + } + /** * Handles changes to RX PM Sound setting */