mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
spa filetab
This commit is contained in:
parent
4a843a6624
commit
b265e59834
|
@ -157,6 +157,7 @@ ebi('op_cfg').innerHTML = (
|
||||||
' <a id="thumbs" class="tgl btn" href="#" tt="in icon view, toggle icons or thumbnails$NHotkey: T">🖼️ thumbs</a>\n' +
|
' <a id="thumbs" class="tgl btn" href="#" tt="in icon view, toggle icons or thumbnails$NHotkey: T">🖼️ thumbs</a>\n' +
|
||||||
' <a id="dotfiles" class="tgl btn" href="#" tt="show hidden files (if server permits)">dotfiles</a>\n' +
|
' <a id="dotfiles" class="tgl btn" href="#" tt="show hidden files (if server permits)">dotfiles</a>\n' +
|
||||||
' <a id="ireadme" class="tgl btn" href="#" tt="show README.md in folder listings">📜 readme</a>\n' +
|
' <a id="ireadme" class="tgl btn" href="#" tt="show README.md in folder listings">📜 readme</a>\n' +
|
||||||
|
' <a id="spafiles" class="tgl btn" href="#" tt="speedboost when not using the navpane;$Nturn it off if things arent loading somehow">spa</a>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
'</div>\n' +
|
'</div>\n' +
|
||||||
(have_zip ? (
|
(have_zip ? (
|
||||||
|
@ -1494,7 +1495,8 @@ function play(tid, is_ev, seek, call_depth) {
|
||||||
}
|
}
|
||||||
|
|
||||||
mpui.progress_updater();
|
mpui.progress_updater();
|
||||||
pbar.drawbuf();
|
pbar.onresize();
|
||||||
|
vbar.onresize();
|
||||||
mpl.announce();
|
mpl.announce();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3433,6 +3435,7 @@ var treectl = (function () {
|
||||||
mentered = null,
|
mentered = null,
|
||||||
treesz = clamp(icfg_get('treesz', 16), 10, 50);
|
treesz = clamp(icfg_get('treesz', 16), 10, 50);
|
||||||
|
|
||||||
|
bcfg_bind(r, 'spa', 'spafiles', true);
|
||||||
bcfg_bind(r, 'ireadme', 'ireadme', true);
|
bcfg_bind(r, 'ireadme', 'ireadme', true);
|
||||||
bcfg_bind(r, 'dyn', 'dyntree', true, onresize);
|
bcfg_bind(r, 'dyn', 'dyntree', true, onresize);
|
||||||
bcfg_bind(r, 'dots', 'dotfiles', false, function (v) {
|
bcfg_bind(r, 'dots', 'dotfiles', false, function (v) {
|
||||||
|
@ -3636,7 +3639,7 @@ var treectl = (function () {
|
||||||
|
|
||||||
r.goto = function (url, push) {
|
r.goto = function (url, push) {
|
||||||
get_tree("", url, true);
|
get_tree("", url, true);
|
||||||
reqls(url, push, true);
|
r.reqls(url, push, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
function get_tree(top, dst, rst) {
|
function get_tree(top, dst, rst) {
|
||||||
|
@ -3805,12 +3808,12 @@ var treectl = (function () {
|
||||||
treegrow.call(this.previousSibling, e);
|
treegrow.call(this.previousSibling, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reqls(this.getAttribute('href'), true);
|
r.reqls(this.getAttribute('href'), true);
|
||||||
r.dir_cb = tree_scrollto;
|
r.dir_cb = tree_scrollto;
|
||||||
thegrid.setvis(true);
|
thegrid.setvis(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function reqls(url, hpush, no_tree) {
|
r.reqls = function (url, hpush, no_tree) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.top = url;
|
xhr.top = url;
|
||||||
xhr.hpush = hpush;
|
xhr.hpush = hpush;
|
||||||
|
@ -3954,7 +3957,7 @@ var treectl = (function () {
|
||||||
xhr.open('GET', '/?am_js', true);
|
xhr.open('GET', '/?am_js', true);
|
||||||
xhr.send();
|
xhr.send();
|
||||||
|
|
||||||
return reqls(get_evpath(), false, true);
|
return r.reqls(get_evpath(), false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
r.gentab(get_evpath(), ls0);
|
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) {
|
ebi('files').onclick = ebi('docul').onclick = function (e) {
|
||||||
var tgt = e.target.closest('a[id]');
|
var tgt = e.target.closest('a[id]');
|
||||||
if (tgt && tgt.getAttribute('id').indexOf('f-') === 0 && tgt.textContent.endsWith('/')) {
|
if (tgt && tgt.getAttribute('id').indexOf('f-') === 0 && tgt.textContent.endsWith('/')) {
|
||||||
var el = treectl.find(tgt.textContent.slice(0, -1));
|
var el = treectl.find(tgt.textContent.slice(0, -1));
|
||||||
if (!el)
|
if (el) {
|
||||||
return;
|
el.click();
|
||||||
|
return ev(e);
|
||||||
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]');
|
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'));
|
showfile.show(noq_href(ebi(tgt.getAttribute('hl'))), tgt.getAttribute('lang'));
|
||||||
return ev(e);
|
return ev(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
function reload_mp() {
|
function reload_mp() {
|
||||||
|
|
Loading…
Reference in a new issue