diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 14338280..52bc1e4e 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -5282,10 +5282,11 @@ class HttpCli(object): # chrome cannot handle more than ~2000 unique SVGs # so url-param "raster" returns a png/webp instead # (useragent-sniffing kinshi due to caching proxies) - mime, ico = self.conn.hsrv.ico.get(txt, not small, "raster" in self.uparam, self.uparam.get('a')) + # mime, ico = self.conn.hsrv.ico.get(txt, not small, "raster" in self.uparam, self.uparam.get('a')) lm = formatdate(self.E.t0) - self.reply(ico, mime=mime, headers={"Last-Modified": lm}) + # self.reply(ico, mime=mime, headers={"Last-Modified": lm}) + self.reply('', headers={"Last-Modified": lm}) return True def tx_qr(self): diff --git a/copyparty/ico.py b/copyparty/ico.py index e8a03a8c..663942c1 100644 --- a/copyparty/ico.py +++ b/copyparty/ico.py @@ -35,7 +35,7 @@ class Ico(object): sw, sh = self.args.th_size.split("x") h = int(100.0 / (float(sw) / float(sh))) - if chrome: + if chrome & 0: # cannot handle more than ~2000 unique SVGs if HAVE_PILF: # pillow 10.1 made this the default font; diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 3336e8f8..5672249c 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -955,9 +955,18 @@ tr.play td:nth-child(1) a { border-color: var(--g-f-b1); box-shadow: 0 .1em .3em var(--g-sh); } +#ggrid>a svg { + position: absolute; + max-width: 10em; + max-width: calc(var(--grid-sz) - 4px); + max-height: 8em; + max-height: calc(var(--grid-sz)/1.25); + display: block; + width: 100%; + height: 100%; +} #ggrid>a img { z-index: 1; - background: var(--bg); border-radius: 5px; border-radius: calc(var(--radius) / 3 * 2); max-width: 10em; @@ -997,6 +1006,17 @@ tr.play td:nth-child(1) a { margin: -3px -2px; padding: 4px 3px; } +.th_ext { + position: absolute; + text-align: center; + width: 100%; + width: calc(100% - 8px);; + top: 50%; + top: calc(55% - .5em); + color: var(--a); + text-shadow: none; + font-family: monospace; +} .sel .gselchk, .imgcontainer:hover .gselchk { display: block; diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index b94296c1..102ac05f 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -162,6 +162,34 @@ + + + + + + + + + + + + + +
diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 0e264c38..c586a100 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -6462,8 +6462,13 @@ var thegrid = (function () { '" class="' + ac + '" ttt="' + esc(name) + '">' + '
' + '' + + '' + + (isdir || ext == 'unk' || ext.startsWith('/') ? '' : '' + ext + '') + '
' + ao.innerHTML + ''); } ggrid.innerHTML = html.join('\n'); @@ -6503,6 +6508,21 @@ var thegrid = (function () { drag.initgrid(); } + function hashCode (str) { + let hash = 0; + for(var i = 0; i < str.length; i++){ + hash = str.charCodeAt(i) + 2026 * ((hash << 5) - hash); + } + return hash + } + function intToRGB(i){ + var c = (i & 0x00FFFFFF) + .toString(16) + .toUpperCase(); + + return "00000".substring(0, 6 - c.length) + c; + } + r.bagit = function (isrc) { if (!window.baguetteBox) return; @@ -6655,6 +6675,11 @@ function th_onload(el) { el.style.height = ''; } +function th_onerror(el) { + el.style.opacity = '0' + el.style.pointerEvents = 'none' +} + function tree_scrollto(e) { ev(e);