From b3b8c3541699edd8a4b4d50c9e4e23c4aad0ea3c Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Mon, 8 Jun 2026 11:14:29 +0200 Subject: [PATCH 1/4] hide disabled contextual buttons completely --- copyparty/web/browser.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index aa6c6245..f5282b79 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -4628,10 +4628,10 @@ var fileman = (function () { encut = nsel, encpy = nsel, enpst = r.clip && r.clip.length, - hren = !(have_mv && has(perms, 'write') && has(perms, 'move')), - hdel = !(have_del && has(perms, 'delete')), - hcut = !(have_mv && has(perms, 'move')), - hpst = !(have_mv && has(perms, 'write')), + hren = !(have_mv && has(perms, 'write') && has(perms, 'move')) || !nsel, + hdel = !(have_del && has(perms, 'delete')) || !nsel, + hcut = !(have_mv && has(perms, 'move')) || !nsel, + hpst = !(have_mv && has(perms, 'write')) || !enpst, hshr = !can_shr || !get_evpath().indexOf(have_shr), enclr = enpst || nsel; @@ -4649,7 +4649,8 @@ var fileman = (function () { clmod(bren, 'hide', hren); clmod(bdel, 'hide', hdel); clmod(bcut, 'hide', hcut); - clmod(bpst, 'hide', hpst); + clmod(bcpy, 'hide', !encpy); + clmod(bpst, 'hide', !enpst); clmod(bshr, 'hide', hshr); clmod(bclr, 'hide', !enclr); From c15a9ac67a4f327572e41eeece8d797597d4e4bb Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Mon, 8 Jun 2026 12:28:28 +0200 Subject: [PATCH 2/4] deselect all on mobile cut or copy to improve navigation --- copyparty/web/browser.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index f5282b79..8e3d7f52 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -5367,6 +5367,9 @@ var fileman = (function () { catch (ex) { toast.warn(30, L.fc_warn.format(sel.length)); } + + if(thegrid.tempsel) + msel.evsel(); }; r.cpy = function (e) { @@ -5427,6 +5430,9 @@ var fileman = (function () { catch (ex) { toast.warn(30, L.fcc_warn.format(sel.length)); } + + if(thegrid.tempsel) + msel.evsel(); }; document.onpaste = function (e) { From 36aaeaacbc1dd43d98dded384bac6075e5f3f8f5 Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Mon, 8 Jun 2026 12:33:47 +0200 Subject: [PATCH 3/4] disable special behavior of grid clicks when selection active --- copyparty/web/browser.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 8e3d7f52..b354c386 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -6456,7 +6456,7 @@ window.thegrid = (function () { return r.loadsel(); clmod(this, 'sel', clgot(tr, 'sel')); } - else if (in_tree && !have_sel) + else if (in_tree) in_tree.click(); else if (oth.hasAttribute('download')) @@ -6465,14 +6465,14 @@ window.thegrid = (function () { else if (aplay && (r.vau || !is_img)) aplay.click(); - else if (is_dir && !have_sel) + else if (is_dir) treectl.reqls(qhref, true); else if (is_txt && !has(['md', 'htm', 'html'], is_txt)) atext.click(); - else if (!is_img && have_sel) - window.open(qhref, '_blank'); + // else if (!is_img && have_sel) + // window.open(qhref, '_blank'); else { if (!dbl){ From 7fb00fb9644a4a87bbd5b5f6914dbf023595fa8a Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Mon, 8 Jun 2026 12:38:29 +0200 Subject: [PATCH 4/4] esc to deselect / clear clipboard --- copyparty/web/browser.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index b354c386..e6126dc3 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -7131,6 +7131,9 @@ var ahotkeys = function (e) { if (QS('#music.vis')) return ebi('cl_mu').click(); + if (!clgot(ebi('fclr'), 'hide')) + return fileman.clear(); + if (QS('.opview.act')) return QS('#ops>a').click();