From c750163d172504c2b6240ec408f88979d45d9f3e Mon Sep 17 00:00:00 2001 From: somebody Date: Sun, 30 Oct 2022 21:32:23 -0500 Subject: [PATCH 1/3] Make notifications really way up there --- static/koboldai.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/koboldai.css b/static/koboldai.css index 79c5a496..5b579b92 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -2492,7 +2492,7 @@ body { right: 0px; height: calc(100vh - 15px); width: 400px; - z-index: 8; + z-index: 99999999; pointer-events: none; overflow-y: hidden; overflow-x: hidden; @@ -2500,7 +2500,6 @@ body { } .notification { - z-index: 8; background-color: #30414e; animation: 10s 1 alternate swoosh-in; margin-right: 15px; From 53b1695627ca3a9750c8adf0c8bb2aec16d0ad89 Mon Sep 17 00:00:00 2001 From: somebody Date: Sun, 30 Oct 2022 21:32:47 -0500 Subject: [PATCH 2/3] Support auto-focusing in openPopup --- static/koboldai.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/koboldai.js b/static/koboldai.js index 9e413c2a..f6dbbdf0 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -4922,6 +4922,12 @@ function openPopup(id) { const popup = $el(`#${id}`); popup.classList.remove("hidden"); + + // Sometimes we want to instantly focus on certain elements when a menu opens. + for (const noticeMee of popup.getElementsByClassName("focus-on-me")) { + noticeMee.focus(); + break; + } } function closePopups() { From cdb058e47deb0266a4df7ea13cbc7748d7ae71ff Mon Sep 17 00:00:00 2001 From: somebody Date: Sun, 30 Oct 2022 21:34:49 -0500 Subject: [PATCH 3/3] Make club loading nicer --- static/koboldai.js | 26 +++++++++++++++++++++++++- templates/popups.html | 4 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/static/koboldai.js b/static/koboldai.js index f6dbbdf0..f7d5f1d5 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -4900,6 +4900,7 @@ function updateTitle() { } function openClubImport() { + $el("#aidgpromptnum").value = ""; openPopup("aidg-import-popup"); } @@ -5736,4 +5737,27 @@ function deleteConfirmation(sFormatted, confirmText, denyText, confirmCallback, } openPopup("confirm-delete-dialog"); -} \ No newline at end of file +} + +function attemptClubLoad() { + const input = $el("#aidgpromptnum"); + let val = input.value; + if (!/^\d+$/.test(val)) { + // Not an id, is it a full URL? + const matches = val.match(/aetherroom\.club\/([0-9]+)/) + if (!matches) { + reportError("Malformed club import", "That doesn't look like a valid club URL or ID. Please check your input and try again."); + return; + } + val = matches[1]; + } + socket.emit("load_aidg_club", val); + closePopups(); +} + + +$el("#aidgpromptnum").addEventListener("keydown", function(event) { + if (event.key !== "Enter") return; + attemptClubLoad(); + event.preventDefault(); +}); \ No newline at end of file diff --git a/templates/popups.html b/templates/popups.html index 0598c665..46004b33 100644 --- a/templates/popups.html +++ b/templates/popups.html @@ -122,10 +122,10 @@
https://aetherroom.club/

- +