diff options
| author | sD <stoned@derpymail.org> | 2019-12-21 19:08:50 +0100 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2019-12-21 19:08:50 +0100 |
| commit | 50718dfeb5ecc0010e247e67b4a52777a4da033c (patch) | |
| tree | 07373a627476fa568b92985db63fe2985221be61 | |
| parent | be568feef204eeb07ded55cb51c1e4ba8f2e9c92 (diff) | |
store showname in cookie
| -rw-r--r-- | webAO/client.html | 4 | ||||
| -rw-r--r-- | webAO/client.js | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/webAO/client.html b/webAO/client.html index 4a6852f..875bcf0 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -118,7 +118,7 @@ No judge actions available for this role. </span> <br> - <span id="muting"> + <span id="muting" style="display: none"> <label for="mute_select">Mute a character:</label> <select name="mute_select" id="mute_select" onchange="mutelist_click(event)"></select> </span> @@ -246,7 +246,7 @@ <label for="ic_chat_name">Custom Showname:</label> <input id="ic_chat_name" name="ic_chat_name" class="short" type="text"> <label for="showname">Show others:</label> - <input id="showname" name="showname" type="checkbox"> + <input id="showname" name="showname" type="checkbox" onclick="showname_click()"> </span> <br> <br> diff --git a/webAO/client.js b/webAO/client.js index c5ff1b2..f6917b8 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -317,6 +317,7 @@ class Client extends EventEmitter { if (document.getElementById("OOC_name").value==="") { document.getElementById("OOC_name").value = "web"+this.playerID; } + document.getElementById("client_mvolume").value = getCookie("musicVolume"); changeMusicVolume(); document.getElementById("client_svolume").value = getCookie("sfxVolume"); @@ -324,6 +325,9 @@ class Client extends EventEmitter { document.getElementById("client_bvolume").value = getCookie("blipVolume"); changeBlipVolume(); + document.getElementById("ic_chat_name").value = getCookie("ic_chat_name"); + document.getElementById("showname").value = getCookie("showname"); + // Load evidence array to select const evidence_select = document.getElementById("evi_select"); evidence_select.add(new Option("Custom", 0)); @@ -1318,6 +1322,7 @@ class Viewport { pairSprite.style.display = ""; } else { pairSprite.style.display = "none"; + charSprite.style.left = 0; } } @@ -1592,6 +1597,16 @@ export function mutelist_click(_event) { window.musiclist_click = mutelist_click; /** + * Triggered when the showname checkboc is clicked + * @param {MouseEvent} event + */ +export function showname_click(_event) { + setCookie("showname", document.getElementById("showname").value); + setCookie("ic_chat_name", document.getElementById("ic_chat_name").value); +} +window.showname_click = showname_click; + +/** * Triggered when an item on the area list is clicked. * @param {MouseEvent} event */ |
