From f7dbd95a540eeec963dab8a9f5b7d80882d513c1 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 19 Jul 2021 01:56:19 +0200 Subject: [PATCH] v0.11.43 --- copyparty/__version__.py | 4 ++-- copyparty/web/browser.js | 4 ++-- copyparty/web/up2k.js | 24 ++++++++++++------------ copyparty/web/upload.css | 5 +++++ 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/copyparty/__version__.py b/copyparty/__version__.py index b6707e93..c57cf731 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (0, 11, 42) +VERSION = (0, 11, 43) CODENAME = "the grid" -BUILD_DT = (2021, 7, 18) +BUILD_DT = (2021, 7, 19) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 02629439..50a9a604 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1146,7 +1146,7 @@ var audio_eq = (function () { v = parseFloat(vs); if (isNaN(v) || v + '' != vs) - throw 42; + throw new Error('inval band'); if (isNaN(band)) r.amp = Math.round((v + step * 0.2) * 100) / 100; @@ -2954,7 +2954,7 @@ var arcfmt = (function () { var ofs = href.lastIndexOf('?'); if (ofs < 0) - throw 'missing arg in url'; + throw new Error('missing arg in url'); o.setAttribute("href", href.slice(0, ofs + 1) + arg); o.textContent = fmt.split('_')[0]; diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 614e162b..b98120bc 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -290,8 +290,7 @@ function U2pvis(act, btns) { if (this.is_act(this.tab[a].in)) console.log("tab %d/%d = sz %s", a, aa, this.tab[a].bt); - console.log("a"); - throw 42; + throw new Error('see console'); } obj.innerHTML = fo.hp; @@ -304,15 +303,8 @@ function U2pvis(act, btns) { oldcat = fo.in, bz_act = this.act == "bz"; - if (oldcat == newcat) { - throw 42; - } - - //console.log("oldcat %s %d, newcat %s %d, head=%d, tail=%d, file=%d, act.old=%s, act.new=%s, bz_act=%s", - // oldcat, this.ctr[oldcat], - // newcat, this.ctr[newcat], - // this.head, this.tail, nfile, - // this.is_act(oldcat), this.is_act(newcat), bz_act); + if (oldcat == newcat) + return; fo.in = newcat; this.ctr[oldcat]--; @@ -468,6 +460,12 @@ function U2pvis(act, btns) { } +function fsearch_explain(e) { + ev(e); + alert('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 then refresh\n\nsorry'); +} + + function up2k_init(subtle) { // show modal message function showmodal(msg) { @@ -1298,8 +1296,10 @@ function up2k_init(subtle) { smsg = ''; if (!response || !response.hits || !response.hits.length) { - msg = 'not found on server'; smsg = '404'; + msg = 'not found on server'; + if (has(perms, 'write')) + msg += ' (explain)'; } else { smsg = 'found'; diff --git a/copyparty/web/upload.css b/copyparty/web/upload.css index d1c25375..6babc6f5 100644 --- a/copyparty/web/upload.css +++ b/copyparty/web/upload.css @@ -257,6 +257,11 @@ html.light #u2foot .warn span { float: right; margin-bottom: -.3em; } +.fsearch_explain { + padding-left: .7em; + font-size: 1.1em; + line-height: 0; +}