mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
fix search ui after b265e59
broke it
This commit is contained in:
parent
f0437fbb07
commit
1d9b355743
|
@ -1481,7 +1481,7 @@ function play(tid, is_ev, seek, call_depth) {
|
||||||
seek_au_sec(seek);
|
seek_au_sec(seek);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!seek) {
|
if (!seek && !ebi('unsearch')) {
|
||||||
var o = ebi(oid);
|
var o = ebi(oid);
|
||||||
o.setAttribute('id', 'thx_js');
|
o.setAttribute('id', 'thx_js');
|
||||||
sethash(oid);
|
sethash(oid);
|
||||||
|
@ -2966,9 +2966,6 @@ document.onkeydown = function (e) {
|
||||||
if (QS('.opview.act'))
|
if (QS('.opview.act'))
|
||||||
return QS('#ops>a').click();
|
return QS('#ops>a').click();
|
||||||
|
|
||||||
if (QS('#unsearch'))
|
|
||||||
return QS('#unsearch').click();
|
|
||||||
|
|
||||||
if (widget.is_open)
|
if (widget.is_open)
|
||||||
return widget.close();
|
return widget.close();
|
||||||
|
|
||||||
|
@ -2978,6 +2975,9 @@ document.onkeydown = function (e) {
|
||||||
if (!treectl.hidden)
|
if (!treectl.hidden)
|
||||||
return treectl.detree();
|
return treectl.detree();
|
||||||
|
|
||||||
|
if (QS('#unsearch'))
|
||||||
|
return QS('#unsearch').click();
|
||||||
|
|
||||||
if (thegrid.en)
|
if (thegrid.en)
|
||||||
return ebi('griden').click();
|
return ebi('griden').click();
|
||||||
}
|
}
|
||||||
|
@ -3352,7 +3352,7 @@ document.onkeydown = function (e) {
|
||||||
|
|
||||||
treectl.hide();
|
treectl.hide();
|
||||||
|
|
||||||
var html = mk_files_header(tagord);
|
var html = mk_files_header(tagord), seen = {};
|
||||||
html.push('<tbody>');
|
html.push('<tbody>');
|
||||||
html.push('<tr><td>-</td><td colspan="42"><a href="#" id="unsearch"><big style="font-weight:bold">[❌] close search results</big></a></td></tr>');
|
html.push('<tr><td>-</td><td colspan="42"><a href="#" id="unsearch"><big style="font-weight:bold">[❌] close search results</big></a></td></tr>');
|
||||||
for (var a = 0; a < res.hits.length; a++) {
|
for (var a = 0; a < res.hits.length; a++) {
|
||||||
|
@ -3361,13 +3361,18 @@ document.onkeydown = function (e) {
|
||||||
sz = esc(r.sz + ''),
|
sz = esc(r.sz + ''),
|
||||||
rp = esc(uricom_dec(r.rp + '')[0]),
|
rp = esc(uricom_dec(r.rp + '')[0]),
|
||||||
ext = rp.lastIndexOf('.') > 0 ? rp.split('.').pop().split('?')[0] : '%',
|
ext = rp.lastIndexOf('.') > 0 ? rp.split('.').pop().split('?')[0] : '%',
|
||||||
links = linksplit(r.rp + '');
|
id = 'f-' + ('00000000' + crc32(rp)).slice(-8);
|
||||||
|
|
||||||
|
while (seen[id])
|
||||||
|
id += 'a';
|
||||||
|
seen[id] = 1;
|
||||||
|
|
||||||
if (ext.length > 8)
|
if (ext.length > 8)
|
||||||
ext = '%';
|
ext = '%';
|
||||||
|
|
||||||
links = links.join('');
|
var links = linksplit(r.rp + '', id).join(''),
|
||||||
var nodes = ['<tr><td>-</td><td><div>' + links + '</div>', sz];
|
nodes = ['<tr><td>-</td><td><div>' + links + '</div>', sz];
|
||||||
|
|
||||||
for (var b = 0; b < tagord.length; b++) {
|
for (var b = 0; b < tagord.length; b++) {
|
||||||
var k = tagord[b],
|
var k = tagord[b],
|
||||||
v = r.tags[k] || "";
|
v = r.tags[k] || "";
|
||||||
|
|
|
@ -434,7 +434,7 @@ function makeSortable(table, cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function linksplit(rp) {
|
function linksplit(rp, id) {
|
||||||
var ret = [],
|
var ret = [],
|
||||||
apath = '/',
|
apath = '/',
|
||||||
q = null;
|
q = null;
|
||||||
|
@ -464,9 +464,14 @@ function linksplit(rp) {
|
||||||
vlink = vlink.slice(0, -1) + '<span>/</span>';
|
vlink = vlink.slice(0, -1) + '<span>/</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rp && q)
|
if (!rp) {
|
||||||
|
if (q)
|
||||||
link += q;
|
link += q;
|
||||||
|
|
||||||
|
if (id)
|
||||||
|
link += '" id="' + id;
|
||||||
|
}
|
||||||
|
|
||||||
ret.push('<a href="' + apath + link + '">' + vlink + '</a>');
|
ret.push('<a href="' + apath + link + '">' + vlink + '</a>');
|
||||||
apath += link;
|
apath += link;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue