From a5b2adc1bf119d5ef941e3e227df444d482c027b Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 12 Oct 2023 17:22:32 +0200 Subject: simplify copying --- copyurl.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 copyurl.js (limited to 'copyurl.js') diff --git a/copyurl.js b/copyurl.js new file mode 100644 index 0000000..421ab2c --- /dev/null +++ b/copyurl.js @@ -0,0 +1,13 @@ +function copyURL() { + var copyText = document.getElementById("url"); + navigator.clipboard.writeText(copyText.href); + copyText.classList.add("highlight"); + window.setTimeout(() => copyText.classList.remove("highlight"), 1500); + document.getElementById('share-notice').style.display = "none"; + document.getElementById('shared-notice').style.display = "initial"; +} + +function resetURL() { + document.getElementById('share-notice').style.display = "initial"; + document.getElementById('shared-notice').style.display = "none"; +} -- cgit v1.2.3