mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-20 18:08:00 +02:00
Mockup Page communication
This commit is contained in:
parent
8014ed2055
commit
39459f14c5
@ -116,7 +116,7 @@ def init():
|
||||
try:
|
||||
image: GalleryImage = db.query(GalleryImage).filter(GalleryImage.path == image_path).first()
|
||||
head = "<head><link rel='stylesheet' href='/media/css/single-gallery.css'></head>"
|
||||
body = "<body><img src='/image/" + image.path + "'>" + image.htmlForm() + "</body>"
|
||||
body = "<body><div><button id='button'></button></div><img src='/image/" + image.path + "'>" + image.htmlForm() + "</body>"
|
||||
return Response(content="<html>" + head + body + "</head>", media_type="text/html")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user