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 @@