fix regex for always full size image in lightbox

This commit is contained in:
infeeeee
2019-10-08 21:32:35 +02:00
parent adf4fac0b6
commit ae10f90786
3 changed files with 3 additions and 12 deletions

View File

@@ -50,7 +50,7 @@
slideshowSpeed: 2500,
slideshowStart: "start slideshow",
slideshowStop: "stop slideshow",
photoRegex: /(.*)(-\d{2,}x\d{2,})?\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
photoRegex: /^(.*?)(?:-\d{2,}x\d{2,})?\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
// alternate image paths for high-res displays
retinaImage: false,
@@ -255,7 +255,7 @@
function retinaUrl(settings, url) {
console.log(url)
console.log(url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')))
return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
return settings.get('retinaUrl') ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
}
function trapFocus(e) {