Add copy-to-clipboard button to meta page

Fixes #42.
This commit is contained in:
Daan Sprenkels
2020-04-05 18:14:02 +02:00
parent a766d5d596
commit 1dd0d17ba5
3 changed files with 54 additions and 0 deletions

View File

@@ -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}}