From 5ccca3fbd52d45b56260adc7f48ca08229242caf Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 27 Mar 2021 16:12:47 +0100 Subject: [PATCH] more --- copyparty/authsrv.py | 1 + copyparty/httpcli.py | 3 ++- copyparty/web/browser.js | 32 +++++++++++++++++++------------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 8cf30503..485ee2f9 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -170,6 +170,7 @@ class VFS(object): files = [x for x in files if x[0] in flt] rd = [x for x in rd if x[0] in flt] vd = {x: y for x, y in vd.items() if x in flt} + flt = None # print(repr([vpath, apath, [x[0] for x in files]])) fnames = [n[0] for n in files] diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 52bb9061..11e49227 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -417,7 +417,8 @@ class HttpCli(object): raise Pebkac(422, "need files list") items = items.replace("\r", "").split("\n") - items = [x for x in items if items] + items = [unquotep(x) for x in items if items] + return self.tx_zip(k, v, vn, rem, items, self.args.ed) def handle_post_json(self): diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 4d5b1319..3e8c8258 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1149,7 +1149,7 @@ var treectl = (function () { filecols.set_style(); mukey.render(); - arcfmt.render(); + msel.render(); reload_tree(); reload_browser(); } @@ -1631,7 +1631,7 @@ var msel = (function () { var names = []; var links = document.querySelectorAll('#files tbody tr.sel td:nth-child(2) a'); for (var a = 0, aa = links.length; a < aa; a++) - names.push(links[a].getAttribute('href')); + names.push(links[a].getAttribute('href').split('/').slice(-1)); return names; } @@ -1645,18 +1645,18 @@ var msel = (function () { tr.classList.toggle('sel'); selui(); } - var trs = document.querySelectorAll('#files tbody tr'); - ebi('selall').onclick = function (e) { + function evsel(e, fun) { ev(e); + var trs = document.querySelectorAll('#files tbody tr'); for (var a = 0, aa = trs.length; a < aa; a++) - trs[a].classList.add('sel'); + trs[a].classList[fun]('sel'); selui(); + } + ebi('selall').onclick = function (e) { + evsel(e, "add"); }; ebi('selinv').onclick = function (e) { - ev(e); - for (var a = 0, aa = trs.length; a < aa; a++) - trs[a].classList.toggle('sel'); - selui(); + evsel(e, "toggle"); }; ebi('selzip').onclick = function (e) { ev(e); @@ -1682,10 +1682,16 @@ var msel = (function () { console.log(txt); frm.submit(); }; - var tds = document.querySelectorAll('#files tbody td+td+td'); - for (var a = 0, aa = tds.length; a < aa; a++) { - tds[a].onclick = seltgl; + function render() { + var tds = document.querySelectorAll('#files tbody td+td+td'); + for (var a = 0, aa = tds.length; a < aa; a++) { + tds[a].onclick = seltgl; + } + arcfmt.render(); } + return { + "render": render + }; })(); @@ -1741,4 +1747,4 @@ function reload_browser(not_mp) { } reload_browser(true); mukey.render(); -arcfmt.render(); +msel.render();