Added setting to hide channel chat prompt button

This commit is contained in:
rainbow napkin 2026-10-03 07:43:39 -04:00
parent 3815617a8e
commit 4af9d25573
3 changed files with 36 additions and 2 deletions

View file

@ -54,6 +54,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
<p>Disable Portrait/Mobile Layout: </p>
<input type="checkbox">
</span>
<span id="settings-panel-disable-send-button" class="settings-panel-setting">
<p>Hide chat prompt send button: </p>
<input type="checkbox">
</span>
<h4>Notification Settings</h4>
<span id="settings-panel-ping-on-pm-rx" class="settings-panel-setting">
<p>Play Sound for received PMs: </p>

View file

@ -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]
]);
}

View file

@ -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
*/