diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index ad42c249..8e26701c 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -6978,6 +6978,14 @@ class HttpCli(object): if "zip" in self.uparam or "tar" in self.uparam: raise Pebkac(403) + zsl = j2a["files"] = [] + if is_js: + j2a["ls0"] = cgv["ls0"] = { + "dirs": zsl, + "files": zsl, + "taglist": zsl, + } + html = self.j2s(tpl, **j2a) self.reply(html.encode("utf-8", "replace")) return True diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 0bbd32b1..5cb8a943 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -7560,9 +7560,10 @@ var treectl = (function () { qsr('#bbsw'); srvinf = ebi('srv_info').innerHTML.slice(6, -7); if (ls0 === null) { - setck('js=y'); r.ls_cb = showfile.addlinks; - return r.reqls(get_evpath(), false, undefined, true); + return setck('js=y', function () { + r.reqls(get_evpath(), false, undefined, true); + }); } ls0.unlist = unlist0; ls0.u2ts = u2ts; diff --git a/copyparty/web/util.js b/copyparty/web/util.js index ec896d74..357f8e5c 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -1326,9 +1326,10 @@ function scfg_bind(obj, oname, cname, defval, cb) { return v; } -function setck(v) { +function setck(v, cb) { var xhr = new XHR(); xhr.open('GET', SR + '/?setck=' + v, true); + xhr.onload = cb; xhr.send(); }