diff --git a/assets/main.js b/assets/main.js index 3223d66..054c2cc 100644 --- a/assets/main.js +++ b/assets/main.js @@ -324,10 +324,25 @@ class ThemeToggler extends HTMLAnchorElement { } } +// TODO bug: if pinned then moved, pin button loses bold + class PoemSaver extends HTMLFormElement { // TODO oops, you can't copy an image on ff; disable copy if image selected connectedCallback() { + this.querySelectorAll("input[name=type]").forEach((e) => { + e.addEventListener("change", (e) => { + if (e.target.value == "image") { + this.querySelector("button.copy").setAttribute("disabled", true); + } else { + this.querySelector("button").removeAttribute("disabled"); + } + }); + }); + const fd = new FormData(this); + if (fd.get("type") == "image") { + this.querySelector("button.copy").setAttribute("disabled", true); + } this.addEventListener("submit", (e) => { e.preventDefault(); const fd = new FormData(e.target); diff --git a/templates/index.tmpl b/templates/index.tmpl index 2871d8b..124136e 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -50,8 +50,6 @@ span.linetext {
- -about @@ -64,8 +62,8 @@ span.linetext { as text as image include sources - - + +