From 39459f14c5ad4f052b53bba78fc2c1e24c22f0bc Mon Sep 17 00:00:00 2001 From: ManInDark <61268856+ManInDark@users.noreply.github.com> Date: Thu, 10 Aug 2023 00:05:07 +0200 Subject: [PATCH] Mockup Page communication --- ui/easydiffusion/bucket_manager.py | 2 +- ui/media/js/main.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/easydiffusion/bucket_manager.py b/ui/easydiffusion/bucket_manager.py index 9b7aeae1..e17a1c2a 100644 --- a/ui/easydiffusion/bucket_manager.py +++ b/ui/easydiffusion/bucket_manager.py @@ -116,7 +116,7 @@ def init(): try: image: GalleryImage = db.query(GalleryImage).filter(GalleryImage.path == image_path).first() head = "" - body = "" + image.htmlForm() + "" + body = "
" + image.htmlForm() + "" return Response(content="" + head + body + "", media_type="text/html") except Exception as e: print(e) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 5beb094d..72cd72e8 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -3088,6 +3088,15 @@ let recentResolutionsValues = [] function galleryImage(item) { let div = document.createElement("div") let img = document.createElement("img") + img.addEventListener("click", (event) => { + let w; + w = window.open("/single_image?image_path=" + item.path, "_blank") + w.addEventListener("DOMContentLoaded", () => { + w.document.getElementById("button").addEventListener("click", () => { + document.title = "hi" + }) + }) + }) img.src = "/image/" + item.path img.dataset["request"] = JSON.stringify(item)