From cf87cea9f834c2f7c12a1b5f27e0a1c3a3117e58 Mon Sep 17 00:00:00 2001
From: ed
Date: Sat, 21 May 2022 11:32:25 +0200
Subject: [PATCH] ux, tl
---
copyparty/web/browser.js | 40 +++++++++++++++++++++++++++++-----------
copyparty/web/ui.css | 6 +++++-
copyparty/web/up2k.js | 25 +++++++++++++------------
3 files changed, 47 insertions(+), 24 deletions(-)
diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js
index 94fa1dad..95d50c26 100644
--- a/copyparty/web/browser.js
+++ b/copyparty/web/browser.js
@@ -62,7 +62,7 @@ var Ls = {
"ut_ask": "ask for confirmation before upload starts",
"ut_srch": "don't actually upload, instead check if the files already $N exist on the server (will scan all folders you can read)",
"ut_par": "pause uploads by setting it to 0$N$Nincrease if your connection is slow / high latency$N$Nkeep it 1 on LAN or if the server HDD is a bottleneck",
- "ul_btn": "drop files / folders
here (or click me)",
+ "ul_btn": "drop files / folders
here (or click me)",
"ul_btnu": "U P L O A D",
"ul_btns": "S E A R C H",
@@ -84,7 +84,7 @@ var Ls = {
"utl_stat": "status",
"utl_prog": "progress",
- "ul_flagblk": "the files were added to the queue
however there is a busy up2k in another browser tab,
so waiting for that to finish first",
+ "ul_flagblk": "the files were added to the queue
however there is a busy up2k in another browser tab,
so waiting for that to finish first",
"udt_up": "Upload",
"udt_srch": "Search",
@@ -280,7 +280,7 @@ var Ls = {
"u_https2": "switch to https",
"u_https3": "for much better performance",
"u_ancient": 'your browser is impressively ancient -- maybe you should use bup instead',
- "u_ever": "this is the basic uploader; up2k needs at least
chrome 21 // firefox 13 // edge 12 // opera 12 // safari 5.1",
+ "u_ever": "this is the basic uploader; up2k needs at least
chrome 21 // firefox 13 // edge 12 // opera 12 // safari 5.1",
"u_su2k": 'this is the basic uploader; up2k is better',
"u_ewrite": 'you do not have write-access to this folder',
"u_eread": 'you do not have read-access to this folder',
@@ -288,8 +288,8 @@ var Ls = {
"u_badf": 'These {0} files (of {1} total) were skipped, possibly due to filesystem permissions:\n\n',
"u_blankf": 'These {0} files (of {1} total) are blank / empty; upload them anyways?\n\n',
"u_just1": '\nMaybe it works better if you select just one file',
- "u_asku": 'upload these {0} files?',
- 'u_asks': 'search for these {0} files?',
+ "u_asku": 'upload these {0} files to {1}
',
+ "u_unpt": "you can undo / delete this upload using the top-left 🧯",
"u_etadone": 'Done ({0}, {1} files)',
"u_etaprep": '(preparing to upload)',
"u_hashdone": 'hashing done',
@@ -300,6 +300,15 @@ var Ls = {
"u_ehsfin": "server rejected the request to finalize upload",
"u_ehssrch": "server rejected the request to perform search",
"u_ehsinit": "server rejected the request to initiate upload",
+ "u_s404": "not found on server",
+ "u_expl": "explain",
+ "u_tu": '
WARNING: turbo enabled, client may not detect and resume incomplete uploads; see turbo-button tooltip
', + "u_ts": 'WARNING: turbo enabled, search results can be incorrect; see turbo-button tooltip
', + "ue_ro": 'your access to this folder is Read-Only\n\n', + "ue_nl": 'you are currently not logged in', + "ue_la": 'you are currently logged in as "{0}"', + "ue_sr": 'you are currently in file-search mode\n\nswitch to upload-mode by clicking the magnifying glass 🔎 (next to the big SEARCH button), and try uploading again\n\nsorry', + "ue_ta": 'try uploading again, it should work now', "lang_set": "refresh to make the change take effect?", }, @@ -363,7 +372,7 @@ var Ls = { "ut_ask": "bekreft filutvalg før opplastning starter", "ut_srch": "utfør søk istedenfor å laste opp --$Nleter igjennom alle mappene du har lov til å se", "ut_par": "sett til 0 for å midlertidig stanse opplastning$N$Nhøye verdier (4 eller 8) kan gi bedre ytelse,$Nspesielt på trege internettlinjer$N$Nbør ikke være høyere enn 1 på LAN$Neller hvis serveren sin harddisk er treg", - "ul_btn": "slipp filer / mapper{1}
',
+ "u_unpt": "Du kan angre / slette opplastningen med 🧯 oppe til venstre",
"u_etadone": 'Ferdig ({0}, {1} filer)',
"u_etaprep": '(forbereder opplastning)',
"u_hashdone": 'befaring ferdig',
@@ -601,6 +610,15 @@ var Ls = {
"u_ehsfin": "server nektet forespørselen om å ferdigstille filen",
"u_ehssrch": "server nektet forespørselen om å utføre søk",
"u_ehsinit": "server nektet forespørselen om å begynne en ny opplastning",
+ "u_s404": "ikke funnet på serveren",
+ "u_expl": "forklar",
+ "u_tu": 'ADVARSEL: turbo er på, avbrutte opplastninger vil muligens ikke oppdages og gjenopptas; hold musepekeren over turbo-knappen for mer info
', + "u_ts": 'ADVARSEL: turbo er på, søkeresultater kan være feil; hold musepekeren over turbo-knappen for mer info
', + "ue_ro": 'du har ikke skrivetilgang i denne mappen\n\n', + "ue_nl": 'du er ikke logget inn', + "ue_la": 'du er logget inn som "{0}"', + "ue_sr": 'du er i filsøk-modus\n\nbytt til opplastning ved å klikke på forstørrelsesglasset 🔎 (ved siden av den store FILSØK-knappen) og prøv igjen\n\nsorry', + "ue_ta": 'prøv å laste opp igjen, det burde funke nå', "lang_set": "passer det å laste siden på nytt?", }, diff --git a/copyparty/web/ui.css b/copyparty/web/ui.css index 5360b741..042d4dc7 100644 --- a/copyparty/web/ui.css +++ b/copyparty/web/ui.css @@ -174,11 +174,15 @@ html.y #tt, html.y #toast { box-shadow: 0 .3em 1em rgba(0,0,0,0.4); } -#modalc code, html.y #tt code { background: #060; color: #fff; } +#modalc code { + color: #060; + background: transparent; + border: 1px solid #ccc; +} html.y #tt em { color: #d38; } diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 7d6814b9..9fac3d99 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -568,12 +568,12 @@ function Donut(uc, st) { function fsearch_explain(n) { if (n) - return toast.inf(60, 'your access to this folder is Read-Only\n\n' + (acct == '*' ? 'you are currently not logged in' : 'you are currently logged in as "' + acct + '"')); + return toast.inf(60, L.ue_ro + (acct == '*' ? L.ue_nl : L.ue_la).format(acct)); if (bcfg_get('fsearch', false)) - return toast.inf(60, 'you are currently in file-search mode\n\nswitch to upload-mode by clicking the green magnifying glass (next to the big yellow search button), and try uploading again\n\nsorry'); + return toast.inf(60, L.ue_sr); - return toast.inf(60, 'try again, it should work now'); + return toast.inf(60, L.ue_ta); } @@ -985,12 +985,15 @@ function up2k_init(subtle) { return a < b ? -1 : a > b ? 1 : 0; }); - var msg = [(uc.fsearch ? L.u_asks : L.u_asku).format(good_files.length) + 'WARNING: turbo enabled, client may not detect and resume incomplete uploads; see turbo-button tooltip
', - msgs = 'WARNING: turbo enabled, search results can be incorrect; see turbo-button tooltip
', - msg = uc.fsearch ? msgs : msgu, - omsg = uc.fsearch ? msgu : msgs, + var msg = uc.fsearch ? L.u_ts : L.u_tu, + omsg = uc.fsearch ? L.u_tu : L.u_ts, html = ebi('u2foot').innerHTML, ohtml = html; @@ -2012,7 +2013,7 @@ function up2k_init(subtle) { if (msg && html.indexOf(msg) === -1) html = html.replace(omsg, '') + msg; else if (!msg) - html = html.replace(msgu, '').replace(msgs, ''); + html = html.replace(L.u_tu, '').replace(L.u_ts, ''); if (html !== ohtml) ebi('u2foot').innerHTML = html;