Add copy-to-clipboard button to meta page

Fixes #42.
This commit is contained in:
Daan Sprenkels committed 2020-04-05 18:16:41 +02:00
1 parent a766d5d596
commit 1dd0d17ba5
3 files changed
+54

No files matched your search

@@ -2,8 +2,15 @@
'{{.Paste.Key}}{{.FileExt}}' metadata - rushlink
{{end}}
{{define "head-append"}}
<script type="text/javascript" src="/js/copyclipboard.js" defer></script>
{{end}}
{{define "body"}}
<pre>
<button onclick="copyToClipboard('{{.RootURL}}/{{.Paste.Key}}{{.FileExt}}')">Copy URL to clipboard</button> <span id="copyToClipboardStatus"></span>
</pre>
<pre>
<a href="{{.RootURL}}/{{.Paste.Key}}{{.FileExt}}">{{.RootURL}}/{{.Paste.Key}}{{.FileExt}}</a>
---
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}