mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
ext-th: reduce specificity (#170);
thumbnails defined for file-extension '.asdf' will now also apply to '.qwer.asdf' if no more specific ext-th is given
This commit is contained in:
parent
9dd5dec093
commit
c75b0c25a6
|
@ -6558,6 +6558,7 @@ var thegrid = (function () {
|
||||||
ohref = esc(ao.getAttribute('href')),
|
ohref = esc(ao.getAttribute('href')),
|
||||||
href = ohref.split('?')[0],
|
href = ohref.split('?')[0],
|
||||||
ext = '',
|
ext = '',
|
||||||
|
ext0 = '',
|
||||||
name = uricom_dec(vsplit(href)[1]),
|
name = uricom_dec(vsplit(href)[1]),
|
||||||
ref = ao.getAttribute('id'),
|
ref = ao.getAttribute('id'),
|
||||||
isdir = href.endsWith('/'),
|
isdir = href.endsWith('/'),
|
||||||
|
@ -6570,17 +6571,19 @@ var thegrid = (function () {
|
||||||
ar.shift();
|
ar.shift();
|
||||||
|
|
||||||
ar.reverse();
|
ar.reverse();
|
||||||
|
ext0 = ar[0];
|
||||||
for (var b = 0; b < Math.min(2, ar.length); b++) {
|
for (var b = 0; b < Math.min(2, ar.length); b++) {
|
||||||
if (ar[b].length > 7)
|
if (ar[b].length > 7)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ext = ar[b] + '.' + ext;
|
ext = ext ? (ar[b] + '.' + ext) : ar[b];
|
||||||
}
|
}
|
||||||
ext = (ext || 'unk.').slice(0, -1);
|
if (!ext)
|
||||||
|
ext = 'unk';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_ext_th && ext_th[ext]) {
|
if (use_ext_th && (ext_th[ext] || ext_th[ext0])) {
|
||||||
ihref = ext_th[ext];
|
ihref = ext_th[ext] || ext_th[ext0];
|
||||||
}
|
}
|
||||||
else if (r.thumbs) {
|
else if (r.thumbs) {
|
||||||
ihref = addq(ihref, 'th=' + (have_webp ? 'w' : 'j'));
|
ihref = addq(ihref, 'th=' + (have_webp ? 'w' : 'j'));
|
||||||
|
|
Loading…
Reference in a new issue