diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 49455062..b5b53599 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1381,7 +1381,11 @@ class HttpCli(object): if self.vpath == ".cpr/metrics": return self.conn.hsrv.metrics.tx(self) - res_path = "web/" + self.vpath[5:] + if self.vpath.startswith(".cpr/w/"): + res_path = "web/" + self.vpath[7:] + else: + res_path = "web/" + self.vpath[5:] + if res_path in RES: ap = self.E.mod_ + res_path if bos.path.exists(ap) or bos.path.exists(ap + ".gz"): diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index a830f5c5..c82cd43d 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -137,7 +137,7 @@ class HttpSrv(object): dls: dict[str, tuple[float, int]] = {} # state self.dli = self.tdli = dli self.dls = self.tdls = dls - self.iiam = '' % (self.args.SRS,) + self.iiam = '' % (self.args.SRS,) self.bound: set[tuple[str, int]] = set() self.name = "hsrv" + nsuf diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index b372cd58..a5b412b0 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -7,8 +7,8 @@ - - + + {{ html_head }} {%- if css %} @@ -146,13 +146,13 @@ var STG = window.localStorage; document.documentElement.className = (STG && STG.cpp_thm) || dtheme; - + {%- if lang != "eng" %} - + {%- endif %} - - - + + + {%- if js %} {%- endif %} diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 2552bfa8..72878b20 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -717,7 +717,7 @@ for (var a = 0; a < LANGN.length; a++) function langtest() { var n = LANGS.length - 1; for (var a = 1; a < LANGS.length; a++) - import_js(SR + '/.cpr/tl/' + LANGS[a] + '.js', function () { if (!--n) langtest2(); }); + import_js(SR + '/.cpr/w/tl/' + LANGS[a] + '.js', function () { if (!--n) langtest2(); }); } function langtest2() { for (var a = 0; a < LANGS.length; a++) { @@ -1844,7 +1844,7 @@ function MPlayer() { // breaks touchbar-macs console.log('init fau'); - r.fau = new Audio(SR + '/.cpr/deps/busy.mp3?_=' + TS); + r.fau = new Audio(SR + '/.cpr/w/deps/busy.mp3?_=' + TS); r.fau.loop = true; r.fau.play(); }; @@ -5027,7 +5027,7 @@ var showfile = (function () { qsr('#prism_css'); var el = mknod('link', 'prism_css'); el.rel = 'stylesheet'; - el.href = SR + '/.cpr/deps/prism' + (light ? '' : 'd') + '.css?_=' + TS; + el.href = SR + '/.cpr/w/deps/prism' + (light ? '' : 'd') + '.css?_=' + TS; document.head.appendChild(el); }; @@ -5240,7 +5240,7 @@ var showfile = (function () { if (!defer) fun(el.firstChild); else - import_js(SR + '/.cpr/deps/prism.js', function () { fun(); }); + import_js(SR + '/.cpr/w/deps/prism.js', function () { fun(); }); } if (!txt && r.wrap) el.className = 'wrap'; @@ -9010,7 +9010,7 @@ var globalcss = (function () { var sandboxjs = (function () { var ret = '', busy = false, - url = SR + '/.cpr/util.js?_=' + TS, + url = SR + '/.cpr/w/util.js?_=' + TS, tag = ''; return function () { @@ -9047,7 +9047,7 @@ function show_md(md, name, div, url, depth) { } wfp_debounce.n--; - return import_js(SR + '/.cpr/deps/marked.js', function () { + return import_js(SR + '/.cpr/w/deps/marked.js', function () { show_md(md, name, div, url, 1); }); } diff --git a/copyparty/web/idp.html b/copyparty/web/idp.html index 1e87ff93..13360181 100644 --- a/copyparty/web/idp.html +++ b/copyparty/web/idp.html @@ -8,8 +8,8 @@ - - + + {{ html_head }} @@ -46,7 +46,7 @@ var STG = window.localStorage; document.documentElement.className = (STG && STG.cpp_thm) || "{{ this.args.theme }}"; - + {%- if js %} {%- endif %} diff --git a/copyparty/web/md.html b/copyparty/web/md.html index ac17db2f..e2d1a9e6 100644 --- a/copyparty/web/md.html +++ b/copyparty/web/md.html @@ -7,10 +7,10 @@ - - + + {%- if edit %} - + {%- endif %} {{ html_head }} @@ -159,11 +159,11 @@ try { l.light = drk? 0:1; } catch (ex) { } })(); - - - + + + {%- if edit %} - + {%- endif %} - - - - + + + + {%- if js %} {%- endif %} diff --git a/copyparty/web/rups.html b/copyparty/web/rups.html index 832dbb50..f2ad0de7 100644 --- a/copyparty/web/rups.html +++ b/copyparty/web/rups.html @@ -8,8 +8,8 @@ - - + + {{ html_head }} @@ -33,9 +33,9 @@ var STG = window.localStorage; document.documentElement.className = (STG && STG.cpp_thm) || "{{ this.args.theme }}"; - + - + {%- if js %} {%- endif %} diff --git a/copyparty/web/shares.html b/copyparty/web/shares.html index 9f60d07c..51b89265 100644 --- a/copyparty/web/shares.html +++ b/copyparty/web/shares.html @@ -8,8 +8,8 @@ - - + + {{ html_head }} @@ -74,8 +74,8 @@ var STG = window.localStorage; document.documentElement.className = (STG && STG.cpp_thm) || "{{ this.args.theme }}"; - - + + {%- if js %} {%- endif %} diff --git a/copyparty/web/splash.html b/copyparty/web/splash.html index f5332c61..47f4d664 100644 --- a/copyparty/web/splash.html +++ b/copyparty/web/splash.html @@ -7,8 +7,8 @@ - - + + {{ html_head }} @@ -216,11 +216,11 @@ var STG = window.localStorage; document.documentElement.className = (STG && STG.cpp_thm) || "{{ this.args.theme }}"; - + {%- if lang != "eng" %} - + {%- endif %} - + {%- if js %} {%- endif %} diff --git a/copyparty/web/svcs.html b/copyparty/web/svcs.html index b95c1278..bf1c1517 100644 --- a/copyparty/web/svcs.html +++ b/copyparty/web/svcs.html @@ -7,8 +7,8 @@ - - + + {{ html_head }} @@ -233,7 +233,7 @@

partyfuse

partyfuse.py -- fast, read-only, - needs fuse.py in the same folder, + needs fuse.py in the same folder, needs winfsp doesn't need root

@@ -357,8 +357,8 @@ var STG = window.localStorage; document.documentElement.className = (STG && STG.cpp_thm) || "{{ args.theme }}"; - - + + {%- if js %} {%- endif %} diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index bee1602a..21a6dad0 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -801,7 +801,7 @@ function up2k_init(subtle) { setTimeout(function () { if (WebAssembly && !hws.length) - fetch(SR + '/.cpr/w.hash.js?_=' + TS); + fetch(SR + '/.cpr/w/w.hash.js?_=' + TS); }, 1000); function showmodal(msg) { @@ -831,7 +831,7 @@ function up2k_init(subtle) { m = L.u_https1 + ' ' + L.u_https2 + ' ' + L.u_https3; showmodal('

loading ' + fn + '

'); - import_js(SR + '/.cpr/deps/' + fn, unmodal); + import_js(SR + '/.cpr/w/deps/' + fn, unmodal); if (HTTPS) { // chrome<37 firefox<34 edge<12 opera<24 safari<7 @@ -1470,7 +1470,7 @@ function up2k_init(subtle) { } for (var a = 0; a < nw; a++) - hws.push(new Worker(SR + '/.cpr/w.hash.js?_=' + TS)); + hws.push(new Worker(SR + '/.cpr/w/w.hash.js?_=' + TS)); if (!subtle) for (var a = 0; a < hws.length; a++)