From fb5430df37022e69df46c4ccf8f0f0525b891ab5 Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Wed, 15 Apr 2026 23:15:38 +0200 Subject: [PATCH] include subfolders option for folder search --- copyparty/web/browser.css | 30 ++++++++++++++++++++++++++---- copyparty/web/browser.html | 8 +++++++- copyparty/web/browser.js | 10 ++++++++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 25daaa64..495e31a8 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -4499,23 +4499,45 @@ html.e #detree { } .popup.show { - visibility: visible; - -webkit-animation: fadeIn 1s; - animation: fadeIn 1s; + visibility: visible; + -webkit-animation: fadeIn 1s; + animation: fadeIn 1s; } .popup { visibility: hidden; width: fit-content; background-color: var(--bg-u5); + border: 1px solid var(--bg-u3); + box-shadow: 0 0 2px var(--txt-sh); text-align: center; border-radius: .3em; padding: .5em; position: absolute; display: block; - z-index: 3; + z-index: 6; bottom: 2.5em; } +.under::after { + display: none; +} +.under { + top: calc(100% - .3em); + bottom: auto; + left: .5em; + right: 0; + text-align: left; + width: auto; +} +#srchfolder_div { + position: relative; + box-shadow: 0 0 2px var(--txt-sh); +} +#srchfolder_div:focus-within .popup{ + visibility: visible; + -webkit-animation: fadeIn 1s; + animation: fadeIn 1s; +} /* Popup arrow */ .popup::after { diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index 82bd75c2..8cb5c174 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -86,7 +86,13 @@ {%- endfor %} - +
+ + + + + +
{%- if doc %} diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 0d66252b..821620d0 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -523,6 +523,7 @@ if (1) "s_t1": "tags contains   (^=start, end=$)", "s_a1": "specific metadata properties", "s_dir": "search this folder", + "s_rec": "include subfolders", "md_eshow": "cannot render ", "md_off": "[📜readme] disabled in [⚙️] -- document hidden", @@ -6705,6 +6706,10 @@ var search_ui = (function () { } folderSearch.onkeydown = ev_search_keydown; + var recur_c = ebi('srch_recursivec'); + recur_c.oninput = ev_search_input; + ebi('srch_recursivelbl').innerHTML = L.s_rec; + function srch_msg(err, txt) { var o = ebi('srch_q'); o.textContent = txt; @@ -6765,6 +6770,7 @@ var search_ui = (function () { } function encode_query() { + var recursive = ebi('srch_recursivec').checked; var q = ''; for (var a = 0; a < sconf.length; a++) { for (var b = 1; b < sconf[a].length; b++) { @@ -6830,14 +6836,14 @@ var search_ui = (function () { if (tv.slice(0, 1) == '^') { tv = tv.slice(1); } - else { + else if(!(k == 'path' && !recursive)) { tv = '*' + tv; } if (tv.slice(-1) == '$') { tv = tv.slice(0, -1); } - else { + else if(!(k == 'path' && !recursive)) { tv += '*'; }