X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/77ab25edd98ec5a3871fc07bceaa0cd61949b69e..39b57edfe705be3f21a2bc5670d4c0e3e68c2d17:/foto/album.inc.php diff --git a/foto/album.inc.php b/foto/album.inc.php index 597e9a4..a0a6c70 100644 --- a/foto/album.inc.php +++ b/foto/album.inc.php @@ -23,6 +23,13 @@ function openphotoswipe(index) { clickToCloseNonZoomable: false, closeElClasses: [], shareButtons: [ + {id:'download', label:'Origineel downloaden', url:'{{raw_image_url}}', download:true} ], }; @@ -67,6 +74,7 @@ function imgjustify() { targetRowHeight: 200, }; var layout = require('justified-layout')(ratios, config); + var thumbreplace = !/[?&]blur\b/.test(window.location.search); gallery.style.position = 'relative'; gallery.style.height = layout.containerHeight + 'px'; @@ -79,21 +87,28 @@ function imgjustify() { imgel.style.top = layout.boxes[i].top + 'px'; imgel.style.left = layout.boxes[i].left + 'px'; - var thumbtarget = imgel.src.replace(/(\/thumb\/)\d+/, '$1'+layout.boxes[i].height) - if (imgel.complete) { - imgel.src = thumbtarget; - } - else if (thumbtarget != imgel.src) { - var loadthumb = new Image(); - loadthumb.src = thumbtarget; - loadthumb.onload = function() { - imgel.src = this.src; - }; + if (thumbreplace) { + var thumbtarget = imgel.src.replace(/(\/thumb\/)\d+/, '$1'+layout.boxes[i].height) + if (imgel.complete) { + imgel.src = thumbtarget; + } + else if (thumbtarget != imgel.src) { + var loadthumb = new Image(); + loadthumb.src = thumbtarget; + loadthumb.onload = function() { + imgel.src = this.src; + }; + } } })(); } }; +if (request = window.location.hash.match(/pid=(.*)/)) { + index = images.findIndex(row => row.src == request[1]); + openphotoswipe(index); +} + window.addEventListener('resize', imgjustify, false); imgjustify();