diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 66bccf46..ad6a70e1 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -857,6 +857,12 @@ html.y #path a:hover { color: var(--srv-3); border-bottom: 1px solid var(--srv-3b); } +#goh+span { + color: var(--bg-u5); + padding-left: .5em; + margin-left: .5em; + border-left: .2em solid var(--bg-u5); +} #repl { padding: .33em; } diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 655d881f..7cf7dfd5 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -2806,6 +2806,7 @@ function eval_hash() { (function () { + // a11y jump-to-content for (var a = 0; a < 2; a++) (function (a) { var d = mknod('a'); @@ -2822,8 +2823,16 @@ function eval_hash() { }; })(a); + // account-info label var d = mknod('div', 'acc_info'); document.body.insertBefore(d, ebi('ops')); + + // folder nav + ebi('goh').parentElement.appendChild(mknod('span', null, + 'prev/up/next')); + ebi('gop').onclick = function () { tree_neigh(-1); } + ebi('gon').onclick = function () { tree_neigh(1); } + ebi('gou').onclick = function () { tree_up(true); } })(); @@ -4274,7 +4283,7 @@ function tree_neigh(n) { } -function tree_up() { +function tree_up(justgo) { if (showfile.active()) return thegrid.setvis(true); @@ -4284,9 +4293,11 @@ function tree_up() { treectl.entree(null, true); return; } - if (act.previousSibling.textContent == '-') - return act.previousSibling.click(); - + if (act.previousSibling.textContent == '-') { + act.previousSibling.click(); + if (!justgo) + return; + } act.parentNode.parentNode.parentNode.getElementsByTagName('a')[1].click(); } diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 3ef0627d..4106c9c8 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -54,11 +54,15 @@ var ebi = document.getElementById.bind(document), XHR = XMLHttpRequest; -function mknod(et, eid) { +function mknod(et, eid, html) { var ret = document.createElement(et); + if (eid) ret.id = eid; + if (html) + ret.innerHTML = html; + return ret; }