From 4809be56a90e05ab178e5b62f4af72c68810a2ca Mon Sep 17 00:00:00 2001 From: G2-Games Date: Thu, 24 Oct 2024 12:58:11 -0500 Subject: [PATCH] Improved UI interactions with things --- src/main.rs | 4 ++-- web/request.js | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index c7584cb..678e0f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ mod database; mod strings; mod settings; -use std::{fs, path::Path, sync::{Arc, RwLock}, thread, time::Duration}; +use std::{fs, path::Path, sync::{Arc, RwLock}}; use blake3::Hash; use chrono::{DateTime, TimeDelta, Utc}; use database::{clean_loop, Database, MochiFile}; @@ -55,7 +55,7 @@ fn home(settings: &State) -> Markup { h2 { "Files up to " (settings.max_filesize.bytes()) " in size are allowed!" } hr; button.main_file_upload onclick="document.getElementById('fileInput').click()" { - h4 { "Upload File" } + h4 { "Upload File(s)" } p { "Click or Drag and Drop" } } h3 { "Expire after:" } diff --git a/web/request.js b/web/request.js index 7f032a6..80bf17f 100644 --- a/web/request.js +++ b/web/request.js @@ -58,21 +58,22 @@ function makeFinished(progressBar, progressText, linkRow, linkAddress, hash) { const link = progressText.appendChild(document.createElement("a")); link.textContent = hash; link.href = linkAddress; + link.target = "_blank"; let button = linkRow.appendChild(document.createElement("button")); button.textContent = "📝"; let buttonTimeout = null; - button.addEventListener('click', function(e) { + button.addEventListener('click', function(_e) { if (buttonTimeout) { clearTimeout(buttonTimeout) } navigator.clipboard.writeText( - encodeURI("https://" + window.location.host + "/" + linkAddress) + encodeURI(window.location.protocol + "//" + window.location.host + "/" + linkAddress) ) button.textContent = "✅"; buttonTimeout = setTimeout(function() { button.textContent = "📝"; - }, 500); + }, 750); }) progressBar.style.display = "none";