X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/ef5176dcf0f6d0ebe26834871ce596099c6d0085..251616969893b447852aad81a4e68be6853e202e:/foto/album.inc.php diff --git a/foto/album.inc.php b/foto/album.inc.php index 5e1a148..42061d7 100644 --- a/foto/album.inc.php +++ b/foto/album.inc.php @@ -24,9 +24,9 @@ function openphotoswipe(index) { closeElClasses: [], shareButtons: [ admin('foto')) { printf("\t\t\t{id:'%s', label:'%s', url:'%s'},\n", - 'cover', 'Cover instellen', "/edit/fotocover$Args?img={{image_url}}" + 'cover', 'Cover instellen', "/edit/foto/cover$Args?img={{image_url}}" ); } ?> @@ -74,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'; @@ -86,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();