include subfolders option for folder search

This commit is contained in:
Til Schmitter 2026-04-15 23:15:38 +02:00
parent 9fef60d345
commit fb5430df37
3 changed files with 41 additions and 7 deletions

View file

@ -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 {

View file

@ -86,7 +86,13 @@
{%- endfor %}
</h1>
</div>
<input id="folder_search" type="text"/>
<div id="srchfolder_div">
<input id="folder_search" type="text"/>
<span id="srch_quickopts" class="popup under">
<input type="checkbox" id="srch_recursivec" checked="true">
<label for="srch_recursivec" id="srch_recursivelbl" tabindex="0"></label>
</span>
</div>
</div>
{%- if doc %}

View file

@ -523,6 +523,7 @@ if (1)
"s_t1": "tags contains &nbsp; (^=start, end=$)",
"s_a1": "specific metadata properties",
"s_dir": "search this folder",
"s_rec": "include subfolders",
"md_eshow": "cannot render ",
"md_off": "[📜<em>readme</em>] 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 += '*';
}