Added portrait-mode toggle

This commit is contained in:
rainbow napkin 2026-05-18 01:21:56 -04:00
parent f9a6321b7b
commit d41e9d1df9
4 changed files with 43 additions and 7 deletions

View file

@ -62,6 +62,11 @@ class settingsPanel extends panelObj{
*/
this.chatWidthMinimum = this.panelDocument.querySelector("#settings-panel-min-chat-width input");
/**
* Disable Portrait/Mobile Layout
*/
this.disablePortrait = this.panelDocument.querySelector("#settings-panel-disable-portrait input");
/**
* Audible Ping on PM Recieved
*/
@ -99,6 +104,7 @@ 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.disablePortrait.addEventListener('change', this.updateDisablePortrait.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));
@ -115,6 +121,7 @@ class settingsPanel extends panelObj{
this.liveSyncTolerance.value = localStorage.getItem("liveSyncTolerance");
this.syncDelta.value = localStorage.getItem("syncDelta");
this.chatWidthMinimum.value = localStorage.getItem("chatWidthMin");
this.disablePortrait.checked = localStorage.getItem("disablePortrait") == 'true';
this.rxPMSound.value = localStorage.getItem('rxPMSound');
this.txPMSound.checked = localStorage.getItem('txPMSound') == 'true';
this.newSeshSound.checked = localStorage.getItem('newSeshSound') == 'true';
@ -218,11 +225,20 @@ class settingsPanel extends panelObj{
client.processConfig("chatWidthMin", this.chatWidthMinimum.value);
}
/**
* Handles change toggle of disable/enable portrait
*/
updateDisablePortrait(){
localStorage.setItem('disablePortrait', this.disablePortrait.checked);
client.processConfig("disablePortrait", this.disablePortrait.checked);
}
/**
* Handles changes to RX PM Sound setting
*/
updateRXPMSound(){
localStorage.setItem('rxPMSound', this.rxPMSound.value);
client.processConfig("rxPMSound", this.rxPMSound.value);
}
/**
@ -230,6 +246,7 @@ class settingsPanel extends panelObj{
*/
updateTXPMSound(){
localStorage.setItem('txPMSound', this.txPMSound.checked);
client.processConfig("txPMSound", this.txPMSound.checked);
}
/**
@ -237,6 +254,7 @@ class settingsPanel extends panelObj{
*/
updateNewPMSeshSound(){
localStorage.setItem('newSeshSound', this.newSeshSound.checked);
client.processConfig("newSeshSound", this.newSeshSound.checked);
}
/**
@ -244,5 +262,6 @@ class settingsPanel extends panelObj{
*/
updateEndPMSeshSound(){
localStorage.setItem('endSeshSound', this.endSeshSound.checked);
client.processConfig("endSeshSound", this.endSeshSound.checked);
}
}