From 6188e3e063bbab26c1571a2c527093c415c672c4 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Sun, 3 Dec 2023 14:18:51 +0100 Subject: [PATCH] feat: Add copy feature --- html/static/js/copy.js | 6 ++++++ templates/layout/bottom.php | 1 + templates/pages/fragments/creation-successful.php | 1 + 3 files changed, 8 insertions(+) create mode 100644 html/static/js/copy.js diff --git a/html/static/js/copy.js b/html/static/js/copy.js new file mode 100644 index 0000000..3e44d04 --- /dev/null +++ b/html/static/js/copy.js @@ -0,0 +1,6 @@ +function copy(selector) { + let element = document.querySelector(selector); + navigator.clipboard.writeText(element.innerHTML); + + return false; +} \ No newline at end of file diff --git a/templates/layout/bottom.php b/templates/layout/bottom.php index 308b1d0..d790ce8 100644 --- a/templates/layout/bottom.php +++ b/templates/layout/bottom.php @@ -1,2 +1,3 @@ + diff --git a/templates/pages/fragments/creation-successful.php b/templates/pages/fragments/creation-successful.php index 75fe3c3..e3b5128 100644 --- a/templates/pages/fragments/creation-successful.php +++ b/templates/pages/fragments/creation-successful.php @@ -1,5 +1,6 @@
" target="_blank"> + copy
Click here to create a new link.