diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js
index 64496dc1..86e941e7 100644
--- a/copyparty/web/browser.js
+++ b/copyparty/web/browser.js
@@ -157,6 +157,7 @@ ebi('op_cfg').innerHTML = (
' 🖼️ thumbs\n' +
' dotfiles\n' +
' 📜 readme\n' +
+ ' spa\n' +
' \n' +
'\n' +
(have_zip ? (
@@ -1494,7 +1495,8 @@ function play(tid, is_ev, seek, call_depth) {
}
mpui.progress_updater();
- pbar.drawbuf();
+ pbar.onresize();
+ vbar.onresize();
mpl.announce();
return true;
}
@@ -3433,6 +3435,7 @@ var treectl = (function () {
mentered = null,
treesz = clamp(icfg_get('treesz', 16), 10, 50);
+ bcfg_bind(r, 'spa', 'spafiles', true);
bcfg_bind(r, 'ireadme', 'ireadme', true);
bcfg_bind(r, 'dyn', 'dyntree', true, onresize);
bcfg_bind(r, 'dots', 'dotfiles', false, function (v) {
@@ -3636,7 +3639,7 @@ var treectl = (function () {
r.goto = function (url, push) {
get_tree("", url, true);
- reqls(url, push, true);
+ r.reqls(url, push, true);
};
function get_tree(top, dst, rst) {
@@ -3805,12 +3808,12 @@ var treectl = (function () {
treegrow.call(this.previousSibling, e);
return;
}
- reqls(this.getAttribute('href'), true);
+ r.reqls(this.getAttribute('href'), true);
r.dir_cb = tree_scrollto;
thegrid.setvis(true);
}
- function reqls(url, hpush, no_tree) {
+ r.reqls = function (url, hpush, no_tree) {
var xhr = new XMLHttpRequest();
xhr.top = url;
xhr.hpush = hpush;
@@ -3954,7 +3957,7 @@ var treectl = (function () {
xhr.open('GET', '/?am_js', true);
xhr.send();
- return reqls(get_evpath(), false, true);
+ return r.reqls(get_evpath(), false, true);
}
r.gentab(get_evpath(), ls0);
@@ -4985,15 +4988,29 @@ function wintitle(txt) {
}
+ebi('path').onclick = function (e) {
+ var a = e.target.closest('a[href]');
+ if (!treectl.spa || !a || !(a = a.getAttribute('href') + '') || !a.endsWith('/'))
+ return;
+
+ treectl.reqls(a, true, true);
+ return ev(e);
+};
+
+
ebi('files').onclick = ebi('docul').onclick = function (e) {
var tgt = e.target.closest('a[id]');
if (tgt && tgt.getAttribute('id').indexOf('f-') === 0 && tgt.textContent.endsWith('/')) {
var el = treectl.find(tgt.textContent.slice(0, -1));
- if (!el)
- return;
-
- el.click();
- return ev(e);
+ if (el) {
+ el.click();
+ return ev(e);
+ }
+ if (treectl.spa) {
+ treectl.reqls(tgt.getAttribute('href'), true, true);
+ return ev(e);
+ }
+ return;
}
tgt = e.target.closest('a[hl]');
@@ -5001,7 +5018,7 @@ ebi('files').onclick = ebi('docul').onclick = function (e) {
showfile.show(noq_href(ebi(tgt.getAttribute('hl'))), tgt.getAttribute('lang'));
return ev(e);
}
-}
+};
function reload_mp() {