diff --git a/internal/web/static/paste.js b/internal/web/static/paste.js index 8796837..0e88715 100644 --- a/internal/web/static/paste.js +++ b/internal/web/static/paste.js @@ -18,10 +18,11 @@ function toggleStats() { } function copyFeedback(btn) { if (!btn) return; + if (!btn.dataset.label) btn.dataset.label = btn.textContent; // remember the original label (Copy/Link) btn.classList.add('ok'); btn.textContent = 'Success!'; clearTimeout(btn._okh); - btn._okh = setTimeout(() => { btn.classList.remove('ok'); btn.textContent = 'copy'; }, 2000); + btn._okh = setTimeout(() => { btn.classList.remove('ok'); btn.textContent = btn.dataset.label; }, 2000); } function copyContent(btn) { navigator.clipboard.writeText(document.getElementById('raw-content').value) diff --git a/internal/web/templates/new.html b/internal/web/templates/new.html index d1d5bad..ef90b5f 100644 --- a/internal/web/templates/new.html +++ b/internal/web/templates/new.html @@ -19,7 +19,7 @@ - + diff --git a/internal/web/templates/paste.html b/internal/web/templates/paste.html index ba43cb7..74456cd 100644 --- a/internal/web/templates/paste.html +++ b/internal/web/templates/paste.html @@ -6,11 +6,11 @@

{{if .Title}}{{.Title}}{{else}}Untitled paste{{end}}

{{if .CustomSlug}}/{{.CustomSlug}}{{end}}
- - raw - link - copy - {{if .DeletionToken}}delete{{end}} + + Raw + Link + Copy + {{if .DeletionToken}}Delete{{end}}