Webpack 5 upgrade

This commit is contained in:
Tony Air 2020-12-25 05:53:50 +07:00
parent 2d220ba015
commit 3504c0da71
11 changed files with 254 additions and 209 deletions

5
dist/css/app.css vendored
View File

@ -1,4 +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}.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}.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)}.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)}.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{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}}
/*# sourceMappingURL=app.css.map*/
.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}}

View File

@ -1 +0,0 @@
{"version":3,"sources":["webpack:///meta-lightbox.scss","webpack:///_variables.scss","webpack:///meta-lightbox-theme.scss"],"names":[],"mappings":"AAEA,uBACI,cAAe,CACf,KAAM,CACN,MAAO,CACP,aAAc,CACd,UAAW,CACX,WAAY,CACZ,eAAgB,CAChB,iBAAkB,CAClB,SAAU,CACV,qBAAsB,CAV1B,0CAaQ,kBAAmB,CACnB,SAAU,CACb,oBAID,iBAAkB,CAClB,OAAQ,CACR,UAAW,CACX,QAAS,CACT,SAAU,CACV,YAAa,CACb,kBAAmB,CACnB,iBAAkB,CAClB,sBAAuB,CAC1B,uBAGG,YAAa,CACb,kBAAmB,CACnB,sBAAuB,CACvB,iBAAkB,CAClB,kBAAmB,CACnB,UCtCQ,CDuCR,UAAW,CACX,WAAY,CARhB,2CAWQ,aCvCY,CD4BpB,mDAeQ,aAAc,CACd,WAAY,CACZ,UAAW,CAjBnB,yDAoBY,UCpDA,CDqDA,4CAA6C,CAC7C,eAAgB,CAChB,iBAAkB,CAClB,SAAU,CACV,UAAW,CACX,SAAU,CACV,4BC1DA,CD+BZ,iEAgCgB,YAAa,CAChB,0BAMT,iBAAkB,CAClB,QAAS,CACT,MAAO,CACP,UAAW,CACX,aAAc,CACd,iBAAkB,CACrB,mBAGG,YAAa,CAChB,oBAGG,iBAAkB,CAClB,OAAQ,CACR,MAAO,CACV,oBAGG,iBAAkB,CAClB,OAAQ,CACR,OAAQ,CACX,qBAGG,iBAAkB,CAClB,MAAO,CACP,QAAS,CACT,eAAgB,CACnB,qBAGG,iBAAkB,CADtB,yBAIQ,cAAe,CACf,eAAgB,CAChB,UAAW,CACX,WAAY,CACZ,qBAAsB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UAAW,CACX,QAAS,CACT,SAAU,CACb,gDAGG,WAAY,CACZ,SAAU,CACV,aAAc,CAHlB,oDAMQ,kBAAmB,CACtB,kDAID,SAAU,CACb","file":"css/app.css","sourcesContent":["@import '_variables';\n\n.meta-lightbox-overlay {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 99998;\n width: 100%;\n height: 100%;\n overflow: hidden;\n visibility: hidden;\n opacity: 0;\n box-sizing: border-box;\n\n &.meta-lightbox-open {\n visibility: visible;\n opacity: 1;\n }\n}\n\n.meta-lightbox-wrap {\n position: absolute;\n top: 10%;\n bottom: 10%;\n left: 10%;\n right: 10%;\n display: flex;\n align-items: center;\n text-align: center;\n justify-content: center;\n}\n\n.meta-lightbox-content {\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n flex-direction: row;\n color: $white;\n width: 100%;\n height: 100%;\n\n .meta-lightbox-ajax {\n color: $body-color;\n }\n\n .meta-lightbox-zoom-wrapper {\n display: block;\n height: 100%;\n width: 100%;\n\n &:after {\n color: $white;\n font: normal normal normal 14px/1 FontAwesome;\n content: '\\f00e';\n position: absolute;\n right: 1em;\n bottom: 1em;\n right: 1em;\n text-shadow: 1px 1px 1px $black;\n }\n\n &.no-zoom {\n &:after {\n display: none;\n }\n }\n }\n}\n\n.meta-lightbox-title-wrap {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n z-index: 99999;\n text-align: center;\n}\n\n.meta-lightbox-nav {\n display: none;\n}\n\n.meta-lightbox-prev {\n position: absolute;\n top: 50%;\n left: 0;\n}\n\n.meta-lightbox-next {\n position: absolute;\n top: 50%;\n right: 0;\n}\n\n.meta-lightbox-close {\n position: absolute;\n top: 2%;\n right: 2%;\n line-height: 1em;\n}\n\n.meta-lightbox-image {\n text-align: center;\n\n img {\n max-width: 100%;\n max-height: 100%;\n width: auto;\n height: auto;\n vertical-align: middle;\n }\n}\n\n.meta-lightbox-content iframe {\n width: 100%;\n height: 100%;\n}\n\n.meta-lightbox-inline,\n.meta-lightbox-ajax {\n max-height: 100%;\n overflow: auto;\n}\n\n.meta-lightbox-error {\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: center;\n width: 100%;\n height: 100%;\n color: $white;\n text-shadow: 0 1px 1px $black;\n .alert {\n margin: 0;\n text-shadow: none;\n }\n}\n\n.meta-lightbox-error p {\n display: table-cell;\n vertical-align: middle;\n}\n\n/* Effects\n **********************************************/\n.meta-lightbox-notouch .meta-lightbox-effect-fade,\n.meta-lightbox-notouch .meta-lightbox-effect-fadeScale,\n.meta-lightbox-notouch .meta-lightbox-effect-slideLeft,\n.meta-lightbox-notouch .meta-lightbox-effect-slideRight,\n.meta-lightbox-notouch .meta-lightbox-effect-slideUp,\n.meta-lightbox-notouch .meta-lightbox-effect-slideDown,\n.meta-lightbox-notouch .meta-lightbox-effect-fall {\n transition: all 0.2s ease-in-out;\n}\n\n/* fadeScale */\n.meta-lightbox-effect-fadeScale .meta-lightbox-wrap {\n transition: all 0.3s;\n transform: scale(0.7);\n}\n\n.meta-lightbox-effect-fadeScale.meta-lightbox-open .meta-lightbox-wrap {\n transform: scale(1);\n}\n\n/* slideLeft / slideRight / slideUp / slideDown */\n.meta-lightbox-effect-slideLeft .meta-lightbox-wrap,\n.meta-lightbox-effect-slideRight .meta-lightbox-wrap,\n.meta-lightbox-effect-slideUp .meta-lightbox-wrap,\n.meta-lightbox-effect-slideDown .meta-lightbox-wrap {\n transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);\n}\n\n.meta-lightbox-effect-slideLeft .meta-lightbox-wrap {\n transform: translateX(-10%);\n}\n\n.meta-lightbox-effect-slideRight .meta-lightbox-wrap {\n transform: translateX(10%);\n}\n\n.meta-lightbox-effect-slideLeft.meta-lightbox-open .meta-lightbox-wrap,\n.meta-lightbox-effect-slideRight.meta-lightbox-open .meta-lightbox-wrap {\n transform: translateX(0);\n}\n\n.meta-lightbox-effect-slideDown .meta-lightbox-wrap {\n transform: translateY(-10%);\n}\n\n.meta-lightbox-effect-slideUp .meta-lightbox-wrap {\n transform: translateY(10%);\n}\n\n.meta-lightbox-effect-slideUp.meta-lightbox-open .meta-lightbox-wrap,\n.meta-lightbox-effect-slideDown.meta-lightbox-open .meta-lightbox-wrap {\n transform: translateY(0);\n}\n\n/* fall */\n.meta-lightbox-body-effect-fall .meta-lightbox-effect-fall {\n perspective: 1000px;\n}\n\n.meta-lightbox-effect-fall .meta-lightbox-wrap {\n transition: all 0.3s ease-out;\n transform: translateZ(300px);\n}\n\n.meta-lightbox-effect-fall.meta-lightbox-open .meta-lightbox-wrap {\n transform: translateZ(0);\n}\n\n@import 'meta-lightbox-theme';\n","$white: #fff !default;\n$black: #000 !default;\n$lightbox-link-hover-color: #007bff !default;\n$lightbox-breakpoint: 576px !default;\n$body-color: #212529 !default;\n\n$grid-breakpoints: (\n xs: 0,\n sm: 576px,\n md: 768px,\n lg: 992px,\n xl: 1200px,\n xxl: 1390px,\n xxxl: 1590px\n) !default;\n$container-max-widths: (\n sm: 540px,\n md: 720px,\n lg: 960px,\n xl: 1140px,\n xxl: 1330px,\n xxxl: 1560px\n) !default;\n",".meta-lightbox-theme-default.meta-lightbox-overlay {\n background: #666;\n background: rgba(0, 0, 0, 0.6);\n}\n\n.meta-lightbox-theme-default .meta-lightbox-nav {\n top: 10%;\n width: 20%;\n height: 80%;\n background-repeat: no-repeat;\n background-position: 50% 50%;\n opacity: 0.5;\n color: $white;\n font-size: 3em;\n text-decoration: none;\n text-shadow: 1px 1px 0 $black;\n\n @media (min-width: map-get($grid-breakpoints, 'sm')) {\n width: 8%;\n }\n .fa {\n position: absolute;\n top: 50%;\n left: 50%;\n margin-top: -1em;\n margin-left: -0.2em;\n }\n\n &:hover {\n color: $lightbox-link-hover-color;\n opacity: 1;\n background-color: transparentize($black, 0.5);\n }\n}\n\n.meta-lightbox-theme-default .meta-lightbox-close {\n display: block;\n opacity: 0.5;\n color: $white;\n text-decoration: none;\n font-size: 2em;\n text-shadow: 1px 1px 0 $black;\n text-align: center;\n width: 1.2em;\n height: 1.2em;\n line-height: 1.2em;\n\n &:focus {\n color: $lightbox-link-hover-color;\n opacity: 1;\n background-color: transparentize($black, 0.5);\n }\n}\n\n.meta-lightbox-theme-default .meta-lightbox-title {\n background: $black;\n color: $white;\n padding: 7px 15px;\n}\n\n.meta-lightbox-theme-default .meta-lightbox-ajax,\n.meta-lightbox-theme-default .meta-lightbox-inline {\n background: $white;\n padding: 2em;\n box-shadow: 0px 1px 1px transparentize($black, 0.4);\n}\n\n@media (max-width: $lightbox-breakpoint) {\n .meta-lightbox-wrap {\n top: 5px !important;\n bottom: 5px;\n left: 5px;\n right: 5px;\n }\n\n .meta-lightbox-theme-default .meta-lightbox-nav {\n height: 100%;\n opacity: 1;\n font-size: 2em;\n\n .fa {\n margin-left: -0.4em;\n }\n }\n\n .meta-lightbox-theme-default .meta-lightbox-close {\n opacity: 1;\n }\n}\n"],"sourceRoot":""}

2
dist/index.html vendored
View File

@ -1,3 +1,3 @@
<!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 {
padding: 2rem;
}</style><link href="/mnt/data/srv/dist/repositories/meta-lightbox/dist/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="/mnt/data/srv/dist/repositories/meta-lightbox/dist/js/app.js"></script></body></html>
}</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>

3
dist/js/app.js vendored
View File

@ -1,3 +1,2 @@
/*! For license information please see app.js.LICENSE.txt */
!function(e){var t={};function a(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(o,n,function(t){return e[t]}.bind(null,n));return o},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/mnt/data/srv/dist/repositories/meta-lightbox/dist",a(a.s="./src/js/app.js")}({"./src/js/_events.js":function(e,t){e.exports={AJAX:"ajax-load",AJAXMAIN:"ajax-main-load",MAININIT:"main-init",TABHIDDEN:"tab-hidden",TABFOCUSED:"tab-focused",OFFLINE:"offline",ONLINE:"online",BACKONLINE:"back-online",TOUCHENABLE:"touch-enabled",TOUCHDISABLED:"touch-disabled",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(e,t,a){"use strict";a.r(t);a("./src/scss/app.scss");var o=a("jquery"),n=a.n(o),i=a("./src/js/_events.js"),r=a.n(i);function l(e){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var a=0;a<t.length;a++){var o=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var s,f,d,u,h,m,g,p;s=n.a,f=window,d=s(f),u=document,h=s("body"),m="MetaLightboxUI",g='<div class="meta-lightbox-error"><div class="alert alert-error alert-danger">Connection failure.</div></div>',p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,a,o;return t=e,o=[{key:"init",value:function(){console.log("".concat(m,": init ..."));var e=this;e.isMSIE=0;try{e.isHidpi=e.is_hdpi()}catch(t){console.log("".concat(m,": catch"))}s(".js".concat(m,',[data-toggle="lightbox"],[data-lightbox-gallery]')).on("click",(function(t){t.preventDefault(),t.stopPropagation();var a=s(t.currentTarget);e.show(a)}))}},{key:"is_hdpi",value:function(){return console.log("".concat(m,": isHidpi")),f.devicePixelRatio>1||f.matchMedia&&f.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(e){console.log("".concat(m,": show"));var t=this;if(t.constructLightbox()){var a=t.$content;if(a){if(h.addClass("meta-lightbox-body-effect-fade"),t.process(a,e),e.data("lightbox-gallery")){var o=s('[data-lightbox-gallery="'.concat(e.data("lightbox-gallery"),'"]'));1===o.length?s(".meta-lightbox-nav").hide():s(".meta-lightbox-nav").show(),s(".meta-lightbox-prev").off("click").on("click",(function(a){a.preventDefault();var n=o.index(e),i=o.eq(n-1);i.length||(i=o.last()),setTimeout((function(){t.show(i)}),10)})),s(".meta-lightbox-next").off("click").on("click",(function(a){a.preventDefault();var n=o.index(e),i=o.eq(n+1);i.length||(i=o.first()),setTimeout((function(){t.show(i)}),10)}))}setTimeout((function(){t.$overlay.addClass("meta-lightbox-open")}),1)}}}},{key:"constructLightbox",value:function(){console.log("".concat(m,": constructLightbox"));var e=this,t=s("<div>",{class:"meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade"}),a=s("<div>",{class:"meta-lightbox-wrap"}),o=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 e.$overlay||(e.isMSIE&&t.addClass("meta-lightbox-ie"),a.append(o),a.append(r),t.append(a),t.append(n),t.append(i),h.append(t),t.on("click",(function(t){t.preventDefault(),e.hide()})),i.on("click",(function(t){t.preventDefault(),e.hide()})),e.$overlay=t,e.$content=o,e.$title=r),e.$overlay}},{key:"setTitle",value:function(e){this.$title.html(e)}},{key:"process",value:function(e,t){console.log("".concat(m,": process"));var a=this,o=t.attr("href")&&t.attr("href").length?t.attr("href"):t.data("href");a.$content.attr("class","meta-lightbox-content"),a.$content.addClass(t.data("lightbox-class")),o.length||(console.log(t),console.error("".concat(m,": href(attr/data) is missing")));var n=s("#PageLoading .loading-spinner"),i=n.length?n.clone():"";if(a.$content.append(i).addClass("meta-lightbox-loading"),o.match(/\.(jpeg|jpg|gif|png|svg)$/i)){s.ajax({url:o,success:function(){var t=s("<img>",{src:o}),n=s('<div class="meta-lightbox-image"></div>'),i=s('<span class="meta-lightbox-zoom-wrapper"></span>');i.append(t),n.append(i),n.css({"line-height":"".concat(e.height(),"px"),height:"".concat(e.height(),"px")}),d.resize((function(){n.css({"line-height":"".concat(e.height(),"px"),height:"".concat(e.height(),"px")})})),"undefined"!==typeof i.zoom?i.zoom():i.addClass("no-zoom"),a.$content.html(n),a.contentLoaded()},error:function(e,t){var o=s(g);a.$content.html(o),a.contentLoaded()}});var r=t.data("title")?t.data("title"):t.attr("title");a.setTitle(r),"function"===typeof ga&&ga("send","event","meta","Image Click",o)}else if(o.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/)){var c,h=o.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/),p="meta-lightbox-video";if("youtube"==h[1]&&(c="https://www.youtube.com/embed/".concat(h[4]),p="".concat(p," meta-lightbox-youtube")),"youtu"==h[1]&&(c="https://www.youtube.com/embed/".concat(h[3]),p="".concat(p," meta-lightbox-youtube")),"youtube-nocookie"==h[1]&&(c="https://www.youtube-nocookie.com/embed/".concat(h[4]),p="".concat(p," meta-lightbox-youtube")),"vimeo"==h[1]&&(c="https://player.vimeo.com/video/".concat(h[3]),p="".concat(p," meta-lightbox-vimeo")),!c)return console.warn("".concat(m,": Video loading bad URL")),!1;if(!a.loadIframe(c,p))return t.addClass("meta-offline"),!1;t.removeClass("meta-offline");var b=t.data("title")?t.data("title"):t.attr("title");a.setTitle(b),"function"===typeof ga&&ga("send","event","meta","Video Click",h)}else if("#"==o.substring(0,1))s(o).length?(wrap=s('<div class="meta-lightbox-inline" />'),wrap.append(s(o).clone().show()),wrap.outerHeight()<a.$content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")}),d.resize((function(){wrap.outerHeight()<a.$content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")})})),a.$content.html(wrap),a.contentLoaded()):(wrap=s(g),a.$content.html(wrap),a.contentLoaded()),s(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","inline HTML click",o);else{if(t.data("force-iframe"))return console.log("".concat(m,": IFrame forced")),a.loadIframe(o,"meta-lightbox-iframe-content")?(t.removeClass("meta-offline"),!0):(t.addClass("meta-offline"),!1);console.log("".concat(m,": loading AJAX")),s.ajax({sync:!1,async:!0,url:o,dataType:"html",method:"GET",cache:!1,statusCode:{404:function(){console.log("".concat(m,": page not found")),f.location.href=url},302:function(){console.log("".concat(m,": redirect 302")),f.location.href=url}},error:function(e,t){console.log("".concat(m,": AJAX request failure.").concat(e.statusText));var o=s(g);a.$content.html(o),a.contentLoaded(),"function"===typeof ga&&ga("send","event","error","AJAX ERROR",e.statusText)},success:function(e,t,o){console.log("".concat(m,": AJAX success"));try{var n=s.parseJSON(e);if("object"===l(n)){if(console.log("".concat(m,": AJAX JSON")),"object"===l(n.regions)&&"undefinded"!==typeof n.regions.LayoutAjax){var i=s('<div class="meta-lightbox-ajax" />');i.html(n.regions.LayoutAjax),a.$content.html(i),a.contentLoaded()}var r=o.getResponseHeader("X-Title"),c=o.getResponseHeader("X-Link");r&&r.length&&c&&c.length&&c!==f.location.href&&c.substring(0,c.indexOf("#"))!==f.location.href.replace(s("base").attr("href"),"/")&&(s(".meta-lightbox-ajax").data("curr-title",u.title),s(".meta-lightbox-ajax").data("curr-link",f.location.href),"undefined"!==typeof f.localStorage&&"/"!==c&&f.localStorage.setItem("current-page",c),u.URL!==c&&u.URL!==s("base").attr("href")+c&&u.URL!=="".concat(s("base").attr("href"),"/").concat(c)&&f.history.pushState({title:r,page:c,ajax:"true"},r,c),s(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&(ga("set",{page:c.replace(s("base").attr("href"),""),title:r}),ga("send","pageview")))}}catch(h){console.log("".concat(m,": AJAX HTML"));var d=s('<div class="meta-lightbox-ajax" />');d.append(e),a.$content.html(d),a.contentLoaded()}a.contentLoaded()}})}}},{key:"loadIframe",value:function(e,t){var a=this,o=s("<iframe>",{src:e,class:t,frameborder:0,vspace:0,hspace:0,scrolling:"auto",allowtransparency:"true"});return console.log("".concat(m,": loading iframe")),h.append('<div id="MetaIFramePreload" class="hidden d-none iframe-preload" style="display:none"></div>'),s("#MetaIFramePreload").html(o),o.on("load",(function(){if(h.hasClass("is-offline"))return console.warn("".concat(m,": Unable to load iframe offline")),!1;a.finishIFrameLoading()})),o}},{key:"finishIFrameLoading",value:function(){var e=this,t=s("#MetaIFramePreload");if(!t.length)return console.warn("".concat(m,": iframe preload not found")),!1;var a=t.find("iframe");if(!a.length)return console.warn("".concat(m,": iframe preload > iframe not found")),!1;console.log("".concat(m,": the iframe was loaded")),t.html(""),t.remove(),e.$content.addClass("iframe-delay"),e.$content.html(a),e.contentLoaded(),setTimeout((function(){e.$content.removeClass("iframe-delay")}),1e3)}},{key:"contentLoaded",value:function(){var e=this;e.$content.removeClass("meta-lightbox-loading"),s(".meta-lightbox-content .js".concat(m,',.meta-lightbox-content [data-toggle="lightbox"],.meta-lightbox-content [data-lightbox-gallery]')).on("click",(function(t){t.preventDefault(),t.stopPropagation();var a=s(t.currentTarget);e.show(a)})),setTimeout((function(){d.trigger("meta-lightbox-loaded")}),1),setTimeout((function(){h.addClass("meta-lightbox-body-effect-fade")}),600)}},{key:"hide",value:function(e){var t=this.$overlay,a=s(".meta-lightbox-ajax").data("curr-title"),o=s(".meta-lightbox-ajax").data("curr-link");a&&o&&("undefined"!==typeof f.localStorage&&"/"!==o&&f.localStorage.setItem("current-page",o),u.URL!==o&&u.URL!==s("base").attr("href")+o&&u.URL!=="".concat(s("base").attr("href"),"/").concat(o)&&f.history.replaceState({title:a,page:o,ajax:"true"},a,o)),t.removeClass("meta-lightbox-open"),h.removeClass("meta-lightbox-body-effect-fade"),s(".meta-lightbox-content .meta-lightbox-zoom-wrapper").trigger("zoom.destroy"),this.isMSIE&&(t.find("iframe").attr("src"," "),t.find("iframe").remove()),s(".meta-lightbox-prev").off("click"),s(".meta-lightbox-next").off("click"),s(".meta-lightbox-content").empty(),h.removeClass("meta-lightbox-body-effect-fade")}}],(a=null)&&c(t.prototype,a),o&&c(t,o),e}(),d.on("MetaLightboxUI.init ".concat(r.a.AJAX," ").concat(r.a.LOADED),(function(){p.init()})),d.on("".concat(r.a.BACKONLINE),(function(){s(".meta-offline").removeClass("meta-offline"),console.log("".concat(m,": reloading iframe")),p.finishIFrameLoading();var e=s(".meta-lightbox-content iframe");e.length&&e.attr("src",e.attr("src"))})),f.MetaLightboxUI=p},"./src/scss/app.scss":function(e,t,a){},jquery:function(e,t){e.exports=jQuery}});
//# sourceMappingURL=app.js.map
!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 i(t){return(i="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 c(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(t){var e=window,l=t(e),r=document,s=t("body"),f="MetaLightboxUI",h='<div class="meta-lightbox-error"><div class="alert alert-error alert-danger">Connection failure.</div></div>',d=function(){function o(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o)}var a,n,d;return a=o,d=[{key:"init",value:function(){console.log("".concat(f,": init ..."));var e=this;e.isMSIE=0;try{e.isHidpi=e.is_hdpi()}catch(o){console.log("".concat(f,": catch"))}t(".js".concat(f,',[data-toggle="lightbox"],[data-lightbox-gallery]')).on("click",(function(o){o.preventDefault(),o.stopPropagation();var a=t(o.currentTarget);e.show(a)})),t(".js".concat(f,"-close-inline")).on("click",(function(e){t(e.currentTarget).parents(".meta-lightbox-overlay").removeClass("meta-lightbox-open")}))}},{key:"is_hdpi",value:function(){return console.log("".concat(f,": isHidpi")),e.devicePixelRatio>1||e.matchMedia&&e.matchMedia("(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)").matches}},{key:"show",value:function(e){console.log("".concat(f,": show"));var o=this;if(o.constructLightbox()){var a=o.$content;if(a){if(s.addClass("meta-lightbox-body-effect-fade"),o.process(a,e),e.data("lightbox-gallery")){var n=t('[data-lightbox-gallery="'.concat(e.data("lightbox-gallery"),'"]'));1===n.length?t(".meta-lightbox-nav").hide():t(".meta-lightbox-nav").show(),t(".meta-lightbox-prev").off("click").on("click",(function(t){t.preventDefault();var a=n.index(e),i=n.eq(a-1);i.length||(i=n.last()),setTimeout((function(){o.show(i)}),10)})),t(".meta-lightbox-next").off("click").on("click",(function(t){t.preventDefault();var a=n.index(e),i=n.eq(a+1);i.length||(i=n.first()),setTimeout((function(){o.show(i)}),10)}))}setTimeout((function(){o.$overlay.addClass("meta-lightbox-open")}),1)}}}},{key:"constructLightbox",value:function(){console.log("".concat(f,": constructLightbox"));var e=this,o=t("<div>",{class:"meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade"}),a=t("<div>",{class:"meta-lightbox-wrap"}),n=t("<div>",{class:"meta-lightbox-content"}),i=t('<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>'),c=t('<a href="#" class="meta-lightbox-close fas fa fa-times" title="Close"><span class="sr-only">Close</span></a>'),l=t("<div>",{class:"meta-lightbox-title-wrap"});return e.$overlay||(e.isMSIE&&o.addClass("meta-lightbox-ie"),a.append(n),a.append(l),o.append(a),o.append(i),o.append(c),s.append(o),o.on("click",(function(t){t.preventDefault(),e.hide()})),c.on("click",(function(t){t.preventDefault(),e.hide()})),e.$overlay=o,e.$content=n,e.$title=l),e.$overlay}},{key:"setTitle",value:function(t){this.$title.html(t)}},{key:"process",value:function(o,a){console.log("".concat(f,": 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(f,": href(attr/data) is missing")));var s=t("#PageLoading .loading-spinner"),d=s.length?s.clone():"";if(n.$content.append(d).addClass("meta-lightbox-loading"),c.match(/\.(jpeg|jpg|gif|png|svg)$/i)){t.ajax({url:c,success:function(){var e=t("<img>",{src:c}),a=t('<div class="meta-lightbox-image"></div>'),i=t('<span class="meta-lightbox-zoom-wrapper"></span>');i.append(e),a.append(i),a.css({"line-height":"".concat(o.height(),"px"),height:"".concat(o.height(),"px")}),l.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(e,o){var a=t(h);n.$content.html(a),n.contentLoaded()}});var g=a.data("title")?a.data("title"):a.attr("title");n.setTitle(g),"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-]+))/)){var u,m=c.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/),p="meta-lightbox-video";if("youtube"==m[1]&&(u="https://www.youtube.com/embed/".concat(m[4]),p="".concat(p," meta-lightbox-youtube")),"youtu"==m[1]&&(u="https://www.youtube.com/embed/".concat(m[3]),p="".concat(p," meta-lightbox-youtube")),"youtube-nocookie"==m[1]&&(u="https://www.youtube-nocookie.com/embed/".concat(m[4]),p="".concat(p," meta-lightbox-youtube")),"vimeo"==m[1]&&(u="https://player.vimeo.com/video/".concat(m[3]),p="".concat(p," meta-lightbox-vimeo")),!u)return console.warn("".concat(f,": Video loading bad URL")),!1;if(!n.loadIframe(u,p))return a.addClass("meta-offline"),!1;a.removeClass("meta-offline");var b=a.data("title")?a.data("title"):a.attr("title");n.setTitle(b),"function"===typeof ga&&ga("send","event","meta","Video Click",m)}else if("#"==c.substring(0,1))t(c).length?(wrap=t('<div class="meta-lightbox-inline" />'),wrap.append(t(c).clone().show()),wrap.outerHeight()<n.$content.height()&&wrap.css({position:"relative",top:"50%","margin-top":"".concat(-wrap.outerHeight()/2,"px")}),l.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=t(h),n.$content.html(wrap),n.contentLoaded()),t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","inline HTML click",c);else{if(a.data("force-iframe"))return console.log("".concat(f,": IFrame forced")),n.loadIframe(c,"meta-lightbox-iframe-content")?(a.removeClass("meta-offline"),!0):(a.addClass("meta-offline"),!1);console.log("".concat(f,": loading AJAX")),t.ajax({sync:!1,async:!0,url:c,dataType:"html",method:"GET",cache:!1,statusCode:{404:function(){console.log("".concat(f,": page not found")),e.location.href=url},302:function(){console.log("".concat(f,": redirect 302")),e.location.href=url}},error:function(e,o){console.log("".concat(f,": AJAX request failure.").concat(e.statusText));var a=t(h);n.$content.html(a),n.contentLoaded(),"function"===typeof ga&&ga("send","event","error","AJAX ERROR",e.statusText)},success:function(o,a,c){console.log("".concat(f,": AJAX success"));try{var l=t.parseJSON(o);if("object"===i(l)){if(console.log("".concat(f,": AJAX JSON")),"object"===i(l.regions)&&"undefinded"!==typeof l.regions.LayoutAjax){var s=t('<div class="meta-lightbox-ajax" />');s.html(l.regions.LayoutAjax),n.$content.html(s),n.contentLoaded()}var h=c.getResponseHeader("X-Title"),d=c.getResponseHeader("X-Link");h&&h.length&&d&&d.length&&d!==e.location.href&&d.substring(0,d.indexOf("#"))!==e.location.href.replace(t("base").attr("href"),"/")&&(t(".meta-lightbox-ajax").data("curr-title",r.title),t(".meta-lightbox-ajax").data("curr-link",e.location.href),"undefined"!==typeof e.localStorage&&"/"!==d&&e.localStorage.setItem("current-page",d),r.URL!==d&&r.URL!==t("base").attr("href")+d&&r.URL!=="".concat(t("base").attr("href"),"/").concat(d)&&e.history.pushState({title:h,page:d,ajax:"true"},h,d),t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&(ga("set",{page:d.replace(t("base").attr("href"),""),title:h}),ga("send","pageview")))}}catch(u){console.log("".concat(f,": AJAX HTML"));var g=t('<div class="meta-lightbox-ajax" />');g.append(o),n.$content.html(g),n.contentLoaded()}n.contentLoaded()}})}}},{key:"loadIframe",value:function(e,o){var a=this,n=t("<iframe>",{src:e,class:o,frameborder:0,vspace:0,hspace:0,scrolling:"auto",allowtransparency:"true"});return console.log("".concat(f,": loading iframe")),s.append('<div id="MetaIFramePreload" class="hidden d-none iframe-preload" style="display:none"></div>'),t("#MetaIFramePreload").html(n),n.on("load",(function(){if(s.hasClass("is-offline"))return console.warn("".concat(f,": Unable to load iframe offline")),!1;a.finishIFrameLoading()})),n}},{key:"finishIFrameLoading",value:function(){var e=this,o=t("#MetaIFramePreload");if(!o.length)return console.warn("".concat(f,": iframe preload not found")),!1;var a=o.find("iframe");if(!a.length)return console.warn("".concat(f,": iframe preload > iframe not found")),!1;console.log("".concat(f,": the iframe was loaded")),o.html(""),o.remove(),e.$content.addClass("iframe-delay"),e.$content.html(a),e.contentLoaded(),setTimeout((function(){e.$content.removeClass("iframe-delay")}),1e3)}},{key:"contentLoaded",value:function(){var e=this;e.$content.removeClass("meta-lightbox-loading"),t(".meta-lightbox-content .js".concat(f,',.meta-lightbox-content [data-toggle="lightbox"],.meta-lightbox-content [data-lightbox-gallery]')).on("click",(function(o){o.preventDefault(),o.stopPropagation();var a=t(o.currentTarget);e.show(a)})),t(".js".concat(f,"-close")).on("click",(function(t){t.preventDefault(),e.hide()})),setTimeout((function(){l.trigger("meta-lightbox-loaded")}),1),setTimeout((function(){s.addClass("meta-lightbox-body-effect-fade")}),600)}},{key:"hide",value:function(o){var a=this.$overlay,n=t(".meta-lightbox-ajax").data("curr-title"),i=t(".meta-lightbox-ajax").data("curr-link");n&&i&&("undefined"!==typeof e.localStorage&&"/"!==i&&e.localStorage.setItem("current-page",i),r.URL!==i&&r.URL!==t("base").attr("href")+i&&r.URL!=="".concat(t("base").attr("href"),"/").concat(i)&&e.history.replaceState({title:n,page:i,ajax:"true"},n,i)),a.removeClass("meta-lightbox-open"),s.removeClass("meta-lightbox-body-effect-fade"),t(".meta-lightbox-content .meta-lightbox-zoom-wrapper").trigger("zoom.destroy"),this.isMSIE&&(a.find("iframe").attr("src"," "),a.find("iframe").remove()),t(".meta-lightbox-prev").off("click"),t(".meta-lightbox-next").off("click"),t(".meta-lightbox-content").empty(),s.removeClass("meta-lightbox-body-effect-fade")}}],(n=null)&&c(a.prototype,n),d&&c(a,d),o}();l.on("MetaLightboxUI.init ".concat(o," ").concat(n),(function(){d.init()})),l.on("".concat(a),(function(){t(".meta-offline").removeClass("meta-offline"),console.log("".concat(f,": reloading iframe")),d.finishIFrameLoading();var e=t(".meta-lightbox-content iframe");e.length&&e.attr("src",e.attr("src"))})),e.MetaLightboxUI=d}(t.n(e)())}();

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

@ -1 +0,0 @@
{"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","AJAXMAIN","MAININIT","TABHIDDEN","TABFOCUSED","OFFLINE","ONLINE","BACKONLINE","TOUCHENABLE","TOUCHDISABLED","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","$W","D","$Body","NAME","NETWORK_ERROR","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","eq","last","setTimeout","first","$overlay","overlay","class","wrap","content","nav","close","title","append","$title","str","html","href","attr","error","$pageSpinner","loadingContent","clone","match","ajax","url","success","img","src","imgwrapper","css","height","resize","zoom","contentLoaded","jqXHR","status","setTitle","ga","video","classTerm","warn","loadIframe","removeClass","substring","outerHeight","position","top","sync","async","dataType","method","cache","statusCode","404","location","302","statusText","dataJson","parseJSON","getResponseHeader","link","indexOf","replace","localStorage","setItem","URL","history","pushState","page","$wrap","$iframe","frameborder","vspace","hspace","scrolling","allowtransparency","hasClass","finishIFrameLoading","$preload","find","remove","trigger","callback","replaceState","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,Q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KAES6B,SAEhBO,EAAQjD,EAAE,uBAAuB+B,KAAK,cACxCmE,EAAOlG,EAAE,uBAAuB+B,KAAK,aACnCkB,GAASiD,IACmB,qBAAnBjG,EAAEoG,cAAyC,MAATH,GAC3CjG,EAAEoG,aAAaC,QAAQ,eAAgBJ,GAIvC/F,EAAEoG,MAAQL,GACf/F,EAAEoG,MAAQvG,EAAE,QAAQuD,KAAK,QAAU2C,GACnC/F,EAAEoG,MAAF,UAAavG,EAAE,QAAQuD,KAAK,QAA5B,YAAuC2C,IAElCjG,EAAEuG,QAAQiB,aACR,CACExE,QACAyD,KAAMR,EACNrC,KAAM,QAERZ,EACAiD,IAKNxD,EAASsC,YAAY,sBACrB5E,EAAM4E,YAAY,kCAClBhF,EAAE,sDAAsDuH,QACtD,gBA/BS1G,KAmCJC,SACL4B,EAAS2E,KAAK,UAAU9D,KAAK,MAAO,KACpCb,EAAS2E,KAAK,UAAUC,UAE1BtH,EAAE,uBAAuBmC,IAAI,SAG7BnC,EAAE,uBAAuBmC,IAAI,SAG7BnC,EAAE,0BAA0B0H,QAE5BtH,EAAM4E,YAAY,sC,EApqBO,O,2BAAA,KAwqB7B9E,EAAGgB,GAAH,8BAA6ByG,IAAOhK,KAApC,YAA4CgK,IAAOtJ,SAAU,WAC3DkC,EAAeqH,UAGjB1H,EAAGgB,GAAH,UAASyG,IAAOzJ,aAAc,WAC5B8B,EAAE,iBAAiBgF,YAAY,gBAE/BtE,QAAQC,IAAR,UAAeN,EAAf,uBACAE,EAAe4G,sBAEf,IAAMP,EAAU5G,EAAE,iCACd4G,EAAQ3E,QACV2E,EAAQrD,KAAK,MAAOqD,EAAQrD,KAAK,WAIrCtD,EAAEM,eAAiBA,G,6DCvsBrB7E,EAAOD,QAAUoM","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 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","/*\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 $W = $(W);\n const D = document;\n const $Body = $('body');\n\n const NAME = 'MetaLightboxUI';\n const NETWORK_ERROR =\n\t\t'<div class=\"meta-lightbox-error\"><div class=\"alert alert-error alert-danger\">Connection failure.</div></div>';\n\n class MetaLightboxUI {\n static init() {\n console.log(`${NAME}: init ...`);\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(`${NAME}: catch`);\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 = ui.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($link);\n let $currentLink = $galleryItems.eq(index - 1);\n if (!$currentLink.length)\n $currentLink = $galleryItems.last();\n\n //ui.hide();\n setTimeout(() => {\n ui.show($currentLink);\n }, 10);\n });\n\n // Next\n $('.meta-lightbox-next')\n .off('click')\n .on('click', (e) => {\n e.preventDefault();\n const index = $galleryItems.index($link);\n let $currentLink = $galleryItems.eq(index + 1);\n if (!$currentLink.length)\n $currentLink = $galleryItems.first();\n\n //ui.hide();\n setTimeout(() => {\n ui.show($currentLink);\n }, 10);\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 =\n\t\t\t\t$link.attr('href') && $link.attr('href').length\n\t\t\t\t ? $link.attr('href')\n\t\t\t\t : $link.data('href');\n\n // add custom link specific class\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(`${NAME}: href(attr/data) is missing`);\n }\n\n const $pageSpinner = $('#PageLoading .loading-spinner');\n const loadingContent = $pageSpinner.length\n ? $pageSpinner.clone()\n : '';\n ui.$content\n .append(loadingContent)\n .addClass('meta-lightbox-loading');\n\n // Image\n if (href.match(/\\.(jpeg|jpg|gif|png|svg)$/i)) {\n $.ajax({\n url: href,\n success: () => {\n const img = $('<img>', { src: href });\n const wrap = $(\n '<div class=\"meta-lightbox-image\"></div>',\n );\n const 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 $W.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 } else {\n imgwrapper.addClass('no-zoom');\n }\n\n ui.$content.html(wrap);\n ui.contentLoaded();\n },\n error: (jqXHR, status) => {\n const wrap = $(NETWORK_ERROR);\n\n ui.$content.html(wrap);\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', '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 console.warn(`${NAME}: Video loading bad URL`);\n return false;\n }\n\n const $iframe = ui.loadIframe(src, classTerm);\n if (!$iframe) {\n $link.addClass('meta-offline');\n return false;\n }\n $link.removeClass('meta-offline');\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() < 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 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('');\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 if ($link.data('force-iframe')) {\n console.log(`${NAME}: IFrame forced`);\n\n const $iframe = ui.loadIframe(\n href,\n '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(`${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(`${NAME}: page not found`);\n W.location.href = url;\n },\n 302: function () {\n console.log(`${NAME}: redirect 302`);\n W.location.href = url;\n },\n },\n error: function (jqXHR, status) {\n console.log(\n `${NAME}: AJAX request failure.${jqXHR.statusText}`,\n );\n\n var wrap = $(NETWORK_ERROR);\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 console.log(`${NAME}: AJAX success`);\n\n try {\n const dataJson = $.parseJSON(data);\n if (typeof dataJson === 'object') {\n console.log(`${NAME}: AJAX JSON`);\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 ui.$content.html(wrap);\n ui.contentLoaded();\n }\n\n // trigger events\n /*if (typeof (data['events']) === 'object') {\n for (var eventName in data.events) {\n $(D).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 !== W.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\tW.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 D.title,\n );\n $('.meta-lightbox-ajax').data(\n 'curr-link',\n W.location.href,\n );\n\n if (\n typeof W.localStorage !== 'undefined' &&\n\t\t\t\t\t\t\t\t\t\tlink !== '/'\n ) {\n W.localStorage.setItem(\n 'current-page',\n link,\n );\n }\n\n if (\n D.URL !== link &&\n\t\t\t\t\t\t\t\t\t\tD.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\tD.URL !==\n\t\t\t\t\t\t\t\t\t\t\t`${$('base').attr('href')}/${link}`\n ) {\n W.history.pushState(\n {\n title,\n page: link,\n ajax: 'true',\n },\n title,\n link,\n );\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 console.log(`${NAME}: AJAX HTML`);\n const $wrap = $(\n '<div class=\"meta-lightbox-ajax\" />',\n );\n $wrap.append(data);\n ui.$content.html($wrap);\n ui.contentLoaded();\n }\n\n // Vertically center html\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\n if (typeof W.imagesLoaded === 'function') {\n W.imagesLoaded().then(() => {\n $W.resize();\n });\n }\n }, 500);*/\n\n ui.contentLoaded();\n },\n });\n }\n }\n\n static loadIframe(href, classTerm) {\n const ui = this;\n\n const $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\n console.log(`${NAME}: loading iframe`);\n\n $Body.append(\n '<div id=\"MetaIFramePreload\" class=\"hidden d-none iframe-preload\" style=\"display:none\"></div>',\n );\n const $preload = $('#MetaIFramePreload');\n $preload.html($iframe);\n\n $iframe.on('load', () => {\n // don't load on offline\n if ($Body.hasClass('is-offline')) {\n console.warn(`${NAME}: Unable to load iframe offline`);\n return false;\n }\n ui.finishIFrameLoading();\n });\n\n return $iframe;\n }\n\n static finishIFrameLoading() {\n const ui = this;\n\n const $preload = $('#MetaIFramePreload');\n if (!$preload.length) {\n console.warn(`${NAME}: iframe preload not found`);\n return false;\n }\n\n const $iframe = $preload.find('iframe');\n if (!$iframe.length) {\n console.warn(`${NAME}: iframe preload > iframe not found`);\n return false;\n }\n\n console.log(`${NAME}: the iframe was loaded`);\n $preload.html('');\n $preload.remove();\n\n ui.$content.addClass('iframe-delay');\n\n ui.$content.html($iframe);\n ui.contentLoaded();\n\n setTimeout(() => {\n ui.$content.removeClass('iframe-delay');\n }, 1000);\n }\n\n static contentLoaded() {\n const ui = this;\n\n ui.$content.removeClass('meta-lightbox-loading');\n\n $(`.meta-lightbox-content .js${NAME},.meta-lightbox-content [data-toggle=\"lightbox\"],.meta-lightbox-content [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 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 W.localStorage !== 'undefined' && link !== '/') {\n W.localStorage.setItem('current-page', link);\n }\n\n if (\n D.URL !== link &&\n\t\t\t\t\tD.URL !== $('base').attr('href') + link &&\n\t\t\t\t\tD.URL !== `${$('base').attr('href')}/${link}`\n ) {\n W.history.replaceState(\n {\n title,\n page: link,\n ajax: 'true',\n },\n title,\n link,\n );\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(\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(`MetaLightboxUI.init ${Events.AJAX} ${Events.LOADED}`, () => {\n MetaLightboxUI.init();\n });\n\n $W.on(`${Events.BACKONLINE}`, () => {\n $('.meta-offline').removeClass('meta-offline');\n\n console.log(`${NAME}: reloading iframe`);\n MetaLightboxUI.finishIFrameLoading();\n\n const $iframe = $('.meta-lightbox-content iframe');\n if ($iframe.length) {\n $iframe.attr('src', $iframe.attr('src'));\n }\n });\n\n W.MetaLightboxUI = MetaLightboxUI;\n\n return MetaLightboxUI;\n})($);\n\nexport default MetaLightboxUI;\n","module.exports = jQuery;"],"sourceRoot":""}

46
dist/records.json vendored Normal file
View File

@ -0,0 +1,46 @@
{
"HtmlWebpackCompiler": [
{
"chunks": {
"byName": {
"HtmlWebpackPlugin_0": 443
},
"bySource": {
"0 HtmlWebpackPlugin_0": 443
},
"usedIds": [
443
]
},
"modules": {
"byIdentifier": {
"./node_modules/.pnpm/html-loader@1.3.2_webpack@5.11.0/node_modules/html-loader/dist/cjs.js!./src/html/meta-lightbox.html": 797,
"./node_modules/.pnpm/html-webpack-plugin@4.5.0_webpack@5.11.0/node_modules/html-webpack-plugin/lib/loader.js!./src/index.html": 853
},
"usedIds": [
797,
853
]
}
}
],
"chunks": {
"byName": {
"app": 143
},
"bySource": {
"0 app": 143
},
"usedIds": [
143
]
},
"modules": {
"byIdentifier": {
"./node_modules/.pnpm/babel-loader@8.2.2_3d9c2a837cc4b2484cb693b7275aaf13/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].use!./src/js/app.js|f9ef15cfc04422112506fdbd7697fdab": 70
},
"usedIds": [
70
]
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@a2nt/meta-lightbox",
"version": "2.4.0",
"version": "2.7.1",
"description": "Universal Lightbox window",
"main": "meta-lightbox.js",
"author": "Tony Air <tony@twma.pro>",
@ -9,13 +9,19 @@
"type": "git",
"url": "git+https://github.com/a2nt/meta-lightbox.git"
},
"private": false,
"main": "src/js/app.js",
"repository": {
"type": "git",
"url": "git+https://github.com/a2nt/webpack-bootstrap-ui-kit"
},
"engines": {
"yarn": ">= 1.0.0"
},
"scripts": {
"start": "cross-env NODE_ENV=development webpack-dev-server --https -d --config webpack.config.js",
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.js",
"build": "cross-env NODE_ENV=production webpack -p --config webpack.config.js --progress",
"start": "cross-env NODE_ENV=development webpack-dev-server --https",
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server",
"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",
"lint:js": "eslint ./src --config .eslintrc",
@ -32,68 +38,106 @@
"ie>=11"
],
"dependencies": {
"font-awesome": "^4",
"aos": "^2.3.4",
"bootbox": "^5.5.2",
"bootstrap": "^4.5.3",
"bootstrap-confirmation2": "^4.1.0",
"bootstrap-datepicker": "^1.9.0",
"bootstrap-offcanvas": "^1.0.0",
"bootstrap-table": "^1.18.1",
"bootstrap-timepicker": "^0.5.2",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"inputmask": "^5.0.5",
"jquery": "^3.5.1",
"jquery-hammerjs": "^2.0.0",
"jquery-hoverintent": "*",
"jquery-zoom": "^1.7.21",
"jquery.appear": "^1.0.1",
"jquery.instagramFeed": "github:jsanahuja/jquery.instagramFeed",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"mapbox-gl": "^2.0.1",
"material-design-color": "^2.3.2",
"yarn": "^1.22.5"
"moment": "^2.29.1",
"offcanvas-bootstrap": "^2.5.2",
"popper.js": "*",
"select2": "^4.0.13",
"setimmediate": "^1.0.5",
"smooth-scroll": "^16.1.3",
"sticky-sidebar": "^3.3.1",
"tablednd": "^1.0.5",
"yarn": "^1.22.10"
},
"devDependencies": {
"@a2nt/image-sprite-webpack-plugin": "^0.2.5",
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/plugin-transform-react-jsx": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"@babel/core": "^7.12.10",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-transform-react-jsx": "^7.12.12",
"@babel/preset-env": "^7.12.11",
"@googlemaps/markerclustererplus": "*",
"animate.css": "^4.1.1",
"ansi-html": "^0.0.7",
"ansi-regex": "^5.0.0",
"autoprefixer": "^9.8.6",
"autoprefixer": "^10.1.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"copy-webpack-plugin": "^6.1.0",
"cross-env": "^7.0.2",
"css-loader": "^4.3.0",
"eslint": "^7.8.1",
"eslint-plugin-import": "^2.22.0",
"babel-loader": "^8.2.2",
"bindings": "^1.5.0",
"copy-webpack-plugin": "^7.0.0",
"croppie": "^2.6.5",
"cross-env": "^7.0.3",
"css-loader": "^5.0.1",
"eslint": "^7.16.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jquery": "^1.5.1",
"eslint-plugin-react": "^7.20.6",
"exports-loader": "^1.1.0",
"favicons-webpack-plugin": "4.2.00",
"file-loader": "^6.1.0",
"hard-source-webpack-plugin": "^0.13.1",
"html-entities": "^1.3.1",
"html-loader": "^1.3.0",
"html-webpack-plugin": "^4.4.1",
"imagemin-gifsicle": "^7.0.0",
"eslint-plugin-react": "^7.21.5",
"exif-js": "^2.3.0",
"exports-loader": "^1.1.1",
"fast-levenshtein": "^3.0.0",
"fastest-levenshtein": "^1.0.12",
"favicons-webpack-plugin": "^4.2.0",
"file-loader": "^6.2.0",
"font-awesome": "^4.7.0",
"fsevents": "^2.2.1",
"hoist-non-react-statics": "^3.3.2",
"html-entities": "^1.4.0",
"html-loader": "^1.3.2",
"html-webpack-plugin": "^4.5.0",
"image-minimizer-webpack-plugin": "^2.1.0",
"imagemin-jpegtran": "^7.0.0",
"imagemin-optipng": "^8.0.0",
"imagemin-svgo": "^8.0.0",
"imagemin-webpack": "^5.1.1",
"loglevel": "^1.7.0",
"mini-css-extract-plugin": "^0.11.1",
"node-sass": "^4.14.1",
"img-optimize-loader": "^1.0.7",
"loglevel": "^1.7.1",
"mini-css-extract-plugin": "^1.3.3",
"node-sass": "^5.0.0",
"object-assign": "^4.1.1",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"postcss-loader": "^4.0.1",
"react-hot-loader": "^4.12.21",
"resolve-url-loader": "^3.1.1",
"postcss-loader": "^4.1.0",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-hot-loader": "^4.13.0",
"react-is": "^17.0.1",
"react-lifecycles-compat": "^3.0.4",
"resolve-url-loader": "^3.1.2",
"rimraf": "^3.0.2",
"routie": "0.0.1",
"sass-lint": "^1.13.1",
"sass-lint-fix": "^1.12.1",
"sass-loader": "^10.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"sass-loader": "^10.1.0",
"scheduler": "^0.20.1",
"script-ext-html-webpack-plugin": "^2.1.5",
"shallowequal": "^1.1.0",
"sockjs-client": "^1.5.0",
"strip-ansi": "^6.0.0",
"style-loader": "^1.2.1",
"svg-url-loader": "^6.0.0",
"terser-webpack-plugin": "^4.1.0",
"url-loader": "^4.1.0",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-manifest-plugin": "^2.2.0",
"webpack-merge": "^5.1.4"
"style-loader": "^2.0.0",
"svg-url-loader": "^7.1.1",
"terser-webpack-plugin": "^5.0.3",
"url-loader": "^4.1.1",
"webpack": "^5.11.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^4.0.0-beta.0",
"webpack-manifest-plugin": "^3.0.0",
"webpack-merge": "^5.7.3"
},
"stylelint": {
"rules": {

View File

@ -2,7 +2,7 @@
* Add your global events here
*/
module.exports = {
export default {
AJAX: 'ajax-load',
AJAXMAIN: 'ajax-main-load',
MAININIT: 'main-init',

View File

@ -21,7 +21,7 @@ const MetaLightboxUI = (($) => {
const NAME = 'MetaLightboxUI';
const NETWORK_ERROR =
'<div class="meta-lightbox-error"><div class="alert alert-error alert-danger">Connection failure.</div></div>';
'<div class="meta-lightbox-error"><div class="alert alert-error alert-danger">Connection failure.</div></div>';
class MetaLightboxUI {
static init() {
@ -45,12 +45,17 @@ const MetaLightboxUI = (($) => {
ui.show($link);
},
);
$(`.js${NAME}-close-inline`).on('click', (e) => {
const $el = $(e.currentTarget);
$el.parents('.meta-lightbox-overlay').removeClass('meta-lightbox-open');
});
}
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)';
@ -76,9 +81,7 @@ const MetaLightboxUI = (($) => {
// Nav
if ($link.data('lightbox-gallery')) {
const $galleryItems = $(
`[data-lightbox-gallery="${$link.data(
'lightbox-gallery',
)}"]`,
`[data-lightbox-gallery="${$link.data('lightbox-gallery')}"]`,
);
if ($galleryItems.length === 1) {
@ -94,8 +97,7 @@ const MetaLightboxUI = (($) => {
e.preventDefault();
const index = $galleryItems.index($link);
let $currentLink = $galleryItems.eq(index - 1);
if (!$currentLink.length)
$currentLink = $galleryItems.last();
if (!$currentLink.length) $currentLink = $galleryItems.last();
//ui.hide();
setTimeout(() => {
@ -110,8 +112,7 @@ const MetaLightboxUI = (($) => {
e.preventDefault();
const index = $galleryItems.index($link);
let $currentLink = $galleryItems.eq(index + 1);
if (!$currentLink.length)
$currentLink = $galleryItems.first();
if (!$currentLink.length) $currentLink = $galleryItems.first();
//ui.hide();
setTimeout(() => {
@ -131,7 +132,7 @@ const MetaLightboxUI = (($) => {
const overlay = $('<div>', {
class:
'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade',
'meta-lightbox-overlay meta-lightbox-theme-default meta-lightbox-effect-fade',
});
const wrap = $('<div>', {
class: 'meta-lightbox-wrap',
@ -188,9 +189,9 @@ const MetaLightboxUI = (($) => {
const ui = this;
const href =
$link.attr('href') && $link.attr('href').length
? $link.attr('href')
: $link.data('href');
$link.attr('href') && $link.attr('href').length
? $link.attr('href')
: $link.data('href');
// add custom link specific class
ui.$content.attr('class', 'meta-lightbox-content');
@ -202,12 +203,8 @@ const MetaLightboxUI = (($) => {
}
const $pageSpinner = $('#PageLoading .loading-spinner');
const loadingContent = $pageSpinner.length
? $pageSpinner.clone()
: '';
ui.$content
.append(loadingContent)
.addClass('meta-lightbox-loading');
const loadingContent = $pageSpinner.length ? $pageSpinner.clone() : '';
ui.$content.append(loadingContent).addClass('meta-lightbox-loading');
// Image
if (href.match(/\.(jpeg|jpg|gif|png|svg)$/i)) {
@ -215,9 +212,7 @@ const MetaLightboxUI = (($) => {
url: href,
success: () => {
const img = $('<img>', { src: href });
const wrap = $(
'<div class="meta-lightbox-image"></div>',
);
const wrap = $('<div class="meta-lightbox-image"></div>');
const imgwrapper = $(
'<span class="meta-lightbox-zoom-wrapper"></span>',
);
@ -362,10 +357,7 @@ const MetaLightboxUI = (($) => {
if ($link.data('force-iframe')) {
console.log(`${NAME}: IFrame forced`);
const $iframe = ui.loadIframe(
href,
'meta-lightbox-iframe-content',
);
const $iframe = ui.loadIframe(href, 'meta-lightbox-iframe-content');
if (!$iframe) {
$link.addClass('meta-offline');
return false;
@ -394,9 +386,7 @@ const MetaLightboxUI = (($) => {
},
},
error: function (jqXHR, status) {
console.log(
`${NAME}: AJAX request failure.${jqXHR.statusText}`,
);
console.log(`${NAME}: AJAX request failure.${jqXHR.statusText}`);
var wrap = $(NETWORK_ERROR);
ui.$content.html(wrap);
@ -404,13 +394,7 @@ 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) {
@ -423,15 +407,10 @@ 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'],
);
var wrap = $('<div class="meta-lightbox-ajax" />');
wrap.html(dataJson['regions']['LayoutAjax']);
ui.$content.html(wrap);
ui.contentLoaded();
}
@ -448,41 +427,24 @@ const MetaLightboxUI = (($) => {
if (
title &&
title.length &&
link &&
link.length &&
link !== W.location.href &&
link.substring(0, link.indexOf('#')) !==
W.location.href.replace(
$('base').attr('href'),
'/',
)
title.length &&
link &&
link.length &&
link !== W.location.href &&
link.substring(0, link.indexOf('#')) !==
W.location.href.replace($('base').attr('href'), '/')
) {
$('.meta-lightbox-ajax').data(
'curr-title',
D.title,
);
$('.meta-lightbox-ajax').data(
'curr-link',
W.location.href,
);
$('.meta-lightbox-ajax').data('curr-title', D.title);
$('.meta-lightbox-ajax').data('curr-link', W.location.href);
if (
typeof W.localStorage !== 'undefined' &&
link !== '/'
) {
W.localStorage.setItem(
'current-page',
link,
);
if (typeof W.localStorage !== 'undefined' && link !== '/') {
W.localStorage.setItem('current-page', link);
}
if (
D.URL !== link &&
D.URL !==
$('base').attr('href') + link &&
D.URL !==
`${$('base').attr('href')}/${link}`
D.URL !== $('base').attr('href') + link &&
D.URL !== `${$('base').attr('href')}/${link}`
) {
W.history.pushState(
{
@ -500,10 +462,7 @@ 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');
@ -512,9 +471,7 @@ const MetaLightboxUI = (($) => {
}
} catch (e) {
console.log(`${NAME}: AJAX HTML`);
const $wrap = $(
'<div class="meta-lightbox-ajax" />',
);
const $wrap = $('<div class="meta-lightbox-ajax" />');
$wrap.append(data);
ui.$content.html($wrap);
ui.contentLoaded();
@ -621,16 +578,20 @@ const MetaLightboxUI = (($) => {
ui.$content.removeClass('meta-lightbox-loading');
$(`.meta-lightbox-content .js${NAME},.meta-lightbox-content [data-toggle="lightbox"],.meta-lightbox-content [data-lightbox-gallery]`).on(
'click',
(e) => {
e.preventDefault();
e.stopPropagation();
const $link = $(e.currentTarget);
$(
`.meta-lightbox-content .js${NAME},.meta-lightbox-content [data-toggle="lightbox"],.meta-lightbox-content [data-lightbox-gallery]`,
).on('click', (e) => {
e.preventDefault();
e.stopPropagation();
const $link = $(e.currentTarget);
ui.show($link);
},
);
ui.show($link);
});
$(`.js${NAME}-close`).on('click', (e) => {
e.preventDefault();
ui.hide();
});
setTimeout(() => {
$W.trigger('meta-lightbox-loaded');
@ -655,8 +616,8 @@ const MetaLightboxUI = (($) => {
if (
D.URL !== link &&
D.URL !== $('base').attr('href') + link &&
D.URL !== `${$('base').attr('href')}/${link}`
D.URL !== $('base').attr('href') + link &&
D.URL !== `${$('base').attr('href')}/${link}`
) {
W.history.replaceState(
{

View File

@ -60,6 +60,7 @@
.meta-lightbox-theme-default .meta-lightbox-ajax,
.meta-lightbox-theme-default .meta-lightbox-inline {
color: $black;
background: $white;
padding: 2em;
box-shadow: 0px 1px 1px transparentize($black, 0.4);

View File

@ -1,37 +1,50 @@
const SOURCEDIR = './src';
const COMPRESS = false;
const COMPRESS = true;
const conf = {
APPDIR: '',
SRC: 'src',
DIST: 'dist',
webp: false,
};
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const path = require('path');
const filesystem = require('fs');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack');
const ImageminPlugin = require('image-minimizer-webpack-plugin');
const ImageSpritePlugin = require('@a2nt/image-sprite-webpack-plugin');
const UIInfo = require('./package.json');
console.log('WebP images: ' + conf['webp']);
const plugins = [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),
new HardSourceWebpackPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: COMPRESS,
debug: false,
}),
new MiniCssExtractPlugin({
filename: 'css/[name].css',
allChunks: true,
//allChunks: true,
}),
/**/
new HtmlWebpackPlugin({
template: './src/index.html',
template: path.join(conf.APPDIR, conf.SRC, 'index.html'),
}),
new webpack.DefinePlugin({
UINAME: JSON.stringify(UIInfo.name),
UIVERSION: JSON.stringify(UIInfo.version),
UIAUTHOR: JSON.stringify(UIInfo.author),
}),
];
@ -61,18 +74,12 @@ if (COMPRESS) {
}),
);
plugins.push(require('autoprefixer'));
plugins.push(
new ImageminPlugin({
bail: false, // Ignore errors on corrupted images
cache: true,
filter: (source, sourcePath) => {
if (source.byteLength < 512000) {
return false;
}
return true;
},
imageminOptions: {
minimizerOptions: {
// Lossless optimization with custom option
// Feel free to experiment with options for better result for you
plugins: [
['gifsicle', { interlaced: true }],
['jpegtran', { progressive: true }],
@ -162,33 +169,28 @@ const _addAppFiles = (theme) => {
}
};
_addAppFiles(SOURCEDIR);
// remove unnecessary elements for the demo
delete includes['app_cms'];
delete includes['app_editor'];
delete includes['app_order'];
_addAppFiles(path.join(conf.APPDIR, conf.SRC));
module.exports = {
entry: includes,
output: {
path: path.resolve(__dirname, 'dist'),
filename: path.join('js', '[name].js'),
publicPath: path.resolve(__dirname, 'dist'),
recordsPath: path.join(__dirname, conf.APPDIR, conf.DIST, 'records.json'),
cache: {
type: 'filesystem',
},
output: {
publicPath: path.join(conf.APPDIR),
path: path.join(__dirname, conf.APPDIR, conf.DIST),
filename: path.join('js', '[name].js'),
},
devtool: COMPRESS ? '' : 'source-map',
externals: {
jquery: 'jQuery',
},
optimization: {
namedModules: true, // NamedModulesPlugin()
splitChunks: {
// CommonsChunkPlugin()
name: 'vendor',
minChunks: 2,
},
noEmitOnErrors: true, // NoEmitOnErrorsPlugin
concatenateModules: true, //ModuleConcatenationPlugin
concatenateModules: true,
minimizer: [
new TerserPlugin({
terserOptions: {
@ -211,6 +213,9 @@ module.exports = {
},
mangle: {
safari10: true,
/*keep_fnames: true,
keep_classnames: true,
reserved: ['$', 'jQuery', 'jquery'],*/
},
output: {
ecma: 5,
@ -223,8 +228,6 @@ module.exports = {
// Use multi-process parallel running to improve the build speed
// Default number of concurrent runs: os.cpus().length - 1
parallel: true,
// Enable file caching
cache: true,
}),
],
},
@ -237,24 +240,12 @@ module.exports = {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'], //Preset used for env setup
plugins: [
['@babel/transform-react-jsx'],
['react-hot-loader/babel'],
],
plugins: [['@babel/transform-react-jsx']],
cacheDirectory: true,
cacheCompression: false,
},
},
},
/*{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.coffee?$/,
use: 'coffee-loader',
},*/
{
test: /\.worker\.js$/,
use: {
@ -273,12 +264,6 @@ module.exports = {
sourceMap: !COMPRESS,
},
},
{
loader: 'postcss-loader',
options: {
sourceMap: !COMPRESS,
},
},
{
loader: 'resolve-url-loader',
},
@ -317,13 +302,26 @@ module.exports = {
],
},
{
test: /\.(png|jpg|jpeg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'img/',
publicPath: '../img/',
},
test: /\.(png|webp|jpg|jpeg|gif|svg)$/,
use: [
{
loader: 'img-optimize-loader',
options: {
name: '[name].[ext]',
outputPath: 'img/',
publicPath: '../img/',
compress: {
// This will take more time and get smaller images.
mode: 'low', // 'lossless', 'high', 'low'
disableOnDevelopment: true,
webp: conf['webp'],
},
inline: {
limit: 1,
},
},
},
],
},
],
},
@ -336,6 +334,7 @@ module.exports = {
jquery: require.resolve('jquery'),
jQuery: require.resolve('jquery'),
},
fallback: { url: false, events: false },
},
plugins: plugins,
@ -344,12 +343,12 @@ module.exports = {
port: 8001,
historyApiFallback: true,
hot: false,
clientLogLevel: 'info',
/*clientLogLevel: 'info',
contentBase: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, 'dist'),
],
],*/
//watchContentBase: true,
overlay: {
warnings: true,