FIX: compatibility improvement

This commit is contained in:
Tony Air 2020-04-20 15:35:43 +07:00
parent 37bdbb93f7
commit b33e2e70d5
4 changed files with 189 additions and 134 deletions

2
dist/js/app.js vendored
View File

@ -1,3 +1,3 @@
/*! For license information please see app.js.LICENSE.txt */
!function(t){var e={};function o(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=t,o.c=e,o.d=function(t,e,a){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(a,i,function(e){return t[e]}.bind(null,i));return a},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/mnt/data/srv/dist/repositories/meta-lightbox/dist",o(o.s="./src/js/index.js")}({"./src/js/index.js":function(t,e,o){"use strict";o.r(e);o("./src/scss/index.scss"),o("./src/js/meta-lightbox.js")},"./src/js/meta-lightbox.js":function(t,e){function o(t){return(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})(t)}!function(t,e,a){var i={effect:"fade",theme:"default",keyboardNav:!0,clickOverlayToClose:!0,onInit:function(){},beforeShowLightbox:function(){},afterShowLightbox:function(t){},beforeHideLightbox:function(){},afterHideLightbox:function(){},onPrev:function(t){},onNext:function(t){},errorMessage:"The requested content cannot be loaded. Please try again later."};function n(e,o){this.options=t.extend({},i,o),this._defaults=i,this._name="metaLightbox",this.init()}n.prototype={init:function(){var e=this,o=t("html");this.ajaxLoaded=!1,a.MetaLightbox=this,o.hasClass("meta-lightbox-notouch")||o.addClass("meta-lightbox-notouch"),"ontouchstart"in a&&o.removeClass("meta-lightbox-notouch"),t(a).on("click",'[data-toggle="lightbox"],[data-lightbox-gallery]',(function(t){return t.preventDefault(),t.stopPropagation(),e.showLightbox(this),!1})),this.options.keyboardNav&&t("body").off("keyup").on("keyup",(function(o){var a=o.keyCode?o.keyCode:o.which;27===a&&e.destructLightbox(),37===a&&t(".meta-lightbox-prev").trigger("click"),39===a&&t(".meta-lightbox-next").trigger("click")})),this.options.onInit.call(this)},showLightbox:function(e){this.el=e,this.$el=t(this.el);var o,a,i,n,l=this;this.options.beforeShowLightbox.call(this),(o=this.constructLightbox())&&(a=o.find(".meta-lightbox-content"))&&(i=this.$el,t("body").addClass("meta-lightbox-body-effect-".concat(this.options.effect)),this.processContent(a,i),this.$el.data("lightbox-gallery")&&(1===(n=t('[data-lightbox-gallery="'.concat(this.$el.data("lightbox-gallery"),'"]'))).length?t(".meta-lightbox-nav").hide():t(".meta-lightbox-nav").show(),t(".meta-lightbox-prev").off("click").on("click",(function(e){e.preventDefault();var o=n.index(i);i=n.eq(o-1),t(i).length||(i=n.last()),l.processContent(a,i),l.options.onPrev.call(this,[i])})),t(".meta-lightbox-next").off("click").on("click",(function(e){e.preventDefault();var o=n.index(i);i=n.eq(o+1),t(i).length||(i=n.first()),l.processContent(a,i),l.options.onNext.call(this,[i])}))),setTimeout((function(){o.addClass("meta-lightbox-open"),l.options.afterShowLightbox.call(this,[o])}),1))},processContent:function(i,n){var l,s,r,c,h,g,d=this;href=n.attr("href"),href||(href=n.data("href")),i.html("").addClass("meta-lightbox-loading"),this.isHidpi()&&n.data("lightbox-hidpi")&&(href=n.data("lightbox-hidpi")),null!=href.match(/\.(jpeg|jpg|gif|png)$/i)?((l=t("<img>",{src:href})).on("load",(function(){var o=t('<div class="meta-lightbox-image"></div>'),a=t(".meta-lightbox-content"),n=t('<span class="meta-lightbox-zoom-wrapper"></span>');n.append(l),o.append(n),o.css({"line-height":"".concat(a.height(),"px"),height:"".concat(a.height(),"px")}),t(e).resize((function(){o.css({"line-height":"".concat(a.height(),"px"),height:"".concat(a.height(),"px")})})),"undefined"!==typeof n.zoom&&n.zoom(),i.html(o).removeClass("meta-lightbox-loading"),d.contentLoaded()})),l.on("error",(function(){var e=t('<div class="meta-lightbox-error"><p>'.concat(d.options.errorMessage,"</p></div>"));i.html(e).removeClass("meta-lightbox-loading"),d.contentLoaded()})),n.data("title")?d.setTitle(n.data("title")):n.attr("title")?d.setTitle(n.attr("title")):t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","Image Click",href)):(s=href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/))?(r="",c="meta-lightbox-video","youtube"==s[1]&&(r="https://www.youtube.com/embed/".concat(s[4]),c="meta-lightbox-youtube"),"youtu"==s[1]&&(r="https://www.youtube.com/embed/".concat(s[3]),c="meta-lightbox-youtube"),"youtube-nocookie"==s[1]&&(r="https://www.youtube-nocookie.com/embed/".concat(s[4]),c="nivo-lightbox-youtube"),"vimeo"==s[1]&&(r="https://player.vimeo.com/video/".concat(s[3]),c="meta-lightbox-vimeo"),r&&(h=t("<iframe>",{src:r,class:c,frameborder:0,vspace:0,hspace:0,scrolling:"auto"}),i.html(h),h.on("load",(function(){i.removeClass("meta-lightbox-loading"),d.contentLoaded()}))),n.data("title")?d.setTitle(n.data("title")):n.attr("title")?d.setTitle(n.attr("title")):t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","Video Click",s)):"#"==href.substring(0,1)?(t(href).length?((g=t('<div class="meta-lightbox-inline" />')).append(t(href).clone().show()),g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")}),t(e).resize((function(){g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")})})),i.html(g).removeClass("meta-lightbox-loading"),d.contentLoaded()):(g=t('<div class="meta-lightbox-error"><p>'.concat(d.options.errorMessage,"</p></div>")),i.html(g).removeClass("meta-lightbox-loading"),d.contentLoaded()),t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","inline HTML click",href)):t.ajax({sync:!1,async:!0,url:href,dataType:"html",method:"GET",cache:!1,statusCode:{404:function(){console.log("page not found"),e.location.href=url},302:function(){console.log("redirect 302"),e.location.href=url}},error:function(e){console.log("AJAX request failure.".concat(e.statusText));var o=t('<div class="meta-lightbox-error"><p>'.concat(d.options.errorMessage,"</p></div>"));i.html(o).removeClass("meta-lightbox-loading"),d.contentLoaded(),"function"===typeof ga&&ga("send","event","error","AJAX ERROR",e.statusText)},success:function(n,l,s){try{var r=t.parseJSON(n);if("object"===o(r)){if("object"===o(r.regions)&&"undefinded"!==typeof r.regions.LayoutAjax)(g=t('<div class="meta-lightbox-ajax" />')).html(r.regions.LayoutAjax),i.html(g).removeClass("meta-lightbox-loading");var c=s.getResponseHeader("X-Title"),h=s.getResponseHeader("X-Link");c&&c.length&&h&&h.length&&h!==e.location.href&&h.substring(0,h.indexOf("#"))!==e.location.href.replace(t("base").attr("href"),"/")&&(t(".meta-lightbox-ajax").data("curr-title",a.title),t(".meta-lightbox-ajax").data("curr-link",e.location.href),"undefined"!==typeof e.localStorage&&"/"!==h&&e.localStorage.setItem("current-page",h),a.URL!==h&&a.URL!==t("base").attr("href")+h&&a.URL!=="".concat(t("base").attr("href"),"/").concat(h)&&e.history.pushState({title:c,page:h,ajax:"true"},c,h),t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&(ga("set",{page:h.replace(t("base").attr("href"),""),title:c}),ga("send","pageview")))}}catch(f){var g;(g=t('<div class="meta-lightbox-ajax" />')).append(n),i.html(g).removeClass("meta-lightbox-loading")}g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")}),t(e).resize((function(){g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")})})),setTimeout((function(){t(e).resize(),e.imagesLoaded().then((function(){t(e).resize()}))}),500),d.contentLoaded()}})},setTitle:function(e){var o=t("<div>",{class:"meta-lightbox-title"});o.text(e),t(".meta-lightbox-title-wrap").html(o)},contentLoaded:function(){setTimeout((function(){t(e).trigger("meta-lightbox-loaded")}),1),setTimeout((function(){t("body").addClass("meta-lightbox-body-effect-fade")}),600)},constructLightbox:function(){var e=this,o=t("<div>",{class:"meta-lightbox-overlay meta-lightbox-theme-".concat(this.options.theme," meta-lightbox-effect-").concat(this.options.effect)}),a=t("<div>",{class:"meta-lightbox-wrap"}),i=t("<div>",{class:"meta-lightbox-content"}),n=t('<a href="#" class="meta-lightbox-nav meta-lightbox-prev"><i class="fa fa-chevron-left"></i> <span class="sr-only">Previous</span></a><a href="#" class="meta-lightbox-nav meta-lightbox-next"><i class="fa fa-chevron-right"></i> <span class="sr-only">Next</span></a>'),l=t('<a href="#" class="meta-lightbox-close fa fa-times" title="Close"><span class="sr-only">Close</span></a>'),s=t("<div>",{class:"meta-lightbox-title-wrap"}),r=t(".meta-lightbox-overlay");return r.length?r:(a.append(i),a.append(s),o.append(a),o.append(n),o.append(l),t("body").append(o),e.options.clickOverlayToClose&&o.on("click",(function(o){var a=t(o.target);(a.hasClass("meta-lightbox-zoom-wrapper")||a.hasClass("meta-lightbox-content")||a.hasClass("meta-lightbox-wrap")||a.hasClass("meta-lightbox-image")||a.hasClass("meta-lightbox-overlay"))&&e.destructLightbox()})),l.on("click",(function(t){t.preventDefault(),e.destructLightbox()})),o)},destructLightbox:function(){var o=t(".meta-lightbox-overlay");this.options.beforeHideLightbox.call(this);var i=t(".meta-lightbox-ajax").data("curr-title"),n=t(".meta-lightbox-ajax").data("curr-link");i&&n&&("undefined"!==typeof e.localStorage&&"/"!==n&&e.localStorage.setItem("current-page",n),a.URL!==n&&a.URL!==t("base").attr("href")+n&&a.URL!=="".concat(t("base").attr("href"),"/").concat(n)&&e.history.replaceState({title:i,page:n,ajax:"true"},i,n)),o.removeClass("meta-lightbox-open"),t(".meta-lightbox-nav").hide(),t("body").removeClass("meta-lightbox-body-effect-".concat(this.options.effect)),t(".meta-lightbox-content .meta-lightbox-zoom-wrapper").trigger("zoom.destroy"),t(".meta-lightbox-prev").off("click"),t(".meta-lightbox-next").off("click"),t(".meta-lightbox-content").empty(),t("body").removeClass("meta-lightbox-body-effect-fade"),this.options.afterHideLightbox.call(this)},isHidpi:function(){return e.devicePixelRatio>1||e.matchMedia&&e.matchMedia("(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)").matches}},t.fn.metaLightbox=function(e){return this.each((function(){t.data(this,"metaLightbox")||t.data(this,"metaLightbox",new n(this,e))}))},t(a).metaLightbox()}(jQuery,this,document)},"./src/scss/index.scss":function(t,e){}});
!function(t){var e={};function o(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=t,o.c=e,o.d=function(t,e,a){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(a,i,function(e){return t[e]}.bind(null,i));return a},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/mnt/data/srv/dist/repositories/meta-lightbox/dist",o(o.s="./src/js/index.js")}({"./src/js/index.js":function(t,e,o){"use strict";o.r(e);o("./src/scss/index.scss"),o("./src/js/meta-lightbox.js")},"./src/js/meta-lightbox.js":function(t,e){function o(t){return(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})(t)}!function(t,e,a){var i={effect:"fade",theme:"default",keyboardNav:!0,clickOverlayToClose:!0,onInit:function(){},beforeShowLightbox:function(){},afterShowLightbox:function(t){},beforeHideLightbox:function(){},afterHideLightbox:function(){},onPrev:function(t){},onNext:function(t){},errorMessage:"The requested content cannot be loaded. Please try again later."};function n(e,o){this.options=t.extend({},i,o),this._defaults=i,this._name="metaLightbox",this.init()}n.prototype={init:function(){var e=this,o=t("html");this.ajaxLoaded=!1,a.MetaLightbox=this,o.hasClass("meta-lightbox-notouch")||o.addClass("meta-lightbox-notouch"),"ontouchstart"in a&&o.removeClass("meta-lightbox-notouch"),t(a).on("click",'[data-toggle="lightbox"],[data-lightbox-gallery]',(function(t){return t.preventDefault(),t.stopPropagation(),e.showLightbox(this),!1})),this.options.keyboardNav&&t("body").off("keyup").on("keyup",(function(o){var a=o.keyCode?o.keyCode:o.which;27===a&&e.destructLightbox(),37===a&&t(".meta-lightbox-prev").trigger("click"),39===a&&t(".meta-lightbox-next").trigger("click")})),this.options.onInit.call(this)},showLightbox:function(e){this.el=e,this.$el=t(this.el);var o,a,i,n,s=this;this.options.beforeShowLightbox.call(this),(o=this.constructLightbox())&&(a=o.find(".meta-lightbox-content"))&&(i=this.$el,t("body").addClass("meta-lightbox-body-effect-".concat(this.options.effect)),this.processContent(a,i),this.$el.data("lightbox-gallery")&&(1===(n=t('[data-lightbox-gallery="'.concat(this.$el.data("lightbox-gallery"),'"]'))).length?t(".meta-lightbox-nav").hide():t(".meta-lightbox-nav").show(),t(".meta-lightbox-prev").off("click").on("click",(function(e){e.preventDefault();var o=n.index(i);i=n.eq(o-1),t(i).length||(i=n.last()),s.processContent(a,i),s.options.onPrev.call(this,[i])})),t(".meta-lightbox-next").off("click").on("click",(function(e){e.preventDefault();var o=n.index(i);i=n.eq(o+1),t(i).length||(i=n.first()),s.processContent(a,i),s.options.onNext.call(this,[i])}))),setTimeout((function(){o.addClass("meta-lightbox-open"),s.options.afterShowLightbox.call(this,[o])}),1))},processContent:function(i,n){var s,l,r,c,h,g,d=this;href=n.attr("href"),href||(href=n.data("href")),i.html("").addClass("meta-lightbox-loading"),this.isHidpi()&&n.data("lightbox-hidpi")&&(href=n.data("lightbox-hidpi")),null!=href.match(/\.(jpeg|jpg|gif|png)$/i)?((s=t("<img>",{src:href})).on("load",(function(){var o=t('<div class="meta-lightbox-image"></div>'),a=t(".meta-lightbox-content"),n=t('<span class="meta-lightbox-zoom-wrapper"></span>');n.append(s),o.append(n),o.css({"line-height":"".concat(a.height(),"px"),height:"".concat(a.height(),"px")}),t(e).resize((function(){o.css({"line-height":"".concat(a.height(),"px"),height:"".concat(a.height(),"px")})})),"undefined"!==typeof n.zoom&&n.zoom(),i.html(o).removeClass("meta-lightbox-loading"),d.contentLoaded()})),s.on("error",(function(){var e=t('<div class="meta-lightbox-error"><p>'.concat(d.options.errorMessage,"</p></div>"));i.html(e).removeClass("meta-lightbox-loading"),d.contentLoaded()})),n.data("title")?d.setTitle(n.data("title")):n.attr("title")?d.setTitle(n.attr("title")):t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","Image Click",href)):(l=href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/))?(r="",c="meta-lightbox-video","youtube"==l[1]&&(r="https://www.youtube.com/embed/".concat(l[4]),c="meta-lightbox-youtube"),"youtu"==l[1]&&(r="https://www.youtube.com/embed/".concat(l[3]),c="meta-lightbox-youtube"),"youtube-nocookie"==l[1]&&(r="https://www.youtube-nocookie.com/embed/".concat(l[4]),c="nivo-lightbox-youtube"),"vimeo"==l[1]&&(r="https://player.vimeo.com/video/".concat(l[3]),c="meta-lightbox-vimeo"),r&&(h=t("<iframe>",{src:r,class:c,frameborder:0,vspace:0,hspace:0,scrolling:"auto"}),i.html(h),h.on("load",(function(){i.removeClass("meta-lightbox-loading"),d.contentLoaded()}))),n.data("title")?d.setTitle(n.data("title")):n.attr("title")?d.setTitle(n.attr("title")):t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","Video Click",l)):"#"==href.substring(0,1)?(t(href).length?((g=t('<div class="meta-lightbox-inline" />')).append(t(href).clone().show()),g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")}),t(e).resize((function(){g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")})})),i.html(g).removeClass("meta-lightbox-loading"),d.contentLoaded()):(g=t('<div class="meta-lightbox-error"><p>'.concat(d.options.errorMessage,"</p></div>")),i.html(g).removeClass("meta-lightbox-loading"),d.contentLoaded()),t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","inline HTML click",href)):t.ajax({sync:!1,async:!0,url:href,dataType:"html",method:"GET",cache:!1,statusCode:{404:function(){console.log("page not found"),e.location.href=url},302:function(){console.log("redirect 302"),e.location.href=url}},error:function(e){console.log("AJAX request failure.".concat(e.statusText));var o=t('<div class="meta-lightbox-error"><p>'.concat(d.options.errorMessage,"</p></div>"));i.html(o).removeClass("meta-lightbox-loading"),d.contentLoaded(),"function"===typeof ga&&ga("send","event","error","AJAX ERROR",e.statusText)},success:function(n,s,l){try{var r=t.parseJSON(n);if("object"===o(r)){if("object"===o(r.regions)&&"undefinded"!==typeof r.regions.LayoutAjax)(g=t('<div class="meta-lightbox-ajax" />')).html(r.regions.LayoutAjax),i.html(g).removeClass("meta-lightbox-loading");var c=l.getResponseHeader("X-Title"),h=l.getResponseHeader("X-Link");c&&c.length&&h&&h.length&&h!==e.location.href&&h.substring(0,h.indexOf("#"))!==e.location.href.replace(t("base").attr("href"),"/")&&(t(".meta-lightbox-ajax").data("curr-title",a.title),t(".meta-lightbox-ajax").data("curr-link",e.location.href),"undefined"!==typeof e.localStorage&&"/"!==h&&e.localStorage.setItem("current-page",h),a.URL!==h&&a.URL!==t("base").attr("href")+h&&a.URL!=="".concat(t("base").attr("href"),"/").concat(h)&&e.history.pushState({title:c,page:h,ajax:"true"},c,h),t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&(ga("set",{page:h.replace(t("base").attr("href"),""),title:c}),ga("send","pageview")))}}catch(f){var g;(g=t('<div class="meta-lightbox-ajax" />')).append(n),i.html(g).removeClass("meta-lightbox-loading")}g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")}),t(e).resize((function(){g.outerHeight()<i.height()&&g.css({position:"relative",top:"50%","margin-top":"".concat(-g.outerHeight()/2,"px")})})),setTimeout((function(){t(e).resize(),"function"===typeof e.imagesLoaded&&e.imagesLoaded().then((function(){t(e).resize()}))}),500),d.contentLoaded()}})},setTitle:function(e){var o=t("<div>",{class:"meta-lightbox-title"});o.text(e),t(".meta-lightbox-title-wrap").html(o)},contentLoaded:function(){setTimeout((function(){t(e).trigger("meta-lightbox-loaded")}),1),setTimeout((function(){t("body").addClass("meta-lightbox-body-effect-fade")}),600)},constructLightbox:function(){var e=this,o=t("<div>",{class:"meta-lightbox-overlay meta-lightbox-theme-".concat(this.options.theme," meta-lightbox-effect-").concat(this.options.effect)}),a=t("<div>",{class:"meta-lightbox-wrap"}),i=t("<div>",{class:"meta-lightbox-content"}),n=t('<a href="#" class="meta-lightbox-nav meta-lightbox-prev"><i class="fa fa-chevron-left"></i> <span class="sr-only">Previous</span></a><a href="#" class="meta-lightbox-nav meta-lightbox-next"><i class="fa fa-chevron-right"></i> <span class="sr-only">Next</span></a>'),s=t('<a href="#" class="meta-lightbox-close fa fa-times" title="Close"><span class="sr-only">Close</span></a>'),l=t("<div>",{class:"meta-lightbox-title-wrap"}),r=t(".meta-lightbox-overlay");return r.length?r:(a.append(i),a.append(l),o.append(a),o.append(n),o.append(s),t("body").append(o),e.options.clickOverlayToClose&&o.on("click",(function(o){var a=t(o.target);(a.hasClass("meta-lightbox-zoom-wrapper")||a.hasClass("meta-lightbox-content")||a.hasClass("meta-lightbox-wrap")||a.hasClass("meta-lightbox-image")||a.hasClass("meta-lightbox-overlay"))&&e.destructLightbox()})),s.on("click",(function(t){t.preventDefault(),e.destructLightbox()})),o)},destructLightbox:function(){var o=t(".meta-lightbox-overlay");this.options.beforeHideLightbox.call(this);var i=t(".meta-lightbox-ajax").data("curr-title"),n=t(".meta-lightbox-ajax").data("curr-link");i&&n&&("undefined"!==typeof e.localStorage&&"/"!==n&&e.localStorage.setItem("current-page",n),a.URL!==n&&a.URL!==t("base").attr("href")+n&&a.URL!=="".concat(t("base").attr("href"),"/").concat(n)&&e.history.replaceState({title:i,page:n,ajax:"true"},i,n)),o.removeClass("meta-lightbox-open"),t(".meta-lightbox-nav").hide(),t("body").removeClass("meta-lightbox-body-effect-".concat(this.options.effect)),t(".meta-lightbox-content .meta-lightbox-zoom-wrapper").trigger("zoom.destroy"),t(".meta-lightbox-prev").off("click"),t(".meta-lightbox-next").off("click"),t(".meta-lightbox-content").empty(),t("body").removeClass("meta-lightbox-body-effect-fade"),this.options.afterHideLightbox.call(this)},isHidpi:function(){return e.devicePixelRatio>1||e.matchMedia&&e.matchMedia("(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)").matches}},t.fn.metaLightbox=function(e){return this.each((function(){t.data(this,"metaLightbox")||t.data(this,"metaLightbox",new n(this,e))}))},t(a).metaLightbox()}(jQuery,this,document)},"./src/scss/index.scss":function(t,e){}});
//# sourceMappingURL=app.js.map

2
dist/js/app.js.map vendored
View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/js/index.js","webpack:///./src/js/meta-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","$","window","document","defaults","effect","theme","keyboardNav","clickOverlayToClose","onInit","beforeShowLightbox","afterShowLightbox","lightbox","beforeHideLightbox","afterHideLightbox","onPrev","element","onNext","errorMessage","MetaLightbox","options","this","extend","_defaults","_name","init","$this","$html","ajaxLoaded","hasClass","addClass","removeClass","on","e","preventDefault","stopPropagation","showLightbox","off","code","keyCode","which","destructLightbox","trigger","el","$el","content","currentLink","galleryItems","constructLightbox","find","processContent","data","length","hide","show","index","eq","last","first","setTimeout","link","img","video","src","classTerm","iframe","wrap","href","attr","html","isHidpi","match","$content","imgwrapper","append","css","height","resize","zoom","contentLoaded","setTitle","ga","frameborder","vspace","hspace","scrolling","substring","clone","outerHeight","ajax","sync","async","url","dataType","method","cache","statusCode","404","console","log","location","302","error","jqXHR","statusText","success","status","dataJson","parseJSON","title","getResponseHeader","indexOf","replace","localStorage","setItem","URL","history","pushState","page","imagesLoaded","then","text","titleWrap","overlay","nav","close","$overlay","$target","target","replaceState","empty","devicePixelRatio","matchMedia","matches","fn","each","metaLightbox","jQuery"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,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BC,iBAokBXpB,EAAEkD,KAAK9B,KApkBI,eAokBc,IAAIF,EAAaE,KAAMD,QAKtDnB,EAAEE,GAAUqI,eA3kBd,CA6kBGC,OAAQpH,KAAMlB,W","file":"js/app.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 = \"/mnt/data/srv/dist/repositories/meta-lightbox/dist\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/js/index.js\");\n","/*\n * MetaLightbox\n * https://tony.twma.pro\n *\n */\n\n\nimport '../scss/index.scss';\nimport './meta-lightbox';\n","/*\n * MetaLightbox v0.61\n * https://tony.twma.pro\n *\n */\n\n//=require ../../bower_components/jquery-zoom/jquery.zoom.js\n\n(function($, window, document) {\n\n var pluginName = 'metaLightbox',\n defaults = {\n effect: 'fade',\n theme: 'default',\n keyboardNav: true,\n clickOverlayToClose: true,\n onInit: function() {},\n beforeShowLightbox: function() {},\n afterShowLightbox: function(lightbox) {},\n beforeHideLightbox: function() {},\n afterHideLightbox: function() {},\n onPrev: function(element) {},\n onNext: function(element) {},\n errorMessage: 'The requested content cannot be loaded. Please try again later.',\n };\n\n function MetaLightbox(element, options) {\n /*this.el = element;\n this.$el = $(this.el);*/\n\n this.options = $.extend({}, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }\n\n MetaLightbox.prototype = {\n\n init: function() {\n var $this = this,\n $html = $('html');\n\n this.ajaxLoaded = false;\n\n // make object globally accessible\n document.MetaLightbox = this;\n\n // Need this so we don't use CSS transitions in mobile\n if (!$html.hasClass('meta-lightbox-notouch')) $html.addClass('meta-lightbox-notouch');\n if ('ontouchstart' in document) $html.removeClass('meta-lightbox-notouch');\n\n // Setup the click\n $(document).on('click', '[data-toggle=\"lightbox\"],[data-lightbox-gallery]', function(e) {\n e.preventDefault();\n e.stopPropagation();\n\n $this.showLightbox(this);\n return false;\n });\n\n // keyboardNav\n if (this.options.keyboardNav) {\n $('body').off('keyup').on('keyup', (e) => {\n var code = (e.keyCode ? e.keyCode : e.which);\n // Escape\n if (code === 27) {\n $this.destructLightbox();\n }\n // Left\n if (code === 37) {\n $('.meta-lightbox-prev').trigger('click');\n }\n // Right\n if (code === 39) {\n $('.meta-lightbox-next').trigger('click');\n }\n });\n }\n\n this.options.onInit.call(this);\n\n },\n\n showLightbox: function(element) {\n this.el = element;\n this.$el = $(this.el);\n\n var $this = this,\n lightbox, content, currentLink, galleryItems;\n\n this.options.beforeShowLightbox.call(this);\n\n lightbox = this.constructLightbox();\n if (!lightbox) return;\n content = lightbox.find('.meta-lightbox-content');\n if (!content) return;\n currentLink = this.$el;\n $('body').addClass(`meta-lightbox-body-effect-${ this.options.effect}`);\n\n // Add content\n this.processContent(content, currentLink);\n\n // Nav\n if (this.$el.data('lightbox-gallery')) {\n galleryItems = $(`[data-lightbox-gallery=\"${ this.$el.data('lightbox-gallery') }\"]`);\n\n if (galleryItems.length === 1) {\n $('.meta-lightbox-nav').hide();\n } else {\n $('.meta-lightbox-nav').show();\n }\n\n // Prev\n $('.meta-lightbox-prev').off('click').on('click', function(e) {\n e.preventDefault();\n var index = galleryItems.index(currentLink);\n currentLink = galleryItems.eq(index - 1);\n if (!$(currentLink).length) currentLink = galleryItems.last();\n $this.processContent(content, currentLink);\n $this.options.onPrev.call(this, [currentLink]);\n });\n\n // Next\n $('.meta-lightbox-next').off('click').on('click', function(e) {\n e.preventDefault();\n var index = galleryItems.index(currentLink);\n currentLink = galleryItems.eq(index + 1);\n if (!$(currentLink).length) currentLink = galleryItems.first();\n $this.processContent(content, currentLink);\n $this.options.onNext.call(this, [currentLink]);\n });\n }\n\n setTimeout(function() {\n lightbox.addClass('meta-lightbox-open');\n $this.options.afterShowLightbox.call(this, [lightbox]);\n }, 1); // For CSS transitions\n },\n\n processContent: function(content, link) {\n var $this = this,\n img, video, src, classTerm, iframe, wrap;\n\n href = link.attr('href');\n if (!href) {\n href = link.data('href');\n }\n\n content.html('').addClass('meta-lightbox-loading');\n\n // Is HiDPI?\n if (this.isHidpi() && link.data('lightbox-hidpi')) {\n href = link.data('lightbox-hidpi');\n }\n\n // Image\n if (href.match(/\\.(jpeg|jpg|gif|png)$/i) != null) {\n /*if ($(window).width() < 768) {\n window.open(href, '_blank');\n }*/\n img = $('<img>', {\n src: href,\n });\n img.on('load', () => {\n var wrap = $('<div class=\"meta-lightbox-image\"></div>'),\n $content = $('.meta-lightbox-content'),\n imgwrapper = $('<span class=\"meta-lightbox-zoom-wrapper\"></span>');\n\n imgwrapper.append(img);\n wrap.append(imgwrapper);\n\n // Vertically center images\n wrap.css({\n 'line-height': `${$content.height() }px`,\n 'height': `${$content.height() }px`, // For Firefox\n });\n $(window).resize(() => {\n wrap.css({\n 'line-height': `${$content.height() }px`,\n 'height': `${$content.height() }px`, // For Firefox\n });\n });\n\n if (typeof imgwrapper['zoom'] !== 'undefined') {\n imgwrapper.zoom();\n }\n\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n\n });\n /*.each(function () {\n if (this.complete) $(this).load();\n });*/\n\n img.on('error', () => {\n var wrap = $(`<div class=\"meta-lightbox-error\"><p>${ $this.options.errorMessage }</p></div>`);\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n });\n\n // Set the title\n if (link.data('title')) {\n $this.setTitle(link.data('title'));\n } else if (link.attr('title')) {\n $this.setTitle(link.attr('title'));\n } else {\n $('.meta-lightbox-title-wrap').html('');\n }\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'Image Click', href);\n }\n }\n // Video (Youtube/Vimeo)\n else if (video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/)) {\n src = '';\n classTerm = 'meta-lightbox-video';\n\n if (video[1] == 'youtube') {\n src = `https://www.youtube.com/embed/${ video[4]}`;\n classTerm = 'meta-lightbox-youtube';\n }\n if (video[1] == 'youtu') {\n src = `https://www.youtube.com/embed/${ video[3]}`;\n classTerm = 'meta-lightbox-youtube';\n }\n if (video[1] == 'youtube-nocookie') {\n src = `https://www.youtube-nocookie.com/embed/${ video[4]}`;\n classTerm = 'nivo-lightbox-youtube';\n }\n if (video[1] == 'vimeo') {\n src = `https://player.vimeo.com/video/${ video[3]}`;\n classTerm = 'meta-lightbox-vimeo';\n }\n\n if (src) {\n iframe = $('<iframe>', {\n src,\n 'class': classTerm,\n frameborder: 0,\n vspace: 0,\n hspace: 0,\n scrolling: 'auto',\n });\n content.html(iframe);\n iframe.on('load', () => {\n content.removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n });\n }\n\n // Set the title\n if (link.data('title')) {\n $this.setTitle(link.data('title'));\n } else if (link.attr('title')) {\n $this.setTitle(link.attr('title'));\n } else {\n $('.meta-lightbox-title-wrap').html('');\n }\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'Video Click', video);\n }\n }\n // Inline HTML\n else if (href.substring(0, 1) == '#') {\n if ($(href).length) {\n wrap = $('<div class=\"meta-lightbox-inline\" />');\n wrap.append($(href).clone().show());\n\n // Vertically center html\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n 'position': 'relative',\n 'top': '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2) }px`,\n });\n }\n $(window).resize(() => {\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n 'position': 'relative',\n 'top': '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2) }px`,\n });\n }\n });\n\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n } else {\n wrap = $(`<div class=\"meta-lightbox-error\"><p>${ $this.options.errorMessage }</p></div>`);\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n }\n\n $('.meta-lightbox-title-wrap').html('');\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'inline HTML click', href);\n }\n }\n // AJAX/iFrame (default)\n else {\n $.ajax({\n sync: false,\n async: true,\n url: href,\n dataType: 'html',\n method: 'GET',\n cache: false,\n statusCode: {\n 404: function() {\n console.log('page not found');\n window.location.href = url;\n },\n 302: function() {\n console.log('redirect 302');\n window.location.href = url;\n },\n },\n error: function(jqXHR) {\n console.log(`AJAX request failure.${ jqXHR.statusText}`);\n\n var wrap = $(`<div class=\"meta-lightbox-error\"><p>${ $this.options.errorMessage }</p></div>`);\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'error', 'AJAX ERROR', jqXHR.statusText);\n }\n },\n success: function(data, status, jqXHR) {\n try {\n const dataJson = $.parseJSON(data);\n if (typeof(dataJson) === 'object') {\n // Replace regions\n if (typeof(dataJson['regions']) === 'object' && typeof dataJson['regions']['LayoutAjax'] !== 'undefinded') {\n var wrap = $('<div class=\"meta-lightbox-ajax\" />');\n wrap.html(dataJson['regions']['LayoutAjax']);\n content.html(wrap).removeClass('meta-lightbox-loading');\n }\n\n // trigger events\n /*if (typeof (data['events']) === 'object') {\n for (var eventName in data.events) {\n $(document).trigger(eventName, [data['events'][eventName]]);\n }\n }*/\n\n\n var title = jqXHR.getResponseHeader('X-Title'),\n link = jqXHR.getResponseHeader('X-Link');\n\n if (\n title && title.length &&\n link && link.length &&\n link !== window.location.href &&\n link.substring(0, link.indexOf('#')) !== window.location.href.replace($('base').attr('href'), '/')\n ) {\n $('.meta-lightbox-ajax').data('curr-title', document.title);\n $('.meta-lightbox-ajax').data('curr-link', window.location.href);\n\n if (typeof window.localStorage !== 'undefined' && link !== '/') {\n window.localStorage.setItem('current-page', link);\n }\n\n if (\n document.URL !== link &&\n document.URL !== $('base').attr('href') + link &&\n document.URL !== `${$('base').attr('href') }/${ link}`\n ) {\n window.history.pushState({\n title,\n page: link,\n ajax: 'true',\n }, title, link);\n }\n\n // update redirect urls\n /*var pattern = new RegExp('\\\\b(redirect_uri=).*?(&|$)');\n $('a').each(function () {\n var $this = $(this);\n $this.attr('href', $this.attr('href').replace(pattern, 'redirect_uri=' + encodeURI($('base').attr('href') + link)));\n });*/\n\n $('.meta-lightbox-title-wrap').html('');\n\n // google analytics\n if (typeof ga === 'function') {\n ga('set', {\n page: link.replace($('base').attr('href'), ''),\n title,\n });\n ga('send', 'pageview');\n }\n }\n }\n } catch (e) {\n var wrap = $('<div class=\"meta-lightbox-ajax\" />');\n wrap.append(data);\n content.html(wrap).removeClass('meta-lightbox-loading');\n }\n\n // Vertically center html\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n 'position': 'relative',\n 'top': '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2) }px`,\n });\n }\n $(window).resize(() => {\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n 'position': 'relative',\n 'top': '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2) }px`,\n });\n }\n });\n\n setTimeout(() => {\n $(window).resize();\n\n window.imagesLoaded().then(() => {\n $(window).resize();\n });\n }, 500);\n\n $this.contentLoaded();\n },\n });\n }\n },\n\n setTitle: function(text) {\n var titleWrap = $('<div>', {\n 'class': 'meta-lightbox-title',\n });\n titleWrap.text(text);\n $('.meta-lightbox-title-wrap').html(titleWrap);\n },\n\n contentLoaded: function() {\n setTimeout(() => {\n $(window).trigger('meta-lightbox-loaded');\n }, 1); // For CSS transitions\n\n setTimeout(() => {\n $('body').addClass('meta-lightbox-body-effect-fade');\n }, 600);\n },\n\n\n\n constructLightbox: function() {\n var $this = this,\n overlay = $('<div>', {\n 'class': `meta-lightbox-overlay meta-lightbox-theme-${ this.options.theme } meta-lightbox-effect-${ this.options.effect}`,\n }),\n wrap = $('<div>', {\n 'class': 'meta-lightbox-wrap',\n }),\n content = $('<div>', {\n 'class': 'meta-lightbox-content',\n }),\n nav = $('<a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-prev\"><i class=\"fa fa-chevron-left\"></i> <span class=\"sr-only\">Previous</span></a><a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-next\"><i class=\"fa fa-chevron-right\"></i> <span class=\"sr-only\">Next</span></a>'),\n close = $('<a href=\"#\" class=\"meta-lightbox-close fa fa-times\" title=\"Close\"><span class=\"sr-only\">Close</span></a>'),\n title = $('<div>', {\n 'class': 'meta-lightbox-title-wrap',\n }),\n isMSIE = /*@cc_on!@*/ 0,\n $overlay = $('.meta-lightbox-overlay');\n\n if ($overlay.length) return $overlay;\n\n\n if (isMSIE) overlay.addClass('meta-lightbox-ie');\n\n wrap.append(content);\n wrap.append(title);\n overlay.append(wrap);\n overlay.append(nav);\n overlay.append(close);\n $('body').append(overlay);\n\n if ($this.options.clickOverlayToClose) {\n overlay.on('click', (e) => {\n var $target = $(e.target);\n\n if (\n $target.hasClass('meta-lightbox-zoom-wrapper') ||\n $target.hasClass('meta-lightbox-content') ||\n $target.hasClass('meta-lightbox-wrap') ||\n $target.hasClass('meta-lightbox-image') ||\n $target.hasClass('meta-lightbox-overlay')\n ) {\n $this.destructLightbox();\n }\n });\n }\n\n close.on('click', (e) => {\n e.preventDefault();\n $this.destructLightbox();\n });\n\n return overlay;\n },\n\n destructLightbox: function() {\n var $this = this,\n $overlay = $('.meta-lightbox-overlay'),\n isMSIE = /*@cc_on!@*/ 0;\n this.options.beforeHideLightbox.call(this);\n\n var title = $('.meta-lightbox-ajax').data('curr-title'),\n link = $('.meta-lightbox-ajax').data('curr-link');\n if (title && link) {\n\n if (typeof window.localStorage !== 'undefined' && link !== '/') {\n window.localStorage.setItem('current-page', link);\n }\n\n if (\n document.URL !== link &&\n document.URL !== $('base').attr('href') + link &&\n document.URL !== `${$('base').attr('href') }/${ link}`\n ) {\n window.history.replaceState({\n title,\n page: link,\n ajax: 'true',\n }, title, link);\n }\n\n // update redirect urls\n /*var pattern = new RegExp('\\\\b(redirect_uri=).*?(&|$)');\n $('a').each(function () {\n var $this = $(this);\n $this.attr('href', $this.attr('href').replace(pattern, 'redirect_uri=' + encodeURI($('base').attr('href') + link)));\n });*/\n }\n\n $overlay.removeClass('meta-lightbox-open');\n $('.meta-lightbox-nav').hide();\n $('body').removeClass(`meta-lightbox-body-effect-${ $this.options.effect}`);\n $('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger('zoom.destroy');\n\n // For IE\n if (isMSIE) {\n $overlay.find('iframe').attr(\"src\", \" \");\n $overlay.find('iframe').remove();\n }\n $('.meta-lightbox-prev').off('click');\n\n // Remove click handlers\n $('.meta-lightbox-next').off('click');\n\n // Empty content (for videos)\n $('.meta-lightbox-content').empty();\n\n $('body').removeClass('meta-lightbox-body-effect-fade');\n\n this.options.afterHideLightbox.call(this);\n\n },\n\n isHidpi: function() {\n var mediaQuery = \"(-webkit-min-device-pixel-ratio: 1.5),\\\n (min--moz-device-pixel-ratio: 1.5),\\\n (-o-min-device-pixel-ratio: 3/2),\\\n (min-resolution: 1.5dppx)\";\n if (window.devicePixelRatio > 1) return true;\n return (window.matchMedia && window.matchMedia(mediaQuery).matches);\n },\n\n };\n\n $.fn[pluginName] = function(options) {\n return this.each(function() {\n if (!$.data(this, pluginName)) {\n $.data(this, pluginName, new MetaLightbox(this, options));\n }\n });\n };\n\n $(document).metaLightbox();\n\n})(jQuery, this, document);\n"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/js/index.js","webpack:///./src/js/meta-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","$","window","document","defaults","effect","theme","keyboardNav","clickOverlayToClose","onInit","beforeShowLightbox","afterShowLightbox","lightbox","beforeHideLightbox","afterHideLightbox","onPrev","element","onNext","errorMessage","MetaLightbox","options","this","extend","_defaults","_name","init","$this","$html","ajaxLoaded","hasClass","addClass","removeClass","on","e","preventDefault","stopPropagation","showLightbox","off","code","keyCode","which","destructLightbox","trigger","el","$el","content","currentLink","galleryItems","constructLightbox","find","processContent","data","length","hide","show","index","eq","last","first","setTimeout","link","img","video","src","classTerm","iframe","wrap","href","attr","html","isHidpi","match","$content","imgwrapper","append","css","height","resize","zoom","contentLoaded","setTitle","ga","class","frameborder","vspace","hspace","scrolling","substring","clone","outerHeight","position","top","ajax","sync","async","url","dataType","method","cache","statusCode","404","console","log","location","302","error","jqXHR","statusText","success","status","dataJson","parseJSON","title","getResponseHeader","indexOf","replace","localStorage","setItem","URL","history","pushState","page","imagesLoaded","then","text","titleWrap","overlay","nav","close","$overlay","$target","target","replaceState","empty","devicePixelRatio","matchMedia","matches","fn","each","metaLightbox","jQuery"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,C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TrF,iBAAkB,WAChB,IACEwF,EAAWhI,EAAE,0BAEfoB,KAAKD,QAAQP,mBAAmBzC,KAAKiD,MAErC,IAAI2F,EAAQ/G,EAAE,uBAAuBkD,KAAK,cACxCS,EAAO3D,EAAE,uBAAuBkD,KAAK,aACnC6D,GAASpD,IACwB,qBAAxB1D,EAAOkH,cAAyC,MAATxD,GAChD1D,EAAOkH,aAAaC,QAAQ,eAAgBzD,GAI5CzD,EAASmH,MAAQ1D,GACjBzD,EAASmH,MAAQrH,EAAE,QAAQmE,KAAK,QAAUR,GAC1CzD,EAASmH,MAAT,UAAoBrH,EAAE,QAAQmE,KAAK,QAAnC,YAA8CR,IAE9C1D,EAAOqH,QAAQa,aACb,CACEpB,QACAS,KAAM7D,EACNgC,KAAM,QAERoB,EACApD,IAYNqE,EAASlG,YAAY,sBACrB9B,EAAE,sBAAsBoD,OACxBpD,EAAE,QAAQ8B,YAAV,oCAtCYV,KAuCyBD,QAAQf,SAE7CJ,EAAE,sDAAsDyC,QACtD,gBAQFzC,EAAE,uBAAuBoC,IAAI,SAG7BpC,EAAE,uBAAuBoC,IAAI,SAG7BpC,EAAE,0BAA0BoI,QAE5BpI,EAAE,QAAQ8B,YAAY,kCAEtBV,KAAKD,QAAQN,kBAAkB1C,KAAKiD,OAGtCiD,QAAS,WAMP,OAAIpE,EAAOoI,iBAAmB,GACvBpI,EAAOqI,YAAcrI,EAAOqI,WALjC,qKAKwDC,UAI9DvI,EAAEwI,GAAF,aAAmB,SAASrH,GAC1B,OAAOC,KAAKqH,MAAK,WACVzI,EAAEkD,KAAK9B,KA7nBC,iBA8nBXpB,EAAEkD,KAAK9B,KA9nBI,eA8nBc,IAAIF,EAAaE,KAAMD,QAKtDnB,EAAEE,GAAUwI,eApoBd,CAqoBGC,OAAQvH,KAAMlB,W","file":"js/app.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 = \"/mnt/data/srv/dist/repositories/meta-lightbox/dist\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/js/index.js\");\n","/*\n * MetaLightbox\n * https://tony.twma.pro\n *\n */\n\n\nimport '../scss/index.scss';\nimport './meta-lightbox';\n","/*\n * MetaLightbox v0.61\n * https://tony.twma.pro\n *\n */\n\n//=require ../../bower_components/jquery-zoom/jquery.zoom.js\n\n(function($, window, document) {\n var pluginName = 'metaLightbox',\n defaults = {\n effect: 'fade',\n theme: 'default',\n keyboardNav: true,\n clickOverlayToClose: true,\n onInit: function() {},\n beforeShowLightbox: function() {},\n afterShowLightbox: function(lightbox) {},\n beforeHideLightbox: function() {},\n afterHideLightbox: function() {},\n onPrev: function(element) {},\n onNext: function(element) {},\n errorMessage:\n 'The requested content cannot be loaded. Please try again later.',\n };\n\n function MetaLightbox(element, options) {\n /*this.el = element;\n this.$el = $(this.el);*/\n\n this.options = $.extend({}, defaults, options);\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this.init();\n }\n\n MetaLightbox.prototype = {\n init: function() {\n var $this = this,\n $html = $('html');\n\n this.ajaxLoaded = false;\n\n // make object globally accessible\n document.MetaLightbox = this;\n\n // Need this so we don't use CSS transitions in mobile\n if (!$html.hasClass('meta-lightbox-notouch'))\n $html.addClass('meta-lightbox-notouch');\n if ('ontouchstart' in document)\n $html.removeClass('meta-lightbox-notouch');\n\n // Setup the click\n $(document).on(\n 'click',\n '[data-toggle=\"lightbox\"],[data-lightbox-gallery]',\n function(e) {\n e.preventDefault();\n e.stopPropagation();\n\n $this.showLightbox(this);\n return false;\n },\n );\n\n // keyboardNav\n if (this.options.keyboardNav) {\n $('body')\n .off('keyup')\n .on('keyup', (e) => {\n var code = e.keyCode ? e.keyCode : e.which;\n // Escape\n if (code === 27) {\n $this.destructLightbox();\n }\n // Left\n if (code === 37) {\n $('.meta-lightbox-prev').trigger('click');\n }\n // Right\n if (code === 39) {\n $('.meta-lightbox-next').trigger('click');\n }\n });\n }\n\n this.options.onInit.call(this);\n },\n\n showLightbox: function(element) {\n this.el = element;\n this.$el = $(this.el);\n\n var $this = this,\n lightbox,\n content,\n currentLink,\n galleryItems;\n\n this.options.beforeShowLightbox.call(this);\n\n lightbox = this.constructLightbox();\n if (!lightbox) return;\n content = lightbox.find('.meta-lightbox-content');\n if (!content) return;\n currentLink = this.$el;\n $('body').addClass(`meta-lightbox-body-effect-${this.options.effect}`);\n\n // Add content\n this.processContent(content, currentLink);\n\n // Nav\n if (this.$el.data('lightbox-gallery')) {\n galleryItems = $(\n `[data-lightbox-gallery=\"${this.$el.data('lightbox-gallery')}\"]`,\n );\n\n if (galleryItems.length === 1) {\n $('.meta-lightbox-nav').hide();\n } else {\n $('.meta-lightbox-nav').show();\n }\n\n // Prev\n $('.meta-lightbox-prev')\n .off('click')\n .on('click', function(e) {\n e.preventDefault();\n var index = galleryItems.index(currentLink);\n currentLink = galleryItems.eq(index - 1);\n if (!$(currentLink).length) currentLink = galleryItems.last();\n $this.processContent(content, currentLink);\n $this.options.onPrev.call(this, [currentLink]);\n });\n\n // Next\n $('.meta-lightbox-next')\n .off('click')\n .on('click', function(e) {\n e.preventDefault();\n var index = galleryItems.index(currentLink);\n currentLink = galleryItems.eq(index + 1);\n if (!$(currentLink).length) currentLink = galleryItems.first();\n $this.processContent(content, currentLink);\n $this.options.onNext.call(this, [currentLink]);\n });\n }\n\n setTimeout(function() {\n lightbox.addClass('meta-lightbox-open');\n $this.options.afterShowLightbox.call(this, [lightbox]);\n }, 1); // For CSS transitions\n },\n\n processContent: function(content, link) {\n var $this = this,\n img,\n video,\n src,\n classTerm,\n iframe,\n wrap;\n\n href = link.attr('href');\n if (!href) {\n href = link.data('href');\n }\n\n content.html('').addClass('meta-lightbox-loading');\n\n // Is HiDPI?\n if (this.isHidpi() && link.data('lightbox-hidpi')) {\n href = link.data('lightbox-hidpi');\n }\n\n // Image\n if (href.match(/\\.(jpeg|jpg|gif|png)$/i) != null) {\n /*if ($(window).width() < 768) {\n window.open(href, '_blank');\n }*/\n img = $('<img>', {\n src: href,\n });\n img.on('load', () => {\n var wrap = $('<div class=\"meta-lightbox-image\"></div>'),\n $content = $('.meta-lightbox-content'),\n imgwrapper = $('<span class=\"meta-lightbox-zoom-wrapper\"></span>');\n\n imgwrapper.append(img);\n wrap.append(imgwrapper);\n\n // Vertically center images\n wrap.css({\n 'line-height': `${$content.height()}px`,\n height: `${$content.height()}px`, // For Firefox\n });\n $(window).resize(() => {\n wrap.css({\n 'line-height': `${$content.height()}px`,\n height: `${$content.height()}px`, // For Firefox\n });\n });\n\n if (typeof imgwrapper['zoom'] !== 'undefined') {\n imgwrapper.zoom();\n }\n\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n });\n /*.each(function () {\n if (this.complete) $(this).load();\n });*/\n\n img.on('error', () => {\n var wrap = $(\n `<div class=\"meta-lightbox-error\"><p>${$this.options.errorMessage}</p></div>`,\n );\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n });\n\n // Set the title\n if (link.data('title')) {\n $this.setTitle(link.data('title'));\n } else if (link.attr('title')) {\n $this.setTitle(link.attr('title'));\n } else {\n $('.meta-lightbox-title-wrap').html('');\n }\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'Image Click', href);\n }\n }\n // Video (Youtube/Vimeo)\n else if (\n (video = href.match(\n /(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/,\n ))\n ) {\n src = '';\n classTerm = 'meta-lightbox-video';\n\n if (video[1] == 'youtube') {\n src = `https://www.youtube.com/embed/${video[4]}`;\n classTerm = 'meta-lightbox-youtube';\n }\n if (video[1] == 'youtu') {\n src = `https://www.youtube.com/embed/${video[3]}`;\n classTerm = 'meta-lightbox-youtube';\n }\n if (video[1] == 'youtube-nocookie') {\n src = `https://www.youtube-nocookie.com/embed/${video[4]}`;\n classTerm = 'nivo-lightbox-youtube';\n }\n if (video[1] == 'vimeo') {\n src = `https://player.vimeo.com/video/${video[3]}`;\n classTerm = 'meta-lightbox-vimeo';\n }\n\n if (src) {\n iframe = $('<iframe>', {\n src,\n class: classTerm,\n frameborder: 0,\n vspace: 0,\n hspace: 0,\n scrolling: 'auto',\n });\n content.html(iframe);\n iframe.on('load', () => {\n content.removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n });\n }\n\n // Set the title\n if (link.data('title')) {\n $this.setTitle(link.data('title'));\n } else if (link.attr('title')) {\n $this.setTitle(link.attr('title'));\n } else {\n $('.meta-lightbox-title-wrap').html('');\n }\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'Video Click', video);\n }\n }\n // Inline HTML\n else if (href.substring(0, 1) == '#') {\n if ($(href).length) {\n wrap = $('<div class=\"meta-lightbox-inline\" />');\n wrap.append(\n $(href)\n .clone()\n .show(),\n );\n\n // Vertically center html\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n position: 'relative',\n top: '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2)}px`,\n });\n }\n $(window).resize(() => {\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n position: 'relative',\n top: '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2)}px`,\n });\n }\n });\n\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n } else {\n wrap = $(\n `<div class=\"meta-lightbox-error\"><p>${$this.options.errorMessage}</p></div>`,\n );\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n }\n\n $('.meta-lightbox-title-wrap').html('');\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'inline HTML click', href);\n }\n }\n // AJAX/iFrame (default)\n else {\n $.ajax({\n sync: false,\n async: true,\n url: href,\n dataType: 'html',\n method: 'GET',\n cache: false,\n statusCode: {\n 404: function() {\n console.log('page not found');\n window.location.href = url;\n },\n 302: function() {\n console.log('redirect 302');\n window.location.href = url;\n },\n },\n error: function(jqXHR) {\n console.log(`AJAX request failure.${jqXHR.statusText}`);\n\n var wrap = $(\n `<div class=\"meta-lightbox-error\"><p>${$this.options.errorMessage}</p></div>`,\n );\n content.html(wrap).removeClass('meta-lightbox-loading');\n $this.contentLoaded();\n\n // google analytics\n if (typeof ga === 'function') {\n ga('send', 'event', 'error', 'AJAX ERROR', jqXHR.statusText);\n }\n },\n success: function(data, status, jqXHR) {\n try {\n const dataJson = $.parseJSON(data);\n if (typeof dataJson === 'object') {\n // Replace regions\n if (\n typeof dataJson['regions'] === 'object' &&\n typeof dataJson['regions']['LayoutAjax'] !== 'undefinded'\n ) {\n var wrap = $('<div class=\"meta-lightbox-ajax\" />');\n wrap.html(dataJson['regions']['LayoutAjax']);\n content.html(wrap).removeClass('meta-lightbox-loading');\n }\n\n // trigger events\n /*if (typeof (data['events']) === 'object') {\n for (var eventName in data.events) {\n $(document).trigger(eventName, [data['events'][eventName]]);\n }\n }*/\n\n var title = jqXHR.getResponseHeader('X-Title'),\n link = jqXHR.getResponseHeader('X-Link');\n\n if (\n title &&\n title.length &&\n link &&\n link.length &&\n link !== window.location.href &&\n link.substring(0, link.indexOf('#')) !==\n window.location.href.replace($('base').attr('href'), '/')\n ) {\n $('.meta-lightbox-ajax').data('curr-title', document.title);\n $('.meta-lightbox-ajax').data(\n 'curr-link',\n window.location.href,\n );\n\n if (\n typeof window.localStorage !== 'undefined' &&\n link !== '/'\n ) {\n window.localStorage.setItem('current-page', link);\n }\n\n if (\n document.URL !== link &&\n document.URL !== $('base').attr('href') + link &&\n document.URL !== `${$('base').attr('href')}/${link}`\n ) {\n window.history.pushState(\n {\n title,\n page: link,\n ajax: 'true',\n },\n title,\n link,\n );\n }\n\n // update redirect urls\n /*var pattern = new RegExp('\\\\b(redirect_uri=).*?(&|$)');\n $('a').each(function () {\n var $this = $(this);\n $this.attr('href', $this.attr('href').replace(pattern, 'redirect_uri=' + encodeURI($('base').attr('href') + link)));\n });*/\n\n $('.meta-lightbox-title-wrap').html('');\n\n // google analytics\n if (typeof ga === 'function') {\n ga('set', {\n page: link.replace($('base').attr('href'), ''),\n title,\n });\n ga('send', 'pageview');\n }\n }\n }\n } catch (e) {\n var wrap = $('<div class=\"meta-lightbox-ajax\" />');\n wrap.append(data);\n content.html(wrap).removeClass('meta-lightbox-loading');\n }\n\n // Vertically center html\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n position: 'relative',\n top: '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2)}px`,\n });\n }\n $(window).resize(() => {\n if (wrap.outerHeight() < content.height()) {\n wrap.css({\n position: 'relative',\n top: '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2)}px`,\n });\n }\n });\n\n setTimeout(() => {\n $(window).resize();\n\n if (typeof window.imagesLoaded === 'function') {\n window.imagesLoaded().then(() => {\n $(window).resize();\n });\n }\n }, 500);\n\n $this.contentLoaded();\n },\n });\n }\n },\n\n setTitle: function(text) {\n var titleWrap = $('<div>', {\n class: 'meta-lightbox-title',\n });\n titleWrap.text(text);\n $('.meta-lightbox-title-wrap').html(titleWrap);\n },\n\n contentLoaded: function() {\n setTimeout(() => {\n $(window).trigger('meta-lightbox-loaded');\n }, 1); // For CSS transitions\n\n setTimeout(() => {\n $('body').addClass('meta-lightbox-body-effect-fade');\n }, 600);\n },\n\n constructLightbox: function() {\n var $this = this,\n overlay = $('<div>', {\n class: `meta-lightbox-overlay meta-lightbox-theme-${this.options.theme} meta-lightbox-effect-${this.options.effect}`,\n }),\n wrap = $('<div>', {\n class: 'meta-lightbox-wrap',\n }),\n content = $('<div>', {\n class: 'meta-lightbox-content',\n }),\n nav = $(\n '<a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-prev\"><i class=\"fa fa-chevron-left\"></i> <span class=\"sr-only\">Previous</span></a><a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-next\"><i class=\"fa fa-chevron-right\"></i> <span class=\"sr-only\">Next</span></a>',\n ),\n close = $(\n '<a href=\"#\" class=\"meta-lightbox-close fa fa-times\" title=\"Close\"><span class=\"sr-only\">Close</span></a>',\n ),\n title = $('<div>', {\n class: 'meta-lightbox-title-wrap',\n }),\n isMSIE = /*@cc_on!@*/ 0,\n $overlay = $('.meta-lightbox-overlay');\n\n if ($overlay.length) return $overlay;\n\n if (isMSIE) overlay.addClass('meta-lightbox-ie');\n\n wrap.append(content);\n wrap.append(title);\n overlay.append(wrap);\n overlay.append(nav);\n overlay.append(close);\n $('body').append(overlay);\n\n if ($this.options.clickOverlayToClose) {\n overlay.on('click', (e) => {\n var $target = $(e.target);\n\n if (\n $target.hasClass('meta-lightbox-zoom-wrapper') ||\n $target.hasClass('meta-lightbox-content') ||\n $target.hasClass('meta-lightbox-wrap') ||\n $target.hasClass('meta-lightbox-image') ||\n $target.hasClass('meta-lightbox-overlay')\n ) {\n $this.destructLightbox();\n }\n });\n }\n\n close.on('click', (e) => {\n e.preventDefault();\n $this.destructLightbox();\n });\n\n return overlay;\n },\n\n destructLightbox: function() {\n var $this = this,\n $overlay = $('.meta-lightbox-overlay'),\n isMSIE = /*@cc_on!@*/ 0;\n this.options.beforeHideLightbox.call(this);\n\n var title = $('.meta-lightbox-ajax').data('curr-title'),\n link = $('.meta-lightbox-ajax').data('curr-link');\n if (title && link) {\n if (typeof window.localStorage !== 'undefined' && link !== '/') {\n window.localStorage.setItem('current-page', link);\n }\n\n if (\n document.URL !== link &&\n document.URL !== $('base').attr('href') + link &&\n document.URL !== `${$('base').attr('href')}/${link}`\n ) {\n window.history.replaceState(\n {\n title,\n page: link,\n ajax: 'true',\n },\n title,\n link,\n );\n }\n\n // update redirect urls\n /*var pattern = new RegExp('\\\\b(redirect_uri=).*?(&|$)');\n $('a').each(function () {\n var $this = $(this);\n $this.attr('href', $this.attr('href').replace(pattern, 'redirect_uri=' + encodeURI($('base').attr('href') + link)));\n });*/\n }\n\n $overlay.removeClass('meta-lightbox-open');\n $('.meta-lightbox-nav').hide();\n $('body').removeClass(\n `meta-lightbox-body-effect-${$this.options.effect}`,\n );\n $('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger(\n 'zoom.destroy',\n );\n\n // For IE\n if (isMSIE) {\n $overlay.find('iframe').attr('src', ' ');\n $overlay.find('iframe').remove();\n }\n $('.meta-lightbox-prev').off('click');\n\n // Remove click handlers\n $('.meta-lightbox-next').off('click');\n\n // Empty content (for videos)\n $('.meta-lightbox-content').empty();\n\n $('body').removeClass('meta-lightbox-body-effect-fade');\n\n this.options.afterHideLightbox.call(this);\n },\n\n isHidpi: function() {\n var mediaQuery =\n '(-webkit-min-device-pixel-ratio: 1.5),\\\n (min--moz-device-pixel-ratio: 1.5),\\\n (-o-min-device-pixel-ratio: 3/2),\\\n (min-resolution: 1.5dppx)';\n if (window.devicePixelRatio > 1) return true;\n return window.matchMedia && window.matchMedia(mediaQuery).matches;\n },\n };\n\n $.fn[pluginName] = function(options) {\n return this.each(function() {\n if (!$.data(this, pluginName)) {\n $.data(this, pluginName, new MetaLightbox(this, options));\n }\n });\n };\n\n $(document).metaLightbox();\n})(jQuery, this, document);\n"],"sourceRoot":""}

View File

@ -1,6 +1,6 @@
{
"name": "@a2nt/meta-lightbox",
"version": "1.2.4",
"version": "1.2.5",
"description": "Universal Lightbox window",
"main": "meta-lightbox.js",
"author": "Tony Air <tony@twma.pro>",
@ -27,7 +27,6 @@
"postuninstall": "npm run prunecaches"
},
"dependencies": {
"@a2nt/meta-lightbox": "^1.2.2",
"@google/markerclusterer": "^1.0.3",
"animate.css": "^3.7.0",
"bootbox": "^4.4.0",
@ -37,8 +36,8 @@
"bootstrap-offcanvas": "^1.0.0",
"bootstrap-table": "^1.16.0",
"bootstrap-timepicker": "^0.5.2",
"browserslist": "^4.8.6",
"caniuse-lite": "^1.0.30001027",
"browserslist": "^4.11.1",
"caniuse-lite": "^1.0.30001043",
"core-util-is": "^1.0.2",
"croppie": "^2.6.4",
"exif-js": "^2.3.0",
@ -46,13 +45,13 @@
"foundation-emails": "^2.2.1",
"gijgo": "^1.9.13",
"inputmask": "^5.0.3",
"jquery": "^3.4.1",
"jquery": "^3.5.0",
"jquery-hammerjs": "^2.0.0",
"jquery-hoverintent": "^1.10.1",
"jquery-zoom": "^1.7.21",
"jquery.appear": "^1.0.1",
"laravel-mix": "^4.1.2",
"mapbox-gl": "^1.7.0",
"mapbox-gl": "^1.9.1",
"offcanvas-bootstrap": "^2.5.2",
"popper.js": "^1.16.1",
"pouchdb": "^6.4.3",
@ -67,9 +66,9 @@
"devDependencies": {
"@a2nt/image-sprite-webpack-plugin": "^0.2.5",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-react-jsx": "*",
"@babel/preset-env": "^7.8.4",
"@babel/plugin-proposal-object-rest-spread": "^7.9.5",
"@babel/plugin-transform-react-jsx": "^7.9.4",
"@babel/preset-env": "^7.9.5",
"autoprefixer": "^7.2.5",
"babel-eslint": "^8.2.6",
"babel-loader": "^8.0.6",
@ -78,9 +77,9 @@
"copy-webpack-plugin": "^4.6.0",
"copyfiles": "^1.2.0",
"cross-env": "^5.1.6",
"css-loader": "^3.4.2",
"css-loader": "^3.5.2",
"eslint": "^4.18.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jquery": "^1.5.1",
"eslint-plugin-react": "^7.18.3",
"exports-loader": "^0.7.0",
@ -89,21 +88,21 @@
"file-loader": "^1.1.5",
"hard-source-webpack-plugin": "^0.13.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^4.0.0-beta.11",
"html-webpack-plugin": "^4.2.0",
"imagemin-gifsicle": "^7.0.0",
"imagemin-jpegtran": "^6.0.0",
"imagemin-optipng": "^7.1.0",
"imagemin-svgo": "^7.0.0",
"imagemin-webpack": "^5.1.1",
"loglevel": "^1.6.7",
"loglevel": "^1.6.8",
"lost": "^8.3.1",
"material-design-color": "^2.3.2",
"node-sass": "^4.13.1",
"object-assign": "^4.1.1",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss-loader": "^2.1.5",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-hot-loader": "^3.1.3",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.8",
@ -117,7 +116,7 @@
"svg-url-loader": "^2.3.3",
"terser-webpack-plugin": "^2.3.4",
"url-loader": "^0.6.2",
"webpack": "^4.41.6",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"webpack-manifest-plugin": "^1.3.2",

View File

@ -7,7 +7,6 @@
//=require ../../bower_components/jquery-zoom/jquery.zoom.js
(function($, window, document) {
var pluginName = 'metaLightbox',
defaults = {
effect: 'fade',
@ -21,7 +20,8 @@
afterHideLightbox: function() {},
onPrev: function(element) {},
onNext: function(element) {},
errorMessage: 'The requested content cannot be loaded. Please try again later.',
errorMessage:
'The requested content cannot be loaded. Please try again later.',
};
function MetaLightbox(element, options) {
@ -37,7 +37,6 @@
}
MetaLightbox.prototype = {
init: function() {
var $this = this,
$html = $('html');
@ -48,39 +47,46 @@
document.MetaLightbox = this;
// Need this so we don't use CSS transitions in mobile
if (!$html.hasClass('meta-lightbox-notouch')) $html.addClass('meta-lightbox-notouch');
if ('ontouchstart' in document) $html.removeClass('meta-lightbox-notouch');
if (!$html.hasClass('meta-lightbox-notouch'))
$html.addClass('meta-lightbox-notouch');
if ('ontouchstart' in document)
$html.removeClass('meta-lightbox-notouch');
// Setup the click
$(document).on('click', '[data-toggle="lightbox"],[data-lightbox-gallery]', function(e) {
e.preventDefault();
e.stopPropagation();
$(document).on(
'click',
'[data-toggle="lightbox"],[data-lightbox-gallery]',
function(e) {
e.preventDefault();
e.stopPropagation();
$this.showLightbox(this);
return false;
});
$this.showLightbox(this);
return false;
},
);
// keyboardNav
if (this.options.keyboardNav) {
$('body').off('keyup').on('keyup', (e) => {
var code = (e.keyCode ? e.keyCode : e.which);
// Escape
if (code === 27) {
$this.destructLightbox();
}
// Left
if (code === 37) {
$('.meta-lightbox-prev').trigger('click');
}
// Right
if (code === 39) {
$('.meta-lightbox-next').trigger('click');
}
});
$('body')
.off('keyup')
.on('keyup', (e) => {
var code = e.keyCode ? e.keyCode : e.which;
// Escape
if (code === 27) {
$this.destructLightbox();
}
// Left
if (code === 37) {
$('.meta-lightbox-prev').trigger('click');
}
// Right
if (code === 39) {
$('.meta-lightbox-next').trigger('click');
}
});
}
this.options.onInit.call(this);
},
showLightbox: function(element) {
@ -88,7 +94,10 @@
this.$el = $(this.el);
var $this = this,
lightbox, content, currentLink, galleryItems;
lightbox,
content,
currentLink,
galleryItems;
this.options.beforeShowLightbox.call(this);
@ -97,14 +106,16 @@
content = lightbox.find('.meta-lightbox-content');
if (!content) return;
currentLink = this.$el;
$('body').addClass(`meta-lightbox-body-effect-${ this.options.effect}`);
$('body').addClass(`meta-lightbox-body-effect-${this.options.effect}`);
// Add content
this.processContent(content, currentLink);
// Nav
if (this.$el.data('lightbox-gallery')) {
galleryItems = $(`[data-lightbox-gallery="${ this.$el.data('lightbox-gallery') }"]`);
galleryItems = $(
`[data-lightbox-gallery="${this.$el.data('lightbox-gallery')}"]`,
);
if (galleryItems.length === 1) {
$('.meta-lightbox-nav').hide();
@ -113,24 +124,28 @@
}
// Prev
$('.meta-lightbox-prev').off('click').on('click', function(e) {
e.preventDefault();
var index = galleryItems.index(currentLink);
currentLink = galleryItems.eq(index - 1);
if (!$(currentLink).length) currentLink = galleryItems.last();
$this.processContent(content, currentLink);
$this.options.onPrev.call(this, [currentLink]);
});
$('.meta-lightbox-prev')
.off('click')
.on('click', function(e) {
e.preventDefault();
var index = galleryItems.index(currentLink);
currentLink = galleryItems.eq(index - 1);
if (!$(currentLink).length) currentLink = galleryItems.last();
$this.processContent(content, currentLink);
$this.options.onPrev.call(this, [currentLink]);
});
// Next
$('.meta-lightbox-next').off('click').on('click', function(e) {
e.preventDefault();
var index = galleryItems.index(currentLink);
currentLink = galleryItems.eq(index + 1);
if (!$(currentLink).length) currentLink = galleryItems.first();
$this.processContent(content, currentLink);
$this.options.onNext.call(this, [currentLink]);
});
$('.meta-lightbox-next')
.off('click')
.on('click', function(e) {
e.preventDefault();
var index = galleryItems.index(currentLink);
currentLink = galleryItems.eq(index + 1);
if (!$(currentLink).length) currentLink = galleryItems.first();
$this.processContent(content, currentLink);
$this.options.onNext.call(this, [currentLink]);
});
}
setTimeout(function() {
@ -141,7 +156,12 @@
processContent: function(content, link) {
var $this = this,
img, video, src, classTerm, iframe, wrap;
img,
video,
src,
classTerm,
iframe,
wrap;
href = link.attr('href');
if (!href) {
@ -173,13 +193,13 @@
// Vertically center images
wrap.css({
'line-height': `${$content.height() }px`,
'height': `${$content.height() }px`, // For Firefox
'line-height': `${$content.height()}px`,
height: `${$content.height()}px`, // For Firefox
});
$(window).resize(() => {
wrap.css({
'line-height': `${$content.height() }px`,
'height': `${$content.height() }px`, // For Firefox
'line-height': `${$content.height()}px`,
height: `${$content.height()}px`, // For Firefox
});
});
@ -189,14 +209,15 @@
content.html(wrap).removeClass('meta-lightbox-loading');
$this.contentLoaded();
});
/*.each(function () {
if (this.complete) $(this).load();
});*/
img.on('error', () => {
var wrap = $(`<div class="meta-lightbox-error"><p>${ $this.options.errorMessage }</p></div>`);
var wrap = $(
`<div class="meta-lightbox-error"><p>${$this.options.errorMessage}</p></div>`,
);
content.html(wrap).removeClass('meta-lightbox-loading');
$this.contentLoaded();
});
@ -216,31 +237,35 @@
}
}
// Video (Youtube/Vimeo)
else if (video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/)) {
else if (
(video = href.match(
/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/,
))
) {
src = '';
classTerm = 'meta-lightbox-video';
if (video[1] == 'youtube') {
src = `https://www.youtube.com/embed/${ video[4]}`;
src = `https://www.youtube.com/embed/${video[4]}`;
classTerm = 'meta-lightbox-youtube';
}
if (video[1] == 'youtu') {
src = `https://www.youtube.com/embed/${ video[3]}`;
src = `https://www.youtube.com/embed/${video[3]}`;
classTerm = 'meta-lightbox-youtube';
}
if (video[1] == 'youtube-nocookie') {
src = `https://www.youtube-nocookie.com/embed/${ video[4]}`;
src = `https://www.youtube-nocookie.com/embed/${video[4]}`;
classTerm = 'nivo-lightbox-youtube';
}
if (video[1] == 'vimeo') {
src = `https://player.vimeo.com/video/${ video[3]}`;
src = `https://player.vimeo.com/video/${video[3]}`;
classTerm = 'meta-lightbox-vimeo';
}
if (src) {
iframe = $('<iframe>', {
src,
'class': classTerm,
class: classTerm,
frameborder: 0,
vspace: 0,
hspace: 0,
@ -271,22 +296,26 @@
else if (href.substring(0, 1) == '#') {
if ($(href).length) {
wrap = $('<div class="meta-lightbox-inline" />');
wrap.append($(href).clone().show());
wrap.append(
$(href)
.clone()
.show(),
);
// Vertically center html
if (wrap.outerHeight() < content.height()) {
wrap.css({
'position': 'relative',
'top': '50%',
'margin-top': `${-(wrap.outerHeight() / 2) }px`,
position: 'relative',
top: '50%',
'margin-top': `${-(wrap.outerHeight() / 2)}px`,
});
}
$(window).resize(() => {
if (wrap.outerHeight() < content.height()) {
wrap.css({
'position': 'relative',
'top': '50%',
'margin-top': `${-(wrap.outerHeight() / 2) }px`,
position: 'relative',
top: '50%',
'margin-top': `${-(wrap.outerHeight() / 2)}px`,
});
}
});
@ -294,7 +323,9 @@
content.html(wrap).removeClass('meta-lightbox-loading');
$this.contentLoaded();
} else {
wrap = $(`<div class="meta-lightbox-error"><p>${ $this.options.errorMessage }</p></div>`);
wrap = $(
`<div class="meta-lightbox-error"><p>${$this.options.errorMessage}</p></div>`,
);
content.html(wrap).removeClass('meta-lightbox-loading');
$this.contentLoaded();
}
@ -326,9 +357,11 @@
},
},
error: function(jqXHR) {
console.log(`AJAX request failure.${ jqXHR.statusText}`);
console.log(`AJAX request failure.${jqXHR.statusText}`);
var wrap = $(`<div class="meta-lightbox-error"><p>${ $this.options.errorMessage }</p></div>`);
var wrap = $(
`<div class="meta-lightbox-error"><p>${$this.options.errorMessage}</p></div>`,
);
content.html(wrap).removeClass('meta-lightbox-loading');
$this.contentLoaded();
@ -340,9 +373,12 @@
success: function(data, status, jqXHR) {
try {
const dataJson = $.parseJSON(data);
if (typeof(dataJson) === 'object') {
if (typeof dataJson === 'object') {
// Replace regions
if (typeof(dataJson['regions']) === 'object' && typeof dataJson['regions']['LayoutAjax'] !== 'undefinded') {
if (
typeof dataJson['regions'] === 'object' &&
typeof dataJson['regions']['LayoutAjax'] !== 'undefinded'
) {
var wrap = $('<div class="meta-lightbox-ajax" />');
wrap.html(dataJson['regions']['LayoutAjax']);
content.html(wrap).removeClass('meta-lightbox-loading');
@ -355,33 +391,45 @@
}
}*/
var title = jqXHR.getResponseHeader('X-Title'),
link = jqXHR.getResponseHeader('X-Link');
if (
title && title.length &&
link && link.length &&
title &&
title.length &&
link &&
link.length &&
link !== window.location.href &&
link.substring(0, link.indexOf('#')) !== window.location.href.replace($('base').attr('href'), '/')
link.substring(0, link.indexOf('#')) !==
window.location.href.replace($('base').attr('href'), '/')
) {
$('.meta-lightbox-ajax').data('curr-title', document.title);
$('.meta-lightbox-ajax').data('curr-link', window.location.href);
$('.meta-lightbox-ajax').data(
'curr-link',
window.location.href,
);
if (typeof window.localStorage !== 'undefined' && link !== '/') {
if (
typeof window.localStorage !== 'undefined' &&
link !== '/'
) {
window.localStorage.setItem('current-page', link);
}
if (
document.URL !== link &&
document.URL !== $('base').attr('href') + link &&
document.URL !== `${$('base').attr('href') }/${ link}`
document.URL !== `${$('base').attr('href')}/${link}`
) {
window.history.pushState({
window.history.pushState(
{
title,
page: link,
ajax: 'true',
},
title,
page: link,
ajax: 'true',
}, title, link);
link,
);
}
// update redirect urls
@ -412,17 +460,17 @@
// Vertically center html
if (wrap.outerHeight() < content.height()) {
wrap.css({
'position': 'relative',
'top': '50%',
'margin-top': `${-(wrap.outerHeight() / 2) }px`,
position: 'relative',
top: '50%',
'margin-top': `${-(wrap.outerHeight() / 2)}px`,
});
}
$(window).resize(() => {
if (wrap.outerHeight() < content.height()) {
wrap.css({
'position': 'relative',
'top': '50%',
'margin-top': `${-(wrap.outerHeight() / 2) }px`,
position: 'relative',
top: '50%',
'margin-top': `${-(wrap.outerHeight() / 2)}px`,
});
}
});
@ -430,9 +478,11 @@
setTimeout(() => {
$(window).resize();
window.imagesLoaded().then(() => {
$(window).resize();
});
if (typeof window.imagesLoaded === 'function') {
window.imagesLoaded().then(() => {
$(window).resize();
});
}
}, 500);
$this.contentLoaded();
@ -443,7 +493,7 @@
setTitle: function(text) {
var titleWrap = $('<div>', {
'class': 'meta-lightbox-title',
class: 'meta-lightbox-title',
});
titleWrap.text(text);
$('.meta-lightbox-title-wrap').html(titleWrap);
@ -459,30 +509,31 @@
}, 600);
},
constructLightbox: function() {
var $this = this,
overlay = $('<div>', {
'class': `meta-lightbox-overlay meta-lightbox-theme-${ this.options.theme } meta-lightbox-effect-${ this.options.effect}`,
class: `meta-lightbox-overlay meta-lightbox-theme-${this.options.theme} meta-lightbox-effect-${this.options.effect}`,
}),
wrap = $('<div>', {
'class': 'meta-lightbox-wrap',
class: 'meta-lightbox-wrap',
}),
content = $('<div>', {
'class': 'meta-lightbox-content',
class: 'meta-lightbox-content',
}),
nav = $('<a href="#" class="meta-lightbox-nav meta-lightbox-prev"><i class="fa fa-chevron-left"></i> <span class="sr-only">Previous</span></a><a href="#" class="meta-lightbox-nav meta-lightbox-next"><i class="fa fa-chevron-right"></i> <span class="sr-only">Next</span></a>'),
close = $('<a href="#" class="meta-lightbox-close fa fa-times" title="Close"><span class="sr-only">Close</span></a>'),
nav = $(
'<a href="#" class="meta-lightbox-nav meta-lightbox-prev"><i class="fa fa-chevron-left"></i> <span class="sr-only">Previous</span></a><a href="#" class="meta-lightbox-nav meta-lightbox-next"><i class="fa fa-chevron-right"></i> <span class="sr-only">Next</span></a>',
),
close = $(
'<a href="#" class="meta-lightbox-close fa fa-times" title="Close"><span class="sr-only">Close</span></a>',
),
title = $('<div>', {
'class': 'meta-lightbox-title-wrap',
class: 'meta-lightbox-title-wrap',
}),
isMSIE = /*@cc_on!@*/ 0,
$overlay = $('.meta-lightbox-overlay');
if ($overlay.length) return $overlay;
if (isMSIE) overlay.addClass('meta-lightbox-ie');
wrap.append(content);
@ -525,7 +576,6 @@
var title = $('.meta-lightbox-ajax').data('curr-title'),
link = $('.meta-lightbox-ajax').data('curr-link');
if (title && link) {
if (typeof window.localStorage !== 'undefined' && link !== '/') {
window.localStorage.setItem('current-page', link);
}
@ -533,13 +583,17 @@
if (
document.URL !== link &&
document.URL !== $('base').attr('href') + link &&
document.URL !== `${$('base').attr('href') }/${ link}`
document.URL !== `${$('base').attr('href')}/${link}`
) {
window.history.replaceState({
window.history.replaceState(
{
title,
page: link,
ajax: 'true',
},
title,
page: link,
ajax: 'true',
}, title, link);
link,
);
}
// update redirect urls
@ -552,12 +606,16 @@
$overlay.removeClass('meta-lightbox-open');
$('.meta-lightbox-nav').hide();
$('body').removeClass(`meta-lightbox-body-effect-${ $this.options.effect}`);
$('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger('zoom.destroy');
$('body').removeClass(
`meta-lightbox-body-effect-${$this.options.effect}`,
);
$('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger(
'zoom.destroy',
);
// For IE
if (isMSIE) {
$overlay.find('iframe').attr("src", " ");
$overlay.find('iframe').attr('src', ' ');
$overlay.find('iframe').remove();
}
$('.meta-lightbox-prev').off('click');
@ -571,18 +629,17 @@
$('body').removeClass('meta-lightbox-body-effect-fade');
this.options.afterHideLightbox.call(this);
},
isHidpi: function() {
var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
var mediaQuery =
'(-webkit-min-device-pixel-ratio: 1.5),\
(min--moz-device-pixel-ratio: 1.5),\
(-o-min-device-pixel-ratio: 3/2),\
(min-resolution: 1.5dppx)";
(min-resolution: 1.5dppx)';
if (window.devicePixelRatio > 1) return true;
return (window.matchMedia && window.matchMedia(mediaQuery).matches);
return window.matchMedia && window.matchMedia(mediaQuery).matches;
},
};
$.fn[pluginName] = function(options) {
@ -594,5 +651,4 @@
};
$(document).metaLightbox();
})(jQuery, this, document);