From 52175026d8cae941b3e6ddac5ab1b1a45e0186bd Mon Sep 17 00:00:00 2001 From: Ashley White Date: Wed, 8 Aug 2018 20:46:47 +0200 Subject: [PATCH] Add alt-tag support fixes #307 --- dist/ekko-lightbox.js | 2 +- dist/ekko-lightbox.js.map | 2 +- ekko-lightbox.js | 39 +++++++++++++++++++++++---------------- index.html | 28 +++++++++++++++++++++++++--- 4 files changed, 50 insertions(+), 21 deletions(-) diff --git a/dist/ekko-lightbox.js b/dist/ekko-lightbox.js index aacd02f..d655ce6 100644 --- a/dist/ekko-lightbox.js +++ b/dist/ekko-lightbox.js @@ -4,5 +4,5 @@ * * License: https://github.com/ashleydw/lightbox/blob/master/LICENSE * - */!function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){i(1),t.exports=i(2)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t,e){for(var i=0;i
',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},s=function(){function e(i,o){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t.extend({},a,o),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=i instanceof jQuery?i:t(i),this._isBootstrap3=3==t.fn.modal.Constructor.VERSION[0];var s='",r='',l=this._config.fade?"fade in":"",d='";t(this._config.doc.body).append('"),this._$modal=t("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=t(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),t(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(t){return t.preventDefault(),n.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(t){return t.preventDefault(),n.navigateRight()}),this.updateNavigation())),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return n._toggleLoading(!0),n._handle(),n._config.onShown.call(n)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return n._galleryName&&(t(document).off("keydown.ekkoLightbox"),t(window).off("resize.ekkoLightbox")),n._$modal.remove(),n._config.onHidden.call(n)}).modal(this._config),t(window).on("resize.ekkoLightbox",function(){n._resize(n._wantedWidth,n._wantedHeight)}),this._$lightboxContainer.on("touchstart",function(){n._touchstartX=event.changedTouches[0].screenX}).on("touchend",function(){n._touchendX=event.changedTouches[0].screenX,n._swipeGesure()})}return n(e,null,[{key:"Default",get:function(){return a}}]),n(e,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(e){if(e<0||e>this._$galleryItems.length-1)return this;this._galleryIndex=e,this.updateNavigation(),this._$element=t(this._$galleryItems.get(this._galleryIndex)),this._handle()}},{key:"navigateLeft",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(0===this._galleryIndex){if(!this._config.wrapping)return;this._galleryIndex=this._$galleryItems.length-1}else this._galleryIndex--;return this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"navigateRight",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(this._galleryIndex===this._$galleryItems.length-1){if(!this._config.wrapping)return;this._galleryIndex=0}else this._galleryIndex++;return this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"updateNavigation",value:function(){if(!this._config.wrapping){var t=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay");0===this._galleryIndex?t.find("a:first-child").addClass("disabled"):t.find("a:first-child").removeClass("disabled"),this._galleryIndex===this._$galleryItems.length-1?t.find("a:last-child").addClass("disabled"):t.find("a:last-child").removeClass("disabled")}}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(t){return 39===(t=t||window.event).keyCode?this.navigateRight():37===t.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(t,e){return!(e=e||!1)&&this._isImage(t)&&(e="image"),!e&&this._getYoutubeId(t)&&(e="youtube"),!e&&this._getVimeoId(t)&&(e="vimeo"),!e&&this._getInstagramId(t)&&(e="instagram"),("audio"==e||"video"==e||!e&&this._isMedia(t))&&(e="media"),(!e||["image","youtube","vimeo","instagram","media","url"].indexOf(e)<0)&&(e="url"),e}},{key:"_getRemoteContentType",value:function(e){return t.ajax({type:"HEAD",url:e,async:!1}).getResponseHeader("Content-Type")}},{key:"_isImage",value:function(t){return t&&t.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_isMedia",value:function(t){return t&&t.match(/(\.(mp3|mp4|ogg|webm|wav)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var t=this,e=this._$lightboxBodyTwo,i=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(e=this._$lightboxBodyOne,i=this._$lightboxBodyTwo),i.removeClass("in show"),setTimeout(function(){t._$lightboxBodyTwo.hasClass("in")||t._$lightboxBodyTwo.empty(),t._$lightboxBodyOne.hasClass("in")||t._$lightboxBodyOne.empty()},500),e.addClass("in show"),e}},{key:"_handle",value:function(){var t=this._containerToUse();this._updateTitleAndFooter();var e=this._$element.attr("data-remote")||this._$element.attr("href"),i=this._detectRemoteType(e,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","media","url"].indexOf(i)<0)return this._error(this._config.strings.type);switch(i){case"image":this._preloadImage(e,t),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(e,t);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(e),t);break;case"instagram":this._showInstagramVideo(this._getInstagramId(e),t);break;case"media":this._showHtml5Media(e,t);break;default:this._loadRemoteContent(e,t)}return this}},{key:"_getYoutubeId",value:function(t){if(!t)return!1;var e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}},{key:"_getVimeoId",value:function(t){return!!(t&&t.indexOf("vimeo")>0)&&t}},{key:"_getInstagramId",value:function(t){return!!(t&&t.indexOf("instagram")>0)&&t}},{key:"_toggleLoading",value:function(e){return(e=e||!1)?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),t(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display",this._config.verticalAlignCenter?"flex":"block"),this._$modal.addClass("in show"),t(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(t){return parseInt(this._$modalDialog.css(t),10)+parseInt(this._$modalContent.css(t),10)+parseInt(this._$modalBody.css(t),10)}},{key:"_updateTitleAndFooter",value:function(){var t=this._$element.data("title")||"",e=this._$element.data("footer")||"";return this._titleIsShown=!1,t||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(t||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,e?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(e)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(t,e){var i=this._getYoutubeId(t),o=t.indexOf("&")>0?t.substr(t.indexOf("&")):"",n=this._$element.data("width")||560,a=this._$element.data("height")||n/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+i+"?badge=0&autoplay=1&html5=1"+o,n,a,e)}},{key:"_showVimeoVideo",value:function(t,e){var i=this._$element.data("width")||500,o=this._$element.data("height")||i/(560/315);return this._showVideoIframe(t+"?autoplay=1",i,o,e)}},{key:"_showInstagramVideo",value:function(t,e){var i=this._$element.data("width")||612,o=i+80;return t="/"!==t.substr(-1)?t+"/":t,e.html(''),this._resize(i,o),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(t,e,i,o){return i=i||e,o.html('
'),this._resize(e,i),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Media",value:function(t,e){var i=this._getRemoteContentType(t);if(!i)return this._error(this._config.strings.type);var o="";o=i.indexOf("audio")>0?"audio":"video";var n=this._$element.data("width")||560,a=this._$element.data("height")||n/(560/315);return e.html('
<'+o+' width="'+n+'" height="'+a+'" preload="auto" autoplay controls class="embed-responsive-item">'+this._config.strings.type+"
"),this._resize(n,a),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(e,i){var o=this,n=this._$element.data("width")||560,a=this._$element.data("height")||560,s=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),s||this._isExternal(e)?(i.html(''),this._config.onContentLoaded.call(this)):i.load(e,t.proxy(function(){return o._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(n,a),this}},{key:"_isExternal",value:function(t){var e=t.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof e[1]&&e[1].length>0&&e[1].toLowerCase()!==location.protocol||"string"==typeof e[2]&&e[2].length>0&&e[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(t){return console.error(t),this._containerToUse().html(t),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(e,i){if(this._$galleryItems){var o=t(this._$galleryItems.get(e),!1);if(void 0!==o){var n=o.attr("data-remote")||o.attr("href");return("image"===o.attr("data-type")||this._isImage(n))&&this._preloadImage(n,!1),i>0?this._preloadImageByIndex(e+1,i-1):void 0}}}},{key:"_preloadImage",value:function(e,i){var o=this;i=i||!1;var n=new Image;if(i){var a=setTimeout(function(){i.append(o._config.loadingMessage)},200);n.onload=function(){a&&clearTimeout(a),a=null;var e=t("");return e.attr("src",n.src),e.addClass("img-fluid"),e.css("width","100%"),i.html(e),o._$modalArrows&&o._$modalArrows.css("display",""),o._resize(n.width,n.height),o._toggleLoading(!1),o._config.onContentLoaded.call(o)},n.onerror=function(){return o._toggleLoading(!1),o._error(o._config.strings.fail+" "+e)}}return n.src=e,n}},{key:"_swipeGesure",value:function(){return this._touchendXthis._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(e,i){i=i||e,this._wantedWidth=e,this._wantedHeight=i;var o=e/i,n=this._padding.left+this._padding.right+this._border.left+this._border.right,a=this._config.doc.body.clientWidth>575?20:0,s=this._config.doc.body.clientWidth>575?0:20,r=Math.min(e+n,this._config.doc.body.clientWidth-a,this._config.maxWidth);e+n>r?(i=(r-n-s)/o,e=r):e+=n;var l=0,d=0;this._footerIsShown&&(d=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(l=this._$modalHeader.outerHeight(!0)||67);var h=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,g=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),u=Math.min(i,t(window).height()-h-g-l-d,this._config.maxHeight-h-l-d);i>u&&(e=Math.ceil(u*o)+n),this._$lightboxContainer.css("height",u),this._$modalDialog.css("flex","1").css("maxWidth",e);var c=this._$modal.data("bs.modal");if(c)try{c._handleUpdate()}catch(t){c.handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(i){var n=this;return i=i||{},this.each(function(){var a=t(n),s=t.extend({},e.Default,a.data(),"object"===(void 0===i?"undefined":o(i))&&i);new e(n,s)})}}]),e}();return t.fn[e]=s._jQueryInterface,t.fn[e].Constructor=s,t.fn[e].noConflict=function(){return t.fn[e]=i,s._jQueryInterface},s}(jQuery);e.default=a},function(t,e,i){}]); + */!function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){i(1),t.exports=i(2)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t,e){for(var i=0;i
',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},s=function(){function e(i,o){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t.extend({},a,o),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=i instanceof jQuery?i:t(i),this._isBootstrap3=3==t.fn.modal.Constructor.VERSION[0];var s='",r='',l=this._config.fade?"fade in":"",d='";t(this._config.doc.body).append('"),this._$modal=t("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=t(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),t(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(t){return t.preventDefault(),n.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(t){return t.preventDefault(),n.navigateRight()}),this.updateNavigation())),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return n._toggleLoading(!0),n._handle(),n._config.onShown.call(n)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return n._galleryName&&(t(document).off("keydown.ekkoLightbox"),t(window).off("resize.ekkoLightbox")),n._$modal.remove(),n._config.onHidden.call(n)}).modal(this._config),t(window).on("resize.ekkoLightbox",function(){n._resize(n._wantedWidth,n._wantedHeight)}),this._$lightboxContainer.on("touchstart",function(){n._touchstartX=event.changedTouches[0].screenX}).on("touchend",function(){n._touchendX=event.changedTouches[0].screenX,n._swipeGesure()})}return n(e,null,[{key:"Default",get:function(){return a}}]),n(e,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(e){if(e<0||e>this._$galleryItems.length-1)return this;this._galleryIndex=e,this.updateNavigation(),this._$element=t(this._$galleryItems.get(this._galleryIndex)),this._handle()}},{key:"navigateLeft",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(0===this._galleryIndex){if(!this._config.wrapping)return;this._galleryIndex=this._$galleryItems.length-1}else this._galleryIndex--;return this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"navigateRight",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(this._galleryIndex===this._$galleryItems.length-1){if(!this._config.wrapping)return;this._galleryIndex=0}else this._galleryIndex++;return this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"updateNavigation",value:function(){if(!this._config.wrapping){var t=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay");0===this._galleryIndex?t.find("a:first-child").addClass("disabled"):t.find("a:first-child").removeClass("disabled"),this._galleryIndex===this._$galleryItems.length-1?t.find("a:last-child").addClass("disabled"):t.find("a:last-child").removeClass("disabled")}}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(t){return 39===(t=t||window.event).keyCode?this.navigateRight():37===t.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(t,e){return!(e=e||!1)&&this._isImage(t)&&(e="image"),!e&&this._getYoutubeId(t)&&(e="youtube"),!e&&this._getVimeoId(t)&&(e="vimeo"),!e&&this._getInstagramId(t)&&(e="instagram"),("audio"==e||"video"==e||!e&&this._isMedia(t))&&(e="media"),(!e||["image","youtube","vimeo","instagram","media","url"].indexOf(e)<0)&&(e="url"),e}},{key:"_getRemoteContentType",value:function(e){return t.ajax({type:"HEAD",url:e,async:!1}).getResponseHeader("Content-Type")}},{key:"_isImage",value:function(t){return t&&t.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_isMedia",value:function(t){return t&&t.match(/(\.(mp3|mp4|ogg|webm|wav)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var t=this,e=this._$lightboxBodyTwo,i=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(e=this._$lightboxBodyOne,i=this._$lightboxBodyTwo),i.removeClass("in show"),setTimeout(function(){t._$lightboxBodyTwo.hasClass("in")||t._$lightboxBodyTwo.empty(),t._$lightboxBodyOne.hasClass("in")||t._$lightboxBodyOne.empty()},500),e.addClass("in show"),e}},{key:"_handle",value:function(){var t=this._containerToUse();this._updateTitleAndFooter();var e=this._$element.attr("data-remote")||this._$element.attr("href"),i=this._detectRemoteType(e,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","media","url"].indexOf(i)<0)return this._error(this._config.strings.type);switch(i){case"image":var o=this._$element.attr("data-alt")||"";this._preloadImage(e,o,t),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(e,t);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(e),t);break;case"instagram":this._showInstagramVideo(this._getInstagramId(e),t);break;case"media":this._showHtml5Media(e,t);break;default:this._loadRemoteContent(e,t)}return this}},{key:"_getYoutubeId",value:function(t){if(!t)return!1;var e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}},{key:"_getVimeoId",value:function(t){return!!(t&&t.indexOf("vimeo")>0)&&t}},{key:"_getInstagramId",value:function(t){return!!(t&&t.indexOf("instagram")>0)&&t}},{key:"_toggleLoading",value:function(e){return(e=e||!1)?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),t(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display",this._config.verticalAlignCenter?"flex":"block"),this._$modal.addClass("in show"),t(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(t){return parseInt(this._$modalDialog.css(t),10)+parseInt(this._$modalContent.css(t),10)+parseInt(this._$modalBody.css(t),10)}},{key:"_updateTitleAndFooter",value:function(){var t=this._$element.data("title")||"",e=this._$element.data("footer")||"";return this._titleIsShown=!1,t||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(t||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,e?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(e)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(t,e){var i=this._getYoutubeId(t),o=t.indexOf("&")>0?t.substr(t.indexOf("&")):"",n=this._$element.data("width")||560,a=this._$element.data("height")||n/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+i+"?badge=0&autoplay=1&html5=1"+o,n,a,e)}},{key:"_showVimeoVideo",value:function(t,e){var i=this._$element.data("width")||500,o=this._$element.data("height")||i/(560/315);return this._showVideoIframe(t+"?autoplay=1",i,o,e)}},{key:"_showInstagramVideo",value:function(t,e){var i=this._$element.data("width")||612,o=i+80;return t="/"!==t.substr(-1)?t+"/":t,e.html(''),this._resize(i,o),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(t,e,i,o){return i=i||e,o.html('
'),this._resize(e,i),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Media",value:function(t,e){var i=this._getRemoteContentType(t);if(!i)return this._error(this._config.strings.type);var o="";o=i.indexOf("audio")>0?"audio":"video";var n=this._$element.data("width")||560,a=this._$element.data("height")||n/(560/315);return e.html('
<'+o+' width="'+n+'" height="'+a+'" preload="auto" autoplay controls class="embed-responsive-item">'+this._config.strings.type+"
"),this._resize(n,a),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(e,i){var o=this,n=this._$element.data("width")||560,a=this._$element.data("height")||560,s=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),s||this._isExternal(e)?(i.html(''),this._config.onContentLoaded.call(this)):i.load(e,t.proxy(function(){return o._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(n,a),this}},{key:"_isExternal",value:function(t){var e=t.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof e[1]&&e[1].length>0&&e[1].toLowerCase()!==location.protocol||"string"==typeof e[2]&&e[2].length>0&&e[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(t){return console.error(t),this._containerToUse().html(t),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(e,i){if(this._$galleryItems){var o=t(this._$galleryItems.get(e),!1);if(void 0!==o){var n=o.attr("data-remote")||o.attr("href");return("image"===o.attr("data-type")||this._isImage(n))&&this._preloadImage(n,"",!1),i>0?this._preloadImageByIndex(e+1,i-1):void 0}}}},{key:"_preloadImage",value:function(e,i,o){var n=this;o=o||!1;var a=new Image,s=null;return o&&(s=setTimeout(function(){o.append(n._config.loadingMessage)},200)),a.onload=function(){s&&clearTimeout(s),s=null;var e=t("");if(e.attr("src",a.src),e.attr("alt",i),e.addClass("img-fluid"),e.css("width","100%"),o)return o.html(e),n._$modalArrows&&n._$modalArrows.css("display",""),n._resize(a.width,a.height),n._toggleLoading(!1),n._config.onContentLoaded.call(n)},o&&(a.onerror=function(){return n._toggleLoading(!1),n._error(n._config.strings.fail+" "+e)}),a.src=e,a}},{key:"_swipeGesure",value:function(){return this._touchendXthis._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(e,i){i=i||e,this._wantedWidth=e,this._wantedHeight=i;var o=e/i,n=this._padding.left+this._padding.right+this._border.left+this._border.right,a=this._config.doc.body.clientWidth>575?20:0,s=this._config.doc.body.clientWidth>575?0:20,r=Math.min(e+n,this._config.doc.body.clientWidth-a,this._config.maxWidth);e+n>r?(i=(r-n-s)/o,e=r):e+=n;var l=0,d=0;this._footerIsShown&&(d=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(l=this._$modalHeader.outerHeight(!0)||67);var h=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,u=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),g=Math.min(i,t(window).height()-h-u-l-d,this._config.maxHeight-h-l-d);i>g&&(e=Math.ceil(g*o)+n),this._$lightboxContainer.css("height",g),this._$modalDialog.css("flex","1").css("maxWidth",e);var c=this._$modal.data("bs.modal");if(c)try{c._handleUpdate()}catch(t){c.handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(i){var n=this;return i=i||{},this.each(function(){var a=t(n),s=t.extend({},e.Default,a.data(),"object"===(void 0===i?"undefined":o(i))&&i);new e(n,s)})}}]),e}();return t.fn[e]=s._jQueryInterface,t.fn[e].Constructor=s,t.fn[e].noConflict=function(){return t.fn[e]=i,s._jQueryInterface},s}(jQuery);e.default=a},function(t,e,i){}]); //# sourceMappingURL=ekko-lightbox.js.map \ No newline at end of file diff --git a/dist/ekko-lightbox.js.map b/dist/ekko-lightbox.js.map index f3b5ace..2fcd35f 100644 --- a/dist/ekko-lightbox.js.map +++ b/dist/ekko-lightbox.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./ekko-lightbox.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Lightbox","$","NAME","JQUERY_NO_CONFLICT","fn","Default","title","footer","maxWidth","maxHeight","showArrows","wrapping","type","alwaysShowClose","fade","verticalAlignCenter","loadingMessage","leftArrow","rightArrow","strings","close","fail","doc","document","onShow","onShown","onHide","onHidden","onNavigate","onContentLoaded","$element","config","_this","this","_classCallCheck","_config","extend","_$modalArrows","_galleryIndex","_galleryName","_padding","_border","_titleIsShown","_footerIsShown","_wantedWidth","_wantedHeight","_touchstartX","_touchendX","_modalId","Math","floor","random","_$element","jQuery","_isBootstrap3","modal","Constructor","VERSION","h4","btn","dialog","body","append","_$modal","_$modalDialog","find","first","_$modalContent","_$modalBody","_$modalHeader","_$modalFooter","_$lightboxContainer","_$lightboxBodyOne","_$lightboxBodyTwo","_calculateBorders","_calculatePadding","data","_$galleryItems","index","on","_navigationalBinder","length","event","preventDefault","navigateLeft","navigateRight","updateNavigation","_toggleLoading","_handle","off","window","remove","_resize","changedTouches","screenX","_swipeGesure","_createClass","navigateTo","$nav","addClass","removeClass","keyCode","src","_isImage","_getYoutubeId","_getVimeoId","_getInstagramId","_isMedia","indexOf","ajax","url","async","getResponseHeader","string","match","_this2","$toUse","$current","hasClass","setTimeout","empty","_containerToUse","_updateTitleAndFooter","currentRemote","attr","currentType","_detectRemoteType","_error","_preloadImage","_preloadImageByIndex","_showYoutubeVideo","_showVimeoVideo","_showInstagramVideo","_showHtml5Media","_loadRemoteContent","matches","show","css","top","_totalCssByAttribute","right","bottom","left","attribute","parseInt","caption","html","remote","$containerForElement","id","query","substr","width","height","_showVideoIframe","contentType","_getRemoteContentType","mediaType","_this3","disableExternalCheck","_isExternal","load","proxy","trigger","toLowerCase","location","protocol","replace","RegExp","http:","https:","host","message","console","error","startIndex","numberOfTimes","next","$containerForImage","_this4","img","Image","loadingTimeout","onload","clearTimeout","image","onerror","imageAspecRatio","widthBorderAndPadding","addMargin","clientWidth","discountMargin","min","headerHeight","footerHeight","outerHeight","borderPadding","margins","parseFloat","ceil","_handleUpdate","Exception","handleUpdate","_this5","each","$this","_typeof","_jQueryInterface","noConflict"],"mappings":";;;;;;gBACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,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A,mBAAAN,MAAA,SA+pBC8C,GAAQ,IAAA4K,EAAA1K,KAE/B,OADAF,EAASA,MACFE,KAAK2K,KAAK,WAChB,IAAIC,EAAQ5M,EAAE0M,GACVxK,EAAUlC,EAAEmC,UAEfpC,EAASK,QACTwM,EAAMjI,OACY,iBAAlB,IAAO7C,EAAP,YAAA+K,EAAO/K,KAAuBA,GAG/B,IAAI/B,EAAS2M,EAAMxK,SA1qBEnC,EAAA,GAwrBxB,OAPAC,EAAEG,GAAGF,GAAoBF,EAAS+M,iBAClC9M,EAAEG,GAAGF,GAAMsD,YAAcxD,EACzBC,EAAEG,GAAGF,GAAM8M,WAAc,WAExB,OADA/M,EAAEG,GAAGF,GAAQC,EACNH,EAAS+M,kBAGV/M,EAxrBU,CA0rBfqD,kBAEYrD","file":"ekko-lightbox.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const Lightbox = (($) => {\n\n\tconst NAME = 'ekkoLightbox'\n\tconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\n\tconst Default = {\n\t\ttitle: '',\n\t\tfooter: '',\n\t\tmaxWidth: 9999,\n\t\tmaxHeight: 9999,\n\t\tshowArrows: true, //display the left / right arrows or not\n\t\twrapping: true, //if true, gallery loops infinitely\n\t\ttype: null, //force the lightbox into image / youtube mode. if null, or not image|youtube|vimeo; detect it\n\t\talwaysShowClose: false, //always show the close button, even if there is no title\n\t\tfade: true, // fade in or not\n\t\tverticalAlignCenter: false, // vertically centered modal\n\t\tloadingMessage: '
', // http://tobiasahlin.com/spinkit/\n\t\tleftArrow: '',\n\t\trightArrow: '',\n\t\tstrings: {\n\t\t\tclose: 'Close',\n\t\t\tfail: 'Failed to load image:',\n\t\t\ttype: 'Could not detect remote target type. Force the type using data-type',\n\t\t},\n\t\tdoc: document, // if in an iframe can specify top.document\n\t\tonShow() {},\n\t\tonShown() {},\n\t\tonHide() {},\n\t\tonHidden() {},\n\t\tonNavigate() {},\n\t\tonContentLoaded() {}\n\t}\n\n\tclass Lightbox {\n\n\t\t/**\n\n\t Class properties:\n\n\t\t _$element: null -> the element currently being displayed\n\t\t _$modal: The bootstrap modal generated\n\t\t _$modalDialog: The .modal-dialog\n\t\t _$modalContent: The .modal-content\n\t\t _$modalBody: The .modal-body\n\t\t _$modalHeader: The .modal-header\n\t\t _$modalFooter: The .modal-footer\n\t\t _$lightboxContainerOne: Container of the first lightbox element\n\t\t _$lightboxContainerTwo: Container of the second lightbox element\n\t\t _$lightboxBody: First element in the container\n\t\t _$modalArrows: The overlayed arrows container\n\n\t\t _$galleryItems: Other 's available for this gallery\n\t\t _galleryName: Name of the current data('gallery') showing\n\t\t _galleryIndex: The current index of the _$galleryItems being shown\n\n\t\t _config: {} the options for the modal\n\t\t _modalId: unique id for the current lightbox\n\t\t _padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content\n\n\t\t */\n\n\t\tstatic get Default() {\n\t\t\treturn Default\n\t\t}\n\n\t\tconstructor($element, config) {\n\t\t\tthis._config = $.extend({}, Default, config)\n\t\t\tthis._$modalArrows = null\n\t\t\tthis._galleryIndex = 0\n\t\t\tthis._galleryName = null\n\t\t\tthis._padding = null\n\t\t\tthis._border = null\n\t\t\tthis._titleIsShown = false\n\t\t\tthis._footerIsShown = false\n\t\t\tthis._wantedWidth = 0\n\t\t\tthis._wantedHeight = 0\n\t\t\tthis._touchstartX = 0\n\t\t\tthis._touchendX = 0\n\n\t\t\tthis._modalId = `ekkoLightbox-${Math.floor((Math.random() * 1000) + 1)}`;\n\t\t\tthis._$element = $element instanceof jQuery ? $element : $($element)\n\n\t\t\tthis._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3;\n\n\t\t\tlet h4 = `

${this._config.title || \" \"}

`;\n\t\t\tlet btn = ``;\n\n\t\t\tlet fade = this._config.fade ? 'fade in' : '';\n\t\t\tlet vertical = this._config.verticalAlignCenter ? 'modal-dialog-centered' : '';\n\n\t\t\tlet header = `
`+(this._isBootstrap3 ? btn+h4 : h4+btn)+`
`;\n\t\t\tlet footer = `
${this._config.footer || \" \"}
`;\n\t\t\tlet body = `
`;\n\t\t\tlet dialog = `
${header}${body}${footer}
`;\n\t\t\t$(this._config.doc.body).append(`
${dialog}
`)\n\n\t\t\tthis._$modal = $(`#${this._modalId}`, this._config.doc)\n\t\t\tthis._$modalDialog = this._$modal.find('.modal-dialog').first()\n\t\t\tthis._$modalContent = this._$modal.find('.modal-content').first()\n\t\t\tthis._$modalBody = this._$modal.find('.modal-body').first()\n\t\t\tthis._$modalHeader = this._$modal.find('.modal-header').first()\n\t\t\tthis._$modalFooter = this._$modal.find('.modal-footer').first()\n\n\t\t\tthis._$lightboxContainer = this._$modalBody.find('.ekko-lightbox-container').first()\n\t\t\tthis._$lightboxBodyOne = this._$lightboxContainer.find('> div:first-child').first()\n\t\t\tthis._$lightboxBodyTwo = this._$lightboxContainer.find('> div:last-child').first()\n\n\t\t\tthis._border = this._calculateBorders()\n\t\t\tthis._padding = this._calculatePadding()\n\n\t\t\tthis._galleryName = this._$element.data('gallery')\n\t\t\tif (this._galleryName) {\n\t\t\t\tthis._$galleryItems = $(document.body).find(`*[data-gallery=\"${this._galleryName}\"]`)\n\t\t\t\tthis._galleryIndex = this._$galleryItems.index(this._$element)\n\t\t\t\t$(document).on('keydown.ekkoLightbox', this._navigationalBinder.bind(this))\n\n\t\t\t\t// add the directional arrows to the modal\n\t\t\t\tif (this._config.showArrows && this._$galleryItems.length > 1) {\n\t\t\t\t\tthis._$lightboxContainer.append(`
`)\n\t\t\t\t\tthis._$modalArrows = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay').first()\n\t\t\t\t\tthis._$lightboxContainer.on('click', 'a:first-child', event => {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn this.navigateLeft()\n\t\t\t\t\t})\n\t\t\t\t\tthis._$lightboxContainer.on('click', 'a:last-child', event => {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn this.navigateRight()\n\t\t\t\t\t})\n\t\t\t\t\tthis.updateNavigation()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._$modal\n\t\t\t.on('show.bs.modal', this._config.onShow.bind(this))\n\t\t\t.on('shown.bs.modal', () => {\n\t\t\t\tthis._toggleLoading(true)\n\t\t\t\tthis._handle()\n\t\t\t\treturn this._config.onShown.call(this)\n\t\t\t})\n\t\t\t.on('hide.bs.modal', this._config.onHide.bind(this))\n\t\t\t.on('hidden.bs.modal', () => {\n\t\t\t\tif (this._galleryName) {\n\t\t\t\t\t$(document).off('keydown.ekkoLightbox')\n\t\t\t\t\t$(window).off('resize.ekkoLightbox')\n\t\t\t\t}\n\t\t\t\tthis._$modal.remove()\n\t\t\t\treturn this._config.onHidden.call(this)\n\t\t\t})\n\t\t\t.modal(this._config)\n\n\t\t\t$(window).on('resize.ekkoLightbox', () => {\n\t\t\t\tthis._resize(this._wantedWidth, this._wantedHeight)\n\t\t\t})\n\t\t\tthis._$lightboxContainer\n\t\t\t.on('touchstart', () => {\n\t\t\t\tthis._touchstartX = event.changedTouches[0].screenX;\n\n\t\t\t})\n\t\t\t.on('touchend', () => {\n\t\t\t\tthis._touchendX = event.changedTouches[0].screenX;\n\t\t\t this._swipeGesure();\n\t\t\t})\n\t\t}\n\n\t\telement() {\n\t\t\treturn this._$element;\n\t\t}\n\n\t\tmodal() {\n\t\t\treturn this._$modal;\n\t\t}\n\n\t\tnavigateTo(index) {\n\n\t\t\tif (index < 0 || index > this._$galleryItems.length-1)\n\t\t\t\treturn this\n\n\t\t\tthis._galleryIndex = index\n\n\t\t\tthis.updateNavigation()\n\n\t\t\tthis._$element = $(this._$galleryItems.get(this._galleryIndex))\n\t\t\tthis._handle();\n\t\t}\n\n\t\tnavigateLeft() {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n\n\t\t\tif (this._$galleryItems.length === 1)\n\t\t\t\treturn\n\n\t\t\tif (this._galleryIndex === 0) {\n\t\t\t\tif (this._config.wrapping)\n\t\t\t\t\tthis._galleryIndex = this._$galleryItems.length - 1\n\t\t\t\telse\n\t\t\t\t\treturn\n\t\t\t}\n\t\t\telse //circular\n\t\t\t\tthis._galleryIndex--\n\n\t\t\tthis._config.onNavigate.call(this, 'left', this._galleryIndex)\n\t\t\treturn this.navigateTo(this._galleryIndex)\n\t\t}\n\n\t\tnavigateRight() {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n\n\t\t\tif (this._$galleryItems.length === 1)\n\t\t\t\treturn\n\n\t\t\tif (this._galleryIndex === this._$galleryItems.length - 1) {\n\t\t\t\tif (this._config.wrapping)\n\t\t\t\t\tthis._galleryIndex = 0\n\t\t\t\telse\n\t\t\t\t\treturn\n\t\t\t}\n\t\t\telse //circular\n\t\t\t\tthis._galleryIndex++\n\n\t\t\tthis._config.onNavigate.call(this, 'right', this._galleryIndex)\n\t\t\treturn this.navigateTo(this._galleryIndex)\n\t\t}\n\n\t\tupdateNavigation() {\n\t\t\tif (!this._config.wrapping) {\n\t\t\t\tlet $nav = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay')\n\t\t\t\tif (this._galleryIndex === 0)\n\t\t\t\t\t$nav.find('a:first-child').addClass('disabled')\n\t\t\t\telse\n\t\t\t\t\t$nav.find('a:first-child').removeClass('disabled')\n\n\t\t\t\tif (this._galleryIndex === this._$galleryItems.length - 1)\n\t\t\t\t\t$nav.find('a:last-child').addClass('disabled')\n\t\t\t\telse\n\t\t\t\t\t$nav.find('a:last-child').removeClass('disabled')\n\t\t\t}\n\t\t}\n\n\t\tclose() {\n\t\t\treturn this._$modal.modal('hide');\n\t\t}\n\n\t\t// helper private methods\n\t\t_navigationalBinder(event) {\n\t\t\tevent = event || window.event;\n\t\t\tif (event.keyCode === 39)\n\t\t\t\treturn this.navigateRight()\n\t\t\tif (event.keyCode === 37)\n\t\t\t\treturn this.navigateLeft()\n\t\t}\n\n\t\t// type detection private methods\n\t\t_detectRemoteType(src, type) {\n\n\t\t\ttype = type || false;\n\n\t\t\tif(!type && this._isImage(src))\n\t\t\t\ttype = 'image';\n\t\t\tif(!type && this._getYoutubeId(src))\n\t\t\t\ttype = 'youtube';\n\t\t\tif(!type && this._getVimeoId(src))\n\t\t\t\ttype = 'vimeo';\n\t\t\tif(!type && this._getInstagramId(src))\n\t\t\t\ttype = 'instagram';\n\t\t\tif(type == 'audio' || type == 'video' || (!type && this._isMedia(src)))\n\t\t\t\ttype = 'media';\n\t\t\tif(!type || ['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(type) < 0)\n\t\t\t\ttype = 'url';\n\n\t\t\treturn type;\n\t\t}\n\n\t\t_getRemoteContentType(src) {\n\t\t\tlet response = $.ajax({\n\t\t\t\ttype: 'HEAD',\n\t\t\t\turl: src,\n\t\t\t\tasync: false\n\t\t\t});\n\t\t\tlet contentType = response.getResponseHeader('Content-Type')\n\t\t\treturn contentType;\n\t\t}\n\n\t\t_isImage(string) {\n\t\t\treturn string && string.match(/(^data:image\\/.*,)|(\\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\\?|#).*)?$)/i)\n\t\t}\n\n\t\t_isMedia(string) {\n\t\t\treturn string && string.match(/(\\.(mp3|mp4|ogg|webm|wav)((\\?|#).*)?$)/i)\n\t\t}\n\n\t\t_containerToUse() {\n\t\t\t// if currently showing an image, fade it out and remove\n\t\t\tlet $toUse = this._$lightboxBodyTwo\n\t\t\tlet $current = this._$lightboxBodyOne\n\n\t\t\tif(this._$lightboxBodyTwo.hasClass('in')) {\n\t\t\t\t$toUse = this._$lightboxBodyOne\n\t\t\t\t$current = this._$lightboxBodyTwo\n\t\t\t}\n\n\t\t\t$current.removeClass('in show')\n\t\t\tsetTimeout(() => {\n\t\t\t\tif(!this._$lightboxBodyTwo.hasClass('in'))\n\t\t\t\t\tthis._$lightboxBodyTwo.empty()\n\t\t\t\tif(!this._$lightboxBodyOne.hasClass('in'))\n\t\t\t\t\tthis._$lightboxBodyOne.empty()\n\t\t\t}, 500)\n\n\t\t\t$toUse.addClass('in show')\n\t\t\treturn $toUse\n\t\t}\n\n\t\t_handle() {\n\n\t\t\tlet $toUse = this._containerToUse()\n\t\t\tthis._updateTitleAndFooter()\n\n\t\t\tlet currentRemote = this._$element.attr('data-remote') || this._$element.attr('href')\n\t\t\tlet currentType = this._detectRemoteType(currentRemote, this._$element.attr('data-type') || false)\n\n\t\t\tif(['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(currentType) < 0)\n\t\t\t\treturn this._error(this._config.strings.type)\n\n\t\t\tswitch(currentType) {\n\t\t\t\tcase 'image':\n\t\t\t\t\tthis._preloadImage(currentRemote, $toUse)\n\t\t\t\t\tthis._preloadImageByIndex(this._galleryIndex, 3)\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'youtube':\n\t\t\t\t\tthis._showYoutubeVideo(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'vimeo':\n\t\t\t\t\tthis._showVimeoVideo(this._getVimeoId(currentRemote), $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'instagram':\n\t\t\t\t\tthis._showInstagramVideo(this._getInstagramId(currentRemote), $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'media':\n\t\t\t\t\tthis._showHtml5Media(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // url\n\t\t\t\t\tthis._loadRemoteContent(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\t_getYoutubeId(string) {\n\t\t\tif(!string)\n\t\t\t\treturn false;\n\t\t\tlet matches = string.match(/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/)\n\t\t\treturn (matches && matches[2].length === 11) ? matches[2] : false\n\t\t}\n\n\t\t_getVimeoId(string) {\n\t\t\treturn string && string.indexOf('vimeo') > 0 ? string : false\n\t\t}\n\n\t\t_getInstagramId(string) {\n\t\t\treturn string && string.indexOf('instagram') > 0 ? string : false\n\t\t}\n\n\t\t// layout private methods\n\t\t_toggleLoading(show) {\n\t\t\tshow = show || false\n\t\t\tif(show) {\n\t\t\t\tthis._$modalDialog.css('display', 'none')\n\t\t\t\tthis._$modal.removeClass('in show')\n\t\t\t\t$('.modal-backdrop').append(this._config.loadingMessage)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._$modalDialog.css('display', this._config.verticalAlignCenter ? 'flex' : 'block')\n\t\t\t\tthis._$modal.addClass('in show')\n\t\t\t\t$('.modal-backdrop').find('.ekko-lightbox-loader').remove()\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t_calculateBorders() {\n\t\t\treturn {\n\t\t\t\ttop: this._totalCssByAttribute('border-top-width'),\n\t\t\t\tright: this._totalCssByAttribute('border-right-width'),\n\t\t\t\tbottom: this._totalCssByAttribute('border-bottom-width'),\n\t\t\t\tleft: this._totalCssByAttribute('border-left-width'),\n\t\t\t}\n\t\t}\n\n\t\t_calculatePadding() {\n\t\t\treturn {\n\t\t\t\ttop: this._totalCssByAttribute('padding-top'),\n\t\t\t\tright: this._totalCssByAttribute('padding-right'),\n\t\t\t\tbottom: this._totalCssByAttribute('padding-bottom'),\n\t\t\t\tleft: this._totalCssByAttribute('padding-left'),\n\t\t\t}\n\t\t}\n\n\t\t_totalCssByAttribute(attribute) {\n\t\t\treturn parseInt(this._$modalDialog.css(attribute), 10) +\n\t\t\t\tparseInt(this._$modalContent.css(attribute), 10) +\n\t\t\t\tparseInt(this._$modalBody.css(attribute), 10)\n\t\t}\n\n\t\t_updateTitleAndFooter() {\n\t\t\tlet title = this._$element.data('title') || \"\"\n\t\t\tlet caption = this._$element.data('footer') || \"\"\n\n\t\t\tthis._titleIsShown = false\n\t\t\tif (title || this._config.alwaysShowClose) {\n\t\t\t\tthis._titleIsShown = true\n\t\t\t\tthis._$modalHeader.css('display', '').find('.modal-title').html(title || \" \")\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis._$modalHeader.css('display', 'none')\n\n\t\t\tthis._footerIsShown = false\n\t\t\tif (caption) {\n\t\t\t\tthis._footerIsShown = true\n\t\t\t\tthis._$modalFooter.css('display', '').html(caption)\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis._$modalFooter.css('display', 'none')\n\n\t\t\treturn this;\n\t\t}\n\n\t\t_showYoutubeVideo(remote, $containerForElement) {\n\t\t\tlet id = this._getYoutubeId(remote)\n\t\t\tlet query = remote.indexOf('&') > 0 ? remote.substr(remote.indexOf('&')) : ''\n\t\t\tlet width = this._$element.data('width') || 560\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\treturn this._showVideoIframe(\n\t\t\t\t`//www.youtube.com/embed/${id}?badge=0&autoplay=1&html5=1${query}`,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\t$containerForElement\n\t\t\t);\n\t\t}\n\n\t\t_showVimeoVideo(id, $containerForElement) {\n\t\t\tlet width = this._$element.data('width') || 500\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\treturn this._showVideoIframe(id + '?autoplay=1', width, height, $containerForElement)\n\t\t}\n\n\t\t_showInstagramVideo(id, $containerForElement) {\n\t\t\t// instagram load their content into iframe's so this can be put straight into the element\n\t\t\tlet width = this._$element.data('width') || 612\n\t\t\tlet height = width + 80;\n\t\t\tid = id.substr(-1) !== '/' ? id + '/' : id; // ensure id has trailing slash\n\t\t\t$containerForElement.html(``);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows) //hide the arrows when showing video\n\t\t\t\tthis._$modalArrows.css('display', 'none');\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n\n\t\t_showVideoIframe(url, width, height, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)\n\t\t\theight = height || width; // default to square\n\t\t\t$containerForElement.html(`
`);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows)\n\t\t\t\tthis._$modalArrows.css('display', 'none'); //hide the arrows when showing video\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n \n\t\t_showHtml5Media(url, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)\n\t\t\tlet contentType = this._getRemoteContentType(url);\n\t\t\tif(!contentType){\n\t\t\t\treturn this._error(this._config.strings.type)\n\t\t\t}\n\t\t\tlet mediaType = '';\n\t\t\tif(contentType.indexOf('audio') > 0){\n\t\t\t\tmediaType = 'audio';\n\t\t\t}else{\n\t\t\t\tmediaType = 'video';\n\t\t\t}\n\t\t\tlet width = this._$element.data('width') || 560\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\t$containerForElement.html(`
<${mediaType} width=\"${width}\" height=\"${height}\" preload=\"auto\" autoplay controls class=\"embed-responsive-item\">${this._config.strings.type}
`);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows)\n\t\t\t\tthis._$modalArrows.css('display', 'none'); //hide the arrows when showing video\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n\n\t\t_loadRemoteContent(url, $containerForElement) {\n\t\t\tlet width = this._$element.data('width') || 560;\n\t\t\tlet height = this._$element.data('height') || 560;\n\n\t\t\tlet disableExternalCheck = this._$element.data('disableExternalCheck') || false;\n\t\t\tthis._toggleLoading(false);\n\n\t\t\t// external urls are loading into an iframe\n\t\t\t// local ajax can be loaded into the container itself\n\t\t\tif (!disableExternalCheck && !this._isExternal(url)) {\n\t\t\t\t$containerForElement.load(url, $.proxy(() => {\n\t\t\t\t\treturn this._$element.trigger('loaded.bs.modal');\n\t\t\t\t}));\n\n\t\t\t} else {\n\t\t\t\t$containerForElement.html(``);\n\t\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\t}\n\n\t\t\tif (this._$modalArrows) //hide the arrows when remote content\n\t\t\t\tthis._$modalArrows.css('display', 'none')\n\n\t\t\tthis._resize(width, height);\n\t\t\treturn this;\n\t\t}\n\n\t\t_isExternal(url) {\n\t\t\tlet match = url.match(/^([^:\\/?#]+:)?(?:\\/\\/([^\\/?#]*))?([^?#]+)?(\\?[^#]*)?(#.*)?/);\n\t\t\tif (typeof match[1] === \"string\" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol)\n\t\t\t\treturn true;\n\n\t\t\tif (typeof match[2] === \"string\" && match[2].length > 0 && match[2].replace(new RegExp(`:(${{\n\t\t\t\t\t\"http:\": 80,\n\t\t\t\t\t\"https:\": 443\n\t\t\t\t}[location.protocol]})?$`), \"\") !== location.host)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\t_error( message ) {\n\t\t\tconsole.error(message);\n\t\t\tthis._containerToUse().html(message);\n\t\t\tthis._resize(300, 300);\n\t\t\treturn this;\n\t\t}\n\n\t\t_preloadImageByIndex(startIndex, numberOfTimes) {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n\n\t\t\tlet next = $(this._$galleryItems.get(startIndex), false)\n\t\t\tif(typeof next == 'undefined')\n\t\t\t\treturn\n\n\t\t\tlet src = next.attr('data-remote') || next.attr('href')\n\t\t\tif (next.attr('data-type') === 'image' || this._isImage(src))\n\t\t\t\tthis._preloadImage(src, false)\n\n\t\t\tif(numberOfTimes > 0)\n\t\t\t\treturn this._preloadImageByIndex(startIndex + 1, numberOfTimes-1);\n\t\t}\n\n\t\t_preloadImage( src, $containerForImage) {\n\n\t\t\t$containerForImage = $containerForImage || false\n\n\t\t\tlet img = new Image();\n\t\t\tif ($containerForImage) {\n\n\t\t\t\t// if loading takes > 200ms show a loader\n\t\t\t\tlet loadingTimeout = setTimeout(() => {\n\t\t\t\t\t$containerForImage.append(this._config.loadingMessage)\n\t\t\t\t}, 200)\n\n\t\t\t\timg.onload = () => {\n\t\t\t\t\tif(loadingTimeout)\n\t\t\t\t\t\tclearTimeout(loadingTimeout)\n\t\t\t\t\tloadingTimeout = null;\n\t\t\t\t\tlet image = $('');\n\t\t\t\t\timage.attr('src', img.src);\n\t\t\t\t\timage.addClass('img-fluid');\n\n\t\t\t\t\t// backward compatibility for bootstrap v3\n\t\t\t\t\timage.css('width', '100%');\n\n\t\t\t\t\t$containerForImage.html(image);\n\t\t\t\t\tif (this._$modalArrows)\n\t\t\t\t\t\tthis._$modalArrows.css('display', '') // remove display to default to css property\n\n\t\t\t\t\tthis._resize(img.width, img.height);\n\t\t\t\t\tthis._toggleLoading(false);\n\t\t\t\t\treturn this._config.onContentLoaded.call(this);\n\t\t\t\t};\n\t\t\t\timg.onerror = () => {\n\t\t\t\t\tthis._toggleLoading(false);\n\t\t\t\t\treturn this._error(this._config.strings.fail+` ${src}`);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\timg.src = src;\n\t\t\treturn img;\n\t\t}\n\n\t\t_swipeGesure() {\n\t\t if (this._touchendX < this._touchstartX) {\n\t\t return this.navigateRight();\n\t\t }\n\t\t if (this._touchendX > this._touchstartX) {\n\t\t return this.navigateLeft();\n\t\t }\n\t\t}\n\n\t\t_resize( width, height ) {\n\n\t\t\theight = height || width\n\t\t\tthis._wantedWidth = width\n\t\t\tthis._wantedHeight = height\n\n\t\t\tlet imageAspecRatio = width / height;\n\n\t\t\t// if width > the available space, scale down the expected width and height\n\t\t\tlet widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right\n\n\t\t\t// force 10px margin if window size > 575px\n\t\t\tlet addMargin = this._config.doc.body.clientWidth > 575 ? 20 : 0\n\t\t\tlet discountMargin = this._config.doc.body.clientWidth > 575 ? 0 : 20\n\n\t\t\tlet maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth - addMargin, this._config.maxWidth)\n\n\t\t\tif((width + widthBorderAndPadding) > maxWidth) {\n\t\t\t\theight = (maxWidth - widthBorderAndPadding - discountMargin) / imageAspecRatio;\n\t\t\t\twidth = maxWidth\n\t\t\t} else\n\t\t\t\twidth = (width + widthBorderAndPadding)\n\n\t\t\tlet headerHeight = 0,\n\t\t\t footerHeight = 0\n\n\t\t\t// as the resize is performed the modal is show, the calculate might fail\n\t\t\t// if so, default to the default sizes\n\t\t\tif (this._footerIsShown)\n\t\t\t\tfooterHeight = this._$modalFooter.outerHeight(true) || 55\n\n\t\t\tif (this._titleIsShown)\n\t\t\t\theaderHeight = this._$modalHeader.outerHeight(true) || 67\n\n\t\t\tlet borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top\n\n\t\t\t//calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins\n\t\t\tlet margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom'));\n\n\t\t\tlet maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight, this._config.maxHeight - borderPadding - headerHeight - footerHeight);\n\n\t\t\tif(height > maxHeight) {\n\t\t\t\t// if height > the available height, scale down the width\n\t\t\t\twidth = Math.ceil(maxHeight * imageAspecRatio) + widthBorderAndPadding;\n\t\t\t}\n\n\t\t\tthis._$lightboxContainer.css('height', maxHeight)\n\t\t\tthis._$modalDialog.css('flex', '1').css('maxWidth', width);\n\n\t\t\tlet modal = this._$modal.data('bs.modal');\n\t\t\tif (modal) {\n\t\t\t\t// v4 method is mistakenly protected\n\t\t\t\ttry {\n\t\t\t\t\tmodal._handleUpdate();\n\t\t\t\t} catch(Exception) {\n\t\t\t\t\tmodal.handleUpdate();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tstatic _jQueryInterface(config) {\n\t\t\tconfig = config || {}\n\t\t\treturn this.each(() => {\n\t\t\t\tlet $this = $(this)\n\t\t\t\tlet _config = $.extend(\n\t\t\t\t\t{},\n\t\t\t\t\tLightbox.Default,\n\t\t\t\t\t$this.data(),\n\t\t\t\t\ttypeof config === 'object' && config\n\t\t\t\t)\n\n\t\t\t\tnew Lightbox(this, _config)\n\t\t\t})\n\t\t}\n\t}\n\n\n\n\t$.fn[NAME] = Lightbox._jQueryInterface\n\t$.fn[NAME].Constructor = Lightbox\n\t$.fn[NAME].noConflict = () => {\n\t\t$.fn[NAME] = JQUERY_NO_CONFLICT\n\t\treturn Lightbox._jQueryInterface\n\t}\n\n\treturn Lightbox\n\n})(jQuery)\n\nexport default Lightbox\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./ekko-lightbox.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Lightbox","$","NAME","JQUERY_NO_CONFLICT","fn","Default","title","footer","maxWidth","maxHeight","showArrows","wrapping","type","alwaysShowClose","fade","verticalAlignCenter","loadingMessage","leftArrow","rightArrow","strings","close","fail","doc","document","onShow","onShown","onHide","onHidden","onNavigate","onContentLoaded","$element","config","_this","this","_classCallCheck","_config","extend","_$modalArrows","_galleryIndex","_galleryName","_padding","_border","_titleIsShown","_footerIsShown","_wantedWidth","_wantedHeight","_touchstartX","_touchendX","_modalId","Math","floor","random","_$element","jQuery","_isBootstrap3","modal","Constructor","VERSION","h4","btn","dialog","body","append","_$modal","_$modalDialog","find","first","_$modalContent","_$modalBody","_$modalHeader","_$modalFooter","_$lightboxContainer","_$lightboxBodyOne","_$lightboxBodyTwo","_calculateBorders","_calculatePadding","data","_$galleryItems","index","on","_navigationalBinder","length","event","preventDefault","navigateLeft","navigateRight","updateNavigation","_toggleLoading","_handle","off","window","remove","_resize","changedTouches","screenX","_swipeGesure","_createClass","navigateTo","$nav","addClass","removeClass","keyCode","src","_isImage","_getYoutubeId","_getVimeoId","_getInstagramId","_isMedia","indexOf","ajax","url","async","getResponseHeader","string","match","_this2","$toUse","$current","hasClass","setTimeout","empty","_containerToUse","_updateTitleAndFooter","currentRemote","attr","currentType","_detectRemoteType","_error","altTag","_preloadImage","_preloadImageByIndex","_showYoutubeVideo","_showVimeoVideo","_showInstagramVideo","_showHtml5Media","_loadRemoteContent","matches","show","css","top","_totalCssByAttribute","right","bottom","left","attribute","parseInt","caption","html","remote","$containerForElement","id","query","substr","width","height","_showVideoIframe","contentType","_getRemoteContentType","mediaType","_this3","disableExternalCheck","_isExternal","load","proxy","trigger","toLowerCase","location","protocol","replace","RegExp","http:","https:","host","message","console","error","startIndex","numberOfTimes","next","$containerForImage","_this4","img","Image","loadingTimeout","onload","clearTimeout","image","onerror","imageAspecRatio","widthBorderAndPadding","addMargin","clientWidth","discountMargin","min","headerHeight","footerHeight","outerHeight","borderPadding","margins","parseFloat","ceil","_handleUpdate","Exception","handleUpdate","_this5","each","$this","_typeof","_jQueryInterface","noConflict"],"mappings":";;;;;;gBACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,K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AS7G,KAAKQ,QAAQkG,IAG9F2D,EAAUC,WAAWtK,KAAK+B,cAAc0E,IAAI,eAAiB6D,WAAWtK,KAAK+B,cAAc0E,IAAI,kBAE/FjI,EAAYwC,KAAKgJ,IAAIvC,EAAQzJ,EAAEyF,QAAQgE,SAAW2C,EAAgBC,EAAUJ,EAAeC,EAAclK,KAAKE,QAAQ1B,UAAY4L,EAAgBH,EAAeC,GAElKzC,EAASjJ,IAEXgJ,EAAQxG,KAAKuJ,KAAK/L,EAAYmL,GAAmBC,GAGlD5J,KAAKsC,oBAAoBmE,IAAI,SAAUjI,GACvCwB,KAAK+B,cAAc0E,IAAI,OAAQ,KAAKA,IAAI,WAAYe,GAEpD,IAAIlG,EAAQtB,KAAK8B,QAAQa,KAAK,YAC9B,GAAIrB,EAEH,IACCA,EAAMkJ,gBACL,MAAMC,GACPnJ,EAAMoJ,eAGR,OAAO1K,UAnqBe1C,IAAA,mBAAAN,MAAA,SAsqBC8C,GAAQ,IAAA6K,EAAA3K,KAE/B,OADAF,EAASA,MACFE,KAAK4K,KAAK,WAChB,IAAIC,EAAQ7M,EAAE2M,GACVzK,EAAUlC,EAAEmC,UAEfpC,EAASK,QACTyM,EAAMlI,OACY,iBAAlB,IAAO7C,EAAP,YAAAgL,EAAOhL,KAAuBA,GAG/B,IAAI/B,EAAS4M,EAAMzK,SAjrBEnC,EAAA,GA+rBxB,OAPAC,EAAEG,GAAGF,GAAoBF,EAASgN,iBAClC/M,EAAEG,GAAGF,GAAMsD,YAAcxD,EACzBC,EAAEG,GAAGF,GAAM+M,WAAc,WAExB,OADAhN,EAAEG,GAAGF,GAAQC,EACNH,EAASgN,kBAGVhN,EA/rBU,CAisBfqD,kBAEYrD","file":"ekko-lightbox.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const Lightbox = (($) => {\n\n\tconst NAME = 'ekkoLightbox'\n\tconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\n\tconst Default = {\n\t\ttitle: '',\n\t\tfooter: '',\n\t\tmaxWidth: 9999,\n\t\tmaxHeight: 9999,\n\t\tshowArrows: true, //display the left / right arrows or not\n\t\twrapping: true, //if true, gallery loops infinitely\n\t\ttype: null, //force the lightbox into image / youtube mode. if null, or not image|youtube|vimeo; detect it\n\t\talwaysShowClose: false, //always show the close button, even if there is no title\n\t\tfade: true, // fade in or not\n\t\tverticalAlignCenter: false, // vertically centered modal\n\t\tloadingMessage: '
', // http://tobiasahlin.com/spinkit/\n\t\tleftArrow: '',\n\t\trightArrow: '',\n\t\tstrings: {\n\t\t\tclose: 'Close',\n\t\t\tfail: 'Failed to load image:',\n\t\t\ttype: 'Could not detect remote target type. Force the type using data-type',\n\t\t},\n\t\tdoc: document, // if in an iframe can specify top.document\n\t\tonShow() {},\n\t\tonShown() {},\n\t\tonHide() {},\n\t\tonHidden() {},\n\t\tonNavigate() {},\n\t\tonContentLoaded() {}\n\t}\n\n\tclass Lightbox {\n\n\t\t/**\n\n\t Class properties:\n\n\t\t _$element: null -> the element currently being displayed\n\t\t _$modal: The bootstrap modal generated\n\t\t _$modalDialog: The .modal-dialog\n\t\t _$modalContent: The .modal-content\n\t\t _$modalBody: The .modal-body\n\t\t _$modalHeader: The .modal-header\n\t\t _$modalFooter: The .modal-footer\n\t\t _$lightboxContainerOne: Container of the first lightbox element\n\t\t _$lightboxContainerTwo: Container of the second lightbox element\n\t\t _$lightboxBody: First element in the container\n\t\t _$modalArrows: The overlayed arrows container\n\n\t\t _$galleryItems: Other 's available for this gallery\n\t\t _galleryName: Name of the current data('gallery') showing\n\t\t _galleryIndex: The current index of the _$galleryItems being shown\n\n\t\t _config: {} the options for the modal\n\t\t _modalId: unique id for the current lightbox\n\t\t _padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content\n\n\t\t */\n\n\t\tstatic get Default() {\n\t\t\treturn Default\n\t\t}\n\n\t\tconstructor($element, config) {\n\t\t\tthis._config = $.extend({}, Default, config)\n\t\t\tthis._$modalArrows = null\n\t\t\tthis._galleryIndex = 0\n\t\t\tthis._galleryName = null\n\t\t\tthis._padding = null\n\t\t\tthis._border = null\n\t\t\tthis._titleIsShown = false\n\t\t\tthis._footerIsShown = false\n\t\t\tthis._wantedWidth = 0\n\t\t\tthis._wantedHeight = 0\n\t\t\tthis._touchstartX = 0\n\t\t\tthis._touchendX = 0\n\n\t\t\tthis._modalId = `ekkoLightbox-${Math.floor((Math.random() * 1000) + 1)}`;\n\t\t\tthis._$element = $element instanceof jQuery ? $element : $($element)\n\n\t\t\tthis._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3;\n\n\t\t\tlet h4 = `

${this._config.title || \" \"}

`;\n\t\t\tlet btn = ``;\n\n\t\t\tlet fade = this._config.fade ? 'fade in' : '';\n\t\t\tlet vertical = this._config.verticalAlignCenter ? 'modal-dialog-centered' : '';\n\n\t\t\tlet header = `
`+(this._isBootstrap3 ? btn+h4 : h4+btn)+`
`;\n\t\t\tlet footer = `
${this._config.footer || \" \"}
`;\n\t\t\tlet body = `
`;\n\t\t\tlet dialog = `
${header}${body}${footer}
`;\n\t\t\t$(this._config.doc.body).append(`
${dialog}
`)\n\n\t\t\tthis._$modal = $(`#${this._modalId}`, this._config.doc)\n\t\t\tthis._$modalDialog = this._$modal.find('.modal-dialog').first()\n\t\t\tthis._$modalContent = this._$modal.find('.modal-content').first()\n\t\t\tthis._$modalBody = this._$modal.find('.modal-body').first()\n\t\t\tthis._$modalHeader = this._$modal.find('.modal-header').first()\n\t\t\tthis._$modalFooter = this._$modal.find('.modal-footer').first()\n\n\t\t\tthis._$lightboxContainer = this._$modalBody.find('.ekko-lightbox-container').first()\n\t\t\tthis._$lightboxBodyOne = this._$lightboxContainer.find('> div:first-child').first()\n\t\t\tthis._$lightboxBodyTwo = this._$lightboxContainer.find('> div:last-child').first()\n\n\t\t\tthis._border = this._calculateBorders()\n\t\t\tthis._padding = this._calculatePadding()\n\n\t\t\tthis._galleryName = this._$element.data('gallery')\n\t\t\tif (this._galleryName) {\n\t\t\t\tthis._$galleryItems = $(document.body).find(`*[data-gallery=\"${this._galleryName}\"]`)\n\t\t\t\tthis._galleryIndex = this._$galleryItems.index(this._$element)\n\t\t\t\t$(document).on('keydown.ekkoLightbox', this._navigationalBinder.bind(this))\n\n\t\t\t\t// add the directional arrows to the modal\n\t\t\t\tif (this._config.showArrows && this._$galleryItems.length > 1) {\n\t\t\t\t\tthis._$lightboxContainer.append(`
`)\n\t\t\t\t\tthis._$modalArrows = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay').first()\n\t\t\t\t\tthis._$lightboxContainer.on('click', 'a:first-child', event => {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn this.navigateLeft()\n\t\t\t\t\t})\n\t\t\t\t\tthis._$lightboxContainer.on('click', 'a:last-child', event => {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn this.navigateRight()\n\t\t\t\t\t})\n\t\t\t\t\tthis.updateNavigation()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._$modal\n\t\t\t.on('show.bs.modal', this._config.onShow.bind(this))\n\t\t\t.on('shown.bs.modal', () => {\n\t\t\t\tthis._toggleLoading(true)\n\t\t\t\tthis._handle()\n\t\t\t\treturn this._config.onShown.call(this)\n\t\t\t})\n\t\t\t.on('hide.bs.modal', this._config.onHide.bind(this))\n\t\t\t.on('hidden.bs.modal', () => {\n\t\t\t\tif (this._galleryName) {\n\t\t\t\t\t$(document).off('keydown.ekkoLightbox')\n\t\t\t\t\t$(window).off('resize.ekkoLightbox')\n\t\t\t\t}\n\t\t\t\tthis._$modal.remove()\n\t\t\t\treturn this._config.onHidden.call(this)\n\t\t\t})\n\t\t\t.modal(this._config)\n\n\t\t\t$(window).on('resize.ekkoLightbox', () => {\n\t\t\t\tthis._resize(this._wantedWidth, this._wantedHeight)\n\t\t\t})\n\t\t\tthis._$lightboxContainer\n\t\t\t.on('touchstart', () => {\n\t\t\t\tthis._touchstartX = event.changedTouches[0].screenX;\n\n\t\t\t})\n\t\t\t.on('touchend', () => {\n\t\t\t\tthis._touchendX = event.changedTouches[0].screenX;\n\t\t\t this._swipeGesure();\n\t\t\t})\n\t\t}\n\n\t\telement() {\n\t\t\treturn this._$element;\n\t\t}\n\n\t\tmodal() {\n\t\t\treturn this._$modal;\n\t\t}\n\n\t\tnavigateTo(index) {\n\n\t\t\tif (index < 0 || index > this._$galleryItems.length-1)\n\t\t\t\treturn this\n\n\t\t\tthis._galleryIndex = index\n\n\t\t\tthis.updateNavigation()\n\n\t\t\tthis._$element = $(this._$galleryItems.get(this._galleryIndex))\n\t\t\tthis._handle();\n\t\t}\n\n\t\tnavigateLeft() {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n\n\t\t\tif (this._$galleryItems.length === 1)\n\t\t\t\treturn\n\n\t\t\tif (this._galleryIndex === 0) {\n\t\t\t\tif (this._config.wrapping)\n\t\t\t\t\tthis._galleryIndex = this._$galleryItems.length - 1\n\t\t\t\telse\n\t\t\t\t\treturn\n\t\t\t}\n\t\t\telse //circular\n\t\t\t\tthis._galleryIndex--\n\n\t\t\tthis._config.onNavigate.call(this, 'left', this._galleryIndex)\n\t\t\treturn this.navigateTo(this._galleryIndex)\n\t\t}\n\n\t\tnavigateRight() {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n\n\t\t\tif (this._$galleryItems.length === 1)\n\t\t\t\treturn\n\n\t\t\tif (this._galleryIndex === this._$galleryItems.length - 1) {\n\t\t\t\tif (this._config.wrapping)\n\t\t\t\t\tthis._galleryIndex = 0\n\t\t\t\telse\n\t\t\t\t\treturn\n\t\t\t}\n\t\t\telse //circular\n\t\t\t\tthis._galleryIndex++\n\n\t\t\tthis._config.onNavigate.call(this, 'right', this._galleryIndex)\n\t\t\treturn this.navigateTo(this._galleryIndex)\n\t\t}\n\n\t\tupdateNavigation() {\n\t\t\tif (!this._config.wrapping) {\n\t\t\t\tlet $nav = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay')\n\t\t\t\tif (this._galleryIndex === 0)\n\t\t\t\t\t$nav.find('a:first-child').addClass('disabled')\n\t\t\t\telse\n\t\t\t\t\t$nav.find('a:first-child').removeClass('disabled')\n\n\t\t\t\tif (this._galleryIndex === this._$galleryItems.length - 1)\n\t\t\t\t\t$nav.find('a:last-child').addClass('disabled')\n\t\t\t\telse\n\t\t\t\t\t$nav.find('a:last-child').removeClass('disabled')\n\t\t\t}\n\t\t}\n\n\t\tclose() {\n\t\t\treturn this._$modal.modal('hide');\n\t\t}\n\n\t\t// helper private methods\n\t\t_navigationalBinder(event) {\n\t\t\tevent = event || window.event;\n\t\t\tif (event.keyCode === 39)\n\t\t\t\treturn this.navigateRight()\n\t\t\tif (event.keyCode === 37)\n\t\t\t\treturn this.navigateLeft()\n\t\t}\n\n\t\t// type detection private methods\n\t\t_detectRemoteType(src, type) {\n\n\t\t\ttype = type || false;\n\n\t\t\tif(!type && this._isImage(src))\n\t\t\t\ttype = 'image';\n\t\t\tif(!type && this._getYoutubeId(src))\n\t\t\t\ttype = 'youtube';\n\t\t\tif(!type && this._getVimeoId(src))\n\t\t\t\ttype = 'vimeo';\n\t\t\tif(!type && this._getInstagramId(src))\n\t\t\t\ttype = 'instagram';\n\t\t\tif(type == 'audio' || type == 'video' || (!type && this._isMedia(src)))\n\t\t\t\ttype = 'media';\n\t\t\tif(!type || ['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(type) < 0)\n\t\t\t\ttype = 'url';\n\n\t\t\treturn type;\n\t\t}\n\n\t\t_getRemoteContentType(src) {\n\t\t\tlet response = $.ajax({\n\t\t\t\ttype: 'HEAD',\n\t\t\t\turl: src,\n\t\t\t\tasync: false\n\t\t\t});\n\t\t\tlet contentType = response.getResponseHeader('Content-Type')\n\t\t\treturn contentType;\n\t\t}\n\n\t\t_isImage(string) {\n\t\t\treturn string && string.match(/(^data:image\\/.*,)|(\\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\\?|#).*)?$)/i)\n\t\t}\n\n\t\t_isMedia(string) {\n\t\t\treturn string && string.match(/(\\.(mp3|mp4|ogg|webm|wav)((\\?|#).*)?$)/i)\n\t\t}\n\n\t\t_containerToUse() {\n\t\t\t// if currently showing an image, fade it out and remove\n\t\t\tlet $toUse = this._$lightboxBodyTwo\n\t\t\tlet $current = this._$lightboxBodyOne\n\n\t\t\tif(this._$lightboxBodyTwo.hasClass('in')) {\n\t\t\t\t$toUse = this._$lightboxBodyOne\n\t\t\t\t$current = this._$lightboxBodyTwo\n\t\t\t}\n\n\t\t\t$current.removeClass('in show')\n\t\t\tsetTimeout(() => {\n\t\t\t\tif(!this._$lightboxBodyTwo.hasClass('in'))\n\t\t\t\t\tthis._$lightboxBodyTwo.empty()\n\t\t\t\tif(!this._$lightboxBodyOne.hasClass('in'))\n\t\t\t\t\tthis._$lightboxBodyOne.empty()\n\t\t\t}, 500)\n\n\t\t\t$toUse.addClass('in show')\n\t\t\treturn $toUse\n\t\t}\n\n\t\t_handle() {\n\n\t\t\tlet $toUse = this._containerToUse()\n\t\t\tthis._updateTitleAndFooter()\n\n\t\t\tlet currentRemote = this._$element.attr('data-remote') || this._$element.attr('href')\n\t\t\tlet currentType = this._detectRemoteType(currentRemote, this._$element.attr('data-type') || false)\n\n\t\t\tif(['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(currentType) < 0)\n\t\t\t\treturn this._error(this._config.strings.type)\n\n\t\t\tswitch(currentType) {\n\t\t\t\tcase 'image':\n\t\t\t\t\tlet altTag = this._$element.attr('data-alt') || '';\n\t\t\t\t\tthis._preloadImage(currentRemote, altTag, $toUse)\n\t\t\t\t\tthis._preloadImageByIndex(this._galleryIndex, 3)\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'youtube':\n\t\t\t\t\tthis._showYoutubeVideo(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'vimeo':\n\t\t\t\t\tthis._showVimeoVideo(this._getVimeoId(currentRemote), $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'instagram':\n\t\t\t\t\tthis._showInstagramVideo(this._getInstagramId(currentRemote), $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'media':\n\t\t\t\t\tthis._showHtml5Media(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // url\n\t\t\t\t\tthis._loadRemoteContent(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\t_getYoutubeId(string) {\n\t\t\tif(!string)\n\t\t\t\treturn false;\n\t\t\tlet matches = string.match(/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/)\n\t\t\treturn (matches && matches[2].length === 11) ? matches[2] : false\n\t\t}\n\n\t\t_getVimeoId(string) {\n\t\t\treturn string && string.indexOf('vimeo') > 0 ? string : false\n\t\t}\n\n\t\t_getInstagramId(string) {\n\t\t\treturn string && string.indexOf('instagram') > 0 ? string : false\n\t\t}\n\n\t\t// layout private methods\n\t\t_toggleLoading(show) {\n\t\t\tshow = show || false\n\t\t\tif(show) {\n\t\t\t\tthis._$modalDialog.css('display', 'none')\n\t\t\t\tthis._$modal.removeClass('in show')\n\t\t\t\t$('.modal-backdrop').append(this._config.loadingMessage)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._$modalDialog.css('display', this._config.verticalAlignCenter ? 'flex' : 'block')\n\t\t\t\tthis._$modal.addClass('in show')\n\t\t\t\t$('.modal-backdrop').find('.ekko-lightbox-loader').remove()\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t_calculateBorders() {\n\t\t\treturn {\n\t\t\t\ttop: this._totalCssByAttribute('border-top-width'),\n\t\t\t\tright: this._totalCssByAttribute('border-right-width'),\n\t\t\t\tbottom: this._totalCssByAttribute('border-bottom-width'),\n\t\t\t\tleft: this._totalCssByAttribute('border-left-width'),\n\t\t\t}\n\t\t}\n\n\t\t_calculatePadding() {\n\t\t\treturn {\n\t\t\t\ttop: this._totalCssByAttribute('padding-top'),\n\t\t\t\tright: this._totalCssByAttribute('padding-right'),\n\t\t\t\tbottom: this._totalCssByAttribute('padding-bottom'),\n\t\t\t\tleft: this._totalCssByAttribute('padding-left'),\n\t\t\t}\n\t\t}\n\n\t\t_totalCssByAttribute(attribute) {\n\t\t\treturn parseInt(this._$modalDialog.css(attribute), 10) +\n\t\t\t\tparseInt(this._$modalContent.css(attribute), 10) +\n\t\t\t\tparseInt(this._$modalBody.css(attribute), 10)\n\t\t}\n\n\t\t_updateTitleAndFooter() {\n\t\t\tlet title = this._$element.data('title') || \"\"\n\t\t\tlet caption = this._$element.data('footer') || \"\"\n\n\t\t\tthis._titleIsShown = false\n\t\t\tif (title || this._config.alwaysShowClose) {\n\t\t\t\tthis._titleIsShown = true\n\t\t\t\tthis._$modalHeader.css('display', '').find('.modal-title').html(title || \" \")\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis._$modalHeader.css('display', 'none')\n\n\t\t\tthis._footerIsShown = false\n\t\t\tif (caption) {\n\t\t\t\tthis._footerIsShown = true\n\t\t\t\tthis._$modalFooter.css('display', '').html(caption)\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis._$modalFooter.css('display', 'none')\n\n\t\t\treturn this;\n\t\t}\n\n\t\t_showYoutubeVideo(remote, $containerForElement) {\n\t\t\tlet id = this._getYoutubeId(remote)\n\t\t\tlet query = remote.indexOf('&') > 0 ? remote.substr(remote.indexOf('&')) : ''\n\t\t\tlet width = this._$element.data('width') || 560\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\treturn this._showVideoIframe(\n\t\t\t\t`//www.youtube.com/embed/${id}?badge=0&autoplay=1&html5=1${query}`,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\t$containerForElement\n\t\t\t);\n\t\t}\n\n\t\t_showVimeoVideo(id, $containerForElement) {\n\t\t\tlet width = this._$element.data('width') || 500\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\treturn this._showVideoIframe(id + '?autoplay=1', width, height, $containerForElement)\n\t\t}\n\n\t\t_showInstagramVideo(id, $containerForElement) {\n\t\t\t// instagram load their content into iframe's so this can be put straight into the element\n\t\t\tlet width = this._$element.data('width') || 612\n\t\t\tlet height = width + 80;\n\t\t\tid = id.substr(-1) !== '/' ? id + '/' : id; // ensure id has trailing slash\n\t\t\t$containerForElement.html(``);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows) //hide the arrows when showing video\n\t\t\t\tthis._$modalArrows.css('display', 'none');\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n\n\t\t_showVideoIframe(url, width, height, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)\n\t\t\theight = height || width; // default to square\n\t\t\t$containerForElement.html(`
`);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows)\n\t\t\t\tthis._$modalArrows.css('display', 'none'); //hide the arrows when showing video\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n \n\t\t_showHtml5Media(url, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)\n\t\t\tlet contentType = this._getRemoteContentType(url);\n\t\t\tif(!contentType){\n\t\t\t\treturn this._error(this._config.strings.type)\n\t\t\t}\n\t\t\tlet mediaType = '';\n\t\t\tif(contentType.indexOf('audio') > 0){\n\t\t\t\tmediaType = 'audio';\n\t\t\t}else{\n\t\t\t\tmediaType = 'video';\n\t\t\t}\n\t\t\tlet width = this._$element.data('width') || 560\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\t$containerForElement.html(`
<${mediaType} width=\"${width}\" height=\"${height}\" preload=\"auto\" autoplay controls class=\"embed-responsive-item\">${this._config.strings.type}
`);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows)\n\t\t\t\tthis._$modalArrows.css('display', 'none'); //hide the arrows when showing video\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n\n\t\t_loadRemoteContent(url, $containerForElement) {\n\t\t\tlet width = this._$element.data('width') || 560;\n\t\t\tlet height = this._$element.data('height') || 560;\n\n\t\t\tlet disableExternalCheck = this._$element.data('disableExternalCheck') || false;\n\t\t\tthis._toggleLoading(false);\n\n\t\t\t// external urls are loading into an iframe\n\t\t\t// local ajax can be loaded into the container itself\n\t\t\tif (!disableExternalCheck && !this._isExternal(url)) {\n\t\t\t\t$containerForElement.load(url, $.proxy(() => {\n\t\t\t\t\treturn this._$element.trigger('loaded.bs.modal');\n\t\t\t\t}));\n\n\t\t\t} else {\n\t\t\t\t$containerForElement.html(``);\n\t\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\t}\n\n\t\t\tif (this._$modalArrows) //hide the arrows when remote content\n\t\t\t\tthis._$modalArrows.css('display', 'none')\n\n\t\t\tthis._resize(width, height);\n\t\t\treturn this;\n\t\t}\n\n\t\t_isExternal(url) {\n\t\t\tlet match = url.match(/^([^:\\/?#]+:)?(?:\\/\\/([^\\/?#]*))?([^?#]+)?(\\?[^#]*)?(#.*)?/);\n\t\t\tif (typeof match[1] === \"string\" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol)\n\t\t\t\treturn true;\n\n\t\t\tif (typeof match[2] === \"string\" && match[2].length > 0 && match[2].replace(new RegExp(`:(${{\n\t\t\t\t\t\"http:\": 80,\n\t\t\t\t\t\"https:\": 443\n\t\t\t\t}[location.protocol]})?$`), \"\") !== location.host)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\t_error( message ) {\n\t\t\tconsole.error(message);\n\t\t\tthis._containerToUse().html(message);\n\t\t\tthis._resize(300, 300);\n\t\t\treturn this;\n\t\t}\n\n\t\t_preloadImageByIndex(startIndex, numberOfTimes) {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n\n\t\t\tlet next = $(this._$galleryItems.get(startIndex), false)\n\t\t\tif(typeof next == 'undefined')\n\t\t\t\treturn\n\n\t\t\tlet src = next.attr('data-remote') || next.attr('href')\n\t\t\tif (next.attr('data-type') === 'image' || this._isImage(src))\n\t\t\t\tthis._preloadImage(src, '', false)\n\n\t\t\tif(numberOfTimes > 0)\n\t\t\t\treturn this._preloadImageByIndex(startIndex + 1, numberOfTimes-1);\n\t\t}\n\n\t\t_preloadImage(src, altTag, $containerForImage) {\n\n\t\t\t$containerForImage = $containerForImage || false\n\n\t\t\tlet img = new Image();\n\t\t\tlet loadingTimeout = null;\n\t\t\tif ($containerForImage) {\n\t\t\t\t// if loading takes > 200ms show a loader\n\t\t\t\tloadingTimeout = setTimeout(() => {\n\t\t\t\t\t$containerForImage.append(this._config.loadingMessage)\n\t\t\t\t}, 200);\n\t\t\t}\n\n\t\t\timg.onload = () => {\n\t\t\t\tif(loadingTimeout)\n\t\t\t\t\tclearTimeout(loadingTimeout)\n\t\t\t\tloadingTimeout = null;\n\t\t\t\tlet image = $('');\n\t\t\t\timage.attr('src', img.src);\n\t\t\t\timage.attr('alt', altTag);\n\t\t\t\timage.addClass('img-fluid');\n\n\t\t\t\t// backward compatibility for bootstrap v3\n\t\t\t\timage.css('width', '100%');\n\n\t\t\t\tif ($containerForImage) {\n\t\t\t\t\t$containerForImage.html(image);\n\t\t\t\t\tif (this._$modalArrows)\n\t\t\t\t\t\tthis._$modalArrows.css('display', '') // remove display to default to css property\n\n\t\t\t\t\tthis._resize(img.width, img.height);\n\t\t\t\t\tthis._toggleLoading(false);\n\t\t\t\t\treturn this._config.onContentLoaded.call(this);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif ($containerForImage) {\n\t\t\t\timg.onerror = () => {\n\t\t\t\t\tthis._toggleLoading(false);\n\t\t\t\t\treturn this._error(this._config.strings.fail+` ${src}`);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\timg.src = src;\n\t\t\treturn img;\n\t\t}\n\n\t\t_swipeGesure() {\n\t\t if (this._touchendX < this._touchstartX) {\n\t\t return this.navigateRight();\n\t\t }\n\t\t if (this._touchendX > this._touchstartX) {\n\t\t return this.navigateLeft();\n\t\t }\n\t\t}\n\n\t\t_resize( width, height ) {\n\n\t\t\theight = height || width\n\t\t\tthis._wantedWidth = width\n\t\t\tthis._wantedHeight = height\n\n\t\t\tlet imageAspecRatio = width / height;\n\n\t\t\t// if width > the available space, scale down the expected width and height\n\t\t\tlet widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right\n\n\t\t\t// force 10px margin if window size > 575px\n\t\t\tlet addMargin = this._config.doc.body.clientWidth > 575 ? 20 : 0\n\t\t\tlet discountMargin = this._config.doc.body.clientWidth > 575 ? 0 : 20\n\n\t\t\tlet maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth - addMargin, this._config.maxWidth)\n\n\t\t\tif((width + widthBorderAndPadding) > maxWidth) {\n\t\t\t\theight = (maxWidth - widthBorderAndPadding - discountMargin) / imageAspecRatio;\n\t\t\t\twidth = maxWidth\n\t\t\t} else\n\t\t\t\twidth = (width + widthBorderAndPadding)\n\n\t\t\tlet headerHeight = 0,\n\t\t\t footerHeight = 0\n\n\t\t\t// as the resize is performed the modal is show, the calculate might fail\n\t\t\t// if so, default to the default sizes\n\t\t\tif (this._footerIsShown)\n\t\t\t\tfooterHeight = this._$modalFooter.outerHeight(true) || 55\n\n\t\t\tif (this._titleIsShown)\n\t\t\t\theaderHeight = this._$modalHeader.outerHeight(true) || 67\n\n\t\t\tlet borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top\n\n\t\t\t//calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins\n\t\t\tlet margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom'));\n\n\t\t\tlet maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight, this._config.maxHeight - borderPadding - headerHeight - footerHeight);\n\n\t\t\tif(height > maxHeight) {\n\t\t\t\t// if height > the available height, scale down the width\n\t\t\t\twidth = Math.ceil(maxHeight * imageAspecRatio) + widthBorderAndPadding;\n\t\t\t}\n\n\t\t\tthis._$lightboxContainer.css('height', maxHeight)\n\t\t\tthis._$modalDialog.css('flex', '1').css('maxWidth', width);\n\n\t\t\tlet modal = this._$modal.data('bs.modal');\n\t\t\tif (modal) {\n\t\t\t\t// v4 method is mistakenly protected\n\t\t\t\ttry {\n\t\t\t\t\tmodal._handleUpdate();\n\t\t\t\t} catch(Exception) {\n\t\t\t\t\tmodal.handleUpdate();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tstatic _jQueryInterface(config) {\n\t\t\tconfig = config || {}\n\t\t\treturn this.each(() => {\n\t\t\t\tlet $this = $(this)\n\t\t\t\tlet _config = $.extend(\n\t\t\t\t\t{},\n\t\t\t\t\tLightbox.Default,\n\t\t\t\t\t$this.data(),\n\t\t\t\t\ttypeof config === 'object' && config\n\t\t\t\t)\n\n\t\t\t\tnew Lightbox(this, _config)\n\t\t\t})\n\t\t}\n\t}\n\n\n\n\t$.fn[NAME] = Lightbox._jQueryInterface\n\t$.fn[NAME].Constructor = Lightbox\n\t$.fn[NAME].noConflict = () => {\n\t\t$.fn[NAME] = JQUERY_NO_CONFLICT\n\t\treturn Lightbox._jQueryInterface\n\t}\n\n\treturn Lightbox\n\n})(jQuery)\n\nexport default Lightbox\n"],"sourceRoot":""} \ No newline at end of file diff --git a/ekko-lightbox.js b/ekko-lightbox.js index c5c4b6b..f1180cb 100644 --- a/ekko-lightbox.js +++ b/ekko-lightbox.js @@ -327,7 +327,8 @@ const Lightbox = (($) => { switch(currentType) { case 'image': - this._preloadImage(currentRemote, $toUse) + let altTag = this._$element.attr('data-alt') || ''; + this._preloadImage(currentRemote, altTag, $toUse) this._preloadImageByIndex(this._galleryIndex, 3) break; case 'youtube': @@ -552,35 +553,38 @@ const Lightbox = (($) => { let src = next.attr('data-remote') || next.attr('href') if (next.attr('data-type') === 'image' || this._isImage(src)) - this._preloadImage(src, false) + this._preloadImage(src, '', false) if(numberOfTimes > 0) return this._preloadImageByIndex(startIndex + 1, numberOfTimes-1); } - _preloadImage( src, $containerForImage) { + _preloadImage(src, altTag, $containerForImage) { $containerForImage = $containerForImage || false let img = new Image(); + let loadingTimeout = null; if ($containerForImage) { - // if loading takes > 200ms show a loader - let loadingTimeout = setTimeout(() => { + loadingTimeout = setTimeout(() => { $containerForImage.append(this._config.loadingMessage) - }, 200) + }, 200); + } - img.onload = () => { - if(loadingTimeout) - clearTimeout(loadingTimeout) - loadingTimeout = null; - let image = $(''); - image.attr('src', img.src); - image.addClass('img-fluid'); + img.onload = () => { + if(loadingTimeout) + clearTimeout(loadingTimeout) + loadingTimeout = null; + let image = $(''); + image.attr('src', img.src); + image.attr('alt', altTag); + image.addClass('img-fluid'); - // backward compatibility for bootstrap v3 - image.css('width', '100%'); + // backward compatibility for bootstrap v3 + image.css('width', '100%'); + if ($containerForImage) { $containerForImage.html(image); if (this._$modalArrows) this._$modalArrows.css('display', '') // remove display to default to css property @@ -588,7 +592,10 @@ const Lightbox = (($) => { this._resize(img.width, img.height); this._toggleLoading(false); return this._config.onContentLoaded.call(this); - }; + } + }; + + if ($containerForImage) { img.onerror = () => { this._toggleLoading(false); return this._error(this._config.strings.fail+` ${src}`); diff --git a/index.html b/index.html index 03595db..ee5a15d 100644 --- a/index.html +++ b/index.html @@ -336,6 +336,7 @@

Examples

  • Disable wrapping
  • Disable fade
  • Center vertically
  • +
  • "alt" attribute
  • Single Image

    @@ -356,13 +357,13 @@
    @@ -610,6 +611,27 @@

    Center vertically

    $(this).ekkoLightbox({ verticalAlignCenter: true }); +

    Image "alt" attribute

    +

    Add data-alt to provide the enlarged image an alt tag.

    +
    +
    +
    + +
    +
    +
    + +