Minor improvements

This commit is contained in:
Tony Air 2021-01-25 18:15:33 +07:00
parent eca61af77e
commit 9f37ee2b73
14 changed files with 646 additions and 143 deletions

245
dist/css/app.css vendored
View File

@ -1 +1,244 @@
.meta-lightbox-overlay{position:fixed;top:0;left:0;z-index:99998;width:100%;height:100%;overflow:hidden;visibility:hidden;opacity:0;box-sizing:border-box}.meta-lightbox-overlay.meta-lightbox-open{visibility:visible;opacity:1}.meta-lightbox-wrap{position:absolute;top:10%;bottom:10%;left:10%;right:10%}.meta-lightbox-content,.meta-lightbox-wrap{display:flex;align-items:center;text-align:center;justify-content:center}.meta-lightbox-content{flex-direction:row;color:#fff;width:100%;height:100%}.meta-lightbox-content .meta-lightbox-ajax{color:#212529}.meta-lightbox-content .meta-lightbox-zoom-wrapper{display:block;height:100%;width:100%}.meta-lightbox-content .meta-lightbox-zoom-wrapper:after{color:#fff;font:normal normal normal 14px/1 FontAwesome;content:"\f00e";position:absolute;bottom:1em;right:1em;text-shadow:1px 1px 1px #000}.meta-lightbox-content .meta-lightbox-zoom-wrapper.no-zoom:after{display:none}.meta-lightbox-title-wrap{position:absolute;bottom:0;left:0;width:100%;z-index:99999;text-align:center}.meta-lightbox-nav{display:none}.meta-lightbox-prev{position:absolute;top:50%;left:0}.meta-lightbox-next{position:absolute;top:50%;right:0}.meta-lightbox-close{position:absolute;top:2%;right:2%;line-height:1em}.meta-lightbox-image{text-align:center}.meta-lightbox-image img{max-width:100%;max-height:100%;width:auto;height:auto;vertical-align:middle}.meta-lightbox-content iframe{width:100%;height:100%}.meta-lightbox-ajax,.meta-lightbox-inline{max-height:100%;overflow:auto}.meta-lightbox-error{display:flex;flex-direction:column;justify-content:center;text-align:center;width:100%;height:100%;color:#fff;text-shadow:0 1px 1px #000}.meta-lightbox-error .alert{margin:0;text-shadow:none}.meta-lightbox-error p{display:table-cell;vertical-align:middle}.meta-lightbox-notouch .meta-lightbox-effect-fade,.meta-lightbox-notouch .meta-lightbox-effect-fadeScale,.meta-lightbox-notouch .meta-lightbox-effect-fall,.meta-lightbox-notouch .meta-lightbox-effect-slideDown,.meta-lightbox-notouch .meta-lightbox-effect-slideLeft,.meta-lightbox-notouch .meta-lightbox-effect-slideRight,.meta-lightbox-notouch .meta-lightbox-effect-slideUp{transition:all .2s ease-in-out}.meta-lightbox-effect-fadeScale .meta-lightbox-wrap{transition:all .3s;transform:scale(.7)}.meta-lightbox-effect-fadeScale.meta-lightbox-open .meta-lightbox-wrap{transform:scale(1)}.meta-lightbox-effect-slideDown .meta-lightbox-wrap,.meta-lightbox-effect-slideLeft .meta-lightbox-wrap,.meta-lightbox-effect-slideRight .meta-lightbox-wrap,.meta-lightbox-effect-slideUp .meta-lightbox-wrap{transition:all .3s cubic-bezier(.25,.5,.5,.9)}.meta-lightbox-effect-slideLeft .meta-lightbox-wrap{transform:translateX(-10%)}.meta-lightbox-effect-slideRight .meta-lightbox-wrap{transform:translateX(10%)}.meta-lightbox-effect-slideLeft.meta-lightbox-open .meta-lightbox-wrap,.meta-lightbox-effect-slideRight.meta-lightbox-open .meta-lightbox-wrap{transform:translateX(0)}.meta-lightbox-effect-slideDown .meta-lightbox-wrap{transform:translateY(-10%)}.meta-lightbox-effect-slideUp .meta-lightbox-wrap{transform:translateY(10%)}.meta-lightbox-effect-slideDown.meta-lightbox-open .meta-lightbox-wrap,.meta-lightbox-effect-slideUp.meta-lightbox-open .meta-lightbox-wrap{transform:translateY(0)}.meta-lightbox-body-effect-fall .meta-lightbox-effect-fall{perspective:1000px}.meta-lightbox-effect-fall .meta-lightbox-wrap{transition:all .3s ease-out;transform:translateZ(300px)}.meta-lightbox-effect-fall.meta-lightbox-open .meta-lightbox-wrap{transform:translateZ(0)}.meta-lightbox-theme-default.meta-lightbox-overlay{background:#666;background:rgba(0,0,0,.6)}.meta-lightbox-theme-default .meta-lightbox-nav{top:10%;width:20%;height:80%;background-repeat:no-repeat;background-position:50% 50%;opacity:.5;color:#fff;font-size:3em;text-decoration:none;text-shadow:1px 1px 0 #000}@media (min-width:576px){.meta-lightbox-theme-default .meta-lightbox-nav{width:8%}}.meta-lightbox-theme-default .meta-lightbox-nav .fa{position:absolute;top:50%;left:50%;margin-top:-1em;margin-left:-.2em}.meta-lightbox-theme-default .meta-lightbox-nav:hover{color:#007bff;opacity:1;background-color:rgba(0,0,0,.5)}.meta-lightbox-theme-default .meta-lightbox-close{display:block;opacity:.5;color:#fff;text-decoration:none;font-size:2em;text-shadow:1px 1px 0 #000;text-align:center;width:1.2em;height:1.2em;line-height:1.2em}.meta-lightbox-theme-default .meta-lightbox-close:focus{color:#007bff;opacity:1;background-color:rgba(0,0,0,.5)}.meta-lightbox-theme-default .meta-lightbox-title{background:#000;color:#fff;padding:7px 15px}.meta-lightbox-theme-default .meta-lightbox-ajax,.meta-lightbox-theme-default .meta-lightbox-inline{color:#000;background:#fff;padding:2em;box-shadow:0 1px 1px rgba(0,0,0,.6)}@media (max-width:576px){.meta-lightbox-wrap{top:5px!important;bottom:5px;left:5px;right:5px}.meta-lightbox-theme-default .meta-lightbox-nav{height:100%;opacity:1;font-size:2em}.meta-lightbox-theme-default .meta-lightbox-nav .fa{margin-left:-.4em}.meta-lightbox-theme-default .meta-lightbox-close{opacity:1}}
.meta-lightbox-overlay {
position: fixed;
top: 0;
left: 0;
z-index: 99998;
width: 100%;
height: 100%;
overflow: hidden;
visibility: hidden;
opacity: 0;
box-sizing: border-box; }
.meta-lightbox-overlay.meta-lightbox-open {
visibility: visible;
opacity: 1; }
.meta-lightbox-wrap {
position: absolute;
top: 10%;
bottom: 10%;
left: 10%;
right: 10%;
display: flex;
align-items: center;
text-align: center;
justify-content: center; }
.meta-lightbox-content {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
flex-direction: row;
color: #fff;
width: 100%;
height: 100%; }
.meta-lightbox-content .meta-lightbox-ajax {
color: #212529; }
.meta-lightbox-content .meta-lightbox-zoom-wrapper {
display: block;
height: 100%;
width: 100%; }
.meta-lightbox-content .meta-lightbox-zoom-wrapper:after {
color: #fff;
font: normal normal normal 14px/1 FontAwesome;
content: '\f00e';
position: absolute;
right: 1em;
bottom: 1em;
right: 1em;
text-shadow: 1px 1px 1px #000; }
.meta-lightbox-content .meta-lightbox-zoom-wrapper.no-zoom:after {
display: none; }
.meta-lightbox-title-wrap {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
z-index: 99999;
text-align: center; }
.meta-lightbox-nav {
display: none; }
.meta-lightbox-prev {
position: absolute;
top: 50%;
left: 0; }
.meta-lightbox-next {
position: absolute;
top: 50%;
right: 0; }
.meta-lightbox-close {
position: absolute;
top: 2%;
right: 2%;
line-height: 1em; }
.meta-lightbox-image {
text-align: center; }
.meta-lightbox-image img {
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
vertical-align: middle; }
.meta-lightbox-content iframe {
width: 100%;
height: 100%; }
.meta-lightbox-inline,
.meta-lightbox-ajax {
max-height: 100%;
overflow: auto; }
.meta-lightbox-error {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
width: 100%;
height: 100%;
color: #fff;
text-shadow: 0 1px 1px #000; }
.meta-lightbox-error .alert {
margin: 0;
text-shadow: none; }
.meta-lightbox-error p {
display: table-cell;
vertical-align: middle; }
/* Effects
**********************************************/
.meta-lightbox-notouch .meta-lightbox-effect-fade,
.meta-lightbox-notouch .meta-lightbox-effect-fadeScale,
.meta-lightbox-notouch .meta-lightbox-effect-slideLeft,
.meta-lightbox-notouch .meta-lightbox-effect-slideRight,
.meta-lightbox-notouch .meta-lightbox-effect-slideUp,
.meta-lightbox-notouch .meta-lightbox-effect-slideDown,
.meta-lightbox-notouch .meta-lightbox-effect-fall {
transition: all 0.2s ease-in-out; }
/* fadeScale */
.meta-lightbox-effect-fadeScale .meta-lightbox-wrap {
transition: all 0.3s;
transform: scale(0.7); }
.meta-lightbox-effect-fadeScale.meta-lightbox-open .meta-lightbox-wrap {
transform: scale(1); }
/* slideLeft / slideRight / slideUp / slideDown */
.meta-lightbox-effect-slideLeft .meta-lightbox-wrap,
.meta-lightbox-effect-slideRight .meta-lightbox-wrap,
.meta-lightbox-effect-slideUp .meta-lightbox-wrap,
.meta-lightbox-effect-slideDown .meta-lightbox-wrap {
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); }
.meta-lightbox-effect-slideLeft .meta-lightbox-wrap {
transform: translateX(-10%); }
.meta-lightbox-effect-slideRight .meta-lightbox-wrap {
transform: translateX(10%); }
.meta-lightbox-effect-slideLeft.meta-lightbox-open .meta-lightbox-wrap,
.meta-lightbox-effect-slideRight.meta-lightbox-open .meta-lightbox-wrap {
transform: translateX(0); }
.meta-lightbox-effect-slideDown .meta-lightbox-wrap {
transform: translateY(-10%); }
.meta-lightbox-effect-slideUp .meta-lightbox-wrap {
transform: translateY(10%); }
.meta-lightbox-effect-slideUp.meta-lightbox-open .meta-lightbox-wrap,
.meta-lightbox-effect-slideDown.meta-lightbox-open .meta-lightbox-wrap {
transform: translateY(0); }
/* fall */
.meta-lightbox-body-effect-fall .meta-lightbox-effect-fall {
perspective: 1000px; }
.meta-lightbox-effect-fall .meta-lightbox-wrap {
transition: all 0.3s ease-out;
transform: translateZ(300px); }
.meta-lightbox-effect-fall.meta-lightbox-open .meta-lightbox-wrap {
transform: translateZ(0); }
.meta-lightbox-theme-default.meta-lightbox-overlay {
background: #666;
background: rgba(0, 0, 0, 0.6); }
.meta-lightbox-theme-default .meta-lightbox-nav {
top: 10%;
width: 20%;
height: 80%;
background-repeat: no-repeat;
background-position: 50% 50%;
opacity: 0.5;
color: #fff;
font-size: 3em;
text-decoration: none;
text-shadow: 1px 1px 0 #000; }
@media (min-width: 576px) {
.meta-lightbox-theme-default .meta-lightbox-nav {
width: 8%; } }
.meta-lightbox-theme-default .meta-lightbox-nav .fa {
position: absolute;
top: 50%;
left: 50%;
margin-top: -1em;
margin-left: -0.2em; }
.meta-lightbox-theme-default .meta-lightbox-nav:hover {
color: #007bff;
opacity: 1;
background-color: rgba(0, 0, 0, 0.5); }
.meta-lightbox-theme-default .meta-lightbox-close {
display: block;
opacity: 0.5;
color: #fff;
text-decoration: none;
font-size: 2em;
text-shadow: 1px 1px 0 #000;
text-align: center;
width: 1.2em;
height: 1.2em;
line-height: 1.2em; }
.meta-lightbox-theme-default .meta-lightbox-close:focus {
color: #007bff;
opacity: 1;
background-color: rgba(0, 0, 0, 0.5); }
.meta-lightbox-theme-default .meta-lightbox-title {
background: #000;
color: #fff;
padding: 7px 15px; }
.meta-lightbox-theme-default .meta-lightbox-ajax,
.meta-lightbox-theme-default .meta-lightbox-inline {
color: #000;
background: #fff;
padding: 2em;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.6); }
@media (max-width: 576px) {
.meta-lightbox-wrap {
top: 5px !important;
bottom: 5px;
left: 5px;
right: 5px; }
.meta-lightbox-theme-default .meta-lightbox-nav {
height: 100%;
opacity: 1;
font-size: 2em; }
.meta-lightbox-theme-default .meta-lightbox-nav .fa {
margin-left: -0.4em; }
.meta-lightbox-theme-default .meta-lightbox-close {
opacity: 1; } }

65
dist/index.html vendored
View File

@ -1,3 +1,64 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="description" content=""><meta name="author" content=""><link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"/><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.0/css/all.css"/><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script><title>Meta-lightbox Demo</title><style>.wrapper {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="description" content="Meta Lightbox" />
<meta name="author" content="Tony Air" />
<title>Meta-lightbox Demo</title>
<style>
.wrapper {
padding: 2rem;
}</style><link href="css/app.css" rel="stylesheet"></head><body><div class="wrapper"><h1>Meta-lightbox Demo</h1><p><a href="../src/img/photo1.png" data-toggle="lightbox" data-lightbox-gallery="demo" data-title="That's first link">Click me to start</a></p><p><a href="../src/img/photo2.jpg" data-toggle="lightbox" data-lightbox-gallery="demo">Use data-toggle="lightbox" attribute to attach lightbox action and href to specify URL.</a></p><p><a href="../src/img/photo1.png" data-toggle="lightbox" data-lightbox-gallery="demo" data-title="Use data-title attribute to specify lightbox title">Use data-lightbox-gallery="YOUR_GALLERY_NAME" to group ligthboxes and use next/prev arrows</a></p><p data-toggle="lightbox" data-href="https://youtu.be/GgnClrx8N2k" data-lightbox-gallery="demo" data-title="Yes you can link vimeo and youtube videos as long as AJAX content">You can use data-href attribute to specify link and attach lightbox to another element</p><p><b>Note:</b> You can add jquery-zoom plugin and lighbox will zoom photos on hover.</p></div><script src="js/app.js"></script></body></html>
}
</style>
<link href="css/app.css" rel="stylesheet"></head>
<body>
<div class="wrapper">
<h1>Meta-lightbox Demo</h1>
NODE_ENV: development <p>
<a
href="../src/img/photo1.png"
data-toggle="lightbox"
data-lightbox-gallery="demo"
data-title="That's first link"
>Click me to start</a>
</p>
<p>
<a href="../src/img/photo2.jpg" data-toggle="lightbox" data-lightbox-gallery="demo">
Use data-toggle="lightbox" attribute to attach lightbox action and href to specify URL.
</a>
</p>
<p>
<a href="../src/img/photo1.png" data-toggle="lightbox" data-lightbox-gallery="demo" data-title="Use data-title attribute to specify lightbox title">
Use data-lightbox-gallery="YOUR_GALLERY_NAME" to group ligthboxes and use next/prev arrows
</a>
</p>
<p data-toggle="lightbox" data-href="https://youtu.be/GgnClrx8N2k" data-lightbox-gallery="demo" data-title="Yes you can link vimeo and youtube videos as long as AJAX content">
You can use data-href attribute to specify link and attach lightbox to another element
</p>
<p>
<b>Note:</b> You can add jquery-zoom plugin and lighbox will
zoom photos on hover.
</p>
<div id="App"></div>
</div>
<!-- That's optional dependencies -->
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.12.0/css/all.css"
/>
<!-- React is required -->
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script><script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<!-- jQuery is required -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="js/app.js"></script></body>
</html>

97
dist/js/app.js vendored
View File

@ -1,2 +1,95 @@
/*! For license information please see app.js.LICENSE.txt */
!function(){"use strict";var t={n:function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,{a:o}),o},d:function(e,o){for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e=jQuery,o="ajax-load",a="back-online",n="load";function _typeof(t){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperties(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)}}!function($){var t=window,e=$(t),i=document,c=$("body"),l="MetaLightboxUI",r='<div class="meta-lightbox-error"><div class="alert alert-error alert-danger">Connection failure.</div></div>',s=function(){function MetaLightboxUI(){!function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,MetaLightboxUI)}return function _createClass(t,e,o){return e&&_defineProperties(t.prototype,e),o&&_defineProperties(t,o),t}(MetaLightboxUI,null,[{key:"init",value:function init(){console.log("".concat(l,": init ..."));var t=this;t.isMSIE=0;try{t.isHidpi=t.is_hdpi()}catch(e){console.log("".concat(l,": catch"))}$(".js".concat(l,',[data-toggle="lightbox"],[data-lightbox-gallery]')).on("click",(function(e){e.preventDefault(),e.stopPropagation();var o=$(e.currentTarget);t.show(o)})),$(".js".concat(l,"-close-inline")).on("click",(function(t){$(t.currentTarget).parents(".meta-lightbox-overlay").removeClass("meta-lightbox-open")}))}},{key:"is_hdpi",value:function is_hdpi(){console.log("".concat(l,": isHidpi"));return t.devicePixelRatio>1||t.matchMedia&&t.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 show(t){console.log("".concat(l,": show"));var e=this;if(e.constructLightbox()){var o=e.$content;if(o){if(c.addClass("meta-lightbox-body-effect-fade"),e.process(o,t),t.data("lightbox-gallery")){var a=$('[data-lightbox-gallery="'.concat(t.data("lightbox-gallery"),'"]'));1===a.length?$(".meta-lightbox-nav").hide():$(".meta-lightbox-nav").show(),$(".meta-lightbox-prev").off("click").on("click",(function(o){o.preventDefault();var n=a.index(t),i=a.eq(n-1);i.length||(i=a.last()),setTimeout((function(){e.show(i)}),10)})),$(".meta-lightbox-next").off("click").on("click",(function(o){o.preventDefault();var n=a.index(t),i=a.eq(n+1);i.length||(i=a.first()),setTimeout((function(){e.show(i)}),10)}))}setTimeout((function(){e.$overlay.addClass("meta-lightbox-open")}),1)}}}},{key:"constructLightbox",value:function constructLightbox(){console.log("".concat(l,": constructLightbox"));var t=this,e=$("<div>",{class:"meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade"}),o=$("<div>",{class:"meta-lightbox-wrap"}),a=$("<div>",{class:"meta-lightbox-content"}),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>'),i=$('<a href="#" class="meta-lightbox-close fas fa fa-times" title="Close"><span class="sr-only">Close</span></a>'),r=$("<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),c.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 setTitle(t){this.$title.html(t)}},{key:"process",value:function process(o,a){console.log("".concat(l,": process"));var n=this,c=a.attr("href")&&a.attr("href").length?a.attr("href"):a.data("href");n.$content.attr("class","meta-lightbox-content"),n.$content.addClass(a.data("lightbox-class")),c.length||(console.log(a),console.error("".concat(l,": href(attr/data) is missing")));var s=$("#PageLoading .loading-spinner"),f=s.length?s.clone():"";if(n.$content.append(f).addClass("meta-lightbox-loading"),c.match(/\.(jpeg|jpg|gif|png|svg)$/i)||"image"===a.data("force")){$.ajax({url:c,success:function success(){var t=$("<img>",{src:c}),a=$('<div class="meta-lightbox-image"></div>'),i=$('<span class="meta-lightbox-zoom-wrapper"></span>');i.append(t),a.append(i),a.css({"line-height":"".concat(o.height(),"px"),height:"".concat(o.height(),"px")}),e.resize((function(){a.css({"line-height":"".concat(o.height(),"px"),height:"".concat(o.height(),"px")})})),"undefined"!==typeof i.zoom?i.zoom():i.addClass("no-zoom"),n.$content.html(a),n.contentLoaded()},error:function error(t,e){var o=$(r);n.$content.html(o),n.contentLoaded()}});var d=a.data("title")?a.data("title"):a.attr("title");n.setTitle(d),"function"===typeof ga&&ga("send","event","meta","Image Click",c)}else if(c.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/)||"youtube"===a.data("force")||"vimeo"===a.data("force")){var h,g=c.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/),u="meta-lightbox-video";if("youtube"==g[1]&&(h="https://www.youtube.com/embed/".concat(g[4]),u="".concat(u," meta-lightbox-youtube")),"youtu"==g[1]&&(h="https://www.youtube.com/embed/".concat(g[3]),u="".concat(u," meta-lightbox-youtube")),"youtube-nocookie"==g[1]&&(h="https://www.youtube-nocookie.com/embed/".concat(g[4]),u="".concat(u," meta-lightbox-youtube")),"vimeo"==g[1]&&(h="https://player.vimeo.com/video/".concat(g[3]),u="".concat(u," meta-lightbox-vimeo")),!h)return console.warn("".concat(l,": Video loading bad URL")),!1;if(!n.loadIframe(h,u))return a.addClass("meta-offline"),!1;a.removeClass("meta-offline");var m=a.data("title")?a.data("title"):a.attr("title");n.setTitle(m),"function"===typeof ga&&ga("send","event","meta","Video Click",g)}else if("#"==c.substring(0,1)||"inline"===a.data("force"))$(c).length?(wrap=$('<div class="meta-lightbox-inline" />'),wrap.append($(c).clone().show()),wrap.outerHeight()<n.$content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")}),e.resize((function(){wrap.outerHeight()<n.$content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")})})),n.$content.html(wrap),n.contentLoaded()):(wrap=$(r),n.$content.html(wrap),n.contentLoaded()),$(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","inline HTML click",c);else{if(a.data("force-iframe")||"iframe"===a.data("force"))return console.log("".concat(l,": IFrame forced")),n.loadIframe(c,"meta-lightbox-iframe-content")?(a.removeClass("meta-offline"),!0):(a.addClass("meta-offline"),!1);console.log("".concat(l,": loading AJAX")),$.ajax({sync:!1,async:!0,url:c,dataType:"html",method:"GET",cache:!1,statusCode:{404:function _(){console.log("".concat(l,": page not found")),t.location.href=url},302:function _(){console.log("".concat(l,": redirect 302")),t.location.href=url}},error:function error(t,e){console.log("".concat(l,": AJAX request failure.").concat(t.statusText));var o=$(r);n.$content.html(o),n.contentLoaded(),"function"===typeof ga&&ga("send","event","error","AJAX ERROR",t.statusText)},success:function success(e,o,a){console.log("".concat(l,": AJAX success"));try{var c=$.parseJSON(e);if("object"===_typeof(c)){if(console.log("".concat(l,": AJAX JSON")),"object"===_typeof(c.regions)&&"undefinded"!==typeof c.regions.LayoutAjax){var r=$('<div class="meta-lightbox-ajax" />');r.html(c.regions.LayoutAjax),n.$content.html(r),n.contentLoaded()}var s=a.getResponseHeader("X-Title"),f=a.getResponseHeader("X-Link");s&&s.length&&f&&f.length&&f!==t.location.href&&f.substring(0,f.indexOf("#"))!==t.location.href.replace($("base").attr("href"),"/")&&($(".meta-lightbox-ajax").data("curr-title",i.title),$(".meta-lightbox-ajax").data("curr-link",t.location.href),"undefined"!==typeof t.localStorage&&"/"!==f&&t.localStorage.setItem("current-page",f),i.URL!==f&&i.URL!==$("base").attr("href")+f&&i.URL!=="".concat($("base").attr("href"),"/").concat(f)&&t.history.pushState({title:s,page:f,ajax:"true"},s,f),$(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&(ga("set",{page:f.replace($("base").attr("href"),""),title:s}),ga("send","pageview")))}}catch(h){console.log("".concat(l,": AJAX HTML"));var d=$('<div class="meta-lightbox-ajax" />');d.append(e),n.$content.html(d),n.contentLoaded()}n.contentLoaded()}})}}},{key:"loadIframe",value:function loadIframe(t,e){var o=this,a=$("<iframe>",{src:t,class:e,frameborder:0,vspace:0,hspace:0,scrolling:"auto",allowtransparency:"true"});return console.log("".concat(l,": loading iframe")),c.append('<div id="MetaIFramePreload" class="hidden d-none iframe-preload" style="display:none"></div>'),$("#MetaIFramePreload").html(a),a.on("load",(function(){if(c.hasClass("is-offline"))return console.warn("".concat(l,": Unable to load iframe offline")),!1;o.finishIFrameLoading()})),a}},{key:"finishIFrameLoading",value:function finishIFrameLoading(){var t=this,e=$("#MetaIFramePreload");if(!e.length)return console.warn("".concat(l,": iframe preload not found")),!1;var o=e.find("iframe");if(!o.length)return console.warn("".concat(l,": iframe preload > iframe not found")),!1;console.log("".concat(l,": the iframe was loaded")),e.html(""),e.remove(),t.$content.addClass("iframe-delay"),t.$content.html(o),t.contentLoaded(),setTimeout((function(){t.$content.removeClass("iframe-delay")}),1e3)}},{key:"contentLoaded",value:function contentLoaded(){var t=this;t.$content.removeClass("meta-lightbox-loading"),$(".meta-lightbox-content .js".concat(l,',.meta-lightbox-content [data-toggle="lightbox"],.meta-lightbox-content [data-lightbox-gallery]')).on("click",(function(e){e.preventDefault(),e.stopPropagation();var o=$(e.currentTarget);t.show(o)})),$(".js".concat(l,"-close")).on("click",(function(e){e.preventDefault(),t.hide()})),setTimeout((function(){e.trigger("meta-lightbox-loaded")}),1),setTimeout((function(){c.addClass("meta-lightbox-body-effect-fade")}),600)}},{key:"hide",value:function hide(e){var o=this.$overlay,a=$(".meta-lightbox-ajax").data("curr-title"),n=$(".meta-lightbox-ajax").data("curr-link");a&&n&&("undefined"!==typeof t.localStorage&&"/"!==n&&t.localStorage.setItem("current-page",n),i.URL!==n&&i.URL!==$("base").attr("href")+n&&i.URL!=="".concat($("base").attr("href"),"/").concat(n)&&t.history.replaceState({title:a,page:n,ajax:"true"},a,n)),o.removeClass("meta-lightbox-open"),c.removeClass("meta-lightbox-body-effect-fade"),$(".meta-lightbox-content .meta-lightbox-zoom-wrapper").trigger("zoom.destroy"),this.isMSIE&&(o.find("iframe").attr("src"," "),o.find("iframe").remove()),$(".meta-lightbox-prev").off("click"),$(".meta-lightbox-next").off("click"),$(".meta-lightbox-content").empty(),c.removeClass("meta-lightbox-body-effect-fade")}}]),MetaLightboxUI}();e.on("MetaLightboxUI.init ".concat(o," ").concat(n),(function(){s.init()})),e.on("".concat(a),(function(){$(".meta-offline").removeClass("meta-offline"),console.log("".concat(l,": reloading iframe")),s.finishIFrameLoading();var t=$(".meta-lightbox-content iframe");t.length&&t.attr("src",t.attr("src"))})),t.MetaLightboxUI=s}(t.n(e)())}();
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/js/app.js":
/*!***********************************!*\
!*** ./src/js/app.js + 4 modules ***!
\***********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
eval("// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n;// CONCATENATED MODULE: ./src/scss/app.scss\n// extracted by mini-css-extract-plugin\n\n;// CONCATENATED MODULE: external \"jQuery\"\nvar external_jQuery_namespaceObject = jQuery;\nvar external_jQuery_default = /*#__PURE__*/__webpack_require__.n(external_jQuery_namespaceObject);\n;// CONCATENATED MODULE: ./src/js/_events.js\n/**\n * Add your global events here\n */\n/* harmony default export */ var _events = ({\n AJAX: 'ajax-load',\n AJAXMAIN: 'ajax-main-load',\n MAININIT: 'main-init',\n TABHIDDEN: 'tab-hidden',\n TABFOCUSED: 'tab-focused',\n OFFLINE: 'offline',\n ONLINE: 'online',\n BACKONLINE: 'back-online',\n TOUCHENABLE: 'touch-enabled',\n TOUCHDISABLED: 'touch-disabled',\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;// CONCATENATED MODULE: ./src/js/meta-lightbox.js\n/*\n * MetaLightbox\n * https://tony.twma.pro\n *\n */\n// optional:\n//=require ../../bower_components/jquery-zoom/jquery.zoom.js\n\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\n\nvar MetaLightboxUI = function ($) {\n var W = window;\n var $W = $(W);\n var D = document;\n var $Body = $('body');\n var NAME = 'MetaLightboxUI';\n var NETWORK_ERROR = '<div class=\"meta-lightbox-error\"><div class=\"alert alert-error alert-danger\">Connection failure.</div></div>';\n\n var MetaLightboxUI = /*#__PURE__*/function () {\n function MetaLightboxUI() {\n _classCallCheck(this, MetaLightboxUI);\n }\n\n _createClass(MetaLightboxUI, null, [{\n key: \"init\",\n value: function init() {\n console.log(\"\".concat(NAME, \": init ...\"));\n var ui = this;\n ui.isMSIE =\n /*@cc_on!@*/\n 0;\n\n try {\n ui.isHidpi = ui.is_hdpi();\n } catch (e) {\n console.log(\"\".concat(NAME, \": catch\"));\n }\n\n $(\".js\".concat(NAME, \",[data-toggle=\\\"lightbox\\\"],[data-lightbox-gallery]\")).on('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var $link = $(e.currentTarget);\n ui.show($link);\n });\n $(\".js\".concat(NAME, \"-close-inline\")).on('click', function (e) {\n var $el = $(e.currentTarget);\n $el.parents('.meta-lightbox-overlay').removeClass('meta-lightbox-open');\n });\n }\n }, {\n key: \"is_hdpi\",\n value: function is_hdpi() {\n console.log(\"\".concat(NAME, \": isHidpi\"));\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 (W.devicePixelRatio > 1) return true;\n return W.matchMedia && W.matchMedia(mediaQuery).matches;\n }\n }, {\n key: \"show\",\n value: function show($link) {\n console.log(\"\".concat(NAME, \": show\"));\n var ui = this;\n var $lightbox = ui.constructLightbox();\n if (!$lightbox) return;\n var $content = ui.$content;\n if (!$content) return;\n $Body.addClass(\"meta-lightbox-body-effect-fade\"); // Add content\n\n ui.process($content, $link); // Nav\n\n if ($link.data('lightbox-gallery')) {\n var $galleryItems = $(\"[data-lightbox-gallery=\\\"\".concat($link.data('lightbox-gallery'), \"\\\"]\"));\n\n if ($galleryItems.length === 1) {\n $('.meta-lightbox-nav').hide();\n } else {\n $('.meta-lightbox-nav').show();\n } // Prev\n\n\n $('.meta-lightbox-prev').off('click').on('click', function (e) {\n e.preventDefault();\n var index = $galleryItems.index($link);\n var $currentLink = $galleryItems.eq(index - 1);\n if (!$currentLink.length) $currentLink = $galleryItems.last(); //ui.hide();\n\n setTimeout(function () {\n ui.show($currentLink);\n }, 10);\n }); // Next\n\n $('.meta-lightbox-next').off('click').on('click', function (e) {\n e.preventDefault();\n var index = $galleryItems.index($link);\n var $currentLink = $galleryItems.eq(index + 1);\n if (!$currentLink.length) $currentLink = $galleryItems.first(); //ui.hide();\n\n setTimeout(function () {\n ui.show($currentLink);\n }, 10);\n });\n }\n\n setTimeout(function () {\n ui.$overlay.addClass('meta-lightbox-open');\n }, 1); // For CSS transitions\n }\n }, {\n key: \"constructLightbox\",\n value: function constructLightbox() {\n console.log(\"\".concat(NAME, \": constructLightbox\"));\n var ui = this;\n var overlay = $('<div>', {\n class: 'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade'\n });\n var wrap = $('<div>', {\n class: 'meta-lightbox-wrap'\n });\n var content = $('<div>', {\n class: 'meta-lightbox-content'\n });\n var nav = $('<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 var close = $('<a href=\"#\" class=\"meta-lightbox-close fas fa fa-times\" title=\"Close\"><span class=\"sr-only\">Close</span></a>');\n var title = $('<div>', {\n class: 'meta-lightbox-title-wrap'\n });\n if (ui.$overlay) return ui.$overlay;\n if (ui.isMSIE) overlay.addClass('meta-lightbox-ie');\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 overlay.on('click', function (e) {\n e.preventDefault();\n ui.hide();\n });\n close.on('click', function (e) {\n e.preventDefault();\n ui.hide();\n });\n ui.$overlay = overlay;\n ui.$content = content;\n ui.$title = title;\n return ui.$overlay;\n }\n }, {\n key: \"setTitle\",\n value: function setTitle(str) {\n var ui = this;\n ui.$title.html(str);\n }\n }, {\n key: \"process\",\n value: function process($content, $link) {\n console.log(\"\".concat(NAME, \": process\"));\n var ui = this;\n var href = $link.attr('href') && $link.attr('href').length ? $link.attr('href') : $link.data('href'); // add custom link specific class\n\n ui.$content.attr('class', 'meta-lightbox-content');\n ui.$content.addClass($link.data('lightbox-class'));\n\n if (!href.length) {\n console.log($link);\n console.error(\"\".concat(NAME, \": href(attr/data) is missing\"));\n }\n\n var $pageSpinner = $('#PageLoading .loading-spinner');\n var loadingContent = $pageSpinner.length ? $pageSpinner.clone() : '';\n ui.$content.append(loadingContent).addClass('meta-lightbox-loading'); // Image\n\n if (href.match(/\\.(jpeg|jpg|gif|png|svg)$/i) || $link.data('force') === 'image') {\n $.ajax({\n url: href,\n success: function success() {\n var img = $('<img>', {\n src: href\n });\n var wrap = $('<div class=\"meta-lightbox-image\"></div>');\n var imgwrapper = $('<span class=\"meta-lightbox-zoom-wrapper\"></span>');\n imgwrapper.append(img);\n wrap.append(imgwrapper); // Vertically center images\n\n wrap.css({\n 'line-height': \"\".concat($content.height(), \"px\"),\n height: \"\".concat($content.height(), \"px\") // For Firefox\n\n });\n $W.resize(function () {\n wrap.css({\n 'line-height': \"\".concat($content.height(), \"px\"),\n height: \"\".concat($content.height(), \"px\") // For Firefox\n\n });\n });\n\n if (typeof imgwrapper['zoom'] !== 'undefined') {\n imgwrapper.zoom();\n } else {\n imgwrapper.addClass('no-zoom');\n }\n\n ui.$content.html(wrap);\n ui.contentLoaded();\n },\n error: function error(jqXHR, status) {\n var wrap = $(NETWORK_ERROR);\n ui.$content.html(wrap);\n ui.contentLoaded();\n }\n }); // Set the title\n\n var title = $link.data('title') ? $link.data('title') : $link.attr('title');\n ui.setTitle(title); // google analytics\n\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'Image Click', href);\n }\n } // Video (Youtube/Vimeo)\n else if (href.match(/(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/) || $link.data('force') === 'youtube' || $link.data('force') === 'vimeo') {\n var video = href.match(/(youtube|youtube-nocookie|youtu|vimeo)\\.(com|be)\\/(watch\\?v=([\\w-]+)|([\\w-]+))/);\n var classTerm = 'meta-lightbox-video';\n var src;\n\n if (video[1] == 'youtube') {\n src = \"https://www.youtube.com/embed/\".concat(video[4]);\n classTerm = \"\".concat(classTerm, \" meta-lightbox-youtube\");\n }\n\n if (video[1] == 'youtu') {\n src = \"https://www.youtube.com/embed/\".concat(video[3]);\n classTerm = \"\".concat(classTerm, \" meta-lightbox-youtube\");\n }\n\n if (video[1] == 'youtube-nocookie') {\n src = \"https://www.youtube-nocookie.com/embed/\".concat(video[4]);\n classTerm = \"\".concat(classTerm, \" meta-lightbox-youtube\");\n }\n\n if (video[1] == 'vimeo') {\n src = \"https://player.vimeo.com/video/\".concat(video[3]);\n classTerm = \"\".concat(classTerm, \" meta-lightbox-vimeo\");\n }\n\n if (!src) {\n console.warn(\"\".concat(NAME, \": Video loading bad URL\"));\n return false;\n }\n\n var $iframe = ui.loadIframe(src, classTerm);\n\n if (!$iframe) {\n $link.addClass('meta-offline');\n return false;\n }\n\n $link.removeClass('meta-offline'); // Set the title\n\n var _title = $link.data('title') ? $link.data('title') : $link.attr('title');\n\n ui.setTitle(_title); // google analytics\n\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'Video Click', video);\n }\n } // Inline HTML\n else if (href.substring(0, 1) == '#' || $link.data('force') === 'inline') {\n if ($(href).length) {\n wrap = $('<div class=\"meta-lightbox-inline\" />');\n wrap.append($(href).clone().show()); // Vertically center html\n\n if (wrap.outerHeight() < ui.$content.height()) {\n wrap.css({\n position: 'relative',\n top: '50%',\n 'margin-top': \"\".concat(-(wrap.outerHeight() / 2), \"px\")\n });\n }\n\n $W.resize(function () {\n if (wrap.outerHeight() < ui.$content.height()) {\n wrap.css({\n position: 'relative',\n top: '50%',\n 'margin-top': \"\".concat(-(wrap.outerHeight() / 2), \"px\")\n });\n }\n });\n ui.$content.html(wrap);\n ui.contentLoaded();\n } else {\n wrap = $(NETWORK_ERROR);\n ui.$content.html(wrap);\n ui.contentLoaded();\n }\n\n $('.meta-lightbox-title-wrap').html(''); // google analytics\n\n if (typeof ga === 'function') {\n ga('send', 'event', 'meta', 'inline HTML click', href);\n }\n } // AJAX/iFrame (default)\n else {\n if ($link.data('force-iframe') || $link.data('force') === 'iframe') {\n console.log(\"\".concat(NAME, \": IFrame forced\"));\n\n var _$iframe = ui.loadIframe(href, 'meta-lightbox-iframe-content');\n\n if (!_$iframe) {\n $link.addClass('meta-offline');\n return false;\n }\n\n $link.removeClass('meta-offline');\n return true;\n }\n\n console.log(\"\".concat(NAME, \": loading AJAX\"));\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(\"\".concat(NAME, \": page not found\"));\n W.location.href = url;\n },\n 302: function _() {\n console.log(\"\".concat(NAME, \": redirect 302\"));\n W.location.href = url;\n }\n },\n error: function error(jqXHR, status) {\n console.log(\"\".concat(NAME, \": AJAX request failure.\").concat(jqXHR.statusText));\n var wrap = $(NETWORK_ERROR);\n ui.$content.html(wrap);\n ui.contentLoaded(); // google analytics\n\n if (typeof ga === 'function') {\n ga('send', 'event', 'error', 'AJAX ERROR', jqXHR.statusText);\n }\n },\n success: function success(data, status, jqXHR) {\n console.log(\"\".concat(NAME, \": AJAX success\"));\n\n try {\n var dataJson = $.parseJSON(data);\n\n if (_typeof(dataJson) === 'object') {\n console.log(\"\".concat(NAME, \": AJAX JSON\")); // Replace regions\n\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 ui.$content.html(wrap);\n ui.contentLoaded();\n } // trigger events\n\n /*if (typeof (data['events']) === 'object') {\n for (var eventName in data.events) {\n $(D).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 (title && title.length && link && link.length && link !== W.location.href && link.substring(0, link.indexOf('#')) !== W.location.href.replace($('base').attr('href'), '/')) {\n $('.meta-lightbox-ajax').data('curr-title', D.title);\n $('.meta-lightbox-ajax').data('curr-link', W.location.href);\n\n if (typeof W.localStorage !== 'undefined' && link !== '/') {\n W.localStorage.setItem('current-page', link);\n }\n\n if (D.URL !== link && D.URL !== $('base').attr('href') + link && D.URL !== \"\".concat($('base').attr('href'), \"/\").concat(link)) {\n W.history.pushState({\n title: title,\n page: link,\n ajax: 'true'\n }, title, link);\n }\n\n $('.meta-lightbox-title-wrap').html(''); // google analytics\n\n if (typeof ga === 'function') {\n ga('set', {\n page: link.replace($('base').attr('href'), ''),\n title: title\n });\n ga('send', 'pageview');\n }\n }\n }\n } catch (e) {\n console.log(\"\".concat(NAME, \": AJAX HTML\"));\n var $wrap = $('<div class=\"meta-lightbox-ajax\" />');\n $wrap.append(data);\n ui.$content.html($wrap);\n ui.contentLoaded();\n } // Vertically center html\n\n /*if (wrap.outerHeight() < ui.$content.height()) {\n wrap.css({\n position: 'relative',\n top: '50%',\n 'margin-top': `${-(wrap.outerHeight() / 2)}px`,\n });\n }\n $W.resize(() => {\n if (wrap.outerHeight() < ui.$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 $W.resize();\n if (typeof W.imagesLoaded === 'function') {\n W.imagesLoaded().then(() => {\n $W.resize();\n });\n }\n }, 500);*/\n\n\n ui.contentLoaded();\n }\n });\n }\n }\n }, {\n key: \"loadIframe\",\n value: function loadIframe(href, classTerm) {\n var ui = this;\n var $iframe = $('<iframe>', {\n src: href,\n class: classTerm,\n frameborder: 0,\n vspace: 0,\n hspace: 0,\n scrolling: 'auto',\n allowtransparency: 'true'\n });\n console.log(\"\".concat(NAME, \": loading iframe\"));\n $Body.append('<div id=\"MetaIFramePreload\" class=\"hidden d-none iframe-preload\" style=\"display:none\"></div>');\n var $preload = $('#MetaIFramePreload');\n $preload.html($iframe);\n $iframe.on('load', function () {\n // don't load on offline\n if ($Body.hasClass('is-offline')) {\n console.warn(\"\".concat(NAME, \": Unable to load iframe offline\"));\n return false;\n }\n\n ui.finishIFrameLoading();\n });\n return $iframe;\n }\n }, {\n key: \"finishIFrameLoading\",\n value: function finishIFrameLoading() {\n var ui = this;\n var $preload = $('#MetaIFramePreload');\n\n if (!$preload.length) {\n console.warn(\"\".concat(NAME, \": iframe preload not found\"));\n return false;\n }\n\n var $iframe = $preload.find('iframe');\n\n if (!$iframe.length) {\n console.warn(\"\".concat(NAME, \": iframe preload > iframe not found\"));\n return false;\n }\n\n console.log(\"\".concat(NAME, \": the iframe was loaded\"));\n $preload.html('');\n $preload.remove();\n ui.$content.addClass('iframe-delay');\n ui.$content.html($iframe);\n ui.contentLoaded();\n setTimeout(function () {\n ui.$content.removeClass('iframe-delay');\n }, 1000);\n }\n }, {\n key: \"contentLoaded\",\n value: function contentLoaded() {\n var ui = this;\n ui.$content.removeClass('meta-lightbox-loading');\n $(\".meta-lightbox-content .js\".concat(NAME, \",.meta-lightbox-content [data-toggle=\\\"lightbox\\\"],.meta-lightbox-content [data-lightbox-gallery]\")).on('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var $link = $(e.currentTarget);\n ui.show($link);\n });\n $(\".js\".concat(NAME, \"-close\")).on('click', function (e) {\n e.preventDefault();\n ui.hide();\n });\n setTimeout(function () {\n $W.trigger('meta-lightbox-loaded');\n }, 1); // For CSS transitions\n\n setTimeout(function () {\n $Body.addClass('meta-lightbox-body-effect-fade');\n }, 600);\n }\n }, {\n key: \"hide\",\n value: function hide(callback) {\n var ui = this;\n var $overlay = ui.$overlay;\n var title = $('.meta-lightbox-ajax').data('curr-title'),\n link = $('.meta-lightbox-ajax').data('curr-link');\n\n if (title && link) {\n if (typeof W.localStorage !== 'undefined' && link !== '/') {\n W.localStorage.setItem('current-page', link);\n }\n\n if (D.URL !== link && D.URL !== $('base').attr('href') + link && D.URL !== \"\".concat($('base').attr('href'), \"/\").concat(link)) {\n W.history.replaceState({\n title: title,\n page: link,\n ajax: 'true'\n }, title, link);\n }\n }\n\n $overlay.removeClass('meta-lightbox-open');\n $Body.removeClass('meta-lightbox-body-effect-fade');\n $('.meta-lightbox-content .meta-lightbox-zoom-wrapper').trigger('zoom.destroy'); // For IE\n\n if (ui.isMSIE) {\n $overlay.find('iframe').attr('src', ' ');\n $overlay.find('iframe').remove();\n }\n\n $('.meta-lightbox-prev').off('click'); // Remove click handlers\n\n $('.meta-lightbox-next').off('click'); // Empty content (for videos)\n\n $('.meta-lightbox-content').empty();\n $Body.removeClass('meta-lightbox-body-effect-fade');\n }\n }]);\n\n return MetaLightboxUI;\n }();\n\n $W.on(\"MetaLightboxUI.init \".concat(_events.AJAX, \" \").concat(_events.LOADED), function () {\n MetaLightboxUI.init();\n });\n $W.on(\"\".concat(_events.BACKONLINE), function () {\n $('.meta-offline').removeClass('meta-offline');\n console.log(\"\".concat(NAME, \": reloading iframe\"));\n MetaLightboxUI.finishIFrameLoading();\n var $iframe = $('.meta-lightbox-content iframe');\n\n if ($iframe.length) {\n $iframe.attr('src', $iframe.attr('src'));\n }\n });\n W.MetaLightboxUI = MetaLightboxUI;\n return MetaLightboxUI;\n}((external_jQuery_default()));\n\n/* harmony default export */ var meta_lightbox = (MetaLightboxUI);\n;// CONCATENATED MODULE: ./src/js/app.js\n/*\n * MetaLightbox\n * https://tony.twma.pro\n *\n */\n\n\n/*import React from 'react';\nimport ReactDOM from 'react-dom';\nimport MetaWindow from './_window.jsx';\n\nconst M = ReactDOM.render(<MetaWindow />, document.getElementById('App'));\nReactDOM.render(<MetaWindow />, document.getElementById('App'));\n\nsetTimeout(() => {\n M.setContent('<b>ZZZZZZZZZAAAA</b>');\n}, 5000);*/\n\n//# sourceURL=webpack://@a2nt/meta-lightbox/./src/js/app.js_+_4_modules?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/
/************************************************************************/
/******/ // startup
/******/ // Load entry module
/******/ __webpack_require__("./src/js/app.js");
/******/ // This entry module used 'exports' so it can't be inlined
/******/ })()
;

View File

@ -1 +0,0 @@
/*@cc_on!@*/

64
dist/records.json vendored
View File

@ -2,70 +2,36 @@
"HtmlWebpackCompiler": [
{
"chunks": {
"byName": {
"HtmlWebpackPlugin_0": 443
},
"bySource": {
"0 HtmlWebpackPlugin_0": 443
},
"usedIds": [
443
]
"byName": {},
"bySource": {},
"usedIds": []
},
"modules": {
"byIdentifier": {
"./node_modules/.pnpm/html-loader@1.3.2_webpack@5.16.0/node_modules/html-loader/dist/cjs.js!./src/html/meta-lightbox.html": 913,
"./node_modules/.pnpm/html-webpack-plugin@4.5.1_webpack@5.16.0/node_modules/html-webpack-plugin/lib/loader.js!./src/index.html": 864
},
"usedIds": [
864,
913
]
"byIdentifier": {},
"usedIds": []
}
}
],
"chunks": {
"byName": {
"app": 143
},
"bySource": {
"0 app": 143
},
"usedIds": [
143
]
"byName": {},
"bySource": {},
"usedIds": []
},
"mini-css-extract-plugin /mnt/data/srv/dist/repositories/meta-lightbox/node_modules/.pnpm/css-loader@5.0.1_webpack@5.16.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./node_modules/.pnpm/resolve-url-loader@3.1.2/node_modules/resolve-url-loader/index.js!./node_modules/.pnpm/sass-loader@10.1.1_node-sass@5.0.0+webpack@5.16.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[3]!./src/scss/app.scss": [
{
"chunks": {
"byName": {
"mini-css-extract-plugin": 323
},
"bySource": {
"0 mini-css-extract-plugin": 323
},
"usedIds": [
323
]
"byName": {},
"bySource": {},
"usedIds": []
},
"modules": {
"byIdentifier": {
"./node_modules/.pnpm/babel-loader@8.2.2_f0c87bb7cbf8c08531ee428ecaa3548a/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].use!./node_modules/.pnpm/css-loader@5.0.1_webpack@5.16.0/node_modules/css-loader/dist/runtime/api.js": 183,
"./node_modules/.pnpm/css-loader@5.0.1_webpack@5.16.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./node_modules/.pnpm/resolve-url-loader@3.1.2/node_modules/resolve-url-loader/index.js!./node_modules/.pnpm/sass-loader@10.1.1_node-sass@5.0.0+webpack@5.16.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[3]!./src/scss/app.scss": 71
},
"usedIds": [
71,
183
]
"byIdentifier": {},
"usedIds": []
}
}
],
"modules": {
"byIdentifier": {
"./node_modules/.pnpm/babel-loader@8.2.2_f0c87bb7cbf8c08531ee428ecaa3548a/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].use!./src/js/app.js|7ed954facc636132a95507c37bb0d705": 527
},
"usedIds": [
527
]
"byIdentifier": {},
"usedIds": []
}
}

4
dist/report.html vendored
View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>@a2nt/meta-lightbox [20 Jan 2021 at 22:21]</title>
<title>@a2nt/meta-lightbox [25 Jan 2021 at 18:15]</title>
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
<script>
@ -31,7 +31,7 @@
<body>
<div id="app"></div>
<script>
window.chartData = [{"label":"js/app.js","isAsset":true,"statSize":29141,"parsedSize":11659,"gzipSize":3537,"groups":[{"label":"src","path":"./src","statSize":29141,"groups":[{"label":"js","path":"./src/js","statSize":24032,"groups":[{"id":527,"label":"app.js + 3 modules (concatenated)","path":"./src/js/app.js + 3 modules (concatenated)","statSize":24032,"parsedSize":11388,"gzipSize":3440,"concatenated":true,"groups":[{"label":"src/js","path":"./src/js/app.js + 3 modules (concatenated)/src/js","statSize":23990,"groups":[{"id":null,"label":"app.js","path":"./src/js/app.js + 3 modules (concatenated)/src/js/app.js","statSize":103,"parsedSize":48,"gzipSize":14,"inaccurateSizes":true},{"id":null,"label":"meta-lightbox.js","path":"./src/js/app.js + 3 modules (concatenated)/src/js/meta-lightbox.js","statSize":22555,"parsedSize":10688,"gzipSize":3228,"inaccurateSizes":true},{"id":null,"label":"_events.js","path":"./src/js/app.js + 3 modules (concatenated)/src/js/_events.js","statSize":1332,"parsedSize":631,"gzipSize":190,"inaccurateSizes":true}],"parsedSize":11368,"gzipSize":3433,"inaccurateSizes":true}]}],"parsedSize":11388,"gzipSize":3440},{"label":"scss","path":"./src/scss","statSize":5109,"groups":[{"id":null,"label":"app.scss","path":"./src/scss/app.scss","statSize":5109}],"parsedSize":0,"gzipSize":0}],"parsedSize":11388,"gzipSize":3440}]}];
window.chartData = [{"label":"js/app.js","isAsset":true,"statSize":30622,"parsedSize":29648,"gzipSize":6829,"groups":[{"label":"src","path":"./src","statSize":30622,"groups":[{"label":"js","path":"./src/js","statSize":24398,"groups":[{"id":"./src/js/app.js","label":"app.js + 4 modules (concatenated)","path":"./src/js/app.js + 4 modules (concatenated)","statSize":24398,"parsedSize":25873,"gzipSize":5806,"concatenated":true,"groups":[{"label":"src","path":"./src/js/app.js + 4 modules (concatenated)/src","statSize":24356,"groups":[{"label":"js","path":"./src/js/app.js + 4 modules (concatenated)/src/js","statSize":24306,"groups":[{"id":null,"label":"app.js","path":"./src/js/app.js + 4 modules (concatenated)/src/js/app.js","statSize":419,"parsedSize":444,"gzipSize":99,"inaccurateSizes":true},{"id":null,"label":"meta-lightbox.js","path":"./src/js/app.js + 4 modules (concatenated)/src/js/meta-lightbox.js","statSize":22555,"parsedSize":23918,"gzipSize":5367,"inaccurateSizes":true},{"id":null,"label":"_events.js","path":"./src/js/app.js + 4 modules (concatenated)/src/js/_events.js","statSize":1332,"parsedSize":1412,"gzipSize":316,"inaccurateSizes":true}],"parsedSize":25775,"gzipSize":5784,"inaccurateSizes":true},{"label":"scss","path":"./src/js/app.js + 4 modules (concatenated)/src/scss","statSize":50,"groups":[{"id":null,"label":"app.scss","path":"./src/js/app.js + 4 modules (concatenated)/src/scss/app.scss","statSize":50,"parsedSize":53,"gzipSize":11,"inaccurateSizes":true}],"parsedSize":53,"gzipSize":11,"inaccurateSizes":true}],"parsedSize":25828,"gzipSize":5796,"inaccurateSizes":true}]}],"parsedSize":25873,"gzipSize":5806},{"label":"scss","path":"./src/scss","statSize":6224,"groups":[{"id":null,"label":"app.scss","path":"./src/scss/app.scss","statSize":6224}],"parsedSize":0,"gzipSize":0}],"parsedSize":25873,"gzipSize":5806}]}];
window.defaultSizes = "parsed";
</script>
</body>

View File

@ -1,6 +1,6 @@
{
"name": "@a2nt/meta-lightbox",
"version": "2.7.3",
"version": "2.8.5",
"description": "Universal Lightbox window",
"main": "src/js/app.js",
"author": "Tony Air <tony@twma.pro>",
@ -11,11 +11,12 @@
},
"private": false,
"engines": {
"yarn": ">= 1.0.0"
"node": ">= 12",
"yarn": ">= 1.22.0"
},
"scripts": {
"start": "cross-env NODE_ENV=development webpack-dev-server --https",
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server",
"start": "cross-env NODE_ENV=development webpack-dev-server --https --config webpack.config.serve.js",
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.serve.js",
"build": "cross-env NODE_ENV=production webpack --progress --stats-all",
"lint:check": "eslint ./src --config .eslintrc && sass-lint ./src --config .sasslintrc -v -q",
"lint:fix": "eslint ./src --config .eslintrc --fix && sass-lint ./src --config .sasslintrc -v -q --fix",
@ -28,12 +29,14 @@
"postuninstall": "npm run prunecaches",
"preinstall": "npx only-allow pnpm"
},
"browser": "./src/js/app.js",
"browserslist": [
"defaults",
"ie>=11"
],
"dependencies": {
"aos": "^2.3.4",
"bindings": "^1.5.0",
"bootbox": "^5.5.2",
"bootstrap": "^4.6.0",
"bootstrap-confirmation2": "^4.2.0",
@ -41,7 +44,9 @@
"bootstrap-offcanvas": "^1.0.0",
"bootstrap-table": "^1.18.1",
"bootstrap-timepicker": "^0.5.2",
"events": "^3.2.0",
"font-awesome": "^4.7.0",
"fsevents": "^2.3.1",
"hammerjs": "^2.0.8",
"inputmask": "^5.0.5",
"jquery": "^3.5.1",
@ -57,16 +62,21 @@
"moment": "^2.29.1",
"offcanvas-bootstrap": "^2.5.2",
"popper.js": "*",
"punycode": "^2.1.1",
"querystring": "^0.2.0",
"select2": "^4.0.13",
"setimmediate": "^1.0.5",
"smooth-scroll": "^16.1.3",
"sticky-sidebar": "^3.3.1",
"tablednd": "^1.0.5",
"url": "^0.11.0",
"watchpack-chokidar2": "^2.0.1",
"yarn": "^1.22.10"
},
"devDependencies": {
"@a2nt/image-sprite-webpack-plugin": "^0.2.5",
"@babel/core": "^7.12.10",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-transform-react-jsx": "^7.12.12",
"@babel/preset-env": "^7.12.11",
@ -93,8 +103,10 @@
"file-loader": "^6.2.0",
"font-awesome": "^4.7.0",
"hoist-non-react-statics": "^3.3.2",
"html-dom-parser": "^1.0.0",
"html-entities": "^1.4.0",
"html-loader": "^1.3.2",
"html-react-parser": "^1.2.1",
"html-webpack-plugin": "^4.5.1",
"image-minimizer-webpack-plugin": "^2.2.0",
"imagemin-jpegtran": "^7.0.0",

View File

@ -2,14 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<!-- That's optional dependencies -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.0/css/all.css" />
<!-- jQuery is required -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="description" content="Meta Lightbox" />
<meta name="author" content="Tony Air" />
<title>Meta-lightbox Demo</title>
<style>
.wrapper {
@ -20,8 +18,28 @@
<body>
<div class="wrapper">
<h1>Meta-lightbox Demo</h1>
<%= require('html-loader!./html/meta-lightbox.html') %>
<p><b>Note:</b> You can add jquery-zoom plugin and lighbox will zoom photos on hover.</p>
NODE_ENV: <%= NODE_ENV %> <%=
require('html-loader!./html/meta-lightbox.html') %>
<p>
<b>Note:</b> You can add jquery-zoom plugin and lighbox will
zoom photos on hover.
</p>
<div id="App"></div>
</div>
<!-- That's optional dependencies -->
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.12.0/css/all.css"
/>
<!-- React is required -->
<%= REACT_SCRIPTS %>
<!-- jQuery is required -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</body>
</html>
</html>

60
src/js/_window.jsx Executable file
View File

@ -0,0 +1,60 @@
/*
* Lightbox window
*/
import { Component } from 'react';
import '../scss/app.scss';
class MetaWindow extends Component {
state = {
content: '',
shown: false,
};
constructor(props) {
super(props);
console.log(`${this.constructor.name}: init`);
}
setContent = (html) => {
console.log(`${this.constructor.name}: setContent`);
this.setState({ content: html });
this.show();
};
show = () => {
this.setState({ shown: true });
};
hide = () => {
this.setState({ shown: false });
};
getHtml = () => {
return { __html: this.state.content };
};
render() {
const className =
'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade ' +
(this.state.shown ? 'meta-lightbox-open' : '');
return (
<div className={className}>
<div
className="meta-lightbox-close fas fa fa-times a"
onClick={this.hide}
>
<span className="sr-only">Close</span>
</div>
<div className="meta-lightbox-content">
<div
className="meta-lightbox-wrap"
dangerouslySetInnerHTML={this.getHtml()}
></div>
</div>
</div>
);
}
}
export default MetaWindow;

View File

@ -6,3 +6,14 @@
import '../scss/app.scss';
import './meta-lightbox';
/*import React from 'react';
import ReactDOM from 'react-dom';
import MetaWindow from './_window.jsx';
const M = ReactDOM.render(<MetaWindow />, document.getElementById('App'));
ReactDOM.render(<MetaWindow />, document.getElementById('App'));
setTimeout(() => {
M.setContent('<b>ZZZZZZZZZAAAA</b>');
}, 5000);*/

View File

@ -22,7 +22,7 @@ const modules = [
];
const _addAppFiles = (theme) => {
const dirPath = path.resolve(__dirname, theme);
const dirPath = './' + theme;
let themeName = path.basename(theme);
if (themeName == '.') {
themeName = 'app';
@ -100,6 +100,8 @@ module.exports = {
entry: includes,
externals: {
jquery: 'jQuery',
react: 'React',
'react-dom': 'ReactDOM',
},
resolve: {
modules: modules,
@ -108,6 +110,8 @@ module.exports = {
$: require.resolve('jquery'),
jquery: require.resolve('jquery'),
jQuery: require.resolve('jquery'),
react: require.resolve('react'),
'react-dom': require.resolve('react-dom'),
},
},
};

View File

@ -1,8 +1,6 @@
/*
* Production assets generation
*/
const COMPRESS = true;
const webpack = require('webpack');
const commonVariables = require('./webpack.configuration');
const conf = commonVariables.configuration;
@ -24,12 +22,20 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const UIInfo = require('./package.json');
const UIVERSION = JSON.stringify(UIInfo.version);
const NODE_ENV = conf.NODE_ENV || process.env.NODE_ENV;
const COMPRESS = NODE_ENV === 'production' ? true : false;
console.log('NODE_ENV: ' + NODE_ENV);
console.log('COMPRESS: ' + COMPRESS);
console.log('WebP images: ' + conf['webp']);
let plugins = [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
react: 'React',
'react-dom': 'ReactDOM',
Popper: ['popper.js', 'default'],
Util: 'exports-loader?Util!bootstrap/js/dist/util',
Alert: 'exports-loader?Alert!bootstrap/js/dist/alert',
@ -45,83 +51,100 @@ let plugins = [
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
NODE_ENV: JSON.stringify(NODE_ENV),
},
UINAME: JSON.stringify(UIInfo.name),
UIVERSION: UIVERSION,
UIAUTHOR: JSON.stringify(UIInfo.author),
}),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,
minimize: COMPRESS,
debug: !COMPRESS,
}),
new MiniCssExtractPlugin({
filename: 'css/[name].css',
//allChunks: true,
}),
new OptimizeCssAssetsPlugin({
//assetNameRegExp: /\.optimize\.css$/g,
cssProcessor: require('cssnano'),
cssProcessorPluginOptions: {
preset: ['default'],
},
cssProcessorOptions: {
zindex: true,
cssDeclarationSorter: true,
reduceIdents: false,
mergeIdents: true,
mergeRules: true,
mergeLonghand: true,
discardUnused: true,
discardOverridden: true,
discardDuplicates: true,
discardComments: {
removeAll: true,
},
},
canPrint: true,
}),
require('autoprefixer'),
new ImageminPlugin({
minimizerOptions: {
// Lossless optimization with custom option
// Feel free to experiment with options for better result for you
plugins: [
['gifsicle', { interlaced: true }],
['jpegtran', { progressive: true }],
['optipng', { optimizationLevel: 5 }],
[
'svgo',
{
plugins: [
{
removeViewBox: false,
},
],
},
],
],
},
}),
new ImageSpritePlugin({
exclude: /exclude|original|default-|icons|sprite|svg|logo|favicon/,
commentOrigin: false,
compress: COMPRESS,
extensions: ['png'],
indent: '',
log: true,
//outputPath: path.join(__dirname, conf.APPDIR, conf.DIST),
outputFilename: 'img/sprite-[hash].png',
padding: 0,
}),
];
if (COMPRESS) {
plugins.push(
new OptimizeCssAssetsPlugin({
//assetNameRegExp: /\.optimize\.css$/g,
cssProcessor: require('cssnano'),
cssProcessorPluginOptions: {
preset: ['default'],
},
cssProcessorOptions: {
zindex: true,
cssDeclarationSorter: true,
reduceIdents: false,
mergeIdents: true,
mergeRules: true,
mergeLonghand: true,
discardUnused: true,
discardOverridden: true,
discardDuplicates: true,
discardComments: {
removeAll: true,
},
},
canPrint: true,
}),
);
plugins.push(require('autoprefixer'));
plugins.push(
new ImageminPlugin({
minimizerOptions: {
// Lossless optimization with custom option
// Feel free to experiment with options for better result for you
plugins: [
['gifsicle', { interlaced: true }],
['jpegtran', { progressive: true }],
['optipng', { optimizationLevel: 5 }],
[
'svgo',
{
plugins: [
{
removeViewBox: false,
},
],
},
],
],
},
}),
);
plugins.push(
new ImageSpritePlugin({
exclude: /exclude|original|default-|icons|sprite|svg|logo|favicon/,
commentOrigin: false,
compress: COMPRESS,
extensions: ['png'],
indent: '',
log: true,
//outputPath: path.join(__dirname, conf.APPDIR, conf.DIST),
outputFilename: 'img/sprite-[hash].png',
padding: 0,
}),
);
}
const indexPath = path.join(__dirname, conf.APPDIR, conf.SRC, 'index.html');
if (filesystem.existsSync(indexPath)) {
plugins.push(
new HtmlWebpackPlugin({
publicPath: '',
template: path.join(conf.APPDIR, conf.SRC, 'index.html'),
templateParameters: {
NODE_ENV: NODE_ENV,
REACT_SCRIPTS:
NODE_ENV === 'production'
? '<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script><script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>'
: '<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script><script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>',
},
}),
);
}
@ -198,11 +221,12 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
}),
);
const cfg = merge(common, {
mode: 'production',
mode: NODE_ENV,
cache: {
type: 'filesystem',
},
@ -274,7 +298,15 @@ const cfg = merge(common, {
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'], //Preset used for env setup
presets: [
'@babel/preset-env',
'@babel/react',
{
plugins: [
'@babel/plugin-proposal-class-properties',
],
},
], //Preset used for env setup
plugins: [['@babel/transform-react-jsx']],
cacheDirectory: true,
cacheCompression: true,

View File

@ -17,8 +17,7 @@ const conf = commonVariables.configuration;
const IP = process.env.IP || conf.HOSTNAME;
const PORT = process.env.PORT || conf.PORT;
const UIInfo = require('./node_modules/@a2nt/ss-bootstrap-ui-webpack-boilerplate/package.json');
const UIMetaInfo = require('./node_modules/@a2nt/meta-lightbox/package.json');
const UIInfo = require('./package.json');
const config = merge(common, {
mode: 'development',
@ -26,7 +25,7 @@ const config = merge(common, {
entry: {
hot: [
'react-hot-loader/patch',
'webpack-dev-server/client?https://' + conf.HOSTNAME + ':' + conf.PORT,
'webpack-dev-server/?https://' + conf.HOSTNAME + ':' + conf.PORT,
'webpack/hot/only-dev-server',
],
},
@ -46,10 +45,16 @@ const config = merge(common, {
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'], //Preset used for env setup
presets: [
'@babel/preset-env',
'@babel/react',
{
plugins: ['@babel/plugin-proposal-class-properties'],
},
], //Preset used for env setup
plugins: [['@babel/transform-react-jsx']],
cacheDirectory: true,
cacheCompression: false,
cacheCompression: true,
},
},
},
@ -122,8 +127,6 @@ const config = merge(common, {
UINAME: JSON.stringify(UIInfo.name),
UIVERSION: JSON.stringify(UIInfo.version),
UIAUTHOR: JSON.stringify(UIInfo.author),
UIMetaNAME: JSON.stringify(UIMetaInfo.name),
UIMetaVersion: JSON.stringify(UIMetaInfo.version),
}),
],

View File

@ -5,10 +5,11 @@
Site\Templates\WebpackTemplateProvider:
APPDIR: ./
THEMESDIR: themes
HOSTNAME: localhost
HOSTNAME: 127.0.0.1
PORT: 3000
SRC: src
DIST: dist
TYPESJS: src/js/types
TYPESSCSS: src/scss/types
NODE_ENV: development #production,development
webp: false