/* # ----------------------------------------------------------------------------- # ~/theme_uno/modules/lightbox/js/lightbox.min.js # Lightbox v.2.11.2 implementation for J1 Template. # # Product/Info: # https://jekyll.one # http://lokeshdhakar.com/projects/lightbox2/ # # Copyright (C) 2021 Juergen Adams # Copyright (C) 2015 Lokesh Dhakar # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE # Lightbox is licensed under the MIT License. # See: https://github.com/lokesh/lightbox2/blob/master/LICENSE # ----------------------------------------------------------------------------- */ (function(a,b){if(typeof define==="function"&&define.amd){define(["jquery"],b)}else{if(typeof exports==="object"){module.exports=b(require("jquery"))}else{a.lightbox=b(a.jQuery)}}}(this,function(a){function b(c){this.album=[];this.currentImageIndex=void 0;this.init();this.options=a.extend({},this.constructor.defaults);this.option(c)}b.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:false,fadeDuration:600,fitImagesInViewport:true,imageFadeDuration:600,positionFromTop:50,resizeDuration:700,showImageNumberLabel:true,wrapAround:false,disableScrolling:false,sanitizeTitle:false};b.prototype.option=function(c){a.extend(this.options,c)};b.prototype.imageCountLabel=function(d,c){return this.options.albumLabel.replace(/%1/g,d).replace(/%2/g,c)};b.prototype.init=function(){var c=this;a(document).ready(function(){c.enable();c.build()})};b.prototype.enable=function(){var c=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(d){c.start(a(d.currentTarget));return false})};b.prototype.build=function(){if(a("#lightbox").length>0){return}var c=this;a('
').appendTo(a("body"));this.$lightbox=a("#lightbox");this.$overlay=a("#lightboxOverlay");this.$outerContainer=this.$lightbox.find(".lb-outerContainer");this.$container=this.$lightbox.find(".lb-container");this.$image=this.$lightbox.find(".lb-image");this.$nav=this.$lightbox.find(".lb-nav");this.containerPadding={top:parseInt(this.$container.css("padding-top"),10),right:parseInt(this.$container.css("padding-right"),10),bottom:parseInt(this.$container.css("padding-bottom"),10),left:parseInt(this.$container.css("padding-left"),10)};this.imageBorderWidth={top:parseInt(this.$image.css("border-top-width"),10),right:parseInt(this.$image.css("border-right-width"),10),bottom:parseInt(this.$image.css("border-bottom-width"),10),left:parseInt(this.$image.css("border-left-width"),10)};this.$overlay.hide().on("click",function(){c.end();return false});this.$lightbox.hide().on("click",function(d){if(a(d.target).attr("id")==="lightbox"){c.end()}});this.$outerContainer.on("click",function(d){if(a(d.target).attr("id")==="lightbox"){c.end()}return false});this.$lightbox.find(".lb-prev").on("click",function(){if(c.currentImageIndex===0){c.changeImage(c.album.length-1)}else{c.changeImage(c.currentImageIndex-1)}return false});this.$lightbox.find(".lb-next").on("click",function(){if(c.currentImageIndex===c.album.length-1){c.changeImage(0)}else{c.changeImage(c.currentImageIndex+1)}return false});this.$nav.on("mousedown",function(d){if(d.which===3){c.$nav.css("pointer-events","none");c.$lightbox.one("contextmenu",function(){setTimeout(function(){this.$nav.css("pointer-events","auto")}.bind(c),0)})}});this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){c.end();return false})};b.prototype.start=function(g){var o=this;var c=a(window);c.on("resize",a.proxy(this.sizeOverlay,this));this.sizeOverlay();this.album=[];var n=0;function l(i){o.album.push({alt:i.attr("data-alt"),link:i.attr("href"),title:i.attr("data-title")||i.attr("title")})}var k=g.attr("data-lightbox");var m;if(k){m=a(g.prop("tagName")+'[data-lightbox="'+k+'"]');for(var f=0;f