mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
fix search results as thumbnails
This commit is contained in:
parent
d102bb3199
commit
41bcf7308d
|
@ -227,7 +227,7 @@ class U2idx(object):
|
||||||
if rd.startswith("//") or fn.startswith("//"):
|
if rd.startswith("//") or fn.startswith("//"):
|
||||||
rd, fn = s3dec(rd, fn)
|
rd, fn = s3dec(rd, fn)
|
||||||
|
|
||||||
rp = "/".join([vtop, rd, fn])
|
rp = "/".join([x for x in [vtop, rd, fn] if x])
|
||||||
sret.append({"ts": int(ts), "sz": sz, "rp": rp, "w": w[:16]})
|
sret.append({"ts": int(ts), "sz": sz, "rp": rp, "w": w[:16]})
|
||||||
|
|
||||||
for hit in sret:
|
for hit in sret:
|
||||||
|
|
|
@ -811,6 +811,9 @@ var thegrid = (function () {
|
||||||
if (e && e.ctrlKey)
|
if (e && e.ctrlKey)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (QS('#ggrid a[ref="unsearch"]'))
|
||||||
|
return ebi('unsearch').click();
|
||||||
|
|
||||||
ev(e);
|
ev(e);
|
||||||
var oth = ebi(this.getAttribute('ref')),
|
var oth = ebi(this.getAttribute('ref')),
|
||||||
td = oth.parentNode.nextSibling,
|
td = oth.parentNode.nextSibling,
|
||||||
|
@ -836,9 +839,9 @@ var thegrid = (function () {
|
||||||
return r.loadsel();
|
return r.loadsel();
|
||||||
|
|
||||||
var html = [];
|
var html = [];
|
||||||
var tr = lfiles.tBodies[0].rows;
|
var files = QSA('#files>tbody>tr>td:nth-child(2) a[id]');
|
||||||
for (var a = 0; a < tr.length; a++) {
|
for (var a = 0, aa = files.length; a < aa; a++) {
|
||||||
var ao = tr[a].cells[1].firstChild,
|
var ao = files[a],
|
||||||
href = esc(ao.getAttribute('href')),
|
href = esc(ao.getAttribute('href')),
|
||||||
ref = ao.getAttribute('id'),
|
ref = ao.getAttribute('id'),
|
||||||
isdir = href.split('?')[0].slice(-1)[0] == '/',
|
isdir = href.split('?')[0].slice(-1)[0] == '/',
|
||||||
|
@ -1124,7 +1127,7 @@ document.onkeydown = function (e) {
|
||||||
xhr.setRequestHeader('Content-Type', 'text/plain');
|
xhr.setRequestHeader('Content-Type', 'text/plain');
|
||||||
xhr.onreadystatechange = xhr_search_results;
|
xhr.onreadystatechange = xhr_search_results;
|
||||||
xhr.ts = Date.now();
|
xhr.ts = Date.now();
|
||||||
xhr.send(JSON.stringify({"q": ebi('q_raw').value}));
|
xhr.send(JSON.stringify({ "q": ebi('q_raw').value }));
|
||||||
}
|
}
|
||||||
|
|
||||||
function xhr_search_results() {
|
function xhr_search_results() {
|
||||||
|
|
Loading…
Reference in a new issue