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; diff --git a/static/koboldai.js b/static/koboldai.js index 97abf9be..5ecaec4c 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -4902,6 +4902,7 @@ function updateTitle() { } function openClubImport() { + $el("#aidgpromptnum").value = ""; openPopup("aidg-import-popup"); } @@ -4924,6 +4925,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() { @@ -5732,4 +5739,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/

- +