summaryrefslogtreecommitdiff
path: root/copyurl.js
diff options
context:
space:
mode:
authormartin f. krafft <madduck@madduck.net>2023-10-12 17:22:32 +0200
committermartin f. krafft <madduck@madduck.net>2023-10-12 17:22:32 +0200
commita5b2adc1bf119d5ef941e3e227df444d482c027b (patch)
treed6b2acc37e6ba191c3188be1afec1609f8b47aea /copyurl.js
parentfa7359d41f45a4a73ad183d58974261de5a0e4f1 (diff)
simplify copying
Diffstat (limited to 'copyurl.js')
-rw-r--r--copyurl.js13
1 files changed, 13 insertions, 0 deletions
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";
+}