// [x-copy-query=""] // [x-inner-text] - will use innerText (() => { // TODO: make copy work with checksums because not uuid will not always cut it. function updateCopy() { document.querySelectorAll("[x-copy-query]:not([x1-copy-uuid])") .forEach(e => { let uuid = new Date().getTime().toString(36); e.setAttribute("x1-copy-uuid", uuid); if (e.hasAttribute("x-inner-text")) { e.innerText = document.querySelector(e.getAttribute("x-copy-query")).innerHTML } else { e.innerHTML = document.querySelector(e.getAttribute("x-copy-query")).innerHTML } }) } updateCopy(); window.x0?.registerModuleUpdateHook("copy", updateCopy); window.x0?.registerModuleRemoveHook("copy", () => { document.querySelectorAll("[x-copy-query]").forEach(e => e.innerHTML = ""); }); })()