From 259d35843aebec55fadf727b15f7da3f1a9a0239 Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Sat, 9 May 2026 00:08:05 +0200 Subject: [PATCH] fix no thumbs mode --- copyparty/web/browser.css | 9 +++++---- copyparty/web/browser.js | 33 ++++++++++++++------------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index d1791e19..5ae64554 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -955,7 +955,8 @@ tr.play td:nth-child(1) a { border-color: var(--g-f-b1); box-shadow: 0 .1em .3em var(--g-sh); } -#ggrid>a.play .thumb { +#ggrid>a.play .thumb, +#ggrid>a.play img { background: var(--bg-u2); } #ggrid>a .thumb, @@ -1057,7 +1058,7 @@ tr.play td:nth-child(1) a { animation: rotate 10s linear infinite; } } -html:not(.e) #ggrid>a.thumbed.dir:before { +html:not(.e) #ggrid>a:not(.nothumb).dir:before { content: '📂'; } #ggrid>a.dir>span { @@ -3977,7 +3978,7 @@ html.e #wrap.thin { padding: .1em 0; margin: .3em; } - a.img.thumbed { + a.img:not(.nothumb) { max-height: none; span:not(.th_ext) { display: none; @@ -4004,7 +4005,7 @@ html.e #wrap.thin { height: calc(var(--grid-sz) - 1.5em); } } - a.img.thumbed { + a.img:not(.nothumb) { min-width: calc(var(--grid-sz) / 2); width: auto; .thumb { diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index dc0ab668..06513e8a 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -6437,27 +6437,20 @@ var thegrid = (function () { if (href == "#") ihref = SR + '/.cpr/ico/' + (ref == 'moar' ? '++' : 'exit'); } - else if (isdir) { - ihref = SR + '/.cpr/ico/folder'; - } else { - if (!svgs.has(ext)) { - if (svgs.size < max_svgs) - svgs.add(ext); - else - ext = "unk"; - } - ihref = SR + '/.cpr/ico/' + ext; + ihref = ''; } - ihref = addq(ihref, 'cache=i&_=' + ACB + TS); - if (CHROME) - ihref += "&raster"; - var accent = getComputedStyle(document.body).getPropertyValue('--a'); - if (!accent) - accent = '#07c'; - ihref += '&a=' + parseColor(accent).replace(/ /g, ''); + if(ihref){ + ihref = addq(ihref, 'cache=i&_=' + ACB + TS); + if (CHROME) + ihref += "&raster"; + var accent = getComputedStyle(document.body).getPropertyValue('--a'); + if (!accent) + accent = '#07c'; + ihref += '&a=' + parseColor(accent).replace(/ /g, ''); + } html.push('' + '
' + @@ -6468,7 +6461,7 @@ var thegrid = (function () { (isdir || ext == 'unk' || ext.startsWith('/') ? '' : '' + ext + '') + - '
' + ao.innerHTML + '
'); } ggrid.innerHTML = html.join('\n'); @@ -6668,7 +6661,6 @@ var thegrid = (function () { function th_onload(el) { - clmod(el.parentElement.parentElement, 'thumbed', true) el.style.position = 'static' el.style.opacity = '1' el.style.height = ''; @@ -6676,6 +6668,9 @@ function th_onload(el) { el.previousSibling.previousSibling.style.display = 'none' } +function th_onerror(el) { + clmod(el.parentElement.parentElement, 'nothumb', true) +} function tree_scrollto(e) {