diff options
| author | sD <stoned@derpymail.org> | 2020-04-11 21:47:02 +0200 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2020-04-11 21:47:02 +0200 |
| commit | 07cbf4bda7f53ac67119f508c7ebf4e2d572728b (patch) | |
| tree | 82817da23f0d1b0f0514932f5f43491189fc81a3 | |
| parent | 82428c0ccc7b4938564b434fb0de153afb5af508 (diff) | |
save showname to a cookie
| -rw-r--r-- | webAO/client.html | 2 | ||||
| -rw-r--r-- | webAO/client.js | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/webAO/client.html b/webAO/client.html index 197d77e..8f675ac 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -161,7 +161,7 @@ <br> <span id="cccc" style="display: none"> <label for="ic_chat_name">Custom Showname:</label> - <input id="ic_chat_name" name="ic_chat_name" type="text"> + <input id="ic_chat_name" name="ic_chat_name" type="text" onchange="onShownameChange()"> <label for="showname">Show others:</label> <input id="showname" name="showname" type="checkbox" onclick="showname_click()"> </span> diff --git a/webAO/client.js b/webAO/client.js index b106b03..90561cc 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1916,6 +1916,15 @@ function setCookie(cname, value) { } /** + * Triggered when the showname is changed + * @param {KeyboardEvent} event + */ +export function onShownameChange(event) { + setCookie("showname",document.getElementById("client_oocinputbox").value); +} +window.onShownameChange = onShownameChange; + +/** * Triggered when the Return key is pressed on the out-of-character chat input box. * @param {KeyboardEvent} event */ |
