fix no thumbs mode

This commit is contained in:
Til Schmitter 2026-05-09 00:08:05 +02:00
parent b5de11093b
commit 259d35843a
2 changed files with 19 additions and 23 deletions

View file

@ -955,7 +955,8 @@ tr.play td:nth-child(1) a {
border-color: var(--g-f-b1); border-color: var(--g-f-b1);
box-shadow: 0 .1em .3em var(--g-sh); box-shadow: 0 .1em .3em var(--g-sh);
} }
#ggrid>a.play .thumb { #ggrid>a.play .thumb,
#ggrid>a.play img {
background: var(--bg-u2); background: var(--bg-u2);
} }
#ggrid>a .thumb, #ggrid>a .thumb,
@ -1057,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.thumbed.dir:before { html:not(.e) #ggrid>a:not(.nothumb).dir:before {
content: '📂'; content: '📂';
} }
#ggrid>a.dir>span { #ggrid>a.dir>span {
@ -3977,7 +3978,7 @@ html.e #wrap.thin {
padding: .1em 0; padding: .1em 0;
margin: .3em; margin: .3em;
} }
a.img.thumbed { a.img:not(.nothumb) {
max-height: none; max-height: none;
span:not(.th_ext) { span:not(.th_ext) {
display: none; display: none;
@ -4004,7 +4005,7 @@ html.e #wrap.thin {
height: calc(var(--grid-sz) - 1.5em); height: calc(var(--grid-sz) - 1.5em);
} }
} }
a.img.thumbed { a.img:not(.nothumb) {
min-width: calc(var(--grid-sz) / 2); min-width: calc(var(--grid-sz) / 2);
width: auto; width: auto;
.thumb { .thumb {

View file

@ -6437,27 +6437,20 @@ var thegrid = (function () {
if (href == "#") if (href == "#")
ihref = SR + '/.cpr/ico/' + (ref == 'moar' ? '++' : 'exit'); ihref = SR + '/.cpr/ico/' + (ref == 'moar' ? '++' : 'exit');
} }
else if (isdir) {
ihref = SR + '/.cpr/ico/folder';
}
else { else {
if (!svgs.has(ext)) { ihref = '';
if (svgs.size < max_svgs)
svgs.add(ext);
else
ext = "unk";
}
ihref = SR + '/.cpr/ico/' + ext;
} }
ihref = addq(ihref, 'cache=i&_=' + ACB + TS);
if (CHROME)
ihref += "&raster";
var accent = getComputedStyle(document.body).getPropertyValue('--a'); if(ihref){
if (!accent) ihref = addq(ihref, 'cache=i&_=' + ACB + TS);
accent = '#07c'; if (CHROME)
ihref += '&a=' + parseColor(accent).replace(/ /g, ''); ihref += "&raster";
var accent = getComputedStyle(document.body).getPropertyValue('--a');
if (!accent)
accent = '#07c';
ihref += '&a=' + parseColor(accent).replace(/ /g, '');
}
html.push('<a href="' + ohref + '" ref="' + ref + html.push('<a href="' + ohref + '" ref="' + ref +
'" class="' + ac + '" ttt="' + esc(name) + '">' + '" class="' + ac + '" ttt="' + esc(name) + '">' +
'<div class="imgcontainer">' + '<div class="imgcontainer">' +
@ -6468,7 +6461,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)" src="' + '<img loading="lazy" onload="th_onload(this)" onerror="th_onerror(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');
@ -6668,7 +6661,6 @@ 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 = '';
@ -6676,6 +6668,9 @@ 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) {