initial upload
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
document.addEventListener("click", async (event) => {
|
||||
const button = event.target.closest("[data-copy]");
|
||||
if (!button) return;
|
||||
const target = document.querySelector(button.dataset.copy);
|
||||
if (!target) return;
|
||||
try {
|
||||
await navigator.clipboard.writeText(target.textContent.trim());
|
||||
const original = button.textContent;
|
||||
button.textContent = "Copied";
|
||||
window.setTimeout(() => {
|
||||
button.textContent = original;
|
||||
}, 1500);
|
||||
} catch {
|
||||
button.textContent = "Copy failed";
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user