Website Summary Files Commits Branches @commit @diff @stats
path: root / views / archive / item.php
diff options
context:
space:
mode:
Commit6c10a09f4353da4127159fbc89ee7f610c16099d (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-02-09 21:14:55 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-02-09 21:14:55 +0200
Files193e001366fc68f1d05864fac67bf373e2f53f68 /views/archive/item.php
nowayforward_human-6c10a09f4353da4127159fbc89ee7f610c16099d.tar
nowayforward_human-6c10a09f4353da4127159fbc89ee7f610c16099d.tar.gz
nowayforward_human-6c10a09f4353da4127159fbc89ee7f610c16099d.zip
Parent0ed7e401196bba31375662475a1b69a6582766ec (diff)
feat(views/archive/item): Add copy to clipboard button
1 files changed, 8 insertions, 1 deletions
-rw-r--r--views/archive/item.php9
diff --git a/views/archive/item.php b/views/archive/item.php
index 5609a31..cff2f92 100644
--- a/views/archive/item.php
+++ b/views/archive/item.php
@@ -18,7 +18,14 @@
<input type="hidden" name="url" value="<?= $page->URL ?>">
<button><?php include $VIEWS_DIR . '/img/pdf-export.svg' ?></button>
</form>
- <span></span>
+ <button id="copy-to-clipboard" title="Copy to clipboard!"><?php include $VIEWS_DIR . '/img/link.svg' ?></button>
+ <script type="text/javascript">
+ const ctc = document.getElementById('copy-to-clipboard');
+ ctc.onclick = function () {
+ navigator.clipboard.writeText('<?= getenv("HTTP_HOST") . "/archives/" . $page->WID . "/index.php" ?>');
+ alert("Copied to clipboard!");
+ };
+ </script>
</section>
<section name="itemButton" hidden>
<form action="/list/add" method="GET">