commit 011f4ec03141e37b5466cb062900dfe7fc9178b8
parent dd3116c2918bc87032aaec53c87df2e9803bd755
Author: breadcat <breadcat@users.noreply.github.com>
Date: Sat, 27 Sep 2025 01:12:58 +0100
Replace long pre raw link with shorter input
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/static/copy-link.js b/static/copy-link.js
@@ -1,5 +1,6 @@
document.getElementById("copy-btn").addEventListener("click", function() {
- const text = document.getElementById("raw-url").textContent.trim();
+ const input = document.getElementById("raw-url");
+ const text = input.value.trim();
const status = document.getElementById("copy-status");
// Fallback approach using a temporary textarea
diff --git a/templates/file.html b/templates/file.html
@@ -52,7 +52,7 @@
<script src="/static/description.js" defer></script>
<h3>Raw URL</h3>
-<pre id="raw-url">http://{{.IP}}:{{.Port}}/uploads/{{.Data.EscapedFilename}}</pre>
+<input id="raw-url" value="http://{{.IP}}:{{.Port}}/uploads/{{.Data.EscapedFilename}}">
<button id="copy-btn" style="margin-top: 5px;">Copy to Clipboard</button>
<span id="copy-status" style="margin-left: 10px;"></span>
<script src="/static/copy-link.js" defer></script>