mirror of
https://github.com/9001/copyparty.git
synced 2026-06-21 05:32:25 -06:00
include subfolders option for folder search
This commit is contained in:
parent
9fef60d345
commit
fb5430df37
|
|
@ -4499,23 +4499,45 @@ html.e #detree {
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup.show {
|
.popup.show {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
-webkit-animation: fadeIn 1s;
|
-webkit-animation: fadeIn 1s;
|
||||||
animation: fadeIn 1s;
|
animation: fadeIn 1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup {
|
.popup {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
background-color: var(--bg-u5);
|
background-color: var(--bg-u5);
|
||||||
|
border: 1px solid var(--bg-u3);
|
||||||
|
box-shadow: 0 0 2px var(--txt-sh);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: .3em;
|
border-radius: .3em;
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: block;
|
display: block;
|
||||||
z-index: 3;
|
z-index: 6;
|
||||||
bottom: 2.5em;
|
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 arrow */
|
||||||
.popup::after {
|
.popup::after {
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,13 @@
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
{%- if doc %}
|
{%- if doc %}
|
||||||
|
|
|
||||||
|
|
@ -523,6 +523,7 @@ if (1)
|
||||||
"s_t1": "tags contains (^=start, end=$)",
|
"s_t1": "tags contains (^=start, end=$)",
|
||||||
"s_a1": "specific metadata properties",
|
"s_a1": "specific metadata properties",
|
||||||
"s_dir": "search this folder",
|
"s_dir": "search this folder",
|
||||||
|
"s_rec": "include subfolders",
|
||||||
|
|
||||||
"md_eshow": "cannot render ",
|
"md_eshow": "cannot render ",
|
||||||
"md_off": "[📜<em>readme</em>] disabled in [⚙️] -- document hidden",
|
"md_off": "[📜<em>readme</em>] disabled in [⚙️] -- document hidden",
|
||||||
|
|
@ -6705,6 +6706,10 @@ var search_ui = (function () {
|
||||||
}
|
}
|
||||||
folderSearch.onkeydown = ev_search_keydown;
|
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) {
|
function srch_msg(err, txt) {
|
||||||
var o = ebi('srch_q');
|
var o = ebi('srch_q');
|
||||||
o.textContent = txt;
|
o.textContent = txt;
|
||||||
|
|
@ -6765,6 +6770,7 @@ var search_ui = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function encode_query() {
|
function encode_query() {
|
||||||
|
var recursive = ebi('srch_recursivec').checked;
|
||||||
var q = '';
|
var q = '';
|
||||||
for (var a = 0; a < sconf.length; a++) {
|
for (var a = 0; a < sconf.length; a++) {
|
||||||
for (var b = 1; b < sconf[a].length; b++) {
|
for (var b = 1; b < sconf[a].length; b++) {
|
||||||
|
|
@ -6830,14 +6836,14 @@ var search_ui = (function () {
|
||||||
if (tv.slice(0, 1) == '^') {
|
if (tv.slice(0, 1) == '^') {
|
||||||
tv = tv.slice(1);
|
tv = tv.slice(1);
|
||||||
}
|
}
|
||||||
else {
|
else if(!(k == 'path' && !recursive)) {
|
||||||
tv = '*' + tv;
|
tv = '*' + tv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tv.slice(-1) == '$') {
|
if (tv.slice(-1) == '$') {
|
||||||
tv = tv.slice(0, -1);
|
tv = tv.slice(0, -1);
|
||||||
}
|
}
|
||||||
else {
|
else if(!(k == 'path' && !recursive)) {
|
||||||
tv += '*';
|
tv += '*';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue