mirror of
https://github.com/a2nt/meta-lightbox.git
synced 2024-10-22 17:05:53 +02:00
IMPR: minor changes
This commit is contained in:
parent
0b0759c5f1
commit
9a184220b5
2
dist/js/app.js
vendored
2
dist/js/app.js
vendored
@ -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 n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,o),n.l=!0,n.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 n in t)o.d(a,n,function(e){return t[e]}.bind(null,n));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/app.js")}({"./src/js/_events.js":function(t,e){t.exports={AJAX:"ajax-load",TABHIDDEN:"tab-hidden",TABFOCUSED:"tab-focused",OFFLINE:"offline",ONLINE:"online",LOADED:"load",SWIPELEFT:"swipeleft panleft",SWIPERIGHT:"swiperight panright",ALLERTAPPEARED:"alert-appeared",ALERTREMOVED:"alert-removed",LODEDANDREADY:"load-ready",LAZYIMAGEREADY:"image-lazy-bg-loaded",LAZYIMAGESREADY:"images-lazy-loaded",MAPLOADED:"map-loaded",MAPAPILOADED:"map-api-loaded",MAPMARKERCLICK:"map-marker-click",MAPPOPUPCLOSE:"map-popup-close",SCROLL:"scroll",RESIZE:"resize",CAROUSEL_READY:"bs.carousel.ready",SET_TARGET_UPDATE:"set-target-update",RESTORE_FIELD:"restore-field",FORM_INIT_BASICS:"form-basics",FORM_INIT_STEPPED:"form-init-stepped",FORM_INIT_VALIDATE:"form-init-validate",FORM_INIT_VALIDATE_FIELD:"form-init-validate-field",FORM_INIT_STORAGE:"form-init-storage",FORM_VALIDATION_FAILED:"form-validation-failed",FORM_STEPPED_NEW_STEP:"form-new-step",FORM_STEPPED_FIRST_STEP:"form-first-step",FORM_STEPPED_LAST_STEP:"form-last-step",FORM_FIELDS:"input,textarea,select"}},"./src/js/app.js":function(t,e,o){"use strict";o.r(e);o("./src/scss/app.scss");var a=o("jquery"),n=o.n(a),i=o("./src/js/_events.js"),r=o.n(i);function c(t){return(c="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 l(t,e){for(var o=0;o<e.length;o++){var a=e[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}var s,d,u,p,h;s=n.a,d=window,document,u=s("body"),p="MetaLightboxUI",h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,o,a;return e=t,a=[{key:"init",value:function(){console.log("Initializing: ".concat(p));var t=this;t.isMSIE=0,t.isHidpi=t.isHidpi(),s(".js".concat(p,',[data-toggle="lightbox"],[data-lightbox-gallery]')).on("click",(function(e){e.preventDefault(),e.stopPropagation();var o=s(e.currentTarget);t.show(o)}))}},{key:"isHidpi",value:function(){return console.log("".concat(p,": isHidpi")),d.devicePixelRatio>1||d.matchMedia&&d.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}},{key:"show",value:function(t){console.log("".concat(p,": show"));var e=this;if(this.constructLightbox()){var o=e.$content;if(o){if(s("body").addClass("meta-lightbox-body-effect-fade"),e.process(o,t),t.data("lightbox-gallery")){var a=s('[data-lightbox-gallery="'.concat(t.data("lightbox-gallery"),'"]'));1===a.length?s(".meta-lightbox-nav").hide():s(".meta-lightbox-nav").show(),s(".meta-lightbox-prev").off("click").on("click",(function(t){t.preventDefault();var e=a.index(currentLink),n=a.eq(e-1);n.length||(n=a.last()),$this.process(o,n)})),s(".meta-lightbox-next").off("click").on("click",(function(t){t.preventDefault();var e=a.index(currentLink);$currentLink=a.eq(e+1),$currentLink.length||($currentLink=a.first()),$this.process(o,$currentLink)}))}setTimeout((function(){e.$overlay.addClass("meta-lightbox-open")}),1)}}}},{key:"constructLightbox",value:function(){console.log("".concat(p,": constructLightbox"));var t=this,e=s("<div>",{class:"meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade"}),o=s("<div>",{class:"meta-lightbox-wrap"}),a=s("<div>",{class:"meta-lightbox-content"}),n=s('<a href="#" class="meta-lightbox-nav meta-lightbox-prev"><i class="fas fa fa-chevron-left"></i> <span class="sr-only">Previous</span></a><a href="#" class="meta-lightbox-nav meta-lightbox-next"><i class="fa fas fa-chevron-right"></i> <span class="sr-only">Next</span></a>'),i=s('<a href="#" class="meta-lightbox-close fas fa fa-times" title="Close"><span class="sr-only">Close</span></a>'),r=s("<div>",{class:"meta-lightbox-title-wrap"});return t.$overlay||(t.isMSIE&&e.addClass("meta-lightbox-ie"),o.append(a),o.append(r),e.append(o),e.append(n),e.append(i),s("body").append(e),e.on("click",(function(e){e.preventDefault(),t.hide()})),i.on("click",(function(e){e.preventDefault(),t.hide()})),t.$overlay=e,t.$content=a,t.$title=r),t.$overlay}},{key:"setTitle",value:function(t){this.$title.html(t)}},{key:"process",value:function(t,e){console.log("".concat(p,": process"));var o=this,a=e.attr("href").length?e.attr("href"):e.data("href");a.length||(console.log(e),console.error("".concat(p,": href(attr/data) is missing")));var n=s("#PageLoading"),i=n.length?n.html():"";if(o.$content.html(i).addClass("meta-lightbox-loading"),a.match(/\.(jpeg|jpg|gif|png|svg)$/i)){var r=s("<img>",{src:a});r.on("load",(function(){var e=s('<div class="meta-lightbox-image"></div>'),a=s('<span class="meta-lightbox-zoom-wrapper"></span>');a.append(r),e.append(a),e.css({"line-height":"".concat(t.height(),"px"),height:"".concat(t.height(),"px")}),s(window).resize((function(){e.css({"line-height":"".concat(t.height(),"px"),height:"".concat(t.height(),"px")})})),"undefined"!==typeof a.zoom&&a.zoom(),o.$content.html(e),o.contentLoaded()})),r.on("error",(function(){var t=s('<div class="meta-lightbox-error"><p class="alert alert-error alert-danger">'.concat($this.options.errorMessage,"</p></div>"));o.$content.html(t),o.contentLoaded()}));var l=e.data("title")?e.data("title"):e.attr("title");o.setTitle(l),"function"===typeof ga&&ga("send","event","meta","Image Click",a)}else if(a.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/)){var d,h=a.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/),f="meta-lightbox-video";if("youtube"==h[1]&&(d="https://www.youtube.com/embed/".concat(h[4]),f="".concat(f," meta-lightbox-youtube")),"youtu"==h[1]&&(d="https://www.youtube.com/embed/".concat(h[3]),f="".concat(f," meta-lightbox-youtube")),"youtube-nocookie"==h[1]&&(d="https://www.youtube-nocookie.com/embed/".concat(h[4]),f="".concat(f," meta-lightbox-youtube")),"vimeo"==h[1]&&(d="https://player.vimeo.com/video/".concat(h[3]),f="".concat(f," meta-lightbox-vimeo")),d){var g=s("<iframe>",{src:d,class:f,frameborder:0,vspace:0,hspace:0,scrolling:"auto"});u.append('<div id="IFramePreload" class="hidden d-none iframe-preload" style="display:none"></div>');var m=s("#IFramePreload");m.html(g),g.on("load",(function(){console.log("".concat(p,": the iframe was loaded")),m.html(""),m.remove(),o.$content.html(g),o.contentLoaded()}))}var b=e.data("title")?e.data("title"):e.attr("title");o.setTitle(b),"function"===typeof ga&&ga("send","event","meta","Video Click",h)}else"#"==a.substring(0,1)?(s(a).length?(wrap=s('<div class="meta-lightbox-inline" />'),wrap.append(s(a).clone().show()),wrap.outerHeight()<content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")}),s(window).resize((function(){wrap.outerHeight()<content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")})})),o.$content.html(wrap),o.contentLoaded()):(wrap=s('<div class="meta-lightbox-error"><p>'.concat($this.options.errorMessage,"</p></div>")),o.$content.html(wrap),o.contentLoaded()),s(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","inline HTML click",a)):s.ajax({sync:!1,async:!0,url:a,dataType:"html",method:"GET",cache:!1,statusCode:{404:function(){console.log("page not found"),window.location.href=url},302:function(){console.log("redirect 302"),window.location.href=url}},error:function(t){console.log("AJAX request failure.".concat(t.statusText));var e=s('<div class="meta-lightbox-error"><p>'.concat($this.options.errorMessage,"</p></div>"));o.$content.html(e),o.contentLoaded(),"function"===typeof ga&&ga("send","event","error","AJAX ERROR",t.statusText)},success:function(t,e,a){try{var n=s.parseJSON(t);if("object"===c(n)){"object"===c(n.regions)&&"undefinded"!==typeof n.regions.LayoutAjax&&((l=s('<div class="meta-lightbox-ajax" />')).html(n.regions.LayoutAjax),content.html(l).removeClass("meta-lightbox-loading"));var i=a.getResponseHeader("X-Title"),r=a.getResponseHeader("X-Link");i&&i.length&&r&&r.length&&r!==window.location.href&&r.substring(0,r.indexOf("#"))!==window.location.href.replace(s("base").attr("href"),"/")&&(s(".meta-lightbox-ajax").data("curr-title",document.title),s(".meta-lightbox-ajax").data("curr-link",window.location.href),"undefined"!==typeof window.localStorage&&"/"!==r&&window.localStorage.setItem("current-page",r),document.URL!==r&&document.URL!==s("base").attr("href")+r&&document.URL!=="".concat(s("base").attr("href"),"/").concat(r)&&window.history.pushState({title:i,page:r,ajax:"true"},i,r),s(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&(ga("set",{page:r.replace(s("base").attr("href"),""),title:i}),ga("send","pageview")))}}catch(d){var l;(l=s('<div class="meta-lightbox-ajax" />')).append(t),content.html(l).removeClass("meta-lightbox-loading")}l.outerHeight()<content.height()&&l.css({position:"relative",top:"50%","margin-top":"".concat(-l.outerHeight()/2,"px")}),s(window).resize((function(){l.outerHeight()<content.height()&&l.css({position:"relative",top:"50%","margin-top":"".concat(-l.outerHeight()/2,"px")})})),setTimeout((function(){s(window).resize(),"function"===typeof window.imagesLoaded&&window.imagesLoaded().then((function(){s(window).resize()}))}),500),o.contentLoaded()}})}},{key:"contentLoaded",value:function(){this.$content.removeClass("meta-lightbox-loading"),setTimeout((function(){s(d).trigger("meta-lightbox-loaded")}),1),setTimeout((function(){u.addClass("meta-lightbox-body-effect-fade")}),600)}},{key:"hide",value:function(t){var e=this.$overlay,o=s(".meta-lightbox-ajax").data("curr-title"),a=s(".meta-lightbox-ajax").data("curr-link");o&&a&&("undefined"!==typeof window.localStorage&&"/"!==a&&window.localStorage.setItem("current-page",a),document.URL!==a&&document.URL!==s("base").attr("href")+a&&document.URL!=="".concat(s("base").attr("href"),"/").concat(a)&&window.history.replaceState({title:o,page:a,ajax:"true"},o,a)),e.removeClass("meta-lightbox-open"),s(".meta-lightbox-nav").hide(),u.removeClass("meta-lightbox-body-effect-fade"),s(".meta-lightbox-content .meta-lightbox-zoom-wrapper").trigger("zoom.destroy"),this.isMSIE&&(e.find("iframe").attr("src"," "),e.find("iframe").remove()),s(".meta-lightbox-prev").off("click"),s(".meta-lightbox-next").off("click"),s(".meta-lightbox-content").empty(),u.removeClass("meta-lightbox-body-effect-fade")}}],(o=null)&&l(e.prototype,o),a&&l(e,a),t}(),s(d).on("".concat(r.a.AJAX," ").concat(r.a.LOADED),(function(){h.init()})),d.MetaLightboxUI=h},"./src/scss/app.scss":function(t,e,o){},jquery:function(t,e){t.exports=jQuery}});
|
||||
!function(t){var e={};function o(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,o),n.l=!0,n.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 n in t)o.d(a,n,function(e){return t[e]}.bind(null,n));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/app.js")}({"./src/js/_events.js":function(t,e){t.exports={AJAX:"ajax-load",TABHIDDEN:"tab-hidden",TABFOCUSED:"tab-focused",OFFLINE:"offline",ONLINE:"online",LOADED:"load",SWIPELEFT:"swipeleft panleft",SWIPERIGHT:"swiperight panright",ALLERTAPPEARED:"alert-appeared",ALERTREMOVED:"alert-removed",LODEDANDREADY:"load-ready",LAZYIMAGEREADY:"image-lazy-bg-loaded",LAZYIMAGESREADY:"images-lazy-loaded",MAPLOADED:"map-loaded",MAPAPILOADED:"map-api-loaded",MAPMARKERCLICK:"map-marker-click",MAPPOPUPCLOSE:"map-popup-close",SCROLL:"scroll",RESIZE:"resize",CAROUSEL_READY:"bs.carousel.ready",SET_TARGET_UPDATE:"set-target-update",RESTORE_FIELD:"restore-field",FORM_INIT_BASICS:"form-basics",FORM_INIT_STEPPED:"form-init-stepped",FORM_INIT_VALIDATE:"form-init-validate",FORM_INIT_VALIDATE_FIELD:"form-init-validate-field",FORM_INIT_STORAGE:"form-init-storage",FORM_VALIDATION_FAILED:"form-validation-failed",FORM_STEPPED_NEW_STEP:"form-new-step",FORM_STEPPED_FIRST_STEP:"form-first-step",FORM_STEPPED_LAST_STEP:"form-last-step",FORM_FIELDS:"input,textarea,select"}},"./src/js/app.js":function(t,e,o){"use strict";o.r(e);o("./src/scss/app.scss");var a=o("jquery"),n=o.n(a),i=o("./src/js/_events.js"),r=o.n(i);function c(t){return(c="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 l(t,e){for(var o=0;o<e.length;o++){var a=e[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}var s,d,u,p,h;s=n.a,d=window,document,u=s("body"),p="MetaLightboxUI",h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,o,a;return e=t,a=[{key:"init",value:function(){console.log("Initializing: ".concat(p));var t=this;t.isMSIE=0;try{t.isHidpi=t.is_hdpi()}catch(e){console.log(t)}s(".js".concat(p,',[data-toggle="lightbox"],[data-lightbox-gallery]')).on("click",(function(e){e.preventDefault(),e.stopPropagation();var o=s(e.currentTarget);t.show(o)}))}},{key:"is_hdpi",value:function(){return console.log("".concat(p,": isHidpi")),d.devicePixelRatio>1||d.matchMedia&&d.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}},{key:"show",value:function(t){console.log("".concat(p,": show"));var e=this;if(this.constructLightbox()){var o=e.$content;if(o){if(s("body").addClass("meta-lightbox-body-effect-fade"),e.process(o,t),t.data("lightbox-gallery")){var a=s('[data-lightbox-gallery="'.concat(t.data("lightbox-gallery"),'"]'));1===a.length?s(".meta-lightbox-nav").hide():s(".meta-lightbox-nav").show(),s(".meta-lightbox-prev").off("click").on("click",(function(t){t.preventDefault();var e=a.index(currentLink),n=a.eq(e-1);n.length||(n=a.last()),$this.process(o,n)})),s(".meta-lightbox-next").off("click").on("click",(function(t){t.preventDefault();var e=a.index(currentLink);$currentLink=a.eq(e+1),$currentLink.length||($currentLink=a.first()),$this.process(o,$currentLink)}))}setTimeout((function(){e.$overlay.addClass("meta-lightbox-open")}),1)}}}},{key:"constructLightbox",value:function(){console.log("".concat(p,": constructLightbox"));var t=this,e=s("<div>",{class:"meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade"}),o=s("<div>",{class:"meta-lightbox-wrap"}),a=s("<div>",{class:"meta-lightbox-content"}),n=s('<a href="#" class="meta-lightbox-nav meta-lightbox-prev"><i class="fas fa fa-chevron-left"></i> <span class="sr-only">Previous</span></a><a href="#" class="meta-lightbox-nav meta-lightbox-next"><i class="fa fas fa-chevron-right"></i> <span class="sr-only">Next</span></a>'),i=s('<a href="#" class="meta-lightbox-close fas fa fa-times" title="Close"><span class="sr-only">Close</span></a>'),r=s("<div>",{class:"meta-lightbox-title-wrap"});return t.$overlay||(t.isMSIE&&e.addClass("meta-lightbox-ie"),o.append(a),o.append(r),e.append(o),e.append(n),e.append(i),s("body").append(e),e.on("click",(function(e){e.preventDefault(),t.hide()})),i.on("click",(function(e){e.preventDefault(),t.hide()})),t.$overlay=e,t.$content=a,t.$title=r),t.$overlay}},{key:"setTitle",value:function(t){this.$title.html(t)}},{key:"process",value:function(t,e){console.log("".concat(p,": process"));var o=this,a=e.attr("href").length?e.attr("href"):e.data("href");a.length||(console.log(e),console.error("".concat(p,": href(attr/data) is missing")));var n=s("#PageLoading"),i=n.length?n.html():"";if(o.$content.html(i).addClass("meta-lightbox-loading"),a.match(/\.(jpeg|jpg|gif|png|svg)$/i)){var r=s("<img>",{src:a});r.on("load",(function(){var e=s('<div class="meta-lightbox-image"></div>'),a=s('<span class="meta-lightbox-zoom-wrapper"></span>');a.append(r),e.append(a),e.css({"line-height":"".concat(t.height(),"px"),height:"".concat(t.height(),"px")}),s(window).resize((function(){e.css({"line-height":"".concat(t.height(),"px"),height:"".concat(t.height(),"px")})})),"undefined"!==typeof a.zoom&&a.zoom(),o.$content.html(e),o.contentLoaded()})),r.on("error",(function(){var t=s('<div class="meta-lightbox-error"><p class="alert alert-error alert-danger">'.concat($this.options.errorMessage,"</p></div>"));o.$content.html(t),o.contentLoaded()}));var l=e.data("title")?e.data("title"):e.attr("title");o.setTitle(l),"function"===typeof ga&&ga("send","event","meta","Image Click",a)}else if(a.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/)){var d,h=a.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/),f="meta-lightbox-video";if("youtube"==h[1]&&(d="https://www.youtube.com/embed/".concat(h[4]),f="".concat(f," meta-lightbox-youtube")),"youtu"==h[1]&&(d="https://www.youtube.com/embed/".concat(h[3]),f="".concat(f," meta-lightbox-youtube")),"youtube-nocookie"==h[1]&&(d="https://www.youtube-nocookie.com/embed/".concat(h[4]),f="".concat(f," meta-lightbox-youtube")),"vimeo"==h[1]&&(d="https://player.vimeo.com/video/".concat(h[3]),f="".concat(f," meta-lightbox-vimeo")),d){var g=s("<iframe>",{src:d,class:f,frameborder:0,vspace:0,hspace:0,scrolling:"auto"});u.append('<div id="IFramePreload" class="hidden d-none iframe-preload" style="display:none"></div>');var m=s("#IFramePreload");m.html(g),g.on("load",(function(){console.log("".concat(p,": the iframe was loaded")),m.html(""),m.remove(),o.$content.html(g),o.contentLoaded()}))}var b=e.data("title")?e.data("title"):e.attr("title");o.setTitle(b),"function"===typeof ga&&ga("send","event","meta","Video Click",h)}else"#"==a.substring(0,1)?(s(a).length?(wrap=s('<div class="meta-lightbox-inline" />'),wrap.append(s(a).clone().show()),wrap.outerHeight()<content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")}),s(window).resize((function(){wrap.outerHeight()<content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")})})),o.$content.html(wrap),o.contentLoaded()):(wrap=s('<div class="meta-lightbox-error"><p>'.concat($this.options.errorMessage,"</p></div>")),o.$content.html(wrap),o.contentLoaded()),s(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","inline HTML click",a)):s.ajax({sync:!1,async:!0,url:a,dataType:"html",method:"GET",cache:!1,statusCode:{404:function(){console.log("page not found"),window.location.href=url},302:function(){console.log("redirect 302"),window.location.href=url}},error:function(t){console.log("AJAX request failure.".concat(t.statusText));var e=s('<div class="meta-lightbox-error"><p>'.concat($this.options.errorMessage,"</p></div>"));o.$content.html(e),o.contentLoaded(),"function"===typeof ga&&ga("send","event","error","AJAX ERROR",t.statusText)},success:function(t,e,a){try{var n=s.parseJSON(t);if("object"===c(n)){"object"===c(n.regions)&&"undefinded"!==typeof n.regions.LayoutAjax&&((l=s('<div class="meta-lightbox-ajax" />')).html(n.regions.LayoutAjax),content.html(l).removeClass("meta-lightbox-loading"));var i=a.getResponseHeader("X-Title"),r=a.getResponseHeader("X-Link");i&&i.length&&r&&r.length&&r!==window.location.href&&r.substring(0,r.indexOf("#"))!==window.location.href.replace(s("base").attr("href"),"/")&&(s(".meta-lightbox-ajax").data("curr-title",document.title),s(".meta-lightbox-ajax").data("curr-link",window.location.href),"undefined"!==typeof window.localStorage&&"/"!==r&&window.localStorage.setItem("current-page",r),document.URL!==r&&document.URL!==s("base").attr("href")+r&&document.URL!=="".concat(s("base").attr("href"),"/").concat(r)&&window.history.pushState({title:i,page:r,ajax:"true"},i,r),s(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&(ga("set",{page:r.replace(s("base").attr("href"),""),title:i}),ga("send","pageview")))}}catch(d){var l;(l=s('<div class="meta-lightbox-ajax" />')).append(t),content.html(l).removeClass("meta-lightbox-loading")}l.outerHeight()<content.height()&&l.css({position:"relative",top:"50%","margin-top":"".concat(-l.outerHeight()/2,"px")}),s(window).resize((function(){l.outerHeight()<content.height()&&l.css({position:"relative",top:"50%","margin-top":"".concat(-l.outerHeight()/2,"px")})})),setTimeout((function(){s(window).resize(),"function"===typeof window.imagesLoaded&&window.imagesLoaded().then((function(){s(window).resize()}))}),500),o.contentLoaded()}})}},{key:"contentLoaded",value:function(){this.$content.removeClass("meta-lightbox-loading"),setTimeout((function(){s(d).trigger("meta-lightbox-loaded")}),1),setTimeout((function(){u.addClass("meta-lightbox-body-effect-fade")}),600)}},{key:"hide",value:function(t){var e=this.$overlay,o=s(".meta-lightbox-ajax").data("curr-title"),a=s(".meta-lightbox-ajax").data("curr-link");o&&a&&("undefined"!==typeof window.localStorage&&"/"!==a&&window.localStorage.setItem("current-page",a),document.URL!==a&&document.URL!==s("base").attr("href")+a&&document.URL!=="".concat(s("base").attr("href"),"/").concat(a)&&window.history.replaceState({title:o,page:a,ajax:"true"},o,a)),e.removeClass("meta-lightbox-open"),s(".meta-lightbox-nav").hide(),u.removeClass("meta-lightbox-body-effect-fade"),s(".meta-lightbox-content .meta-lightbox-zoom-wrapper").trigger("zoom.destroy"),this.isMSIE&&(e.find("iframe").attr("src"," "),e.find("iframe").remove()),s(".meta-lightbox-prev").off("click"),s(".meta-lightbox-next").off("click"),s(".meta-lightbox-content").empty(),u.removeClass("meta-lightbox-body-effect-fade")}}],(o=null)&&l(e.prototype,o),a&&l(e,a),t}(),s(d).on("".concat(r.a.AJAX," ").concat(r.a.LOADED),(function(){h.init()})),d.MetaLightboxUI=h},"./src/scss/app.scss":function(t,e,o){},jquery:function(t,e){t.exports=jQuery}});
|
||||
//# sourceMappingURL=app.js.map
|
2
dist/js/app.js.map
vendored
2
dist/js/app.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/js/_events.js","webpack:///./src/js/meta-lightbox.js","webpack:///external \"jQuery\""],"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","AJAX","TABHIDDEN","TABFOCUSED","OFFLINE","ONLINE","LOADED","SWIPELEFT","SWIPERIGHT","ALLERTAPPEARED","ALERTREMOVED","LODEDANDREADY","LAZYIMAGEREADY","LAZYIMAGESREADY","MAPLOADED","MAPAPILOADED","MAPMARKERCLICK","MAPPOPUPCLOSE","SCROLL","RESIZE","CAROUSEL_READY","SET_TARGET_UPDATE","RESTORE_FIELD","FORM_INIT_BASICS","FORM_INIT_STEPPED","FORM_INIT_VALIDATE","FORM_INIT_VALIDATE_FIELD","FORM_INIT_STORAGE","FORM_VALIDATION_FAILED","FORM_STEPPED_NEW_STEP","FORM_STEPPED_FIRST_STEP","FORM_STEPPED_LAST_STEP","FORM_FIELDS","$","W","$Body","NAME","MetaLightboxUI","window","document","console","log","ui","this","isMSIE","isHidpi","on","e","preventDefault","stopPropagation","$link","currentTarget","show","devicePixelRatio","matchMedia","matches","constructLightbox","$content","addClass","process","data","$galleryItems","length","hide","off","index","currentLink","$currentLink","eq","last","$this","first","setTimeout","$overlay","overlay","class","wrap","content","nav","close","title","append","$title","str","html","href","attr","error","$pageSpinner","loadingContent","match","img","src","imgwrapper","css","height","resize","zoom","contentLoaded","options","errorMessage","setTitle","ga","video","classTerm","$iframe","frameborder","vspace","hspace","scrolling","$preload","remove","substring","clone","outerHeight","position","top","ajax","sync","async","url","dataType","method","cache","statusCode","404","location","302","jqXHR","statusText","success","status","dataJson","parseJSON","removeClass","getResponseHeader","link","indexOf","replace","localStorage","setItem","URL","history","pushState","page","imagesLoaded","then","trigger","callback","replaceState","find","empty","Events","init","jQuery"],"mappings":";aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI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rBrE,EAAOD,QAAU2L","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/app.js\");\n","/**\n * Add your global events here\n */\n\nmodule.exports = {\n AJAX: 'ajax-load',\n TABHIDDEN: 'tab-hidden',\n TABFOCUSED: 'tab-focused',\n OFFLINE: 'offline',\n ONLINE: 'online',\n LOADED: 'load',\n SWIPELEFT: 'swipeleft panleft',\n SWIPERIGHT: 'swiperight panright',\n ALLERTAPPEARED: 'alert-appeared',\n ALERTREMOVED: 'alert-removed',\n LODEDANDREADY: 'load-ready',\n LAZYIMAGEREADY: 'image-lazy-bg-loaded',\n LAZYIMAGESREADY: 'images-lazy-loaded',\n MAPLOADED: 'map-loaded',\n MAPAPILOADED: 'map-api-loaded',\n MAPMARKERCLICK: 'map-marker-click',\n MAPPOPUPCLOSE: 'map-popup-close',\n SCROLL: 'scroll',\n RESIZE: 'resize',\n CAROUSEL_READY: 'bs.carousel.ready',\n SET_TARGET_UPDATE: 'set-target-update',\n RESTORE_FIELD: 'restore-field',\n FORM_INIT_BASICS: 'form-basics',\n FORM_INIT_STEPPED: 'form-init-stepped',\n FORM_INIT_VALIDATE: 'form-init-validate',\n FORM_INIT_VALIDATE_FIELD: 'form-init-validate-field',\n FORM_INIT_STORAGE: 'form-init-storage',\n FORM_VALIDATION_FAILED: 'form-validation-failed',\n FORM_STEPPED_NEW_STEP: 'form-new-step',\n FORM_STEPPED_FIRST_STEP: 'form-first-step',\n FORM_STEPPED_LAST_STEP: 'form-last-step',\n FORM_FIELDS: 'input,textarea,select',\n};\n","/*\n * MetaLightbox\n * https://tony.twma.pro\n *\n */\n\n// optional:\n//=require ../../bower_components/jquery-zoom/jquery.zoom.js\n\n\"use strict\";\n\nimport $ from 'jquery';\n\nimport Events from './_events';\n\nconst MetaLightboxUI = (($) => {\n const W = window;\n const D = document;\n const $Body = $('body');\n\n const NAME = 'MetaLightboxUI';\n\n class MetaLightboxUI {\n static init() {\n console.log(`Initializing: ${NAME}`);\n\n const ui = this;\n ui.isMSIE = /*@cc_on!@*/ 0;\n ui.isHidpi = ui.isHidpi();\n\n\n $(`.js${NAME},[data-toggle=\"lightbox\"],[data-lightbox-gallery]`).on('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n const $link = $(e.currentTarget);\n\n ui.show($link);\n });\n }\n\n static isHidpi() {\n console.log(`${NAME}: isHidpi`);\n const 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 (W.devicePixelRatio > 1) return true;\n return W.matchMedia && W.matchMedia(mediaQuery).matches;\n }\n\n static show($link) {\n console.log(`${NAME}: show`);\n const ui = this;\n\n const $lightbox = this.constructLightbox();\n if (!$lightbox) return;\n\n const $content = ui.$content;\n if (!$content) return;\n\n $('body').addClass(`meta-lightbox-body-effect-fade`);\n\n // Add content\n ui.process($content, $link);\n\n // Nav\n if ($link.data('lightbox-gallery')) {\n const $galleryItems = $(`[data-lightbox-gallery=\"${$link.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')\n .off('click')\n .on('click', (e) => {\n e.preventDefault();\n const index = $galleryItems.index(currentLink);\n let $currentLink = $galleryItems.eq(index - 1);\n if (!$currentLink.length) $currentLink = $galleryItems.last();\n $this.process($content, $currentLink);\n });\n\n // Next\n $('.meta-lightbox-next')\n .off('click')\n .on('click', (e) => {\n e.preventDefault();\n const index = $galleryItems.index(currentLink);\n $currentLink = $galleryItems.eq(index + 1);\n if (!$currentLink.length) $currentLink = $galleryItems.first();\n $this.process($content, $currentLink);\n });\n }\n\n setTimeout(() => {\n ui.$overlay.addClass('meta-lightbox-open');\n }, 1); // For CSS transitions\n }\n\n static constructLightbox() {\n console.log(`${NAME}: constructLightbox`);\n const ui = this;\n\n const overlay = $('<div>', {\n class: 'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade',\n });\n const wrap = $('<div>', {\n class: 'meta-lightbox-wrap',\n });\n const content = $('<div>', {\n class: 'meta-lightbox-content',\n });\n const nav = $(\n '<a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-prev\"><i class=\"fas fa fa-chevron-left\"></i> <span class=\"sr-only\">Previous</span></a><a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-next\"><i class=\"fa fas fa-chevron-right\"></i> <span class=\"sr-only\">Next</span></a>',\n );\n const close = $(\n '<a href=\"#\" class=\"meta-lightbox-close fas fa fa-times\" title=\"Close\"><span class=\"sr-only\">Close</span></a>',\n );\n const title = $('<div>', {\n class: 'meta-lightbox-title-wrap',\n });\n\n if (ui.$overlay) return ui.$overlay;\n\n if (ui.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 overlay.on('click', (e) => {\n e.preventDefault();\n ui.hide();\n });\n\n close.on('click', (e) => {\n e.preventDefault();\n ui.hide();\n });\n\n ui.$overlay = overlay;\n ui.$content = content;\n ui.$title = title;\n\n return ui.$overlay;\n }\n\n static setTitle(str) {\n const ui = this;\n\n ui.$title.html(str);\n }\n\n static process($content, $link) {\n console.log(`${NAME}: process`);\n const ui = this;\n\n const href = $link.attr('href').length ? $link.attr('href') : $link.data('href');\n if (!href.length) {\n console.log($link);\n console.error(`${NAME }: href(attr/data) is missing`);\n }\n\n const $pageSpinner = $('#PageLoading');\n const loadingContent = $pageSpinner.length ? $pageSpinner.html() : '';\n ui.$content.html(loadingContent).addClass('meta-lightbox-loading');\n\n // Image\n if (href.match(/\\.(jpeg|jpg|gif|png|svg)$/i)) {\n const img = $('<img>', {\n src: href,\n });\n\n img.on('load', () => {\n const wrap = $('<div class=\"meta-lightbox-image\"></div>'),\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\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 ui.$content.html(wrap);\n ui.contentLoaded();\n });\n\n img.on('error', () => {\n const wrap = $(\n `<div class=\"meta-lightbox-error\"><p class=\"alert alert-error alert-danger\">${$this.options.errorMessage}</p></div>`,\n );\n\n ui.$content.html(wrap);\n ui.contentLoaded();\n });\n\n // Set the title\n const title = $link.data('title') ? $link.data('title') : $link.attr('title');\n ui.setTitle(title);\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 (href.match(/(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/)) {\n const video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/);\n let classTerm = 'meta-lightbox-video';\n let src;\n\n if (video[1] == 'youtube') {\n src = `https://www.youtube.com/embed/${video[4]}`;\n classTerm = `${classTerm } meta-lightbox-youtube`;\n }\n if (video[1] == 'youtu') {\n src = `https://www.youtube.com/embed/${video[3]}`;\n classTerm = `${classTerm } meta-lightbox-youtube`;\n }\n if (video[1] == 'youtube-nocookie') {\n src = `https://www.youtube-nocookie.com/embed/${video[4]}`;\n classTerm = `${classTerm} meta-lightbox-youtube`;\n }\n if (video[1] == 'vimeo') {\n src = `https://player.vimeo.com/video/${video[3]}`;\n classTerm = `${classTerm } meta-lightbox-vimeo`;\n }\n\n if (src) {\n const $iframe = $('<iframe>', {\n src,\n class: classTerm,\n frameborder: 0,\n vspace: 0,\n hspace: 0,\n scrolling: 'auto',\n });\n\n $Body.append('<div id=\"IFramePreload\" class=\"hidden d-none iframe-preload\" style=\"display:none\"></div>');\n const $preload = $('#IFramePreload');\n $preload.html($iframe);\n\n $iframe.on('load', () => {\n console.log(`${NAME}: the iframe was loaded`);\n $preload.html('');\n $preload.remove();\n\n ui.$content.html($iframe);\n ui.contentLoaded();\n });\n }\n\n // Set the title\n const title = $link.data('title') ? $link.data('title') : $link.attr('title');\n ui.setTitle(title);\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 ui.$content.html(wrap);\n ui.contentLoaded();\n } else {\n wrap = $(\n `<div class=\"meta-lightbox-error\"><p>${$this.options.errorMessage}</p></div>`,\n );\n ui.$content.html(wrap);\n ui.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 ui.$content.html(wrap);\n ui.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 ui.contentLoaded();\n },\n });\n }\n };\n\n static contentLoaded() {\n const ui = this;\n\n ui.$content.removeClass('meta-lightbox-loading');\n setTimeout(() => {\n $(W).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 static hide(callback) {\n const ui = this;\n\n const $overlay = ui.$overlay;\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('meta-lightbox-body-effect-fade');\n $('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger('zoom.destroy');\n\n // For IE\n if (ui.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 }\n\n $(W).on(`${Events.AJAX} ${Events.LOADED}`, () => {\n MetaLightboxUI.init();\n });\n\n W.MetaLightboxUI = MetaLightboxUI;\n\n return MetaLightboxUI;\n})($);\n\nexport default MetaLightboxUI;\n","module.exports = jQuery;"],"sourceRoot":""}
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/js/_events.js","webpack:///./src/js/meta-lightbox.js","webpack:///external \"jQuery\""],"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","AJAX","TABHIDDEN","TABFOCUSED","OFFLINE","ONLINE","LOADED","SWIPELEFT","SWIPERIGHT","ALLERTAPPEARED","ALERTREMOVED","LODEDANDREADY","LAZYIMAGEREADY","LAZYIMAGESREADY","MAPLOADED","MAPAPILOADED","MAPMARKERCLICK","MAPPOPUPCLOSE","SCROLL","RESIZE","CAROUSEL_READY","SET_TARGET_UPDATE","RESTORE_FIELD","FORM_INIT_BASICS","FORM_INIT_STEPPED","FORM_INIT_VALIDATE","FORM_INIT_VALIDATE_FIELD","FORM_INIT_STORAGE","FORM_VALIDATION_FAILED","FORM_STEPPED_NEW_STEP","FORM_STEPPED_FIRST_STEP","FORM_STEPPED_LAST_STEP","FORM_FIELDS","$","W","$Body","NAME","MetaLightboxUI","window","document","console","log","ui","this","isMSIE","isHidpi","is_hdpi","e","on","preventDefault","stopPropagation","$link","currentTarget","show","devicePixelRatio","matchMedia","matches","constructLightbox","$content","addClass","process","data","$galleryItems","length","hide","off","index","currentLink","$currentLink","eq","last","$this","first","setTimeout","$overlay","overlay","class","wrap","content","nav","close","title","append","$title","str","html","href","attr","error","$pageSpinner","loadingContent","match","img","src","imgwrapper","css","height","resize","zoom","contentLoaded","options","errorMessage","setTitle","ga","video","classTerm","$iframe","frameborder","vspace","hspace","scrolling","$preload","remove","substring","clone","outerHeight","position","top","ajax","sync","async","url","dataType","method","cache","statusCode","404","location","302","jqXHR","statusText","success","status","dataJson","parseJSON","removeClass","getResponseHeader","link","indexOf","replace","localStorage","setItem","URL","history","pushState","page","imagesLoaded","then","trigger","callback","replaceState","find","empty","Events","init","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,qBAA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,EAFK/B,KAES+B,SAEhBO,EAAQhD,EAAE,uBAAuB4B,KAAK,cACxC4E,EAAOxG,EAAE,uBAAuB4B,KAAK,aACnCoB,GAASwD,IAEsB,qBAAxBnG,OAAOsG,cACV,MAATH,GAEKnG,OAAOsG,aAAaC,QAAQ,eAAgBJ,GAI5ClG,SAASuG,MAAQL,GACtBlG,SAASuG,MAAQ7G,EAAE,QAAQsD,KAAK,QAAUkD,GAC1ClG,SAASuG,MAAT,UAAoB7G,EAAE,QAAQsD,KAAK,QAAnC,YAA8CkD,IAEzCnG,OAAOyG,QAAQO,aACb,CACErE,QACAgE,KAAMR,EACNnB,KAAM,QAERrC,EACAwD,IAYN/D,EAAS6D,YAAY,sBACrBtG,EAAE,sBAAsB+B,OACxB7B,EAAMoG,YAAY,kCAClBtG,EAAE,sDAAsDmH,QACtD,gBA1CSzG,KA8CJC,SACL8B,EAAS6E,KAAK,UAAUhE,KAAK,MAAO,KACpCb,EAAS6E,KAAK,UAAUvC,UAE1B/E,EAAE,uBAAuBgC,IAAI,SAG7BhC,EAAE,uBAAuBgC,IAAI,SAG7BhC,EAAE,0BAA0BuH,QAE5BrH,EAAMoG,YAAY,sC,EAtlBO,O,2BAAA,KA0lB7BtG,EAAEC,GAAGc,GAAL,UAAWyG,IAAOxJ,KAAlB,YAA0BwJ,IAAOnJ,SAAU,WACzC+B,EAAeqH,UAGjBxH,EAAEG,eAAiBA,G,6DC7mBrBrE,EAAOD,QAAU4L","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/app.js\");\n","/**\n * Add your global events here\n */\n\nmodule.exports = {\n AJAX: 'ajax-load',\n TABHIDDEN: 'tab-hidden',\n TABFOCUSED: 'tab-focused',\n OFFLINE: 'offline',\n ONLINE: 'online',\n LOADED: 'load',\n SWIPELEFT: 'swipeleft panleft',\n SWIPERIGHT: 'swiperight panright',\n ALLERTAPPEARED: 'alert-appeared',\n ALERTREMOVED: 'alert-removed',\n LODEDANDREADY: 'load-ready',\n LAZYIMAGEREADY: 'image-lazy-bg-loaded',\n LAZYIMAGESREADY: 'images-lazy-loaded',\n MAPLOADED: 'map-loaded',\n MAPAPILOADED: 'map-api-loaded',\n MAPMARKERCLICK: 'map-marker-click',\n MAPPOPUPCLOSE: 'map-popup-close',\n SCROLL: 'scroll',\n RESIZE: 'resize',\n CAROUSEL_READY: 'bs.carousel.ready',\n SET_TARGET_UPDATE: 'set-target-update',\n RESTORE_FIELD: 'restore-field',\n FORM_INIT_BASICS: 'form-basics',\n FORM_INIT_STEPPED: 'form-init-stepped',\n FORM_INIT_VALIDATE: 'form-init-validate',\n FORM_INIT_VALIDATE_FIELD: 'form-init-validate-field',\n FORM_INIT_STORAGE: 'form-init-storage',\n FORM_VALIDATION_FAILED: 'form-validation-failed',\n FORM_STEPPED_NEW_STEP: 'form-new-step',\n FORM_STEPPED_FIRST_STEP: 'form-first-step',\n FORM_STEPPED_LAST_STEP: 'form-last-step',\n FORM_FIELDS: 'input,textarea,select',\n};\n","/*\n * MetaLightbox\n * https://tony.twma.pro\n *\n */\n\n// optional:\n//=require ../../bower_components/jquery-zoom/jquery.zoom.js\n\n'use strict';\n\nimport $ from 'jquery';\n\nimport Events from './_events';\n\nconst MetaLightboxUI = (($) => {\n const W = window;\n const D = document;\n const $Body = $('body');\n\n const NAME = 'MetaLightboxUI';\n\n class MetaLightboxUI {\n static init() {\n console.log(`Initializing: ${NAME}`);\n\n const ui = this;\n ui.isMSIE = /*@cc_on!@*/ 0;\n try {\n ui.isHidpi = ui.is_hdpi();\n } catch (e) {\n console.log(ui);\n }\n\n $(`.js${NAME},[data-toggle=\"lightbox\"],[data-lightbox-gallery]`).on(\n 'click',\n (e) => {\n e.preventDefault();\n e.stopPropagation();\n const $link = $(e.currentTarget);\n\n ui.show($link);\n },\n );\n }\n\n static is_hdpi() {\n console.log(`${NAME}: isHidpi`);\n const mediaQuery =\n\t\t\t\t'(-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 (W.devicePixelRatio > 1) return true;\n return W.matchMedia && W.matchMedia(mediaQuery).matches;\n }\n\n static show($link) {\n console.log(`${NAME}: show`);\n const ui = this;\n\n const $lightbox = this.constructLightbox();\n if (!$lightbox) return;\n\n const $content = ui.$content;\n if (!$content) return;\n\n $('body').addClass(`meta-lightbox-body-effect-fade`);\n\n // Add content\n ui.process($content, $link);\n\n // Nav\n if ($link.data('lightbox-gallery')) {\n const $galleryItems = $(\n `[data-lightbox-gallery=\"${$link.data(\n 'lightbox-gallery',\n )}\"]`,\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', (e) => {\n e.preventDefault();\n const index = $galleryItems.index(currentLink);\n let $currentLink = $galleryItems.eq(index - 1);\n if (!$currentLink.length)\n $currentLink = $galleryItems.last();\n $this.process($content, $currentLink);\n });\n\n // Next\n $('.meta-lightbox-next')\n .off('click')\n .on('click', (e) => {\n e.preventDefault();\n const index = $galleryItems.index(currentLink);\n $currentLink = $galleryItems.eq(index + 1);\n if (!$currentLink.length)\n $currentLink = $galleryItems.first();\n $this.process($content, $currentLink);\n });\n }\n\n setTimeout(() => {\n ui.$overlay.addClass('meta-lightbox-open');\n }, 1); // For CSS transitions\n }\n\n static constructLightbox() {\n console.log(`${NAME}: constructLightbox`);\n const ui = this;\n\n const overlay = $('<div>', {\n class:\n\t\t\t\t\t'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade',\n });\n const wrap = $('<div>', {\n class: 'meta-lightbox-wrap',\n });\n const content = $('<div>', {\n class: 'meta-lightbox-content',\n });\n const nav = $(\n '<a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-prev\"><i class=\"fas fa fa-chevron-left\"></i> <span class=\"sr-only\">Previous</span></a><a href=\"#\" class=\"meta-lightbox-nav meta-lightbox-next\"><i class=\"fa fas fa-chevron-right\"></i> <span class=\"sr-only\">Next</span></a>',\n );\n const close = $(\n '<a href=\"#\" class=\"meta-lightbox-close fas fa fa-times\" title=\"Close\"><span class=\"sr-only\">Close</span></a>',\n );\n const title = $('<div>', {\n class: 'meta-lightbox-title-wrap',\n });\n\n if (ui.$overlay) return ui.$overlay;\n\n if (ui.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 overlay.on('click', (e) => {\n e.preventDefault();\n ui.hide();\n });\n\n close.on('click', (e) => {\n e.preventDefault();\n ui.hide();\n });\n\n ui.$overlay = overlay;\n ui.$content = content;\n ui.$title = title;\n\n return ui.$overlay;\n }\n\n static setTitle(str) {\n const ui = this;\n\n ui.$title.html(str);\n }\n\n static process($content, $link) {\n console.log(`${NAME}: process`);\n const ui = this;\n\n const href = $link.attr('href').length\n ? $link.attr('href')\n : $link.data('href');\n if (!href.length) {\n console.log($link);\n console.error(`${NAME}: href(attr/data) is missing`);\n }\n\n const $pageSpinner = $('#PageLoading');\n const loadingContent = $pageSpinner.length\n ? $pageSpinner.html()\n : '';\n ui.$content.html(loadingContent).addClass('meta-lightbox-loading');\n\n // Image\n if (href.match(/\\.(jpeg|jpg|gif|png|svg)$/i)) {\n const img = $('<img>', {\n src: href,\n });\n\n img.on('load', () => {\n const wrap = $('<div class=\"meta-lightbox-image\"></div>'),\n imgwrapper = $(\n '<span class=\"meta-lightbox-zoom-wrapper\"></span>',\n );\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\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 ui.$content.html(wrap);\n ui.contentLoaded();\n });\n\n img.on('error', () => {\n const wrap = $(\n `<div class=\"meta-lightbox-error\"><p class=\"alert alert-error alert-danger\">${$this.options.errorMessage}</p></div>`,\n );\n\n ui.$content.html(wrap);\n ui.contentLoaded();\n });\n\n // Set the title\n const title = $link.data('title')\n ? $link.data('title')\n : $link.attr('title');\n ui.setTitle(title);\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 href.match(\n /(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/,\n )\n ) {\n const video = href.match(\n /(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/,\n );\n let classTerm = 'meta-lightbox-video';\n let src;\n\n if (video[1] == 'youtube') {\n src = `https://www.youtube.com/embed/${video[4]}`;\n classTerm = `${classTerm} meta-lightbox-youtube`;\n }\n if (video[1] == 'youtu') {\n src = `https://www.youtube.com/embed/${video[3]}`;\n classTerm = `${classTerm} meta-lightbox-youtube`;\n }\n if (video[1] == 'youtube-nocookie') {\n src = `https://www.youtube-nocookie.com/embed/${video[4]}`;\n classTerm = `${classTerm} meta-lightbox-youtube`;\n }\n if (video[1] == 'vimeo') {\n src = `https://player.vimeo.com/video/${video[3]}`;\n classTerm = `${classTerm} meta-lightbox-vimeo`;\n }\n\n if (src) {\n const $iframe = $('<iframe>', {\n src,\n class: classTerm,\n frameborder: 0,\n vspace: 0,\n hspace: 0,\n scrolling: 'auto',\n });\n\n $Body.append(\n '<div id=\"IFramePreload\" class=\"hidden d-none iframe-preload\" style=\"display:none\"></div>',\n );\n const $preload = $('#IFramePreload');\n $preload.html($iframe);\n\n $iframe.on('load', () => {\n console.log(`${NAME}: the iframe was loaded`);\n $preload.html('');\n $preload.remove();\n\n ui.$content.html($iframe);\n ui.contentLoaded();\n });\n }\n\n // Set the title\n const title = $link.data('title')\n ? $link.data('title')\n : $link.attr('title');\n ui.setTitle(title);\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 ui.$content.html(wrap);\n ui.contentLoaded();\n } else {\n wrap = $(\n `<div class=\"meta-lightbox-error\"><p>${$this.options.errorMessage}</p></div>`,\n );\n ui.$content.html(wrap);\n ui.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 ui.$content.html(wrap);\n ui.contentLoaded();\n\n // google analytics\n if (typeof ga === 'function') {\n ga(\n 'send',\n 'event',\n 'error',\n 'AJAX ERROR',\n jqXHR.statusText,\n );\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\t\t\t\t\t\t\t\t\ttypeof dataJson['regions']['LayoutAjax'] !==\n\t\t\t\t\t\t\t\t\t\t'undefinded'\n ) {\n var wrap = $(\n '<div class=\"meta-lightbox-ajax\" />',\n );\n wrap.html(\n dataJson['regions']['LayoutAjax'],\n );\n content\n .html(wrap)\n .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\t\t\t\t\t\t\t\t\ttitle.length &&\n\t\t\t\t\t\t\t\t\tlink &&\n\t\t\t\t\t\t\t\t\tlink.length &&\n\t\t\t\t\t\t\t\t\tlink !== window.location.href &&\n\t\t\t\t\t\t\t\t\tlink.substring(0, link.indexOf('#')) !==\n\t\t\t\t\t\t\t\t\t\twindow.location.href.replace(\n\t\t\t\t\t\t\t\t\t\t $('base').attr('href'),\n\t\t\t\t\t\t\t\t\t\t '/',\n\t\t\t\t\t\t\t\t\t\t)\n ) {\n $('.meta-lightbox-ajax').data(\n 'curr-title',\n document.title,\n );\n $('.meta-lightbox-ajax').data(\n 'curr-link',\n window.location.href,\n );\n\n if (\n typeof window.localStorage !==\n\t\t\t\t\t\t\t\t\t\t\t'undefined' &&\n\t\t\t\t\t\t\t\t\t\tlink !== '/'\n ) {\n window.localStorage.setItem(\n 'current-page',\n link,\n );\n }\n\n if (\n document.URL !== link &&\n\t\t\t\t\t\t\t\t\t\tdocument.URL !==\n\t\t\t\t\t\t\t\t\t\t\t$('base').attr('href') + link &&\n\t\t\t\t\t\t\t\t\t\tdocument.URL !==\n\t\t\t\t\t\t\t\t\t\t\t`${$('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(\n $('base').attr('href'),\n '',\n ),\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\n .html(wrap)\n .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': `${-(\n wrap.outerHeight() / 2\n )}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 ui.contentLoaded();\n },\n });\n }\n }\n\n static contentLoaded() {\n const ui = this;\n\n ui.$content.removeClass('meta-lightbox-loading');\n setTimeout(() => {\n $(W).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 static hide(callback) {\n const ui = this;\n\n const $overlay = ui.$overlay;\n\n var title = $('.meta-lightbox-ajax').data('curr-title'),\n link = $('.meta-lightbox-ajax').data('curr-link');\n if (title && link) {\n if (\n typeof window.localStorage !== 'undefined' &&\n\t\t\t\t\tlink !== '/'\n ) {\n window.localStorage.setItem('current-page', link);\n }\n\n if (\n document.URL !== link &&\n\t\t\t\t\tdocument.URL !== $('base').attr('href') + link &&\n\t\t\t\t\tdocument.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('meta-lightbox-body-effect-fade');\n $('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger(\n 'zoom.destroy',\n );\n\n // For IE\n if (ui.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 }\n\n $(W).on(`${Events.AJAX} ${Events.LOADED}`, () => {\n MetaLightboxUI.init();\n });\n\n W.MetaLightboxUI = MetaLightboxUI;\n\n return MetaLightboxUI;\n})($);\n\nexport default MetaLightboxUI;\n","module.exports = jQuery;"],"sourceRoot":""}
|
34
package.json
Executable file → Normal file
34
package.json
Executable file → Normal file
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@a2nt/meta-lightbox",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"description": "Universal Lightbox window",
|
||||
"main": "meta-lightbox.js",
|
||||
"author": "Tony Air <tony@twma.pro>",
|
||||
@ -47,33 +47,33 @@
|
||||
"jquery-hoverintent": "*",
|
||||
"jquery-zoom": "^1.7.21",
|
||||
"jquery.appear": "^1.0.1",
|
||||
"mapbox-gl": "^1.10.0",
|
||||
"mapbox-gl": "^1.11.0",
|
||||
"material-design-color": "^2.3.2",
|
||||
"popper.js": "*",
|
||||
"select2": "^4.0.8",
|
||||
"select2": "^4.0.13",
|
||||
"smooth-scroll": "^14.2.1",
|
||||
"sticky-sidebar": "^3.3.1",
|
||||
"yarn": "^1.22.4"
|
||||
},
|
||||
"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": "^7.9.4",
|
||||
"@babel/preset-env": "^7.9.6",
|
||||
"@babel/core": "^7.10.2",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.10.1",
|
||||
"@babel/plugin-transform-react-jsx": "^7.10.1",
|
||||
"@babel/preset-env": "^7.10.2",
|
||||
"@google/markerclusterer": "^1.0.3",
|
||||
"animate.css": "^3.7.0",
|
||||
"animate.css": "^3.7.2",
|
||||
"ansi-html": "^0.0.7",
|
||||
"ansi-regex": "^5.0.0",
|
||||
"autoprefixer": "^9.7.4",
|
||||
"autoprefixer": "^9.8.0",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"babel-loader": "^8.1.0",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"croppie": "^2.6.4",
|
||||
"croppie": "^2.6.5",
|
||||
"cross-env": "^5.2.1",
|
||||
"css-loader": "^3.5.3",
|
||||
"eslint": "^4.18.1",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"css-loader": "^3.6.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-import": "^2.21.2",
|
||||
"eslint-plugin-jquery": "^1.5.1",
|
||||
"eslint-plugin-react": "^7.20.0",
|
||||
"exports-loader": "^0.7.0",
|
||||
@ -104,13 +104,13 @@
|
||||
"script-ext-html-webpack-plugin": "^2.1.4",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"style-loader": "^0.19.0",
|
||||
"style-loader": "^0.19.1",
|
||||
"svg-url-loader": "^2.3.3",
|
||||
"terser-webpack-plugin": "^2.3.6",
|
||||
"terser-webpack-plugin": "^2.3.7",
|
||||
"url-loader": "^0.6.2",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-server": "^3.10.3",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-server": "^3.11.0",
|
||||
"webpack-manifest-plugin": "^1.3.2",
|
||||
"webpack-merge": "^4.2.2"
|
||||
},
|
||||
|
@ -7,7 +7,7 @@
|
||||
// optional:
|
||||
//=require ../../bower_components/jquery-zoom/jquery.zoom.js
|
||||
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
import $ from 'jquery';
|
||||
|
||||
@ -26,22 +26,28 @@ const MetaLightboxUI = (($) => {
|
||||
|
||||
const ui = this;
|
||||
ui.isMSIE = /*@cc_on!@*/ 0;
|
||||
ui.isHidpi = ui.isHidpi();
|
||||
try {
|
||||
ui.isHidpi = ui.is_hdpi();
|
||||
} catch (e) {
|
||||
console.log(ui);
|
||||
}
|
||||
|
||||
$(`.js${NAME},[data-toggle="lightbox"],[data-lightbox-gallery]`).on(
|
||||
'click',
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const $link = $(e.currentTarget);
|
||||
|
||||
$(`.js${NAME},[data-toggle="lightbox"],[data-lightbox-gallery]`).on('click', (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const $link = $(e.currentTarget);
|
||||
|
||||
ui.show($link);
|
||||
});
|
||||
ui.show($link);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static isHidpi() {
|
||||
static is_hdpi() {
|
||||
console.log(`${NAME}: isHidpi`);
|
||||
const mediaQuery =
|
||||
'(-webkit-min-device-pixel-ratio: 1.5),\
|
||||
'(-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)';
|
||||
@ -66,7 +72,11 @@ const MetaLightboxUI = (($) => {
|
||||
|
||||
// Nav
|
||||
if ($link.data('lightbox-gallery')) {
|
||||
const $galleryItems = $(`[data-lightbox-gallery="${$link.data('lightbox-gallery')}"]`);
|
||||
const $galleryItems = $(
|
||||
`[data-lightbox-gallery="${$link.data(
|
||||
'lightbox-gallery',
|
||||
)}"]`,
|
||||
);
|
||||
|
||||
if ($galleryItems.length === 1) {
|
||||
$('.meta-lightbox-nav').hide();
|
||||
@ -81,7 +91,8 @@ const MetaLightboxUI = (($) => {
|
||||
e.preventDefault();
|
||||
const index = $galleryItems.index(currentLink);
|
||||
let $currentLink = $galleryItems.eq(index - 1);
|
||||
if (!$currentLink.length) $currentLink = $galleryItems.last();
|
||||
if (!$currentLink.length)
|
||||
$currentLink = $galleryItems.last();
|
||||
$this.process($content, $currentLink);
|
||||
});
|
||||
|
||||
@ -92,7 +103,8 @@ const MetaLightboxUI = (($) => {
|
||||
e.preventDefault();
|
||||
const index = $galleryItems.index(currentLink);
|
||||
$currentLink = $galleryItems.eq(index + 1);
|
||||
if (!$currentLink.length) $currentLink = $galleryItems.first();
|
||||
if (!$currentLink.length)
|
||||
$currentLink = $galleryItems.first();
|
||||
$this.process($content, $currentLink);
|
||||
});
|
||||
}
|
||||
@ -107,7 +119,8 @@ const MetaLightboxUI = (($) => {
|
||||
const ui = this;
|
||||
|
||||
const overlay = $('<div>', {
|
||||
class: 'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade',
|
||||
class:
|
||||
'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade',
|
||||
});
|
||||
const wrap = $('<div>', {
|
||||
class: 'meta-lightbox-wrap',
|
||||
@ -163,14 +176,18 @@ const MetaLightboxUI = (($) => {
|
||||
console.log(`${NAME}: process`);
|
||||
const ui = this;
|
||||
|
||||
const href = $link.attr('href').length ? $link.attr('href') : $link.data('href');
|
||||
const href = $link.attr('href').length
|
||||
? $link.attr('href')
|
||||
: $link.data('href');
|
||||
if (!href.length) {
|
||||
console.log($link);
|
||||
console.error(`${NAME }: href(attr/data) is missing`);
|
||||
console.error(`${NAME}: href(attr/data) is missing`);
|
||||
}
|
||||
|
||||
const $pageSpinner = $('#PageLoading');
|
||||
const loadingContent = $pageSpinner.length ? $pageSpinner.html() : '';
|
||||
const loadingContent = $pageSpinner.length
|
||||
? $pageSpinner.html()
|
||||
: '';
|
||||
ui.$content.html(loadingContent).addClass('meta-lightbox-loading');
|
||||
|
||||
// Image
|
||||
@ -181,7 +198,9 @@ const MetaLightboxUI = (($) => {
|
||||
|
||||
img.on('load', () => {
|
||||
const wrap = $('<div class="meta-lightbox-image"></div>'),
|
||||
imgwrapper = $('<span class="meta-lightbox-zoom-wrapper"></span>');
|
||||
imgwrapper = $(
|
||||
'<span class="meta-lightbox-zoom-wrapper"></span>',
|
||||
);
|
||||
|
||||
imgwrapper.append(img);
|
||||
wrap.append(imgwrapper);
|
||||
@ -217,7 +236,9 @@ const MetaLightboxUI = (($) => {
|
||||
});
|
||||
|
||||
// Set the title
|
||||
const title = $link.data('title') ? $link.data('title') : $link.attr('title');
|
||||
const title = $link.data('title')
|
||||
? $link.data('title')
|
||||
: $link.attr('title');
|
||||
ui.setTitle(title);
|
||||
|
||||
// google analytics
|
||||
@ -226,18 +247,24 @@ const MetaLightboxUI = (($) => {
|
||||
}
|
||||
}
|
||||
// Video (Youtube/Vimeo)
|
||||
else if (href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/)) {
|
||||
const video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
|
||||
else if (
|
||||
href.match(
|
||||
/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/,
|
||||
)
|
||||
) {
|
||||
const video = href.match(
|
||||
/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/,
|
||||
);
|
||||
let classTerm = 'meta-lightbox-video';
|
||||
let src;
|
||||
|
||||
if (video[1] == 'youtube') {
|
||||
src = `https://www.youtube.com/embed/${video[4]}`;
|
||||
classTerm = `${classTerm } meta-lightbox-youtube`;
|
||||
classTerm = `${classTerm} meta-lightbox-youtube`;
|
||||
}
|
||||
if (video[1] == 'youtu') {
|
||||
src = `https://www.youtube.com/embed/${video[3]}`;
|
||||
classTerm = `${classTerm } meta-lightbox-youtube`;
|
||||
classTerm = `${classTerm} meta-lightbox-youtube`;
|
||||
}
|
||||
if (video[1] == 'youtube-nocookie') {
|
||||
src = `https://www.youtube-nocookie.com/embed/${video[4]}`;
|
||||
@ -245,7 +272,7 @@ const MetaLightboxUI = (($) => {
|
||||
}
|
||||
if (video[1] == 'vimeo') {
|
||||
src = `https://player.vimeo.com/video/${video[3]}`;
|
||||
classTerm = `${classTerm } meta-lightbox-vimeo`;
|
||||
classTerm = `${classTerm} meta-lightbox-vimeo`;
|
||||
}
|
||||
|
||||
if (src) {
|
||||
@ -258,7 +285,9 @@ const MetaLightboxUI = (($) => {
|
||||
scrolling: 'auto',
|
||||
});
|
||||
|
||||
$Body.append('<div id="IFramePreload" class="hidden d-none iframe-preload" style="display:none"></div>');
|
||||
$Body.append(
|
||||
'<div id="IFramePreload" class="hidden d-none iframe-preload" style="display:none"></div>',
|
||||
);
|
||||
const $preload = $('#IFramePreload');
|
||||
$preload.html($iframe);
|
||||
|
||||
@ -273,7 +302,9 @@ const MetaLightboxUI = (($) => {
|
||||
}
|
||||
|
||||
// Set the title
|
||||
const title = $link.data('title') ? $link.data('title') : $link.attr('title');
|
||||
const title = $link.data('title')
|
||||
? $link.data('title')
|
||||
: $link.attr('title');
|
||||
ui.setTitle(title);
|
||||
|
||||
// google analytics
|
||||
@ -352,7 +383,13 @@ const MetaLightboxUI = (($) => {
|
||||
|
||||
// google analytics
|
||||
if (typeof ga === 'function') {
|
||||
ga('send', 'event', 'error', 'AJAX ERROR', jqXHR.statusText);
|
||||
ga(
|
||||
'send',
|
||||
'event',
|
||||
'error',
|
||||
'AJAX ERROR',
|
||||
jqXHR.statusText,
|
||||
);
|
||||
}
|
||||
},
|
||||
success: function (data, status, jqXHR) {
|
||||
@ -362,11 +399,18 @@ const MetaLightboxUI = (($) => {
|
||||
// Replace regions
|
||||
if (
|
||||
typeof dataJson['regions'] === 'object' &&
|
||||
typeof dataJson['regions']['LayoutAjax'] !== 'undefinded'
|
||||
typeof dataJson['regions']['LayoutAjax'] !==
|
||||
'undefinded'
|
||||
) {
|
||||
var wrap = $('<div class="meta-lightbox-ajax" />');
|
||||
wrap.html(dataJson['regions']['LayoutAjax']);
|
||||
content.html(wrap).removeClass('meta-lightbox-loading');
|
||||
var wrap = $(
|
||||
'<div class="meta-lightbox-ajax" />',
|
||||
);
|
||||
wrap.html(
|
||||
dataJson['regions']['LayoutAjax'],
|
||||
);
|
||||
content
|
||||
.html(wrap)
|
||||
.removeClass('meta-lightbox-loading');
|
||||
}
|
||||
|
||||
// trigger events
|
||||
@ -381,30 +425,42 @@ const MetaLightboxUI = (($) => {
|
||||
|
||||
if (
|
||||
title &&
|
||||
title.length &&
|
||||
link &&
|
||||
link.length &&
|
||||
link !== window.location.href &&
|
||||
link.substring(0, link.indexOf('#')) !==
|
||||
window.location.href.replace($('base').attr('href'), '/')
|
||||
title.length &&
|
||||
link &&
|
||||
link.length &&
|
||||
link !== window.location.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-title',
|
||||
document.title,
|
||||
);
|
||||
$('.meta-lightbox-ajax').data(
|
||||
'curr-link',
|
||||
window.location.href,
|
||||
);
|
||||
|
||||
if (
|
||||
typeof window.localStorage !== 'undefined' &&
|
||||
link !== '/'
|
||||
typeof window.localStorage !==
|
||||
'undefined' &&
|
||||
link !== '/'
|
||||
) {
|
||||
window.localStorage.setItem('current-page', 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 &&
|
||||
document.URL !==
|
||||
`${$('base').attr('href')}/${link}`
|
||||
) {
|
||||
window.history.pushState(
|
||||
{
|
||||
@ -429,7 +485,10 @@ const MetaLightboxUI = (($) => {
|
||||
// google analytics
|
||||
if (typeof ga === 'function') {
|
||||
ga('set', {
|
||||
page: link.replace($('base').attr('href'), ''),
|
||||
page: link.replace(
|
||||
$('base').attr('href'),
|
||||
'',
|
||||
),
|
||||
title,
|
||||
});
|
||||
ga('send', 'pageview');
|
||||
@ -439,7 +498,9 @@ const MetaLightboxUI = (($) => {
|
||||
} catch (e) {
|
||||
var wrap = $('<div class="meta-lightbox-ajax" />');
|
||||
wrap.append(data);
|
||||
content.html(wrap).removeClass('meta-lightbox-loading');
|
||||
content
|
||||
.html(wrap)
|
||||
.removeClass('meta-lightbox-loading');
|
||||
}
|
||||
|
||||
// Vertically center html
|
||||
@ -455,7 +516,9 @@ const MetaLightboxUI = (($) => {
|
||||
wrap.css({
|
||||
position: 'relative',
|
||||
top: '50%',
|
||||
'margin-top': `${-(wrap.outerHeight() / 2)}px`,
|
||||
'margin-top': `${-(
|
||||
wrap.outerHeight() / 2
|
||||
)}px`,
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -474,7 +537,7 @@ const MetaLightboxUI = (($) => {
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static contentLoaded() {
|
||||
const ui = this;
|
||||
@ -487,7 +550,7 @@ const MetaLightboxUI = (($) => {
|
||||
setTimeout(() => {
|
||||
$Body.addClass('meta-lightbox-body-effect-fade');
|
||||
}, 600);
|
||||
};
|
||||
}
|
||||
|
||||
static hide(callback) {
|
||||
const ui = this;
|
||||
@ -497,14 +560,17 @@ const MetaLightboxUI = (($) => {
|
||||
var title = $('.meta-lightbox-ajax').data('curr-title'),
|
||||
link = $('.meta-lightbox-ajax').data('curr-link');
|
||||
if (title && link) {
|
||||
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 &&
|
||||
document.URL !== `${$('base').attr('href')}/${link}`
|
||||
) {
|
||||
window.history.replaceState(
|
||||
{
|
||||
@ -528,7 +594,9 @@ const MetaLightboxUI = (($) => {
|
||||
$overlay.removeClass('meta-lightbox-open');
|
||||
$('.meta-lightbox-nav').hide();
|
||||
$Body.removeClass('meta-lightbox-body-effect-fade');
|
||||
$('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger('zoom.destroy');
|
||||
$('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger(
|
||||
'zoom.destroy',
|
||||
);
|
||||
|
||||
// For IE
|
||||
if (ui.isMSIE) {
|
||||
|
Loading…
Reference in New Issue
Block a user