mirror of
https://github.com/9001/copyparty.git
synced 2026-06-21 05:32:25 -06:00
alternative way to detect thumbnails
This commit is contained in:
parent
434ba30d51
commit
3f30c2e200
|
|
@ -1058,7 +1058,7 @@ tr.play td:nth-child(1) a {
|
||||||
animation: rotate 10s linear infinite;
|
animation: rotate 10s linear infinite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
html:not(.e) #ggrid>a:not(.nothumb).dir:before {
|
html:not(.e) #ggrid>a.thumbed.dir:before {
|
||||||
content: '📂';
|
content: '📂';
|
||||||
}
|
}
|
||||||
#ggrid>a.dir>span {
|
#ggrid>a.dir>span {
|
||||||
|
|
@ -3978,7 +3978,7 @@ html.e #wrap.thin {
|
||||||
padding: .1em 0;
|
padding: .1em 0;
|
||||||
margin: .3em;
|
margin: .3em;
|
||||||
}
|
}
|
||||||
a.img:not(.nothumb) {
|
a.img.thumbed {
|
||||||
max-height: none;
|
max-height: none;
|
||||||
span:not(.th_ext) {
|
span:not(.th_ext) {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
@ -4005,7 +4005,7 @@ html.e #wrap.thin {
|
||||||
height: calc(var(--grid-sz) - 1.5em);
|
height: calc(var(--grid-sz) - 1.5em);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a.img:not(.nothumb) {
|
a.img.thumbed {
|
||||||
min-width: calc(var(--grid-sz) / 2);
|
min-width: calc(var(--grid-sz) / 2);
|
||||||
width: auto;
|
width: auto;
|
||||||
.thumb {
|
.thumb {
|
||||||
|
|
|
||||||
|
|
@ -6459,7 +6459,7 @@ var thegrid = (function () {
|
||||||
(isdir || ext == 'unk' || ext.startsWith('/') ? '' :
|
(isdir || ext == 'unk' || ext.startsWith('/') ? '' :
|
||||||
'<span class="th_ext" style="font-size: ' + (r.sz / 5) +'em; font-size:calc(var(--grid-sz) / 5 * ' +
|
'<span class="th_ext" style="font-size: ' + (r.sz / 5) +'em; font-size:calc(var(--grid-sz) / 5 * ' +
|
||||||
(ext.length > 3 ? 1 / (3 + ext.length * .4) * 3 : 1) + ')">' + ext + '</span>') +
|
(ext.length > 3 ? 1 / (3 + ext.length * .4) * 3 : 1) + ')">' + ext + '</span>') +
|
||||||
'<img loading="lazy" onload="th_onload(this)" onerror="th_onerror(this)" src="' +
|
'<img loading="lazy" onload="th_onload(this)" src="' +
|
||||||
ihref + '" /></div><span class="' + ac + '">' + ao.innerHTML + '</span></a>');
|
ihref + '" /></div><span class="' + ac + '">' + ao.innerHTML + '</span></a>');
|
||||||
}
|
}
|
||||||
ggrid.innerHTML = html.join('\n');
|
ggrid.innerHTML = html.join('\n');
|
||||||
|
|
@ -6479,6 +6479,12 @@ var thegrid = (function () {
|
||||||
ths[a].onclick = gclick1;
|
ths[a].onclick = gclick1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var imgs = QSA('#ggrid>a img');
|
||||||
|
for (var a = 0, aa = imgs.length; a < aa; a++) {
|
||||||
|
if(imgs[a].complete)
|
||||||
|
clmod(imgs[a].parentElement.parentElement, 'thumbed', true)
|
||||||
|
}
|
||||||
|
|
||||||
var chks = QSA('.gselchk');
|
var chks = QSA('.gselchk');
|
||||||
for (var a = 0, aa = chks.length; a < aa; a++) {
|
for (var a = 0, aa = chks.length; a < aa; a++) {
|
||||||
chks[a].onclick = function (e) {
|
chks[a].onclick = function (e) {
|
||||||
|
|
@ -6659,6 +6665,7 @@ var thegrid = (function () {
|
||||||
|
|
||||||
|
|
||||||
function th_onload(el) {
|
function th_onload(el) {
|
||||||
|
clmod(el.parentElement.parentElement, 'thumbed', true)
|
||||||
el.style.position = 'static'
|
el.style.position = 'static'
|
||||||
el.style.opacity = '1'
|
el.style.opacity = '1'
|
||||||
el.style.height = '';
|
el.style.height = '';
|
||||||
|
|
@ -6666,9 +6673,6 @@ function th_onload(el) {
|
||||||
el.previousSibling.previousSibling.style.display =
|
el.previousSibling.previousSibling.style.display =
|
||||||
'none'
|
'none'
|
||||||
}
|
}
|
||||||
function th_onerror(el) {
|
|
||||||
clmod(el.parentElement.parentElement, 'nothumb', true)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function tree_scrollto(e) {
|
function tree_scrollto(e) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue