From 80518796705dffaf13f7526430c7584649ed60df Mon Sep 17 00:00:00 2001 From: Bobby Date: Wed, 6 Sep 2023 23:57:46 +0700 Subject: [PATCH] fix: album lightbox not working with GIFs also updated simple-lightbox from 2.10.3 to 2.14.2 --- public/libs/simple-lightbox/simple-lightbox.min.css | 6 +++--- public/libs/simple-lightbox/simple-lightbox.min.js | 2 +- src/js/album.js | 10 +++------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/public/libs/simple-lightbox/simple-lightbox.min.css b/public/libs/simple-lightbox/simple-lightbox.min.css index 5112696..7947845 100644 --- a/public/libs/simple-lightbox/simple-lightbox.min.css +++ b/public/libs/simple-lightbox/simple-lightbox.min.css @@ -1,7 +1,7 @@ /*! By André Rinas, www.andrerinas.de - Documentation, www.simplelightbox.de + Documentation, www.simplelightbox.com Available for use under the MIT License - Version 2.10.3 + Version 2.14.2 */ -body.hidden-scroll{overflow:hidden}.sl-overlay{position:fixed;left:0;right:0;top:0;bottom:0;background:#fff;display:none;z-index:1035}.sl-wrapper{z-index:1040;width:100%;height:100%;left:0;top:0;position:fixed}.sl-wrapper *{box-sizing:border-box}.sl-wrapper button{border:0 none;background:transparent;font-size:28px;padding:0;cursor:pointer}.sl-wrapper button:hover{opacity:0.7}.sl-wrapper .sl-close{display:none;position:fixed;right:30px;top:30px;z-index:10060;margin-top:-14px;margin-right:-14px;height:44px;width:44px;line-height:44px;font-family:Arial,Baskerville,monospace;color:#000;font-size:3rem}.sl-wrapper .sl-counter{display:none;position:fixed;top:30px;left:30px;z-index:1060;color:#000;font-size:1rem}.sl-wrapper .sl-navigation{width:100%;display:none}.sl-wrapper .sl-navigation button{position:fixed;top:50%;margin-top:-22px;height:44px;width:22px;line-height:44px;text-align:center;display:block;z-index:10060;font-family:Arial,Baskerville,monospace;color:#000}.sl-wrapper .sl-navigation button.sl-next{right:5px;font-size:2rem}.sl-wrapper .sl-navigation button.sl-prev{left:5px;font-size:2rem}@media (min-width: 35.5em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:10px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:10px;font-size:3rem}}@media (min-width: 50em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:20px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:20px;font-size:3rem}}.sl-wrapper.sl-dir-rtl .sl-navigation{direction:ltr}.sl-wrapper .sl-image{position:fixed;-ms-touch-action:none;touch-action:none;z-index:10000}.sl-wrapper .sl-image img{margin:0;padding:0;display:block;border:0 none;width:100%;height:auto}@media (min-width: 35.5em){.sl-wrapper .sl-image img{border:0 none}}@media (min-width: 50em){.sl-wrapper .sl-image img{border:0 none}}.sl-wrapper .sl-image iframe{background:#000;border:0 none}@media (min-width: 35.5em){.sl-wrapper .sl-image iframe{border:0 none}}@media (min-width: 50em){.sl-wrapper .sl-image iframe{border:0 none}}.sl-wrapper .sl-image .sl-caption{display:none;padding:10px;color:#fff;background:rgba(0,0,0,0.8);font-size:1rem;position:absolute;bottom:0;left:0;right:0}.sl-wrapper .sl-image .sl-caption.pos-top{bottom:auto;top:0}.sl-wrapper .sl-image .sl-caption.pos-outside{bottom:auto}.sl-wrapper .sl-image .sl-download{display:none;position:absolute;bottom:5px;right:5px;color:#000;z-index:1060}.sl-spinner{display:none;border:5px solid #333;border-radius:40px;height:40px;left:50%;margin:-20px 0 0 -20px;opacity:0;position:fixed;top:50%;width:40px;z-index:1007;-webkit-animation:pulsate 1s ease-out infinite;-moz-animation:pulsate 1s ease-out infinite;-ms-animation:pulsate 1s ease-out infinite;-o-animation:pulsate 1s ease-out infinite;animation:pulsate 1s ease-out infinite}.sl-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.sl-transition{transition:-moz-transform ease 200ms;transition:-ms-transform ease 200ms;transition:-o-transform ease 200ms;transition:-webkit-transform ease 200ms;transition:transform ease 200ms}@-webkit-keyframes pulsate{0%{transform:scale(0.1);opacity:0.0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@keyframes pulsate{0%{transform:scale(0.1);opacity:0.0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-moz-keyframes pulsate{0%{transform:scale(0.1);opacity:0.0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-o-keyframes pulsate{0%{transform:scale(0.1);opacity:0.0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-ms-keyframes pulsate{0%{transform:scale(0.1);opacity:0.0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}} +body.hidden-scroll{overflow:hidden}.sl-overlay{position:fixed;left:0;right:0;top:0;bottom:0;background:#fff;display:none;z-index:1035}.sl-wrapper{z-index:1040;width:100%;height:100%;left:0;top:0;position:fixed}.sl-wrapper *{box-sizing:border-box}.sl-wrapper button{border:0 none;background:rgba(0,0,0,0);font-size:28px;padding:0;cursor:pointer}.sl-wrapper button:hover{opacity:.7}.sl-wrapper .sl-close{display:none;position:fixed;right:30px;top:30px;z-index:10060;margin-top:-14px;margin-right:-14px;height:44px;width:44px;line-height:44px;font-family:Arial,Baskerville,monospace;color:#000;font-size:3rem}.sl-wrapper .sl-counter{display:none;position:fixed;top:30px;left:30px;z-index:10060;color:#000;font-size:1rem}.sl-wrapper .sl-download{display:none;position:fixed;bottom:5px;width:100%;text-align:center;z-index:10060;color:#fff;font-size:1rem}.sl-wrapper .sl-download a{color:#fff}.sl-wrapper .sl-navigation{width:100%;display:none}.sl-wrapper .sl-navigation button{position:fixed;top:50%;margin-top:-22px;height:44px;width:22px;line-height:44px;text-align:center;display:block;z-index:10060;font-family:Arial,Baskerville,monospace;color:#000}.sl-wrapper .sl-navigation button.sl-next{right:5px;font-size:2rem}.sl-wrapper .sl-navigation button.sl-prev{left:5px;font-size:2rem}@media(min-width: 35.5em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:10px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:10px;font-size:3rem}}@media(min-width: 50em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:20px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:20px;font-size:3rem}}.sl-wrapper.sl-dir-rtl .sl-navigation{direction:ltr}.sl-wrapper .sl-image{position:fixed;-ms-touch-action:none;touch-action:none;z-index:10000}.sl-wrapper .sl-image img{margin:0;padding:0;display:block;border:0 none;width:100%;height:auto}@media(min-width: 35.5em){.sl-wrapper .sl-image img{border:0 none}}@media(min-width: 50em){.sl-wrapper .sl-image img{border:0 none}}.sl-wrapper .sl-image iframe{background:#000;border:0 none}@media(min-width: 35.5em){.sl-wrapper .sl-image iframe{border:0 none}}@media(min-width: 50em){.sl-wrapper .sl-image iframe{border:0 none}}.sl-wrapper .sl-image .sl-caption{display:none;padding:10px;color:#fff;background:rgba(0,0,0,.8);font-size:1rem;position:absolute;bottom:0;left:0;right:0}.sl-wrapper .sl-image .sl-caption.pos-top{bottom:auto;top:0}.sl-wrapper .sl-image .sl-caption.pos-outside{bottom:auto}.sl-spinner{display:none;border:5px solid #333;border-radius:40px;height:40px;left:50%;margin:-20px 0 0 -20px;opacity:0;position:fixed;top:50%;width:40px;z-index:1007;-webkit-animation:pulsate 1s ease-out infinite;-moz-animation:pulsate 1s ease-out infinite;-ms-animation:pulsate 1s ease-out infinite;-o-animation:pulsate 1s ease-out infinite;animation:pulsate 1s ease-out infinite}.sl-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.sl-transition{transition:-moz-transform ease 200ms;transition:-ms-transform ease 200ms;transition:-o-transform ease 200ms;transition:-webkit-transform ease 200ms;transition:transform ease 200ms}@-webkit-keyframes pulsate{0%{transform:scale(0.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@keyframes pulsate{0%{transform:scale(0.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-moz-keyframes pulsate{0%{transform:scale(0.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-o-keyframes pulsate{0%{transform:scale(0.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-ms-keyframes pulsate{0%{transform:scale(0.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}} \ No newline at end of file diff --git a/public/libs/simple-lightbox/simple-lightbox.min.js b/public/libs/simple-lightbox/simple-lightbox.min.js index 1c66ec6..d5a99d7 100644 --- a/public/libs/simple-lightbox/simple-lightbox.min.js +++ b/public/libs/simple-lightbox/simple-lightbox.min.js @@ -1 +1 @@ -!function i(n,s,a){function r(e,t){if(!s[e]){if(!n[e]){var o="function"==typeof require&&require;if(!t&&o)return o(e,!0);if(l)return l(e,!0);throw(o=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",o}o=s[e]={exports:{}},n[e][0].call(o.exports,function(t){return r(n[e][1][t]||t)},o,o.exports,i,n,s,a)}return s[e].exports}for(var l="function"==typeof require&&require,t=0;t=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s=!0,a=!1;return{s:function(){o=o.call(t)},n:function(){var t=o.next();return s=t.done,t},e:function(t){a=!0,n=t},f:function(){try{s||null==o.return||o.return()}finally{if(a)throw n}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);o",this.domNodes.navigation=document.createElement("div"),this.domNodes.navigation.classList.add("sl-navigation"),this.domNodes.navigation.innerHTML='"),this.domNodes.counter=document.createElement("div"),this.domNodes.counter.classList.add("sl-counter"),this.domNodes.counter.innerHTML='/',this.domNodes.caption=document.createElement("div"),this.domNodes.caption.classList.add("sl-caption","pos-"+this.options.captionPosition),this.options.captionClass&&this.domNodes.caption.classList.add(this.options.captionClass),this.domNodes.image=document.createElement("div"),this.domNodes.image.classList.add("sl-image"),this.domNodes.wrapper=document.createElement("div"),this.domNodes.wrapper.classList.add("sl-wrapper"),this.domNodes.wrapper.setAttribute("tabindex",-1),this.domNodes.wrapper.setAttribute("role","dialog"),this.domNodes.wrapper.setAttribute("aria-hidden",!1),this.options.className&&this.domNodes.wrapper.classList.add(this.options.className),this.options.rtl&&this.domNodes.wrapper.classList.add("sl-dir-rtl")}},{key:"throttle",value:function(t,e){var o;return function(){o||(t.apply(this,arguments),o=!0,setTimeout(function(){return o=!1},e))}}},{key:"isValidLink",value:function(t){return!this.options.fileExt||t.getAttribute(this.options.sourceAttr)&&new RegExp("("+this.options.fileExt+")$","i").test(t.getAttribute(this.options.sourceAttr))}},{key:"calculateTransitionPrefix",value:function(){var t=(document.body||document.documentElement).style;return"transition"in t?"":"WebkitTransition"in t?"-webkit-":"MozTransition"in t?"-moz-":"OTransition"in t&&"-o"}},{key:"toggleScrollbar",value:function(t){var e,i=0,o=[].slice.call(document.querySelectorAll("."+this.options.fixedClass));return"hide"===t?((t=window.innerWidth)||(t=(e=document.documentElement.getBoundingClientRect()).right-Math.abs(e.left)),(document.body.clientWidth=this.relatedElements.length)&&!1===this.options.loop)return!1;this.currentImageIndex=t<0?this.relatedElements.length-1:t>this.relatedElements.length-1?0:t,this.domNodes.counter.querySelector(".sl-current").innerHTML=this.currentImageIndex+1,this.options.animationSlide&&this.slide(this.options.animationSpeed/1e3,-100*o-this.controlCoordinates.swipeDiff+"px"),this.fadeOut(this.domNodes.image,this.options.fadeSpeed,function(){e.isAnimating=!0,e.isClosing?e.isAnimating=!1:setTimeout(function(){var t=e.relatedElements[e.currentImageIndex];e.currentImage.setAttribute("src",t.getAttribute(e.options.sourceAttr)),-1===e.loadedImages.indexOf(t.getAttribute(e.options.sourceAttr))&&e.show(e.domNodes.spinner),e.domNodes.image.contains(e.domNodes.caption)&&e.domNodes.image.removeChild(e.domNodes.caption),e.adjustImage(o),e.options.preloading&&e.preload()},100)})}},{key:"adjustImage",value:function(s){var a=this;if(!this.currentImage)return!1;var t=new Image,r=window.innerWidth*this.options.widthRatio,l=window.innerHeight*this.options.heightRatio;t.setAttribute("src",this.currentImage.getAttribute("src")),this.currentImage.dataset.scale=1,this.currentImage.dataset.translateX=0,this.currentImage.dataset.translateY=0,this.zoomPanElement(0,0,1),t.addEventListener("error",function(t){a.relatedElements[a.currentImageIndex].dispatchEvent(new Event("error."+a.eventNamespace)),a.isAnimating=!1,a.isOpen=!0,a.domNodes.spinner.style.display="none";var e=1===s||-1===s;if(a.initialImageIndex===a.currentImageIndex&&e)return a.close();a.options.alertError&&alert(a.options.alertErrorMessage),a.loadImage(e?s:1)}),t.addEventListener("load",function(t){void 0!==s&&(a.relatedElements[a.currentImageIndex].dispatchEvent(new Event("changed."+a.eventNamespace)),a.relatedElements[a.currentImageIndex].dispatchEvent(new Event((1===s?"nextDone":"prevDone")+"."+a.eventNamespace))),a.options.history&&a.updateURL(),-1===a.loadedImages.indexOf(a.currentImage.getAttribute("src"))&&a.loadedImages.push(a.currentImage.getAttribute("src"));var e,o,i=t.target.width,n=t.target.height;(a.options.scaleImageToRatio||r=a.relatedElements.length-1&&a.hide(a.domNodes.navigation.querySelector(".sl-next")),0=i.relatedElements.length-1&&0i.options.swipeTolerance&&t?i.loadImage(0d){var o,i=m(a);try{for(i.s();!(o=i.n()).done;)o.value.style.opacity=d}catch(t){i.e(t)}finally{i.f()}r&&r.call(l,a)}else{var n,s=m(a);try{for(s.s();!(n=s.n()).done;)n.value.style.opacity=e}catch(t){s.e(t)}finally{s.f()}l.isFadeIn&&requestAnimationFrame(t)}})()}},{key:"hide",value:function(t){var e,o=m(t=this.wrap(t));try{for(o.s();!(e=o.n()).done;){var i=e.value;"none"!=i.style.display&&(i.dataset.initialDisplay=i.style.display),i.style.display="none"}}catch(t){o.e(t)}finally{o.f()}}},{key:"show",value:function(t,e){var o,i=m(t=this.wrap(t));try{for(i.s();!(o=i.n()).done;){var n=o.value;n.style.display=n.dataset.initialDisplay||e||"block"}}catch(t){i.e(t)}finally{i.f()}}},{key:"wrap",value:function(t){return"function"==typeof t[Symbol.iterator]&&"string"!=typeof t?t:[t]}},{key:"on",value:function(t,e){t=this.wrap(t);var o,i=m(this.elements);try{for(i.s();!(o=i.n()).done;){var n=o.value;n.fullyNamespacedEvents||(n.fullyNamespacedEvents={});var s,a=m(t);try{for(a.s();!(s=a.n()).done;){var r=s.value;n.fullyNamespacedEvents[r]=e,n.addEventListener(r,e)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){i.e(t)}finally{i.f()}return this}},{key:"off",value:function(t){t=this.wrap(t);var e,o=m(this.elements);try{for(o.s();!(e=o.n()).done;){var i,n=e.value,s=m(t);try{for(s.s();!(i=s.n()).done;){var a=i.value;void 0!==n.fullyNamespacedEvents&&a in n.fullyNamespacedEvents&&n.removeEventListener(a,n.fullyNamespacedEvents[a])}}catch(t){s.e(t)}finally{s.f()}}}catch(t){o.e(t)}finally{o.f()}return this}},{key:"open",value:function(t){t=t||this.elements[0],"undefined"!=typeof jQuery&&t instanceof jQuery&&(t=t.get(0)),this.initialImageIndex=this.elements.indexOf(t),-1=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){var o;if(t)return"string"==typeof t?i(t,e):"Map"===(o="Object"===(o=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?i(t,e):void 0}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o")?(o=this.options.captionSelector.replace(/^>/,"").trimStart(),t.querySelector(o)):t.querySelector(this.options.captionSelector)}},{key:"generateQuerySelector",value:function(t){var e=t.tagName,o=t.id,n=t.className,i=t.parentNode;if("HTML"===e)return"HTML";var s=e;if(s+=""!==o?"#".concat(o):"",n)for(var a=n.trim().split(/\s/),r=0;r ").concat(s)}},{key:"createDomNodes",value:function(){var t,e;this.domNodes.overlay=document.createElement("div"),this.domNodes.overlay.classList.add("sl-overlay"),this.domNodes.overlay.dataset.opacityTarget=this.options.overlayOpacity,this.domNodes.closeButton=document.createElement("button"),this.domNodes.closeButton.classList.add("sl-close"),this.domNodes.closeButton.innerHTML=this.options.closeText,this.domNodes.spinner=document.createElement("div"),this.domNodes.spinner.classList.add("sl-spinner"),this.domNodes.spinner.innerHTML="
",this.domNodes.navigation=document.createElement("div"),this.domNodes.navigation.classList.add("sl-navigation"),this.domNodes.navigation.innerHTML='"),this.domNodes.counter=document.createElement("div"),this.domNodes.counter.classList.add("sl-counter"),this.domNodes.counter.innerHTML='/',this.domNodes.download=document.createElement("div"),this.domNodes.download.classList.add("sl-download"),this.domNodes.downloadLink=document.createElement("a"),this.domNodes.downloadLink.setAttribute("download",""),this.domNodes.downloadLink.textContent=this.options.download,this.domNodes.download.appendChild(this.domNodes.downloadLink),this.domNodes.caption=document.createElement("div"),this.domNodes.caption.classList.add("sl-caption","pos-"+this.options.captionPosition),this.options.captionClass&&(e=this.options.captionClass.split(/[\s,]+/),(t=this.domNodes.caption.classList).add.apply(t,n(e))),this.domNodes.image=document.createElement("div"),this.domNodes.image.classList.add("sl-image"),this.domNodes.wrapper=document.createElement("div"),this.domNodes.wrapper.classList.add("sl-wrapper"),this.domNodes.wrapper.setAttribute("tabindex",-1),this.domNodes.wrapper.setAttribute("role","dialog"),this.domNodes.wrapper.setAttribute("aria-hidden",!1),this.options.className&&this.domNodes.wrapper.classList.add(this.options.className),this.options.rtl&&this.domNodes.wrapper.classList.add("sl-dir-rtl")}},{key:"throttle",value:function(t,e){var o;return function(){o||(t.apply(this,arguments),o=!0,setTimeout(function(){return o=!1},e))}}},{key:"isValidLink",value:function(t){return!this.options.fileExt||t.getAttribute(this.options.sourceAttr)&&new RegExp("("+this.options.fileExt+")($|\\?.*$)","i").test(t.getAttribute(this.options.sourceAttr))}},{key:"calculateTransitionPrefix",value:function(){var t=(document.body||document.documentElement).style;return"transition"in t?"":"WebkitTransition"in t?"-webkit-":"MozTransition"in t?"-moz-":"OTransition"in t&&"-o"}},{key:"getScrollbarWidth",value:function(){var t,e=document.createElement("div");return e.classList.add("sl-scrollbar-measure"),document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e),t}},{key:"toggleScrollbar",value:function(t){var e,n=0,o=[].slice.call(document.querySelectorAll("."+this.options.fixedClass));return"hide"===t?((t=window.innerWidth)||(t=(e=document.documentElement.getBoundingClientRect()).right-Math.abs(e.left)),(document.body.clientWidth=this.relatedElements.length)&&!1===this.options.loop)return!1;this.currentImageIndex=t<0?this.relatedElements.length-1:t>this.relatedElements.length-1?0:t,this.domNodes.counter.querySelector(".sl-current").innerHTML=this.currentImageIndex+1,this.options.animationSlide&&this.slide(this.options.animationSpeed/1e3,-100*o-this.controlCoordinates.swipeDiff+"px"),this.fadeOut(this.domNodes.image,this.options.fadeSpeed,function(){e.isAnimating=!0,e.isClosing?e.isAnimating=!1:setTimeout(function(){var t=e.relatedElements[e.currentImageIndex];e.currentImage&&(e.currentImage.setAttribute("src",t.getAttribute(e.options.sourceAttr)),-1===e.loadedImages.indexOf(t.getAttribute(e.options.sourceAttr))&&e.show(e.domNodes.spinner),e.domNodes.image.contains(e.domNodes.caption)&&e.domNodes.image.removeChild(e.domNodes.caption),e.adjustImage(o),e.options.preloading&&e.preload())},100)})}},{key:"adjustImage",value:function(s){var a=this;if(!this.currentImage)return!1;var t=new Image,r=window.innerWidth*this.options.widthRatio,l=window.innerHeight*this.options.heightRatio;t.setAttribute("src",this.currentImage.getAttribute("src")),this.currentImage.dataset.scale=1,this.currentImage.dataset.translateX=0,this.currentImage.dataset.translateY=0,this.zoomPanElement(0,0,1),t.addEventListener("error",function(t){a.relatedElements[a.currentImageIndex].dispatchEvent(new Event("error."+a.eventNamespace)),a.isAnimating=!1,a.isOpen=!0,a.domNodes.spinner.style.display="none";var e=1===s||-1===s;if(a.initialImageIndex===a.currentImageIndex&&e)return a.close();a.options.alertError&&alert(a.options.alertErrorMessage),a.loadImage(e?s:1)}),t.addEventListener("load",function(t){void 0!==s&&(a.relatedElements[a.currentImageIndex].dispatchEvent(new Event("changed."+a.eventNamespace)),a.relatedElements[a.currentImageIndex].dispatchEvent(new Event((1===s?"nextDone":"prevDone")+"."+a.eventNamespace))),a.options.history&&a.updateURL(),-1===a.loadedImages.indexOf(a.currentImage.getAttribute("src"))&&a.loadedImages.push(a.currentImage.getAttribute("src"));var e,o,n,i=t.target.width,t=t.target.height;(a.options.scaleImageToRatio||r=a.relatedElements.length-1&&a.hide(a.domNodes.navigation.querySelector(".sl-next")),0=n.relatedElements.length-1&&0n.options.swipeTolerance&&t?n.loadImage(0h){var o,n=f(l);try{for(n.s();!(o=n.n()).done;){var i=o.value;i&&(i.style.opacity=h)}}catch(t){n.e(t)}finally{n.f()}d&&d.call(c,l)}else{var s,a=f(l);try{for(a.s();!(s=a.n()).done;){var r=s.value;r&&(r.style.opacity=e)}}catch(t){a.e(t)}finally{a.f()}c.isFadeIn&&requestAnimationFrame(t)}})()}},{key:"hide",value:function(t){var e,o=f(t=this.wrap(t));try{for(o.s();!(e=o.n()).done;){var n=e.value;"none"!=n.style.display&&(n.dataset.initialDisplay=n.style.display),n.style.display="none"}}catch(t){o.e(t)}finally{o.f()}}},{key:"show",value:function(t,e){var o,n=f(t=this.wrap(t));try{for(n.s();!(o=n.n()).done;){var i=o.value;i.style.display=i.dataset.initialDisplay||e||"block"}}catch(t){n.e(t)}finally{n.f()}}},{key:"wrap",value:function(t){return"function"==typeof t[Symbol.iterator]&&"string"!=typeof t?t:[t]}},{key:"on",value:function(t,e){t=this.wrap(t);var o,n=f(this.elements);try{for(n.s();!(o=n.n()).done;){var i,s=o.value,a=(s.fullyNamespacedEvents||(s.fullyNamespacedEvents={}),f(t));try{for(a.s();!(i=a.n()).done;){var r=i.value;s.fullyNamespacedEvents[r]=e,s.addEventListener(r,e)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"off",value:function(t){t=this.wrap(t);var e,o=f(this.elements);try{for(o.s();!(e=o.n()).done;){var n,i=e.value,s=f(t);try{for(s.s();!(n=s.n()).done;){var a=n.value;void 0!==i.fullyNamespacedEvents&&a in i.fullyNamespacedEvents&&i.removeEventListener(a,i.fullyNamespacedEvents[a])}}catch(t){s.e(t)}finally{s.f()}}}catch(t){o.e(t)}finally{o.f()}return this}},{key:"open",value:function(t){var e=1 { callback_enter: page.updateImageContainer }) - // Build RegExp out of imageExts array - // SimpleLightbox demands RegExp for configuring supported file extensions - const imageExtsRegex = new RegExp(`${page.lightboxExts.map(ext => { - return ext.substring(1) // removes starting dot - }).join('|')}`, 'i') - page.lightbox = new SimpleLightbox('#table a.image', { captions: true, captionSelector: 'img', @@ -57,7 +51,9 @@ window.addEventListener('DOMContentLoaded', () => { captionsData: 'alt', captionPosition: 'bottom', captionDelay: 500, - fileExt: imageExtsRegex, + fileExt: page.lightboxExts.map(ext => { + return ext.substring(1) // removes starting dot + }).join('|'), preloading: false, uniqueImages: false })