From 35c8657e37630a1e0823fd2e615d071d7c4a8ab2 Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Fri, 3 Apr 2026 21:03:07 +0200 Subject: [PATCH] fix drop visuals and make drop search work again --- copyparty/web/browser.css | 15 +++++++++------ copyparty/web/up2k.js | 31 ++++++++++++++++++++++++------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index a1c2d5e9..d6ac9087 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -2471,7 +2471,7 @@ html.y #bbox-overlay figcaption a { display: table; left: 10%; width: 78%; - height: 26%; + height: 78%; margin: 0; font-size: 3em; font-weight: bold; @@ -2490,7 +2490,7 @@ html.y #bbox-overlay figcaption a { background: rgba(24, 24, 24, 0.7); left: 8%; width: 82%; - height: 32%; + height: 82%; margin: -3vh 0; } .dropdesc.hl.err { @@ -2535,18 +2535,21 @@ html.y #bbox-overlay figcaption a { height: 100%; } #up_dz { - bottom: 12%; + position: absolute; + bottom: 0; } #srch_dz { - display: none; - top: 50%; + position: absolute; + top: 0; } #up_zd { + position: absolute; top: 12%; bottom: 12%; } #srch_zd { - display: none; + position: absolute; + top: 12%; bottom: 12%; } .dropdesc span { diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 21a6dad0..c54d2a7c 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1054,6 +1054,20 @@ function up2k_init(subtle) { function onoverbtn(e) { return onovercmn(this, e, true); } + function checkDropMode(){ + if(ebi('fsearch')?.checked){ + ebi('srch_zd').style.display = ''; + ebi('up_zd').style.display = 'none'; + ebi('srch_dz').style.display = ''; + ebi('up_dz').style.display = 'none'; + } + else{ + ebi('srch_zd').style.display = 'none'; + ebi('up_zd').style.display = ''; + ebi('srch_dz').style.display = 'none'; + ebi('up_dz').style.display = ''; + } + } function onovercmn(self, e, btn) { try { var ok = false, dt = e.dataTransfer.types; @@ -1087,6 +1101,7 @@ function up2k_init(subtle) { if (btn) return; + checkDropMode(); clmod(ebi('drops'), 'vis', 1); var v = self.getAttribute('v'); if (v) @@ -1100,6 +1115,7 @@ function up2k_init(subtle) { clmod(ebi(v), 'hl'); if (--nenters <= 0) { + checkDropMode(); clmod(ebi('drops'), 'vis'); clmod(ebi('up_dz'), 'hl'); clmod(ebi('srch_dz'), 'hl'); @@ -1158,10 +1174,10 @@ function up2k_init(subtle) { ev(e); nenters = 0; offdrag.call(this); - var dz = this && this.getAttribute('id'); - if (!dz && e && e.clientY) - // cuo2duo fallback - dz = e.clientY < window.innerHeight / 2 ? 'up_dz' : 'srch_dz'; + // var dz = this && this.getAttribute('id'); + // if (!dz && e && e.clientY) + // // cuo2duo fallback + // dz = e.clientY < window.innerHeight / 2 ? 'up_dz' : 'srch_dz'; var err = this.getAttribute('err'); if (err) @@ -1169,10 +1185,11 @@ function up2k_init(subtle) { toast.inf(0, L.u_scan); - if ((dz == 'up_dz' && uc.fsearch) || (dz == 'srch_dz' && !uc.fsearch)) - tgl_fsearch(); + // if ((dz == 'up_dz' && uc.fsearch) || (dz == 'srch_dz' && !uc.fsearch)) + // tgl_fsearch(); - if (!QS('#op_up2k.act')) + //if (!QS('#op_up2k.act')) + if(!uc.fsearch) goto('up2k'); var files,