diff --git a/includes/assets/js/simplelightbox.min.js b/includes/assets/js/simplelightbox.min.js index 468e30ee3..ad1ef4523 100644 --- a/includes/assets/js/simplelightbox.min.js +++ b/includes/assets/js/simplelightbox.min.js @@ -1 +1 @@ -(function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof module&&module.exports?module.exports=b():a.SimpleLightbox=b()})(this,function(){function a(a){for(let b=1;b=this.items.length?a=0:0>a&&(a=this.items.length-1),a},showPosition(a){const b=this.normalizePosition(a);return"undefined"!=typeof this.currentPosition&&(this.direction=b>this.currentPosition?"next":"prev"),this.currentPosition=b,this.setupLightboxHtml().prepareItem(this.currentPosition,this.setContent).show()},loading(a){const d=this,e=this.options;a?this.loadingTimeout=setTimeout(function(){b(d.$el,e.elementLoadingClass),d.$content.innerHTML="

"+e.loadingCaption+"

",d.show()},e.loadingTimeout):(c(this.$el,e.elementLoadingClass),clearTimeout(this.loadingTimeout))},getVideoURL(a){const b=[{rx:/^(?:https?:)?\/\/(?:www\.)?vimeo\.com\/([^\?&"]+).*$/g,tmpl:"//_URL_".replace("_URL_","player.vimeo.com/video/$1")},{rx:/^.*(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/|v\/|user\/.+\/)?([^\?&"]+).*$/g,tmpl:"//_URL_".replace("_URL_","www.youtube.com/embed/$1")},{rx:/^.*(?:https?:\/\/)?(?:www\.)?(?:youtube-nocookie\.com)\/(?:watch\?v=|embed\/|v\/|user\/.+\/)?([^\?&"]+).*$/g,tmpl:"//_URL_".replace("_URL_","www.youtube-nocookie.com/embed/$1")}];for(let c=0;c"))}else{const f=d("
");this.$currentImage=f.querySelector(".slbImage"),this.options.showCaptions&&this.captions[a]&&f.appendChild(d("
"+this.captions[a]+"
")),this.loadImage(e,function(){c.setImageDimensions(),b.call(c,f),c.loadImage(c.items[c.normalizePosition(c.currentPosition+1)])})}return this},loadImage(a,b){if(!this.options.videoRegex.test(a)){const c=new Image;b&&(c.onload=b),c.src=a}},setupLightboxHtml(){const a=this.options;return this.$el||(this.$el=d("
"+(1
":"")+"
"),this.$content=this.$el.querySelector(".slbContent")),this.$content.innerHTML="",this},show(){return this.modalInDom||(document.querySelector(this.options.appendTarget).appendChild(this.$el),b(document.documentElement,this.options.htmlClass),this.setupLightboxEvents(),this.modalInDom=!0),this},setContent(a){const e="string"==typeof a?d(a):a;return this.loading(!1),this.setupLightboxHtml(),c(this.$content,"slbDirectionNext"),c(this.$content,"slbDirectionPrev"),this.direction&&b(this.$content,"next"===this.direction?"slbDirectionNext":"slbDirectionPrev"),this.options.beforeSetContent&&this.options.beforeSetContent(e,this),this.$content.appendChild(e),this},setImageDimensions(){this.$currentImage&&(this.$currentImage.style.maxHeight=g()+"px")},setupLightboxEvents(){const a=this;return this.eventRegistry.lightbox.length?this:(this.addEvent(this.$el,"click",function(b){const c=b.target;f(c,".slbCloseBtn")||a.options.closeOnOverlayClick&&f(c,".slbWrap")?a.close():f(c,".slbArrow")?f(c,".next")?a.next():a.prev():a.options.nextOnImageClick&&1=this.items.length?a=0:0>a&&(a=this.items.length-1),a},showPosition(a){const b=this.normalizePosition(a);return"undefined"!=typeof this.currentPosition&&(this.direction=b>this.currentPosition?"next":"prev"),this.currentPosition=b,this.setupLightboxHtml().prepareItem(this.currentPosition,this.setContent).show()},loading(a){const d=this,e=this.options;a?this.loadingTimeout=setTimeout(function(){b(d.$el,e.elementLoadingClass),d.$content.innerHTML="

"+e.loadingCaption+"

",d.show()},e.loadingTimeout):(c(this.$el,e.elementLoadingClass),clearTimeout(this.loadingTimeout))},getVideoURL(a){const b=[{rx:/^(?:https?:)?\/\/(?:www\.)?vimeo\.com\/([^\?&"]+).*$/g,tmpl:"//_URL_".replace("_URL_","player.vimeo.com/video/$1")},{rx:/^.*(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/|v\/|user\/.+\/)?([^\?&"]+).*$/g,tmpl:"//_URL_".replace("_URL_","www.youtube.com/embed/$1")},{rx:/^.*(?:https?:\/\/)?(?:www\.)?(?:youtube-nocookie\.com)\/(?:watch\?v=|embed\/|v\/|user\/.+\/)?([^\?&"]+).*$/g,tmpl:"//_URL_".replace("_URL_","www.youtube-nocookie.com/embed/$1")}];for(let c=0;c"))}else{const f=d("
");this.$currentImage=f.querySelector(".slbImage"),this.options.showCaptions&&this.captions[a]&&f.appendChild(d("
"+this.captions[a]+"
")),this.loadImage(e,function(){c.setImageDimensions(),b.call(c,f),c.loadImage(c.items[c.normalizePosition(c.currentPosition+1)])})}return this},loadImage(a,b){if(!this.options.videoRegex.test(a)){const c=new Image;b&&(c.onload=b),c.src=a}},setupLightboxHtml(){const a=this.options;return this.$el||(this.$el=d("
"+(1
":"")+"
"),this.$content=this.$el.querySelector(".slbContent")),this.$content.innerHTML="",this},show(){return this.modalInDom||(document.querySelector(this.options.appendTarget).appendChild(this.$el),b(document.documentElement,this.options.htmlClass),this.setupLightboxEvents(),this.modalInDom=!0),this},setContent(a){const e="string"==typeof a?d(a):a;return this.loading(!1),this.setupLightboxHtml(),c(this.$content,"slbDirectionNext"),c(this.$content,"slbDirectionPrev"),this.direction&&b(this.$content,"next"===this.direction?"slbDirectionNext":"slbDirectionPrev"),this.options.beforeSetContent&&this.options.beforeSetContent(e,this),this.$content.appendChild(e),this},setImageDimensions(){this.$currentImage&&(this.$currentImage.style.maxHeight=g()+"px")},setupLightboxEvents(){const a=this;return this.eventRegistry.lightbox.length?this:(this.addEvent(this.$el,"click",function(b){const c=b.target;f(c,".slbCloseBtn")||a.options.closeOnOverlayClick&&f(c,".slbWrap")?a.close():f(c,".slbArrow")?f(c,".next")?a.next():a.prev():a.options.nextOnImageClick&&1