fslightbox
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -1,1 +0,1 @@ | ||
!function(){return function e(t,s,n){function i(r,d){if(!s[r]){if(!t[r]){var a="function"==typeof require&&require;if(!d&&a)return a(r,!0);if(o)return o(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var c=s[r]={exports:{}};t[r][0].call(c.exports,function(e){return i(t[r][1][e]||e)},c,c.exports,e,t,s,n)}return s[r].exports}for(var o="function"==typeof require&&require,r=0;r<n.length;r++)i(n[r]);return i}}()({1:[function(e,t,s){t.exports=function(e){this.elem=document.createElement(e),this.addClassesAndCreate=function(e){for(let t in e)this.elem.classList.add(e[t]);return this.elem}}},{}],2:[function(e,t,s){const n=e("./DOMObject");t.exports=function(){const e=new n("div").addClassesAndCreate(["fslightbox-media-holder"]);return window.innerWidth>1e3?(e.style.width=window.innerWidth-.1*window.innerWidth+"px",e.style.height=window.innerHeight-.1*window.innerHeight+"px"):(e.style.width=window.innerWidth+"px",e.style.height=window.innerHeight+"px"),e}},{"./DOMObject":1}],3:[function(e,t,s){t.exports=function(){this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.classList.add("fslightbox-svg-path"),this.svg.setAttributeNS(null,"class","fslightbox-svg-icon"),this.svg.setAttributeNS(null,"viewBox","0 0 15 15"),this.getSVGIcon=function(e,t,s){return this.path.setAttributeNS(null,"d",s),this.svg.setAttributeNS(null,"viewBox",e),this.svg.setAttributeNS(null,"width",t),this.svg.setAttributeNS(null,"height",t),this.svg.appendChild(this.path),this.svg}}},{}],4:[function(e,t,s){const n=e("./DOMObject");t.exports=function(e){this.toolbarElem=new n("div").addClassesAndCreate(["fslightbox-toolbar"]);const t=this;this.renderDefaultButtons=function(){let s=e.data.toolbarButtons;if(!0===s.fullscreen){let s=new n("div").addClassesAndCreate(["fslightbox-toolbar-button","fslightbox-flex-centered"]),i=(new e.SVGIcon).getSVGIcon("0 0 17.5 17.5","1.25em","M4.5 11H3v4h4v-1.5H4.5V11zM3 7h1.5V4.5H7V3H3v4zm10.5 6.5H11V15h4v-4h-1.5v2.5zM11 3v1.5h2.5V7H15V3h-4z");s.appendChild(i),s.onclick=function(){e.data.fullscreen?t.closeFullscreen():t.openFullscreen()},this.toolbarElem.appendChild(s)}if(!0===s.close){let t=new n("div").addClassesAndCreate(["fslightbox-toolbar-button","fslightbox-flex-centered"]),s=(new e.SVGIcon).getSVGIcon("0 0 20 20","1em","M 11.469 10 l 7.08 -7.08 c 0.406 -0.406 0.406 -1.064 0 -1.469 c -0.406 -0.406 -1.063 -0.406 -1.469 0 L 10 8.53 l -7.081 -7.08 c -0.406 -0.406 -1.064 -0.406 -1.469 0 c -0.406 0.406 -0.406 1.063 0 1.469 L 8.531 10 L 1.45 17.081 c -0.406 0.406 -0.406 1.064 0 1.469 c 0.203 0.203 0.469 0.304 0.735 0.304 c 0.266 0 0.531 -0.101 0.735 -0.304 L 10 11.469 l 7.08 7.081 c 0.203 0.203 0.469 0.304 0.735 0.304 c 0.267 0 0.532 -0.101 0.735 -0.304 c 0.406 -0.406 0.406 -1.064 0 -1.469 L 11.469 10 Z");t.appendChild(s),t.onclick=function(){e.data.fadingOut||e.hide()},this.toolbarElem.appendChild(t)}},this.openFullscreen=function(){e.data.fullscreen=!0;let t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()},this.closeFullscreen=function(){e.data.fullscreen=!1,document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},this.renderToolbar=function(e){this.renderDefaultButtons(),e.appendChild(this.toolbarElem)}}},{"./DOMObject":1}],5:[function(e,t,s){const n=e("../Components/DOMObject");t.exports=function(e){this.renderDOM=function(){e.element.id="fslightbox-container",document.body.appendChild(e.element),s(e.element),e.data.totalSlides>1&&o(e.element),e.element.appendChild(e.mediaHolder),e.data.isfirstTimeLoad=!0};const t=function(){let t=new n("div").addClassesAndCreate(["fslightbox-slide-number-container","fslightbox-flex-centered"]);e.data.slideCounterElem=document.createElement("div");const s=e.data.slideCounterElem;s.innerHTML=e.data.slide,s.id="current_slide";let i=new n("div").addClassesAndCreate(["fslightbox-slash"]);i.innerHTML="/";let o=document.createElement("div");o.innerHTML=e.data.totalSlides,t.appendChild(s),t.appendChild(i),t.appendChild(o),this.renderSlideCounter=function(s){e.data.slideCounter&&s.appendChild(t)}},s=function(s){if(e.data.nav=new n("div").addClassesAndCreate(["fslightbox-nav"]),e.toolbar.renderToolbar(e.data.nav),e.data.totalSlides>2){(new t).renderSlideCounter(e.data.nav)}s.appendChild(e.data.nav)},i=function(t,s,i){let o=new n("div").addClassesAndCreate(["fslightbox-slide-btn","fslightbox-flex-centered"]);o.appendChild((new e.SVGIcon).getSVGIcon("0 0 20 20","1em",i)),t.appendChild(o),s.appendChild(t)},o=function(t){if(!1===e.data.slideButtons)return!1;let s=new n("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-left-container"]);i(s,t,"M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z"),s.onclick=function(){e.appendMethods.previousSlideViaButton(e.data.slide)};let o=new n("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-right-container"]);i(o,t,"M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z"),o.onclick=function(){e.appendMethods.nextSlideViaButton(e.data.slide)}}}},{"../Components/DOMObject":1}],6:[function(e,t,s){t.exports=function(e){this.addRecompense=function(){if(!s())return;document.documentElement.style.marginRight=e+"px";const n=t();if(n)for(let t=0;t<n.length;t++)n[t].style.marginRight=e+"px"},this.removeRecompense=function(){if(!s())return;document.documentElement.style.marginRight="";const e=t();if(e)for(let t=0;t<e.length;t++)e[t].style.marginRight=""};const t=function(){return document.getElementsByClassName("recompense-for-scrollbar")},s=function(){return!!e}}},{}],7:[function(e,t,s){t.exports=function(e){this.getWidth=function(){let t=document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t);let s=t.offsetWidth;t.style.overflow="scroll";let n=document.createElement("div");n.style.width="100%",t.appendChild(n);let i=n.offsetWidth;t.parentNode.removeChild(t),e.scrollbarWidth=s-i}}},{}],8:[function(e,t,s){t.exports=function(t){const s=new(e("../Components/DOMObject"))("div").addClassesAndCreate(["fslightbox-invisible-hover"]),n={mediaHolder:t.mediaHolder,invisibleHover:s},i=t.data.sources,o=t.data.urls.length;let r,d,a=!1,l=!0;const c=function(e){"VIDEO"===e.target.tagName||e.touches||e.preventDefault();for(let e in n)n[e].classList.add("fslightbox-cursor-grabbing");a=!0,r=e.touches?e.touches[0].clientX:e.clientX,d=0},u=function(){t.element.contains(s)&&t.element.removeChild(s);let e=t.stageSourceIndexes.all(t.data.slide);for(let e in n)n[e].classList.remove("fslightbox-cursor-grabbing");a=!1,0!==d&&l&&(l=!1,i[e.previous].classList.add("fslightbox-transform-transition"),i[e.current].classList.add("fslightbox-transform-transition"),i[e.next].classList.add("fslightbox-transform-transition"),d>0?(1===t.data.slide?t.updateSlideNumber(t.data.totalSlides):t.updateSlideNumber(t.data.slide-1),o>=2?(t.slideTransformer.plus(i[e.current]),t.slideTransformer.zero(i[e.previous])):t.slideTransformer.zero(i[e.current]),e=t.stageSourceIndexes.all(t.data.slide),void 0===t.data.sources[e.previous]&&t.loadsources("previous",t.data.slide)):d<0&&(t.data.slide===t.data.totalSlides?t.updateSlideNumber(1):t.updateSlideNumber(t.data.slide+1),o>1?(t.slideTransformer.minus(i[e.current]),t.slideTransformer.zero(i[e.next])):t.slideTransformer.zero(i[e.current]),e=t.stageSourceIndexes.all(t.data.slide),void 0===t.data.sources[e.next]&&t.loadsources("next",t.data.slide)),d=0,t.stopVideos(),setTimeout(function(){i[e.previous].classList.remove("fslightbox-transform-transition"),i[e.current].classList.remove("fslightbox-transform-transition"),i[e.next].classList.remove("fslightbox-transform-transition"),l=!0},250))},h=function(e){if(!a||!l)return;let n;n=e.touches?e.touches[0].clientX:e.clientX,t.element.appendChild(s),d=n-r;const c=t.stageSourceIndexes.all(t.data.slide);o>=3&&(i[c.previous].style.transform="translate("+(-t.data.slideDistance*window.innerWidth+d)+"px,0)"),o>=1&&(i[c.current].style.transform="translate("+d+"px,0)"),o>=2&&(i[c.next].style.transform="translate("+(t.data.slideDistance*window.innerWidth+d)+"px,0)")};for(let e in n)n[e].addEventListener("mousedown",c),n[e].addEventListener("touchstart",c,{passive:!0});window.addEventListener("mouseup",u),window.addEventListener("touchend",u),s.addEventListener("mouseup",u),s.addEventListener("touchend",u,{passive:!0}),window.addEventListener("mousemove",h),window.addEventListener("touchmove",h,{passive:!0}),t.data.nav.addEventListener("mousedown",function(e){e.preventDefault()})}},{"../Components/DOMObject":1}],9:[function(e,t,s){t.exports=function(e){this.minus=function(t){t.style.transform="translate("+-e*window.innerWidth+"px,0)"},this.zero=function(e){e.style.transform="translate(0,0)"},this.plus=function(t){t.style.transform="translate("+e*window.innerWidth+"px,0)"}}},{}],10:[function(e,t,s){t.exports=function(e){this.previous=function(t){let s;const n=t-1;return s=0===n?e.totalSlides-1:n-1},this.next=function(t){let s;const n=t-1;return s=t===e.totalSlides?0:n+1},this.all=function(t){const s=t-1,n={previous:0,current:0,next:0};return n.previous=0===s?e.totalSlides-1:s-1,n.current=s,t===e.totalSlides?n.next=0:n.next=s+1,n}}},{}],11:[function(e,t,s){t.exports=function(t){const s="fslightbox-transform-transition",n="fslightbox-fade-out",i=function(s){const n=new(e("./Components/DOMObject"))("div").addClassesAndCreate(["fslightbox-source-holder","fslightbox-full-dimension"]);return n.innerHTML='<div class="fslightbox-loader"><div></div><div></div><div></div><div></div></div>',t.data.sources[s]=n,n},o=function(e){e.firstChild.classList.add("fslightbox-fade-in")},r=function(e){const t=e.firstChild;t.classList.remove("fslightbox-fade-in"),t.classList.remove(n),t.offsetWidth},d=function(e){const t=e.firstChild;t.style.animation="",t.offsetWidth,t.classList.add(n)};this.renderHolderInitial=function(e){const s=t.stageSourceIndexes.all(e),n=t.data.totalSlides;if(n>=3){const e=i(s.previous);t.slideTransformer.minus(e),t.mediaHolder.appendChild(e)}if(n>=1){const e=i(s.current);t.mediaHolder.appendChild(e)}if(n>=2){const e=i(s.next);t.slideTransformer.plus(e),t.mediaHolder.appendChild(e)}},this.renderHolder=function(e,t){switch(t){case"previous":a(e);break;case"current":c(e);break;case"next":l(e)}};const a=function(e){const s=t.stageSourceIndexes.previous(e),n=i(s);t.slideTransformer.minus(n),t.mediaHolder.insertAdjacentElement("afterbegin",n)},l=function(e){const s=t.stageSourceIndexes.next(e),n=i(s);t.slideTransformer.plus(n),t.mediaHolder.appendChild(n)},c=function(e){const s=t.stageSourceIndexes.all(e),n=i(s.current);t.slideTransformer.zero(n),t.mediaHolder.insertBefore(n,t.data.sources[s.next])};this.previousSlideViaButton=function(e){1===e?t.data.slide=t.data.totalSlides:t.data.slide-=1;const i=u();void 0===t.data.sources[i.previous]&&t.loadsources("previous",t.data.slide);const a=t.data.sources,l=a[i.current],c=a[i.next];c.classList.remove(s),l.classList.remove(s),a[i.previous].classList.remove(s),r(l),o(l),d(c),t.slideTransformer.zero(l),setTimeout(function(){t.slideTransformer.plus(c),c.firstChild.classList.remove(n)},220)},this.nextSlideViaButton=function(e){e===t.data.totalSlides?t.data.slide=1:t.data.slide+=1;const i=u();void 0===t.data.sources[i.next]&&t.loadsources("next",t.data.slide);const a=t.data.sources,l=a[i.current],c=a[i.previous];c.classList.remove(s),l.classList.remove(s),a[i.next].classList.remove(s),r(l),o(l),d(c),t.slideTransformer.zero(l),setTimeout(function(){t.slideTransformer.minus(c),c.firstChild.classList.remove(n)},220)};const u=function(){return t.stopVideos(),t.updateSlideNumber(t.data.slide),t.stageSourceIndexes.all(t.data.slide)}}},{"./Components/DOMObject":1}],12:[function(e,t,s){window.fsLightboxClass=function(){const t=e("./Components/DOMObject");this.data={slide:1,totalSlides:1,slideDistance:1.3,slideCounter:!0,slideButtons:!0,isFirstTimeLoad:!1,moveSlidesViaDrag:!0,toolbarButtons:{close:!0,fullscreen:!0},name:"",recompenseClassName:"",scrollbarWidth:0,urls:[],sources:[],sourcesLoaded:[],rememberedSourcesDimensions:[],videos:[],videosPosters:[],holderWrapper:{},mediaHolder:{},nav:{},toolbar:{},slideCounterElem:{},initiated:!1,fullscreen:!1,fadingOut:!1};const s=this;this.init=function(t){if(this.data.initiated)return this.initSetSlide(t),void this.show();let s=this.data.name,i=[];const o=fsLightboxHelpers.a;for(let e=0;e<o.length;e++)if(o[e].hasAttribute("data-fslightbox")&&o[e].getAttribute("data-fslightbox")===s){let t=i.push(o[e].getAttribute("href"));o[e].hasAttribute("data-video-poster")&&(this.data.videosPosters[t-1]=o[e].getAttribute("data-video-poster"))}this.data.urls=i,this.data.totalSlides=i.length,n.renderDOM(),document.documentElement.classList.add("fslightbox-open"),this.scrollbarRecompensor.addRecompense(),this.onResizeEvent.init(),this.throwEvent("init"),this.throwEvent("open"),e("./Core/SlideSwiping.js")(this),this.initSetSlide(t),this.data.initiated=!0,this.element.classList.add("fslightbox-open")},this.initSetSlide=function(e){switch(typeof e){case"string":this.setSlide(this.data.urls.indexOf(e)+1);break;case"number":this.setSlide(e);break;case"undefined":this.setSlide(1)}},this.show=function(){const e=this.element;this.scrollbarRecompensor.addRecompense(),e.classList.remove("fslightbox-fade-out-complete"),document.documentElement.classList.add("fslightbox-open"),e.offsetWidth,e.classList.add("fslightbox-fade-in-complete"),document.body.appendChild(e),this.onResizeEvent.addListener(),this.throwEvent("show"),this.throwEvent("open")},this.hide=function(){this.data.fullscreen&&this.toolbar.closeFullscreen(),this.element.classList.add("fslightbox-fade-out-complete"),this.data.fadingOut=!0,this.throwEvent("close"),this.onResizeEvent.removeListener(),setTimeout(function(){s.scrollbarRecompensor.removeRecompense(),document.documentElement.classList.remove("fslightbox-open"),s.data.fadingOut=!1,document.body.removeChild(s.element)},250)},this.updateSlideNumber=function(e){this.data.slide=e,this.data.totalSlides>1&&(this.data.slideCounterElem.innerHTML=e)},this.throwEvent=function(e){let t;"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),this.element.dispatchEvent(t)},this.element=new t("div").addClassesAndCreate(["fslightbox-container","fslightbox-full-dimension"]),this.mediaHolder=new(e("./Components/MediaHolder"));const n=new(e("./Core/DomRenderer"))(this);this.stageSourceIndexes=new(e("./Core/StageSourcesIndexes"))(this.data),new(e("./Core/ScrollbarWidthGetter"))(this.data).getWidth(),this.onResizeEvent=new(e("./onResizeEvent"))(this),this.scrollbarRecompensor=new(e("./Core/ScrollbarRecompensor"))(this.data.scrollbarWidth),this.slideTransformer=new(e("./Core/SlideTransformer"))(this.data.slideDistance),this.toolbar=new(e("./Components/Toolbar"))(this),this.SVGIcon=e("./Components/SVGIcon"),this.appendMethods=new(e("./appendMethods"))(this),this.loadsources=function(t,s){return new(e("./loadSource.js"))(this,t,s)},this.stopVideos=function(){const e=this.data.videos,t=this.data.sources;for(let s in e)!0===e[s]?void 0!==t[s].firstChild.pause&&t[s].firstChild.pause():t[s].firstChild.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}',"*")},this.setSlide=function(e){this.data.slide=e,this.updateSlideNumber(e);const t=this.stageSourceIndexes.all(e),s=this.data.sources;0===s.length?this.loadsources("initial",e):(void 0===s[t.previous]&&this.loadsources("previous",e),void 0===s[t.current]&&this.loadsources("current",e),void 0===s[t.next]&&this.loadsources("next",e));for(let e in s)s[e].classList.remove("fslightbox-transform-transition"),e==t.previous&&s.length>1?this.slideTransformer.minus(s[t.previous]):e!=t.current?e!=t.next?this.slideTransformer.minus(s[e]):this.slideTransformer.plus(s[t.next]):this.slideTransformer.zero(s[t.current])}},function(){window.fsLightboxInstances=[],window.fsLightboxHelpers={a:document.getElementsByTagName("a")};let e=window.fsLightboxHelpers.a;for(let t=0;t<e.length;t++){if(!e[t].hasAttribute("data-fslightbox"))continue;const s=e[t].getAttribute("data-fslightbox");void 0===window.fsLightboxInstances[s]&&(window.fsLightbox=new window.fsLightboxClass,window.fsLightbox.data.name=s,window.fsLightboxInstances[s]=window.fsLightbox),e[t].addEventListener("click",function(e){e.preventDefault();let t=this.getAttribute("data-fslightbox");if(window.fsLightboxInstances[t].data.initiated)return window.fsLightboxInstances[t].setSlide(window.fsLightboxInstances[t].data.urls.indexOf(this.getAttribute("href"))+1),void window.fsLightboxInstances[t].show();window.fsLightboxInstances[t].init(this.getAttribute("href"))})}}(document,window)},{"./Components/DOMObject":1,"./Components/MediaHolder":2,"./Components/SVGIcon":3,"./Components/Toolbar":4,"./Core/DomRenderer":5,"./Core/ScrollbarRecompensor":6,"./Core/ScrollbarWidthGetter":7,"./Core/SlideSwiping.js":8,"./Core/SlideTransformer":9,"./Core/StageSourcesIndexes":10,"./appendMethods":11,"./loadSource.js":13,"./onResizeEvent":14}],13:[function(e,t,s){t.exports=function(t,s,n){const i=e("./Components/DOMObject"),o=t.stageSourceIndexes.all(n),r=t.data.urls,d=t.data.sources;let a=function(e,s,n,o){let r=new i("div").addClassesAndCreate(["fslightbox-source-holder"]);t.data.rememberedSourcesDimensions[o]={width:s,height:n},r.appendChild(e),function(e,t){e.innerHTML="",e.appendChild(t),e.firstChild.offsetWidth}(d[o],e),t.onResizeEvent.scaleSource(o)};const l=function(e){let t=new i("div").addClassesAndCreate(["fslightbox-invalid-file-wrapper"]);t.innerHTML="Invalid file",a(t,window.innerWidth,window.innerHeight,e)};if(this.createSourceElem=function(e){const s=document.createElement("a"),n=t.data.urls[e];if(s.href=n,"www.youtube.com"===s.hostname)t.data.videos[e]=!1,function(e,s){let n=new i("iframe").addClassesAndCreate(["fslightbox-single-source"]);n.src="//www.youtube.com/embed/"+e+"?enablejsapi=1",n.setAttribute("allowfullscreen",""),n.setAttribute("frameborder","0"),t.mediaHolder.appendChild(n),a(n,1920,1080,s)}(function(e){let t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return t&&11==t[2].length?t[2]:"error"}(n),e);else{const s=new XMLHttpRequest;s.onreadystatechange=function(){if(2===s.readyState){if(200===s.status||206===s.status){const n=s.getResponseHeader("content-type"),o=n.slice(0,n.indexOf("/"));"image"===o?function(e,t){let s=new i("img").addClassesAndCreate(["fslightbox-single-source"]);s.src=e,s.addEventListener("load",function(){a(s,this.width,this.height,t)})}(r[e],e):"video"===o?(!function(e,s,n){let o,r,d=!1,l=new i("video").addClassesAndCreate(["fslightbox-single-source"]),c=new i("source").elem;t.data.videosPosters[s]&&(l.poster=t.data.videosPosters[s],l.style.objectFit="cover"),c.src=e,c.type=n,l.appendChild(c),l.onloadedmetadata=function(){d||(this.videoWidth&&0!==this.videoWidth?(o=this.videoWidth,r=this.videoHeight):(o=1920,r=1080),d=!0,a(l,o,r,s))};let u=0,h=setInterval(function(){if(d)clearInterval(h);else{if(l.videoWidth&&0!==l.videoWidth)o=l.videoWidth,r=l.videoHeight;else{if(u<31)return void u++;o=1920,r=1080}d=!0,a(l,o,r,s),clearInterval(h)}},100);l.setAttribute("controls","")}(r[e],e,n),t.data.videos[e]=!0):l(e)}else l(e);s.abort()}},s.open("get",n,!0),s.send(null)}},"initial"===s)t.appendMethods.renderHolderInitial(n,i),r.length>=1&&this.createSourceElem(o.current),r.length>=2&&this.createSourceElem(o.next),r.length>=3&&this.createSourceElem(o.previous);else switch(t.appendMethods.renderHolder(n,s),s){case"previous":this.createSourceElem(o.previous);break;case"current":this.createSourceElem(o.current);break;case"next":this.createSourceElem(o.next)}}},{"./Components/DOMObject":1}],14:[function(e,t,s){t.exports=function(e){const t=this,s=e.data.sources,n=e.data.rememberedSourcesDimensions;this.mediaHolderDimensions=function(){const t=e.mediaHolder.style,s=window.innerWidth,n=window.innerHeight;s>1e3?(t.width=s-.1*s+"px",t.height=n-.1*n+"px"):(t.width=s+"px",t.height=n-.1*n+"px")},this.scaleAndTransformSources=function(){const t=e.data.urls.length,n=e.stageSourceIndexes.all(e.data.slide);t>0&&e.slideTransformer.zero(s[n.current]),t>1&&e.slideTransformer.plus(s[n.next]),t>2&&e.slideTransformer.minus(s[n.previous]);for(let i=0;i<t;i++)this.scaleSource(i),i!==n.current&&i!==n.next&&i!==n.previous&&s[i]&&e.slideTransformer.plus(s[i])},this.scaleSource=function(t){if(!s[t])return;const i=s[t].firstChild;let o=n[t].width,r=n[t].height;const d=o/r,a=parseInt(e.mediaHolder.style.width),l=parseInt(e.mediaHolder.style.height);let c=a/d;const u=function(){i.style.height=c+"px",i.style.width=c*d+"px"};if(c<l)return o<a&&(c=r),void u();c=r>l?l:r,u()},this.init=function(){this.mediaHolderDimensions(),this.addListener()},this.addListener=function(){window.addEventListener("resize",i)};const i=function(){t.mediaHolderDimensions(),t.scaleAndTransformSources()};this.removeListener=function(){window.removeEventListener("resize",i)}}},{}]},{},[12]); | ||
!function(){return function e(t,s,n){function i(r,d){if(!s[r]){if(!t[r]){var a="function"==typeof require&&require;if(!d&&a)return a(r,!0);if(o)return o(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var c=s[r]={exports:{}};t[r][0].call(c.exports,function(e){return i(t[r][1][e]||e)},c,c.exports,e,t,s,n)}return s[r].exports}for(var o="function"==typeof require&&require,r=0;r<n.length;r++)i(n[r]);return i}}()({1:[function(e,t,s){t.exports=function(e){this.elem=document.createElement(e),this.addClassesAndCreate=function(e){for(let t in e)this.elem.classList.add(e[t]);return this.elem}}},{}],2:[function(e,t,s){const n=e("./DOMObject");t.exports=function(){const e=new n("div").addClassesAndCreate(["fslightbox-media-holder"]);return window.innerWidth>1e3?(e.style.width=window.innerWidth-.1*window.innerWidth+"px",e.style.height=window.innerHeight-.1*window.innerHeight+"px"):(e.style.width=window.innerWidth+"px",e.style.height=window.innerHeight+"px"),e}},{"./DOMObject":1}],3:[function(e,t,s){t.exports=function(){this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.classList.add("fslightbox-svg-path"),this.svg.setAttributeNS(null,"class","fslightbox-svg-icon"),this.svg.setAttributeNS(null,"viewBox","0 0 15 15"),this.getSVGIcon=function(e,t,s){return this.path.setAttributeNS(null,"d",s),this.svg.setAttributeNS(null,"viewBox",e),this.svg.setAttributeNS(null,"width",t),this.svg.setAttributeNS(null,"height",t),this.svg.appendChild(this.path),this.svg}}},{}],4:[function(e,t,s){const n=e("./DOMObject");t.exports=function(e){this.toolbarElem=new n("div").addClassesAndCreate(["fslightbox-toolbar"]);const t=this;this.renderDefaultButtons=function(){let s=e.data.toolbarButtons;if(!0===s.fullscreen){let s=new n("div").addClassesAndCreate(["fslightbox-toolbar-button","fslightbox-flex-centered"]),i=(new e.SVGIcon).getSVGIcon("0 0 17.5 17.5","20px","M4.5 11H3v4h4v-1.5H4.5V11zM3 7h1.5V4.5H7V3H3v4zm10.5 6.5H11V15h4v-4h-1.5v2.5zM11 3v1.5h2.5V7H15V3h-4z");s.appendChild(i),s.onclick=function(){e.data.fullscreen?t.closeFullscreen():t.openFullscreen()},this.toolbarElem.appendChild(s)}if(!0===s.close){let t=new n("div").addClassesAndCreate(["fslightbox-toolbar-button","fslightbox-flex-centered"]),s=(new e.SVGIcon).getSVGIcon("0 0 20 20","16px","M 11.469 10 l 7.08 -7.08 c 0.406 -0.406 0.406 -1.064 0 -1.469 c -0.406 -0.406 -1.063 -0.406 -1.469 0 L 10 8.53 l -7.081 -7.08 c -0.406 -0.406 -1.064 -0.406 -1.469 0 c -0.406 0.406 -0.406 1.063 0 1.469 L 8.531 10 L 1.45 17.081 c -0.406 0.406 -0.406 1.064 0 1.469 c 0.203 0.203 0.469 0.304 0.735 0.304 c 0.266 0 0.531 -0.101 0.735 -0.304 L 10 11.469 l 7.08 7.081 c 0.203 0.203 0.469 0.304 0.735 0.304 c 0.267 0 0.532 -0.101 0.735 -0.304 c 0.406 -0.406 0.406 -1.064 0 -1.469 L 11.469 10 Z");t.appendChild(s),t.onclick=function(){e.data.fadingOut||e.hide()},this.toolbarElem.appendChild(t)}},this.openFullscreen=function(){e.data.fullscreen=!0;let t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()},this.closeFullscreen=function(){e.data.fullscreen=!1,document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},this.renderToolbar=function(e){this.renderDefaultButtons(),e.appendChild(this.toolbarElem)}}},{"./DOMObject":1}],5:[function(e,t,s){const n=e("../Components/DOMObject");t.exports=function(e){this.renderDOM=function(){e.element.id="fslightbox-container",document.body.appendChild(e.element),s(e.element),e.data.totalSlides>1&&o(e.element),e.element.appendChild(e.mediaHolder),e.data.isfirstTimeLoad=!0};const t=function(){let t=new n("div").addClassesAndCreate(["fslightbox-slide-number-container","fslightbox-flex-centered"]);e.data.slideCounterElem=document.createElement("div");const s=e.data.slideCounterElem;s.innerHTML=e.data.slide,s.id="current_slide";let i=new n("div").addClassesAndCreate(["fslightbox-slash"]);i.innerHTML="/";let o=document.createElement("div");o.innerHTML=e.data.totalSlides,t.appendChild(s),t.appendChild(i),t.appendChild(o),this.renderSlideCounter=function(s){e.data.slideCounter&&s.appendChild(t)}},s=function(s){if(e.data.nav=new n("div").addClassesAndCreate(["fslightbox-nav"]),e.toolbar.renderToolbar(e.data.nav),e.data.totalSlides>2){(new t).renderSlideCounter(e.data.nav)}s.appendChild(e.data.nav)},i=function(t,s,i){let o=new n("div").addClassesAndCreate(["fslightbox-slide-btn","fslightbox-flex-centered"]);o.appendChild((new e.SVGIcon).getSVGIcon("0 0 20 20","1em",i)),t.appendChild(o),s.appendChild(t)},o=function(t){if(!1===e.data.slideButtons)return!1;let s=new n("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-left-container"]);i(s,t,"M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z"),s.onclick=function(){e.appendMethods.previousSlideViaButton(e.data.slide)};let o=new n("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-right-container"]);i(o,t,"M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z"),o.onclick=function(){e.appendMethods.nextSlideViaButton(e.data.slide)}}}},{"../Components/DOMObject":1}],6:[function(e,t,s){t.exports=function(e){this.addRecompense=function(){if(!s())return;document.documentElement.style.marginRight=e+"px";const n=t();if(n)for(let t=0;t<n.length;t++)n[t].style.marginRight=e+"px"},this.removeRecompense=function(){if(!s())return;document.documentElement.style.marginRight="";const e=t();if(e)for(let t=0;t<e.length;t++)e[t].style.marginRight=""};const t=function(){return document.getElementsByClassName("recompense-for-scrollbar")},s=function(){return!!e}}},{}],7:[function(e,t,s){t.exports=function(e){this.getWidth=function(){let t=document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.msOverflowStyle="scrollbar",document.body.appendChild(t);let s=t.offsetWidth;t.style.overflow="scroll";let n=document.createElement("div");n.style.width="100%",t.appendChild(n);let i=n.offsetWidth;t.parentNode.removeChild(t),e.scrollbarWidth=s-i}}},{}],8:[function(e,t,s){t.exports=function(t){const s=new(e("../Components/DOMObject"))("div").addClassesAndCreate(["fslightbox-invisible-hover"]),n={mediaHolder:t.mediaHolder,invisibleHover:s},i=t.data.sources,o=t.data.urls.length;let r,d,a=!1,l=!0;const c=function(e){"VIDEO"===e.target.tagName||e.touches||e.preventDefault();for(let e in n)n[e].classList.add("fslightbox-cursor-grabbing");a=!0,r=e.touches?e.touches[0].clientX:e.clientX,d=0},u=function(){t.element.contains(s)&&t.element.removeChild(s);for(let e in n)n[e].classList.remove("fslightbox-cursor-grabbing");if(a=!1,0===d)return;if(!l)return;l=!1;let e=t.stageSourceIndexes.all(t.data.slide);i[e.previous].classList.add("fslightbox-transform-transition"),i[e.current].classList.add("fslightbox-transform-transition"),i[e.next].classList.add("fslightbox-transform-transition"),d>0?(1===t.data.slide?t.updateSlideNumber(t.data.totalSlides):t.updateSlideNumber(t.data.slide-1),o>=2?(t.slideTransformer.plus(i[e.current]),t.slideTransformer.zero(i[e.previous])):t.slideTransformer.zero(i[e.current]),e=t.stageSourceIndexes.all(t.data.slide),void 0===t.data.sources[e.previous]&&t.loadsources("previous",t.data.slide)):d<0&&(t.data.slide===t.data.totalSlides?t.updateSlideNumber(1):t.updateSlideNumber(t.data.slide+1),o>1?(t.slideTransformer.minus(i[e.current]),t.slideTransformer.zero(i[e.next])):t.slideTransformer.zero(i[e.current]),e=t.stageSourceIndexes.all(t.data.slide),void 0===t.data.sources[e.next]&&t.loadsources("next",t.data.slide)),d=0,t.stopVideos(),setTimeout(function(){i[e.previous].classList.remove("fslightbox-transform-transition"),i[e.current].classList.remove("fslightbox-transform-transition"),i[e.next].classList.remove("fslightbox-transform-transition"),l=!0},250)},h=function(e){if(!a||!l)return;let n;n=e.touches?e.touches[0].clientX:e.clientX,t.element.appendChild(s),d=n-r;const c=t.stageSourceIndexes.all(t.data.slide);o>=3&&(i[c.previous].style.transform="translate("+(-t.data.slideDistance*window.innerWidth+d)+"px,0)"),o>=1&&(i[c.current].style.transform="translate("+d+"px,0)"),o>=2&&(i[c.next].style.transform="translate("+(t.data.slideDistance*window.innerWidth+d)+"px,0)")};for(let e in n)n[e].addEventListener("mousedown",c),n[e].addEventListener("touchstart",c,{passive:!0});window.addEventListener("mouseup",u),window.addEventListener("touchend",u),s.addEventListener("mouseup",u),s.addEventListener("touchend",u,{passive:!0}),window.addEventListener("mousemove",h),window.addEventListener("touchmove",h,{passive:!0}),t.data.nav.addEventListener("mousedown",function(e){e.preventDefault()})}},{"../Components/DOMObject":1}],9:[function(e,t,s){t.exports=function(e){this.minus=function(t){t.style.transform="translate("+-e*window.innerWidth+"px,0)"},this.zero=function(e){e.style.transform="translate(0,0)"},this.plus=function(t){t.style.transform="translate("+e*window.innerWidth+"px,0)"}}},{}],10:[function(e,t,s){t.exports=function(e){this.previous=function(t){let s;const n=t-1;return s=0===n?e.totalSlides-1:n-1},this.next=function(t){let s;const n=t-1;return s=t===e.totalSlides?0:n+1},this.all=function(t){const s=t-1,n={previous:0,current:0,next:0};return n.previous=0===s?e.totalSlides-1:s-1,n.current=s,t===e.totalSlides?n.next=0:n.next=s+1,n}}},{}],11:[function(e,t,s){t.exports=function(t){const s="fslightbox-transform-transition",n="fslightbox-fade-out",i=function(s){const n=new(e("./Components/DOMObject"))("div").addClassesAndCreate(["fslightbox-source-holder","fslightbox-full-dimension"]);return n.innerHTML='<div class="fslightbox-loader"><div></div><div></div><div></div><div></div></div>',t.data.sources[s]=n,n},o=function(e){e.firstChild.classList.add("fslightbox-fade-in")},r=function(e){const t=e.firstChild;t.classList.remove("fslightbox-fade-in"),t.classList.remove(n),t.offsetWidth},d=function(e){e.firstChild.classList.add(n)};this.renderHolderInitial=function(e){const s=t.stageSourceIndexes.all(e),n=t.data.totalSlides;if(n>=3){const e=i(s.previous);t.slideTransformer.minus(e),t.mediaHolder.appendChild(e)}if(n>=1){const e=i(s.current);t.mediaHolder.appendChild(e)}if(n>=2){const e=i(s.next);t.slideTransformer.plus(e),t.mediaHolder.appendChild(e)}},this.renderHolder=function(e,t){switch(t){case"previous":a(e);break;case"current":c(e);break;case"next":l(e)}};const a=function(e){const s=t.stageSourceIndexes.previous(e),n=i(s);t.slideTransformer.minus(n),t.mediaHolder.insertAdjacentElement("afterbegin",n)},l=function(e){const s=t.stageSourceIndexes.next(e),n=i(s);t.slideTransformer.plus(n),t.mediaHolder.appendChild(n)},c=function(e){const s=t.stageSourceIndexes.all(e),n=i(s.current);t.slideTransformer.zero(n),t.mediaHolder.insertBefore(n,t.data.sources[s.next])};this.previousSlideViaButton=function(e){1===e?t.data.slide=t.data.totalSlides:t.data.slide-=1;const i=u();void 0===t.data.sources[i.previous]&&t.loadsources("previous",t.data.slide);const a=t.data.sources,l=a[i.current],c=a[i.next];c.classList.remove(s),l.classList.remove(s),a[i.previous].classList.remove(s),r(l),o(l),d(c),t.slideTransformer.zero(l),setTimeout(function(){t.slideTransformer.plus(c),c.firstChild.classList.remove(n)},220)},this.nextSlideViaButton=function(e){e===t.data.totalSlides?t.data.slide=1:t.data.slide+=1;const i=u();void 0===t.data.sources[i.next]&&t.loadsources("next",t.data.slide);const a=t.data.sources,l=a[i.current],c=a[i.previous];c.classList.remove(s),l.classList.remove(s),a[i.next].classList.remove(s),r(l),o(l),d(c),t.slideTransformer.zero(l),setTimeout(function(){t.slideTransformer.minus(c),c.firstChild.classList.remove(n)},220)};const u=function(){return t.stopVideos(),t.updateSlideNumber(t.data.slide),t.stageSourceIndexes.all(t.data.slide)}}},{"./Components/DOMObject":1}],12:[function(e,t,s){window.fsLightboxClass=function(){const t=e("./Components/DOMObject");this.data={slide:1,totalSlides:1,slideDistance:1.3,slideCounter:!0,slideButtons:!0,isFirstTimeLoad:!1,moveSlidesViaDrag:!0,toolbarButtons:{close:!0,fullscreen:!0},name:"",scrollbarWidth:0,urls:[],sources:[],sourcesLoaded:[],rememberedSourcesDimensions:[],videos:[],videosPosters:[],holderWrapper:{},mediaHolder:{},nav:{},toolbar:{},slideCounterElem:{},initiated:!1,fullscreen:!1,fadingOut:!1};const s=this;this.init=function(t){if(this.data.initiated)return this.initSetSlide(t),void this.show();let s=this.data.name,i=[];const o=fsLightboxHelpers.a;for(let e=0;e<o.length;e++)if(o[e].hasAttribute("data-fslightbox")&&o[e].getAttribute("data-fslightbox")===s){let t=i.push(o[e].getAttribute("href"));o[e].hasAttribute("data-video-poster")&&(this.data.videosPosters[t-1]=o[e].getAttribute("data-video-poster"))}this.data.urls=i,this.data.totalSlides=i.length,n.renderDOM(),document.documentElement.classList.add("fslightbox-open"),this.scrollbarRecompensor.addRecompense(),this.onResizeEvent.init(),this.throwEvent("init"),this.throwEvent("open"),e("./Core/SlideSwiping.js")(this),this.initSetSlide(t),this.data.initiated=!0,this.element.classList.add("fslightbox-open")},this.initSetSlide=function(e){switch(typeof e){case"string":this.setSlide(this.data.urls.indexOf(e)+1);break;case"number":this.setSlide(e);break;case"undefined":this.setSlide(1)}},this.show=function(){const e=this.element;this.scrollbarRecompensor.addRecompense(),e.classList.remove("fslightbox-fade-out-complete"),document.documentElement.classList.add("fslightbox-open"),e.offsetWidth,e.classList.add("fslightbox-fade-in-complete"),document.body.appendChild(e),this.onResizeEvent.addListener(),this.throwEvent("show"),this.throwEvent("open")},this.hide=function(){this.data.fullscreen&&this.toolbar.closeFullscreen(),this.element.classList.add("fslightbox-fade-out-complete"),this.data.fadingOut=!0,this.throwEvent("close"),this.onResizeEvent.removeListener(),setTimeout(function(){s.scrollbarRecompensor.removeRecompense(),document.documentElement.classList.remove("fslightbox-open"),s.data.fadingOut=!1,document.body.removeChild(s.element)},250)},this.updateSlideNumber=function(e){this.data.slide=e,this.data.totalSlides>1&&(this.data.slideCounterElem.innerHTML=e)},this.throwEvent=function(e){let t;"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),this.element.dispatchEvent(t)},this.element=new t("div").addClassesAndCreate(["fslightbox-container","fslightbox-full-dimension"]),this.mediaHolder=new(e("./Components/MediaHolder"));const n=new(e("./Core/DomRenderer"))(this);this.stageSourceIndexes=new(e("./Core/StageSourcesIndexes"))(this.data),new(e("./Core/ScrollbarWidthGetter"))(this.data).getWidth(),this.onResizeEvent=new(e("./onResizeEvent"))(this),this.scrollbarRecompensor=new(e("./Core/ScrollbarRecompensor"))(this.data.scrollbarWidth),this.slideTransformer=new(e("./Core/SlideTransformer"))(this.data.slideDistance),this.toolbar=new(e("./Components/Toolbar"))(this),this.SVGIcon=e("./Components/SVGIcon"),this.appendMethods=new(e("./appendMethods"))(this),this.loadsources=function(t,s){return new(e("./loadSource.js"))(this,t,s)},this.stopVideos=function(){const e=this.data.videos,t=this.data.sources;for(let s in e)!0===e[s]?void 0!==t[s].firstChild.pause&&t[s].firstChild.pause():t[s].firstChild.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}',"*")},this.setSlide=function(e){this.data.slide=e,this.updateSlideNumber(e);const t=this.stageSourceIndexes.all(e),s=this.data.sources;0===s.length?this.loadsources("initial",e):(void 0===s[t.previous]&&this.loadsources("previous",e),void 0===s[t.current]&&this.loadsources("current",e),void 0===s[t.next]&&this.loadsources("next",e));for(let e in s)s[e].classList.remove("fslightbox-transform-transition"),e==t.previous&&s.length>1?this.slideTransformer.minus(s[t.previous]):e!=t.current?e!=t.next?this.slideTransformer.minus(s[e]):this.slideTransformer.plus(s[t.next]):this.slideTransformer.zero(s[t.current])}},function(){window.fsLightboxInstances=[],window.fsLightboxHelpers={a:document.getElementsByTagName("a")};let e=window.fsLightboxHelpers.a;for(let t=0;t<e.length;t++){if(!e[t].hasAttribute("data-fslightbox"))continue;const s=e[t].getAttribute("data-fslightbox");void 0===window.fsLightboxInstances[s]&&(window.fsLightbox=new window.fsLightboxClass,window.fsLightbox.data.name=s,window.fsLightboxInstances[s]=window.fsLightbox),e[t].addEventListener("click",function(e){e.preventDefault();let t=this.getAttribute("data-fslightbox");if(window.fsLightboxInstances[t].data.initiated)return window.fsLightboxInstances[t].setSlide(window.fsLightboxInstances[t].data.urls.indexOf(this.getAttribute("href"))+1),void window.fsLightboxInstances[t].show();window.fsLightboxInstances[t].init(this.getAttribute("href"))})}}(document,window)},{"./Components/DOMObject":1,"./Components/MediaHolder":2,"./Components/SVGIcon":3,"./Components/Toolbar":4,"./Core/DomRenderer":5,"./Core/ScrollbarRecompensor":6,"./Core/ScrollbarWidthGetter":7,"./Core/SlideSwiping.js":8,"./Core/SlideTransformer":9,"./Core/StageSourcesIndexes":10,"./appendMethods":11,"./loadSource.js":13,"./onResizeEvent":14}],13:[function(e,t,s){t.exports=function(t,s,n){const i=e("./Components/DOMObject"),o=t.stageSourceIndexes.all(n),r=t.data.urls,d=t.data.sources;let a=function(e,s,n,o){let r=new i("div").addClassesAndCreate(["fslightbox-source-holder"]);t.data.rememberedSourcesDimensions[o]={width:s,height:n},r.appendChild(e),function(e,t){e.innerHTML="",e.appendChild(t),e.firstChild.offsetWidth}(d[o],e),t.onResizeEvent.scaleSource(o)};const l=function(e){let t=new i("div").addClassesAndCreate(["fslightbox-invalid-file-wrapper"]);t.innerHTML="Invalid file",a(t,window.innerWidth,window.innerHeight,e)};if(this.createSourceElem=function(e){const s=document.createElement("a"),n=t.data.urls[e];if(s.href=n,"www.youtube.com"===s.hostname)t.data.videos[e]=!1,function(e,s){let n=new i("iframe").addClassesAndCreate(["fslightbox-single-source"]);n.src="//www.youtube.com/embed/"+e+"?enablejsapi=1",n.setAttribute("allowfullscreen",""),n.setAttribute("frameborder","0"),t.mediaHolder.appendChild(n),a(n,1920,1080,s)}(function(e){let t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return t&&11==t[2].length?t[2]:"error"}(n),e);else{const s=new XMLHttpRequest;s.onreadystatechange=function(){if(2===s.readyState){if(200===s.status||206===s.status){const n=s.getResponseHeader("content-type"),o=n.slice(0,n.indexOf("/"));"image"===o?function(e,t){let s=new i("img").addClassesAndCreate(["fslightbox-single-source"]);s.src=e,s.addEventListener("load",function(){a(s,this.width,this.height,t)})}(r[e],e):"video"===o?(!function(e,s,n){let o,r,d=!1,l=new i("video").addClassesAndCreate(["fslightbox-single-source"]),c=new i("source").elem;t.data.videosPosters[s]&&(l.poster=t.data.videosPosters[s],l.style.objectFit="cover"),c.src=e,c.type=n,l.appendChild(c),l.onloadedmetadata=function(){d||(this.videoWidth&&0!==this.videoWidth?(o=this.videoWidth,r=this.videoHeight):(o=1920,r=1080),d=!0,a(l,o,r,s))};let u=0,h=setInterval(function(){if(d)clearInterval(h);else{if(l.videoWidth&&0!==l.videoWidth)o=l.videoWidth,r=l.videoHeight;else{if(u<31)return void u++;o=1920,r=1080}d=!0,a(l,o,r,s),clearInterval(h)}},100);l.setAttribute("controls","")}(r[e],e,n),t.data.videos[e]=!0):l(e)}else l(e);s.abort()}},s.open("get",n,!0),s.send(null)}},"initial"===s)t.appendMethods.renderHolderInitial(n,i),r.length>=1&&this.createSourceElem(o.current),r.length>=2&&this.createSourceElem(o.next),r.length>=3&&this.createSourceElem(o.previous);else switch(t.appendMethods.renderHolder(n,s),s){case"previous":this.createSourceElem(o.previous);break;case"current":this.createSourceElem(o.current);break;case"next":this.createSourceElem(o.next)}}},{"./Components/DOMObject":1}],14:[function(e,t,s){t.exports=function(e){const t=this,s=e.data.sources,n=e.data.rememberedSourcesDimensions;this.mediaHolderDimensions=function(){const t=e.mediaHolder.style,s=window.innerWidth,n=window.innerHeight;s>1e3?(t.width=s-.1*s+"px",t.height=n-.1*n+"px"):(t.width=s+"px",t.height=n-.1*n+"px")},this.scaleAndTransformSources=function(){const t=e.data.urls.length,n=e.stageSourceIndexes.all(e.data.slide);t>0&&e.slideTransformer.zero(s[n.current]),t>1&&e.slideTransformer.plus(s[n.next]),t>2&&e.slideTransformer.minus(s[n.previous]);for(let i=0;i<t;i++)this.scaleSource(i),i!==n.current&&i!==n.next&&i!==n.previous&&s[i]&&e.slideTransformer.plus(s[i])},this.scaleSource=function(t){if(!s[t])return;const i=s[t].firstChild;let o=n[t].width,r=n[t].height;const d=o/r,a=parseInt(e.mediaHolder.style.width),l=parseInt(e.mediaHolder.style.height);let c=a/d;const u=function(){i.style.height=c+"px",i.style.width=c*d+"px"};if(c<l)return o<a&&(c=r),void u();c=r>l?l:r,u()},this.init=function(){this.mediaHolderDimensions(),this.addListener()},this.addListener=function(){window.addEventListener("resize",i)};const i=function(){t.mediaHolderDimensions(),t.scaleAndTransformSources()};this.removeListener=function(){window.removeEventListener("resize",i)}}},{}]},{},[12]); |
{ | ||
"name": "fslightbox", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "Fullscreen Lightbox is vanilla JS plugin for displaying images and videos in clean overlaying box.", | ||
"main": "index.js", | ||
"dist-tags": { | ||
"latest": "1.6.1" | ||
"latest": "1.6.2" | ||
}, | ||
@@ -9,0 +9,0 @@ "scripts": { |
# Fullscreen Lightbox Basic | ||
## Version - 1.6.1 | ||
## Version - 1.6.2 | ||
@@ -5,0 +5,0 @@ ## Description |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147872
1522