Added setting to hide channel chat prompt button
This commit is contained in:
parent
3815617a8e
commit
4af9d25573
3 changed files with 36 additions and 2 deletions
|
|
@ -54,6 +54,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
||||||
<p>Disable Portrait/Mobile Layout: </p>
|
<p>Disable Portrait/Mobile Layout: </p>
|
||||||
<input type="checkbox">
|
<input type="checkbox">
|
||||||
</span>
|
</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>
|
<h4>Notification Settings</h4>
|
||||||
<span id="settings-panel-ping-on-pm-rx" class="settings-panel-setting">
|
<span id="settings-panel-ping-on-pm-rx" class="settings-panel-setting">
|
||||||
<p>Play Sound for received PMs: </p>
|
<p>Play Sound for received PMs: </p>
|
||||||
|
|
|
||||||
|
|
@ -312,6 +312,19 @@ class channel{
|
||||||
//Toggle portrait mode
|
//Toggle portrait mode
|
||||||
this.chatBox.togglePortrait();
|
this.chatBox.togglePortrait();
|
||||||
return;
|
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':
|
case 'userlistHidden':
|
||||||
//If the userlist class isn't loaded in yet
|
//If the userlist class isn't loaded in yet
|
||||||
if(this.userList == null){
|
if(this.userList == null){
|
||||||
|
|
@ -346,13 +359,14 @@ class channel{
|
||||||
["syncDelta", 6],
|
["syncDelta", 6],
|
||||||
["theme", "Movie Night"],
|
["theme", "Movie Night"],
|
||||||
["chatWidthMin", 20],
|
["chatWidthMin", 20],
|
||||||
|
["disablePortrait", false],
|
||||||
|
["disableSendButton", false],
|
||||||
["userlistHidden", false],
|
["userlistHidden", false],
|
||||||
["cinemaMode", false],
|
["cinemaMode", false],
|
||||||
["rxPMSound", 'unread'],
|
["rxPMSound", 'unread'],
|
||||||
["txPMSound", false],
|
["txPMSound", false],
|
||||||
["newSeshSound", true],
|
["newSeshSound", true],
|
||||||
["endSeshSound", true],
|
["endSeshSound", true]
|
||||||
["disablePortrait", false]
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,11 @@ class settingsPanel extends panelObj{
|
||||||
*/
|
*/
|
||||||
this.disablePortrait = this.panelDocument.querySelector("#settings-panel-disable-portrait input");
|
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
|
* Audible Ping on PM Recieved
|
||||||
*/
|
*/
|
||||||
|
|
@ -131,6 +136,7 @@ class settingsPanel extends panelObj{
|
||||||
this.theme.addEventListener('change', this.updateTheme.bind(this));
|
this.theme.addEventListener('change', this.updateTheme.bind(this));
|
||||||
this.chatWidthMinimum.addEventListener('change', this.updateChatWidthMinimum.bind(this));
|
this.chatWidthMinimum.addEventListener('change', this.updateChatWidthMinimum.bind(this));
|
||||||
this.disablePortrait.addEventListener('change', this.updateDisablePortrait.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.rxPMSound.addEventListener('change', this.updateRXPMSound.bind(this));
|
||||||
this.txPMSound.addEventListener('change', this.updateTXPMSound.bind(this));
|
this.txPMSound.addEventListener('change', this.updateTXPMSound.bind(this));
|
||||||
this.newSeshSound.addEventListener('change', this.updateNewPMSeshSound.bind(this));
|
this.newSeshSound.addEventListener('change', this.updateNewPMSeshSound.bind(this));
|
||||||
|
|
@ -269,6 +275,16 @@ class settingsPanel extends panelObj{
|
||||||
client.processConfig("disablePortrait", this.disablePortrait.checked);
|
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
|
* Handles changes to RX PM Sound setting
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue