fslightbox
Advanced tools
Comparing version 1.4.11 to 1.5.0
@@ -1,1 +0,1 @@ | ||
!function(){return function e(t,i,s){function n(o,r){if(!i[o]){if(!t[o]){var d="function"==typeof require&&require;if(!r&&d)return d(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[o]={exports:{}};t[o][0].call(c.exports,function(e){return n(t[o][1][e]||e)},c,c.exports,e,t,i,s)}return i[o].exports}for(var a="function"==typeof require&&require,o=0;o<s.length;o++)n(s[o]);return n}}()({1:[function(e,t,i){t.exports={loader:'<div class="lds-ring"><div></div><div></div><div></div><div></div></div>',DOMObject:"",createHolder:function(e,t){let i=new this.DOMObject("div").addClassesAndCreate(["fslightbox-source-holder"]);return i.innerHTML=this.loader,e.data.sources[t]=i,i},renderHolderInitial:function(e,t,i){this.DOMObject=i;const s=e.getSourcesIndexes.all(t),n=e.data.total_slides;if(n>=3){const t=this.createHolder(e,s.previous);e.transforms.transformMinus(t),e.data.mediaHolder.holder.appendChild(t)}if(n>=1){const t=this.createHolder(e,s.current);e.data.mediaHolder.holder.appendChild(t)}if(n>=2){const t=this.createHolder(e,s.next);e.transforms.transformPlus(t),e.data.mediaHolder.holder.appendChild(t)}},renderHolder:function(e,t,i){switch(i){case"previous":this.renderHolderPrevious(e,t);break;case"current":this.renderHolderCurrent(e,t);break;case"next":this.renderHolderNext(e,t)}},renderHolderPrevious:function(e,t){const i=e.getSourcesIndexes.previous(t),s=this.createHolder(e,i);e.transforms.transformMinus(s),e.data.mediaHolder.holder.insertAdjacentElement("afterbegin",s)},renderHolderNext:function(e,t){const i=e.getSourcesIndexes.next(t),s=this.createHolder(e,i);e.transforms.transformPlus(s),e.data.mediaHolder.holder.appendChild(s)},renderHolderCurrent:function(e,t){const i=e.getSourcesIndexes.all(t),s=this.createHolder(e,i.current);e.transforms.transformNull(s),e.data.mediaHolder.holder.insertBefore(s,e.data.sources[i.next])},previousSlideViaButton:function(e,t){1===t?e.data.slide=e.data.total_slides:e.data.slide-=1,e.stopVideos(),e.data.updateSlideNumber(e.data.slide);const i=e.getSourcesIndexes.all(e.data.slide);void 0===e.data.sources[i.previous]&&e.loadsources("previous",e.data.slide);const s=e.data.sources,n=s[i.current],a=s[i.next];a.classList.remove("fslightbox-transform-transition"),n.classList.remove("fslightbox-transform-transition"),s[i.previous].classList.remove("fslightbox-transform-transition"),a.classList.remove("fslightbox-fade-in-animation"),a.offsetWidth,a.classList.add("fslightbox-fade-in-animation"),n.classList.remove("fslightbox-fade-in-animation"),n.offsetWidth,n.classList.add("fslightbox-fade-in-animation"),e.transforms.transformNull(n),e.transforms.transformPlus(a)},nextSlideViaButton:function(e,t){t===e.data.total_slides?e.data.slide=1:e.data.slide+=1,e.stopVideos(),e.data.updateSlideNumber(e.data.slide);const i=e.getSourcesIndexes.all(e.data.slide);void 0===e.data.sources[i.next]&&e.loadsources("next",e.data.slide);const s=e.data.sources,n=s[i.current],a=s[i.previous];a.classList.remove("fslightbox-transform-transition"),n.classList.remove("fslightbox-transform-transition"),s[i.next].classList.remove("fslightbox-transform-transition"),a.classList.remove("fslightbox-fade-in-animation"),a.offsetWidth,a.classList.add("fslightbox-fade-in-animation"),n.classList.remove("fslightbox-fade-in-animation"),n.offsetWidth,n.classList.add("fslightbox-fade-in-animation"),e.transforms.transformNull(n),e.transforms.transformMinus(a)}}},{}],2:[function(e,t,i){t.exports=function(e,t){const i=new t("div").addClassesAndCreate(["fslightbox-invisible-hover"]),s={mediaHolder:e.data.mediaHolder.holder,invisibleHover:i,holderWrapper:e.data.holderWrapper},n=e.data.sources,a=e.data.urls.length;let o,r,d=!1,l=!0,c=function(t){"VIDEO"===t.target.tagName||e.data.isMobile||t.preventDefault();for(let e in s)s[e].classList.add("fslightbox-cursor-grabbing");d=!0,o=e.data.isMobile?t.touches[0].clientX:t.clientX,r=0},u=function(){e.element.contains(i)&&e.element.removeChild(i);let t=e.getSourcesIndexes.all(e.data.slide);for(let e in s)s[e].classList.remove("fslightbox-cursor-grabbing");d=!1,0!==r&&l&&(l=!1,n[t.previous].classList.add("fslightbox-transform-transition"),n[t.current].classList.add("fslightbox-transform-transition"),n[t.next].classList.add("fslightbox-transform-transition"),r>0?(1===e.data.slide?e.data.updateSlideNumber(e.data.total_slides):e.data.updateSlideNumber(e.data.slide-1),a>=2?(e.transforms.transformPlus(n[t.current]),e.transforms.transformNull(n[t.previous])):e.transforms.transformNull(n[t.current]),t=e.getSourcesIndexes.all(e.data.slide),void 0===e.data.sources[t.previous]&&e.loadsources("previous",e.data.slide)):r<0&&(e.data.slide===e.data.total_slides?e.data.updateSlideNumber(1):e.data.updateSlideNumber(e.data.slide+1),a>1?(e.transforms.transformMinus(n[t.current]),e.transforms.transformNull(n[t.next])):e.transforms.transformNull(n[t.current]),t=e.getSourcesIndexes.all(e.data.slide),void 0===e.data.sources[t.next]&&e.loadsources("next",e.data.slide)),r=0,e.stopVideos(),setTimeout(function(){n[t.previous].classList.remove("fslightbox-transform-transition"),n[t.current].classList.remove("fslightbox-transform-transition"),n[t.next].classList.remove("fslightbox-transform-transition"),l=!0},250))},h=function(t){if(!d||!l)return;let s;s=e.data.isMobile?t.touches[0].clientX:t.clientX,e.element.appendChild(i),r=s-o;const c=e.getSourcesIndexes.all(e.data.slide);a>=3&&(n[c.previous].style.transform="translate("+(-e.data.slideDistance*window.innerWidth+r)+"px,0)"),a>=1&&(n[c.current].style.transform="translate("+r+"px,0)"),a>=2&&(n[c.next].style.transform="translate("+(e.data.slideDistance*window.innerWidth+r)+"px,0)")},m=function(e){e.preventDefault()};for(let e in s)s[e].addEventListener("mousedown",c),s[e].addEventListener("touchstart",c,{passive:!0});window.addEventListener("mouseup",u),window.addEventListener("touchend",u),i.addEventListener("mouseup",u),i.addEventListener("touchend",u),window.addEventListener("mousemove",h),window.addEventListener("touchmove",h),e.data.nav.addEventListener("mousedown",m)}},{}],3:[function(e,t,i){window.fsLightboxObject=function(){this.element=new i("div").addClassesAndCreate(["fslightbox-container"]),this.data={slide:1,total_slides:1,slideDistance:1.3,slideCounter:!0,slideButtons:!0,isFirstTimeLoad:!1,moveSlidesViaDrag:!0,toolbarButtons:{close:!0,fullscreen:!0},name:"",isMobile:!1,urls:[],sources:[],sourcesLoaded:[],rememberedSourcesDimensions:[],videos:[],holderWrapper:{},mediaHolder:{},nav:{},toolbar:{},slideCounterElem:{},initiated:!1,fullscreen:!1,fadingOut:!1,onResizeEvent:{},updateSlideNumber:function(){}};let t=this;function i(e){this.elem=document.createElement(e),this.addClassesAndCreate=function(e){for(let t in e)this.elem.classList.add(e[t]);return this.elem}}function s(){let e=this;const i=t.data.sources;this.transforms=function(){const e=t.data.sources,i=t.getSourcesIndexes.all(t.data.slide);for(let s in e)parseInt(s)!==i.previous&&parseInt(s)!==i.current&&parseInt(s)!==i.next&&(e[s].classList.remove("fslightbox-transform-transition"),t.transforms.transformMinus(e[s]))},this.mediaHolderDimensions=function(){window.innerWidth>1e3?(t.data.mediaHolder.holder.style.width=window.innerWidth-.1*window.innerWidth+"px",t.data.mediaHolder.holder.style.height=window.innerHeight-.1*window.innerHeight+"px"):(t.data.mediaHolder.holder.style.width=window.innerWidth+"px",t.data.mediaHolder.holder.style.height=window.innerHeight+"px")},this.sourcesDimensions=function(){const e=t.getSourcesIndexes.all(t.data.slide),s=t.data.rememberedSourcesDimensions;for(let n in i){t.data.urls.length>2&&t.transforms.transformMinus(i[e.previous]),t.transforms.transformNull(i[e.current]),t.data.urls.length>1&&t.transforms.transformPlus(i[e.next]);const a=i[n].firstChild;const o=s[n].width/s[n].height,r=parseInt(t.data.mediaHolder.holder.style.width),d=parseInt(t.data.mediaHolder.holder.style.height);let l=r/o;l<d-60?(a.style.height=l+"px",a.style.width=r+"px"):(l=d-60,a.style.height=l+"px",a.style.width=l*o+"px")}},window.onresize=function(){var i;i=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4))?t.data.isMobile=!0:t.data.isMobile=!1,e.mediaHolderDimensions(),e.sourcesDimensions(),e.transforms()}}this.init=function(n){if(t.data.initiated)return t.initSetSlide(n),void t.show();!function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t.data.isMobile=!0)}(navigator.userAgent||navigator.vendor||window.opera),t.data.onResizeEvent=new s;let a=t.data.name,o=[];const r=fsLightboxHelpers.a;for(let e=0;e<r.length;e++)r[e].hasAttribute("data-fslightbox")&&r[e].getAttribute("data-fslightbox")===a&&o.push(r[e].getAttribute("href"));t.data.urls=o,t.data.total_slides=o.length,new t.dom,t.throwEvent("init"),t.throwEvent("open"),e("./changeSlideByDragging.js")(t,i),t.initSetSlide(n),t.data.initiated=!0},this.initSetSlide=function(e){switch(typeof e){case"string":t.setSlide(t.data.urls.indexOf(e)+1);break;case"number":t.setSlide(e);break;case"undefined":t.setSlide(1)}},this.show=function(){const e=t.element;t.scrollbar.showScrollbar(),e.classList.remove("fslightbox-container-fadeout"),document.body.appendChild(e),t.throwEvent("show"),t.throwEvent("open"),e.classList.remove(["fslightbox-fade-in-animation"]),e.classList.add(["fslightbox-fade-in-animation"])},this.hide=function(){t.data.fullscreen&&t.toolbar.closeFullscreen(),t.element.classList.add("fslightbox-container-fadeout"),t.data.fadingOut=!0,t.throwEvent("close"),setTimeout(function(){t.scrollbar.hideScrollbar(),t.data.fadingOut=!1,document.body.removeChild(t.element)},250)},this.dom=function(){e("./renderDOM.js")(t,i)},this.throwEvent=function(e){let i;"function"==typeof Event?i=new Event(e):(i=document.createEvent("Event")).initEvent(e,!0,!0),t.element.dispatchEvent(i)},this.scrollbar={hideScrollbar:function(){if(document.documentElement.classList.remove("fslightbox-open"),!t.data.isMobile){let e=document.querySelector(".recompense-for-scrollbar");e&&(e.style.paddingRight="0"),document.documentElement.classList.remove("fslightbox-scrollbarfix")}},showScrollbar:function(){if(document.documentElement.classList.add("fslightbox-open"),!t.data.isMobile){let e=document.querySelector(".recompense-for-scrollbar");e&&(e.style.paddingRight="17px"),document.documentElement.classList.add("fslightbox-scrollbarfix")}}},this.SVGIcon=function(){this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.svg.setAttributeNS(null,"class","fslightbox-svg-icon"),this.svg.setAttributeNS(null,"viewBox","0 0 15 15"),this.getSVGIcon=function(e,t,i){return this.path.setAttributeNS(null,"d",i),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}};let n=e("./toolbar");this.toolbar=new n(t,i),this.mediaHolder=function(){this.holder=new i("div").addClassesAndCreate(["fslightbox-media-holder"]),window.innerWidth>1e3?(this.holder.style.width=window.innerWidth-.1*window.innerWidth+"px",this.holder.style.height=window.innerHeight-.1*window.innerHeight+"px"):(this.holder.style.width=window.innerWidth+"px",this.holder.style.height=window.innerHeight+"px"),this.renderHolder=function(e){e.appendChild(this.holder)}},this.getSourcesIndexes={previous:function(e){let i;const s=e-1;return i=0===s?t.data.total_slides-1:s-1},next:function(e){let i;const s=e-1;return i=e===t.data.total_slides?0:s+1},all:function(e){const i=e-1,s={previous:0,current:0,next:0};return s.previous=0===i?t.data.total_slides-1:i-1,s.current=i,e===t.data.total_slides?s.next=0:s.next=i+1,s}},this.transforms={transformMinus:function(e){e.style.transform="translate("+-t.data.slideDistance*window.innerWidth+"px,0)"},transformNull:function(e){e.style.transform="translate(0,0)"},transformPlus:function(e){e.style.transform="translate("+t.data.slideDistance*window.innerWidth+"px,0)"}},this.stopVideos=function(){const e=t.data.videos;for(let i in e)!0===e[i]?void 0!==t.data.sources[i].firstChild.pause&&t.data.sources[i].firstChild.pause():t.data.sources[i].firstChild.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}',"*")},this.setSlide=function(e){t.data.slide=e,t.data.updateSlideNumber(e);const i=t.getSourcesIndexes.all(e),s=t.data.sources;0===s.length?t.loadsources("initial",e):(void 0===s[i.previous]&&t.loadsources("previous",e),void 0===s[i.current]&&t.loadsources("current",e),void 0===s[i.next]&&t.loadsources("next",e));for(let e in s)s[e].classList.remove("fslightbox-transform-transition"),e==i.previous&&s.length>1?t.transforms.transformMinus(s[i.previous]):e!=i.current?e!=i.next?t.transforms.transformMinus(s[e]):t.transforms.transformPlus(s[i.next]):t.transforms.transformNull(s[i.current])},this.appendMethods=e("./appendSource"),this.loadsources=function(s,n){return new(e("./loadSource.js"))(t,i,s,n)}},function(){window.fsLightboxInstances=[],window.fsLightboxHelpers={a:document.getElementsByTagName("a")};let e=fsLightboxHelpers.a;for(let t=0;t<e.length;t++){if(!e[t].hasAttribute("data-fslightbox"))continue;e[t].classList.add("fslightbox-fix-webkit-highlight");const i=e[t].getAttribute("data-fslightbox");void 0===fsLightboxInstances[i]&&(fsLightbox=new fsLightboxObject,fsLightbox.data.name=i,fsLightboxInstances[i]=fsLightbox),e[t].addEventListener("click",function(e){e.preventDefault();let t=this.getAttribute("data-fslightbox");if(fsLightboxInstances[t].data.initiated)return fsLightboxInstances[t].setSlide(fsLightboxInstances[t].data.urls.indexOf(this.getAttribute("href"))+1),void fsLightboxInstances[t].show();fsLightboxInstances[t].init(this.getAttribute("href"))})}}(document,window)},{"./appendSource":1,"./changeSlideByDragging.js":2,"./loadSource.js":4,"./renderDOM.js":5,"./toolbar":6}],4:[function(e,t,i){t.exports=function(e,t,i,s){const n=this,a=e.getSourcesIndexes.all(s),o=e.data.urls,r=e.data.sources;let d=function(s,n,a,o){let d=new t("div").addClassesAndCreate(["fslightbox-source-holder"]);e.data.rememberedSourcesDimensions[o]={width:n,height:a},function(t,i,s){const n=i/s,a=parseInt(e.data.mediaHolder.holder.style.width),o=parseInt(e.data.mediaHolder.holder.style.height);let r=a/n;r<o-60?(t.style.height=r+"px",t.style.width=a+"px"):(r=o-60,t.style.height=r+"px",t.style.width=r*n+"px")}(s,n,a),d.appendChild(s),"initial"===i?function(e,t){e.innerHTML="",e.appendChild(t),e.firstChild.classList.add("fslightbox-fade-in-animation")}(r[o],s):function(e,t){e.innerHTML="",e.appendChild(t),e.firstChild.offsetWidth,e.firstChild.classList.add("fslightbox-fade-in-animation")}(r[o],s)};if(this.loadYoutubevideo=function(i,s){let n=new t("iframe").addClassesAndCreate(["fslightbox-single-source"]);n.src="//www.youtube.com/embed/"+i+"?enablejsapi=1",n.setAttribute("allowfullscreen",""),n.setAttribute("frameborder","0"),e.data.mediaHolder.holder.appendChild(n),d(n,1920,1080,s)},this.imageLoad=function(e,i){let s=new t("img").addClassesAndCreate(["fslightbox-single-source"]);s.src=e,s.addEventListener("load",function(){d(s,this.width,this.height,i)})},this.videoLoad=function(e,i){let s=!1,n=new t("video").addClassesAndCreate(["fslightbox-single-source"]);n.src=e,n.onloadedmetadata=function(){s||(s=!0,d(n,this.videoWidth,this.videoHeight,i))};let a=setInterval(function(){!s&&n.videoWidth&&(s=!0,d(n,this.videoWidth,this.videoHeight,i),clearInterval(a))},100);n.innerText='Sorry, your browser doesn\'t support embedded videos, <a\n href="http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4">download</a> and watch\n with your favorite video player!',n.setAttribute("controls","")},this.invalidFile=function(e){let i=new t("div").addClassesAndCreate(["fslightbox-invalid-file-wrapper"]);i.innerHTML="Invalid file",d(i,window.innerWidth,window.innerHeight,e)},this.createSourceElem=function(t){const i=document.createElement("a"),s=e.data.urls[t];if(i.href=s,"www.youtube.com"===i.hostname)e.data.videos[t]=!1,this.loadYoutubevideo(function(e){let t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return t&&11==t[2].length?t[2]:"error"}(s),t);else{const i=new XMLHttpRequest;i.onreadystatechange=function(){if(2===i.readyState)if(200===i.status||206===i.status){let s=i.getResponseHeader("content-type");s.indexOf("/"),"image"===(s=s.slice(0,s.indexOf("/")))?n.imageLoad(o[t],t):"video"===s?(n.videoLoad(o[t],t),e.data.videos[t]=!0):n.invalidFile(t)}else n.invalidFile(t)},i.open("get",s,!0),i.send(null)}},"initial"===i)e.appendMethods.renderHolderInitial(e,s,t),o.length>=1&&this.createSourceElem(a.current),o.length>=2&&this.createSourceElem(a.next),o.length>=3&&this.createSourceElem(a.previous);else switch(e.appendMethods.renderHolder(e,s,i),i){case"previous":this.createSourceElem(a.previous);break;case"current":this.createSourceElem(a.current);break;case"next":this.createSourceElem(a.next)}}},{}],5:[function(e,t,i){t.exports=function(e,t){let i={renderNav:function(i){e.data.nav=new t("div").addClassesAndCreate(["fslightbox-nav"]),e.toolbar.renderToolbar(e.data.nav),(new this.slideCounter).renderSlideCounter(e.data.nav),i.appendChild(e.data.nav)},createBTN:function(i,s,n){let a=new t("div").addClassesAndCreate(["fslightbox-slide-btn","button-style"]);a.appendChild((new e.SVGIcon).getSVGIcon("0 0 20 20","1em",n)),i.appendChild(a),s.appendChild(i)},renderSlideButtons:function(i){if(!1===e.data.slideButtons)return!1;let s=new t("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-left-container"]);this.createBTN(s,i,"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,e.data.slide)};let n=new t("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-right-container"]);this.createBTN(n,i,"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"),n.onclick=function(){e.appendMethods.nextSlideViaButton(e,e.data.slide)}},slideCounter:function(){let i=new t("div").addClassesAndCreate(["fslightbox-slide-number-container"]);e.data.slideCounterElem=new t("div").addClassesAndCreate(["fslightbox-slide-slide-number"]),e.data.slideCounterElem.innerHTML=e.data.slide,e.data.slideCounterElem.id="current_slide";let s=new t("div").addClassesAndCreate(["fslightbox-slide-slide-number","fslightbox-slash"]);s.innerHTML="/";let n=new t("div").addClassesAndCreate(["fslightbox-slide-slide-number"]);n.innerHTML=e.data.total_slides,i.appendChild(e.data.slideCounterElem),i.appendChild(s),i.appendChild(n),e.data.updateSlideNumber=function(t){e.data.slide=t,e.data.slideCounterElem.innerHTML=t},this.renderSlideCounter=function(t){e.data.slideCounter&&t.appendChild(i)}}};e.scrollbar.showScrollbar(),e.element.id="fslightbox-container",document.body.appendChild(e.element),i.renderNav(e.element),e.data.total_slides>1&&i.renderSlideButtons(e.element),e.data.holderWrapper=new t("div").addClassesAndCreate(["fslightbox-holder-wrapper"]),e.element.appendChild(e.data.holderWrapper),e.data.mediaHolder=new e.mediaHolder,e.data.mediaHolder.renderHolder(e.data.holderWrapper),e.element.classList.add(["fslightbox-fade-in-animation"]),e.data.isfirstTimeLoad=!0}},{}],6:[function(e,t,i){t.exports=function(e,t){this.toolbarElem=new t("div").addClassesAndCreate(["fslightbox-toolbar"]);const i=this;this.renderDefaultButtons=function(){let s=e.data.toolbarButtons;if(!0===s.fullscreen){let s=new t("div").addClassesAndCreate(["fslightbox-toolbar-button","button-style"]),n=(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(n),s.onclick=function(){e.data.fullscreen?i.closeFullscreen():i.openFullscreen()},this.toolbarElem.appendChild(s)}if(!0===s.close){let i=new t("div").addClassesAndCreate(["fslightbox-toolbar-button","button-style"]),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");i.appendChild(s),i.onclick=function(){e.data.fadingOut||e.hide()},this.toolbarElem.appendChild(i)}},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)}}},{}]},{},[3,5,4,1,2,6]); | ||
!function(){return function e(t,s,n){function i(a,r){if(!s[a]){if(!t[a]){var d="function"==typeof require&&require;if(!r&&d)return d(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=s[a]={exports:{}};t[a][0].call(c.exports,function(e){return i(t[a][1][e]||e)},c,c.exports,e,t,s,n)}return s[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}}()({1:[function(e,t,s){t.exports={loader:'<div class="lds-ring"><div></div><div></div><div></div><div></div></div>',DOMObject:"",createHolder:function(e,t){let s=new this.DOMObject("div").addClassesAndCreate(["fslightbox-source-holder"]);return s.innerHTML=this.loader,e.data.sources[t]=s,s},renderHolderInitial:function(e,t,s){this.DOMObject=s;const n=e.getSourcesIndexes.all(t),i=e.data.total_slides;if(i>=3){const t=this.createHolder(e,n.previous);e.transforms.transformMinus(t),e.data.mediaHolder.holder.appendChild(t)}if(i>=1){const t=this.createHolder(e,n.current);e.data.mediaHolder.holder.appendChild(t)}if(i>=2){const t=this.createHolder(e,n.next);e.transforms.transformPlus(t),e.data.mediaHolder.holder.appendChild(t)}},renderHolder:function(e,t,s){switch(s){case"previous":this.renderHolderPrevious(e,t);break;case"current":this.renderHolderCurrent(e,t);break;case"next":this.renderHolderNext(e,t)}},renderHolderPrevious:function(e,t){const s=e.getSourcesIndexes.previous(t),n=this.createHolder(e,s);e.transforms.transformMinus(n),e.data.mediaHolder.holder.insertAdjacentElement("afterbegin",n)},renderHolderNext:function(e,t){const s=e.getSourcesIndexes.next(t),n=this.createHolder(e,s);e.transforms.transformPlus(n),e.data.mediaHolder.holder.appendChild(n)},renderHolderCurrent:function(e,t){const s=e.getSourcesIndexes.all(t),n=this.createHolder(e,s.current);e.transforms.transformNull(n),e.data.mediaHolder.holder.insertBefore(n,e.data.sources[s.next])},previousSlideViaButton:function(e,t){1===t?e.data.slide=e.data.total_slides:e.data.slide-=1,e.stopVideos(),e.data.updateSlideNumber(e.data.slide);const s=e.getSourcesIndexes.all(e.data.slide);void 0===e.data.sources[s.previous]&&e.loadsources("previous",e.data.slide);const n=e.data.sources,i=n[s.current],o=n[s.next];o.classList.remove("fslightbox-transform-transition"),i.classList.remove("fslightbox-transform-transition"),n[s.previous].classList.remove("fslightbox-transform-transition"),o.classList.remove("fslightbox-fade-in-animation"),o.offsetWidth,o.classList.add("fslightbox-fade-in-animation"),i.classList.remove("fslightbox-fade-in-animation"),i.offsetWidth,i.classList.add("fslightbox-fade-in-animation"),e.transforms.transformNull(i),e.transforms.transformPlus(o)},nextSlideViaButton:function(e,t){t===e.data.total_slides?e.data.slide=1:e.data.slide+=1,e.stopVideos(),e.data.updateSlideNumber(e.data.slide);const s=e.getSourcesIndexes.all(e.data.slide);void 0===e.data.sources[s.next]&&e.loadsources("next",e.data.slide);const n=e.data.sources,i=n[s.current],o=n[s.previous];o.classList.remove("fslightbox-transform-transition"),i.classList.remove("fslightbox-transform-transition"),n[s.next].classList.remove("fslightbox-transform-transition"),o.classList.remove("fslightbox-fade-in-animation"),o.offsetWidth,o.classList.add("fslightbox-fade-in-animation"),i.classList.remove("fslightbox-fade-in-animation"),i.offsetWidth,i.classList.add("fslightbox-fade-in-animation"),e.transforms.transformNull(i),e.transforms.transformMinus(o)}}},{}],2:[function(e,t,s){t.exports=function(e,t){const s=new t("div").addClassesAndCreate(["fslightbox-invisible-hover"]),n={mediaHolder:e.data.mediaHolder.holder,invisibleHover:s,holderWrapper:e.data.holderWrapper},i=e.data.sources,o=e.data.urls.length;let a,r,d=!1,l=!0;const c=function(t){"VIDEO"===t.target.tagName||e.data.isMobile||t.preventDefault();for(let e in n)n[e].classList.add("fslightbox-cursor-grabbing");d=!0,a=e.data.isMobile?t.touches[0].clientX:t.clientX,r=0},u=function(){e.element.contains(s)&&e.element.removeChild(s);let t=e.getSourcesIndexes.all(e.data.slide);for(let e in n)n[e].classList.remove("fslightbox-cursor-grabbing");d=!1,0!==r&&l&&(l=!1,i[t.previous].classList.add("fslightbox-transform-transition"),i[t.current].classList.add("fslightbox-transform-transition"),i[t.next].classList.add("fslightbox-transform-transition"),r>0?(1===e.data.slide?e.data.updateSlideNumber(e.data.total_slides):e.data.updateSlideNumber(e.data.slide-1),o>=2?(e.transforms.transformPlus(i[t.current]),e.transforms.transformNull(i[t.previous])):e.transforms.transformNull(i[t.current]),t=e.getSourcesIndexes.all(e.data.slide),void 0===e.data.sources[t.previous]&&e.loadsources("previous",e.data.slide)):r<0&&(e.data.slide===e.data.total_slides?e.data.updateSlideNumber(1):e.data.updateSlideNumber(e.data.slide+1),o>1?(e.transforms.transformMinus(i[t.current]),e.transforms.transformNull(i[t.next])):e.transforms.transformNull(i[t.current]),t=e.getSourcesIndexes.all(e.data.slide),void 0===e.data.sources[t.next]&&e.loadsources("next",e.data.slide)),r=0,e.stopVideos(),setTimeout(function(){i[t.previous].classList.remove("fslightbox-transform-transition"),i[t.current].classList.remove("fslightbox-transform-transition"),i[t.next].classList.remove("fslightbox-transform-transition"),l=!0},250))},h=function(t){if(!d||!l)return;let n;n=e.data.isMobile?t.touches[0].clientX:t.clientX,e.element.appendChild(s),r=n-a;const c=e.getSourcesIndexes.all(e.data.slide);o>=3&&(i[c.previous].style.transform="translate("+(-e.data.slideDistance*window.innerWidth+r)+"px,0)"),o>=1&&(i[c.current].style.transform="translate("+r+"px,0)"),o>=2&&(i[c.next].style.transform="translate("+(e.data.slideDistance*window.innerWidth+r)+"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),window.addEventListener("mousemove",h),window.addEventListener("touchmove",h),e.data.nav.addEventListener("mousedown",function(e){e.preventDefault()})}},{}],3:[function(e,t,s){window.fsLightboxObject=function(){this.element=new s("div").addClassesAndCreate(["fslightbox-container"]),this.data={slide:1,total_slides:1,slideDistance:1.3,slideCounter:!0,slideButtons:!0,isFirstTimeLoad:!1,moveSlidesViaDrag:!0,toolbarButtons:{close:!0,fullscreen:!0},name:"",isMobile:!1,urls:[],sources:[],sourcesLoaded:[],rememberedSourcesDimensions:[],videos:[],videosPosters:[],holderWrapper:{},mediaHolder:{},nav:{},toolbar:{},slideCounterElem:{},initiated:!1,fullscreen:!1,fadingOut:!1,onResizeEvent:{},updateSlideNumber:function(){}};const t=this;function s(e){this.elem=document.createElement(e),this.addClassesAndCreate=function(e){for(let t in e)this.elem.classList.add(e[t]);return this.elem}}function n(){let e=this;const s=t.data.sources;this.mediaHolderDimensions=function(){window.innerWidth>1e3?(t.data.mediaHolder.holder.style.width=window.innerWidth-.1*window.innerWidth+"px",t.data.mediaHolder.holder.style.height=window.innerHeight-.1*window.innerHeight+"px"):(t.data.mediaHolder.holder.style.width=window.innerWidth+"px",t.data.mediaHolder.holder.style.height=window.innerHeight+"px")};window.onresize=function(){t.checkIfMobile(),e.mediaHolderDimensions(),function(){const e=t.getSourcesIndexes.all(t.data.slide),n=t.data.rememberedSourcesDimensions;for(let i in s){t.data.urls.length>2&&t.transforms.transformMinus(s[e.previous]),t.transforms.transformNull(s[e.current]),t.data.urls.length>1&&t.transforms.transformPlus(s[e.next]);const o=s[i].firstChild,a=n[i].width/n[i].height,r=parseInt(t.data.mediaHolder.holder.style.width),d=parseInt(t.data.mediaHolder.holder.style.height);let l=r/a;l<d-60?(o.style.height=l+"px",o.style.width=r+"px"):(l=d-60,o.style.height=l+"px",o.style.width=l*a+"px")}}(),function(){const e=t.data.sources,s=t.getSourcesIndexes.all(t.data.slide);for(let n in e)parseInt(n)!==s.previous&&parseInt(n)!==s.current&&parseInt(n)!==s.next&&(e[n].classList.remove("fslightbox-transform-transition"),t.transforms.transformMinus(e[n]))}()}}this.init=function(i){if(t.data.initiated)return t.initSetSlide(i),void t.show();t.checkIfMobile(),t.data.onResizeEvent=new n;let o=t.data.name,a=[];const r=fsLightboxHelpers.a;for(let e=0;e<r.length;e++)if(r[e].hasAttribute("fslightbox-gallery")&&r[e].getAttribute("fslightbox-gallery")===o){let s=a.push(r[e].getAttribute("href"));r[e].hasAttribute("fslightbox-video-poster")&&(t.data.videosPosters[s-1]=r[e].getAttribute("fslightbox-video-poster"))}t.data.urls=a,t.data.total_slides=a.length,new t.dom,t.throwEvent("init"),t.throwEvent("open"),e("./changeSlideByDragging.js")(t,s),t.initSetSlide(i),t.data.initiated=!0},this.initSetSlide=function(e){switch(typeof e){case"string":t.setSlide(t.data.urls.indexOf(e)+1);break;case"number":t.setSlide(e);break;case"undefined":t.setSlide(1)}},this.show=function(){const e=t.element;t.scrollbar.showScrollbar(),e.classList.remove("fslightbox-container-fadeout"),document.body.appendChild(e),t.throwEvent("show"),t.throwEvent("open"),e.classList.remove(["fslightbox-fade-in-animation"]),e.classList.add(["fslightbox-fade-in-animation"])},this.hide=function(){t.data.fullscreen&&t.toolbar.closeFullscreen(),t.element.classList.add("fslightbox-container-fadeout"),t.data.fadingOut=!0,t.throwEvent("close"),setTimeout(function(){t.scrollbar.hideScrollbar(),t.data.fadingOut=!1,document.body.removeChild(t.element)},250)},this.dom=function(){e("./renderDOM.js")(t,s)},this.throwEvent=function(e){let s;"function"==typeof Event?s=new Event(e):(s=document.createEvent("Event")).initEvent(e,!0,!0),t.element.dispatchEvent(s)},this.checkIfMobile=function(){/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?t.data.isMobile=!0:t.data.isMobile=!1},this.scrollbar={hideScrollbar:function(){if(document.documentElement.classList.contains("fslightbox-scrollbarfix")){let e=document.querySelector(".recompense-for-scrollbar");e&&(e.style.paddingRight="0"),document.documentElement.classList.remove("fslightbox-scrollbarfix")}document.documentElement.classList.remove("fslightbox-open")},showScrollbar:function(){if(!t.data.isMobile&&document.documentElement.offsetHeight>=window.innerHeight){let e=document.querySelector(".recompense-for-scrollbar");e&&(e.style.paddingRight="17px"),document.documentElement.classList.add("fslightbox-scrollbarfix")}document.documentElement.classList.add("fslightbox-open")}},this.SVGIcon=function(){this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.path=document.createElementNS("http://www.w3.org/2000/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}};let i=e("./toolbar");this.toolbar=new i(t,s),this.mediaHolder=function(){this.holder=new s("div").addClassesAndCreate(["fslightbox-media-holder"]),window.innerWidth>1e3?(this.holder.style.width=window.innerWidth-.1*window.innerWidth+"px",this.holder.style.height=window.innerHeight-.1*window.innerHeight+"px"):(this.holder.style.width=window.innerWidth+"px",this.holder.style.height=window.innerHeight+"px"),this.renderHolder=function(e){e.appendChild(this.holder)}},this.getSourcesIndexes={previous:function(e){let s;const n=e-1;return s=0===n?t.data.total_slides-1:n-1},next:function(e){let s;const n=e-1;return s=e===t.data.total_slides?0:n+1},all:function(e){const s=e-1,n={previous:0,current:0,next:0};return n.previous=0===s?t.data.total_slides-1:s-1,n.current=s,e===t.data.total_slides?n.next=0:n.next=s+1,n}},this.transforms={transformMinus:function(e){e.style.transform="translate("+-t.data.slideDistance*window.innerWidth+"px,0)"},transformNull:function(e){e.style.transform="translate(0,0)"},transformPlus:function(e){e.style.transform="translate("+t.data.slideDistance*window.innerWidth+"px,0)"}},this.stopVideos=function(){const e=t.data.videos;for(let s in e)!0===e[s]?void 0!==t.data.sources[s].firstChild.pause&&t.data.sources[s].firstChild.pause():t.data.sources[s].firstChild.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}',"*")},this.setSlide=function(e){t.data.slide=e,t.data.updateSlideNumber(e);const s=t.getSourcesIndexes.all(e),n=t.data.sources;0===n.length?t.loadsources("initial",e):(void 0===n[s.previous]&&t.loadsources("previous",e),void 0===n[s.current]&&t.loadsources("current",e),void 0===n[s.next]&&t.loadsources("next",e));for(let e in n)n[e].classList.remove("fslightbox-transform-transition"),e==s.previous&&n.length>1?t.transforms.transformMinus(n[s.previous]):e!=s.current?e!=s.next?t.transforms.transformMinus(n[e]):t.transforms.transformPlus(n[s.next]):t.transforms.transformNull(n[s.current])},this.appendMethods=e("./appendSource"),this.loadsources=function(n,i){return new(e("./loadSource.js"))(t,s,n,i)}},function(){window.fsLightboxInstances=[],window.fsLightboxHelpers={a:document.getElementsByTagName("a")};let e=fsLightboxHelpers.a;for(let t=0;t<e.length;t++){if(!e[t].hasAttribute("fslightbox-gallery"))continue;const s=e[t].getAttribute("fslightbox-gallery");void 0===fsLightboxInstances[s]&&(fsLightbox=new fsLightboxObject,fsLightbox.data.name=s,fsLightboxInstances[s]=fsLightbox),e[t].addEventListener("click",function(e){e.preventDefault();let t=this.getAttribute("fslightbox-gallery");if(fsLightboxInstances[t].data.initiated)return fsLightboxInstances[t].setSlide(fsLightboxInstances[t].data.urls.indexOf(this.getAttribute("href"))+1),void fsLightboxInstances[t].show();fsLightboxInstances[t].init(this.getAttribute("href"))})}}(document,window)},{"./appendSource":1,"./changeSlideByDragging.js":2,"./loadSource.js":4,"./renderDOM.js":5,"./toolbar":6}],4:[function(e,t,s){t.exports=function(e,t,s,n){const i=e.getSourcesIndexes.all(n),o=e.data.urls,a=e.data.sources;let r=function(n,i,o,r){let d=new t("div").addClassesAndCreate(["fslightbox-source-holder"]);e.data.rememberedSourcesDimensions[r]={width:i,height:o},function(t,s,n){const i=s/n,o=parseInt(e.data.mediaHolder.holder.style.width),a=parseInt(e.data.mediaHolder.holder.style.height);let r=o/i;r<a-60?(t.style.height=r+"px",t.style.width=o+"px"):(r=a-60,t.style.height=r+"px",t.style.width=r*i+"px")}(n,i,o),d.appendChild(n),"initial"===s?function(e,t){e.innerHTML="",e.appendChild(t),e.firstChild.classList.add("fslightbox-fade-in-animation")}(a[r],n):function(e,t){e.innerHTML="",e.appendChild(t),e.firstChild.offsetWidth,e.firstChild.classList.add("fslightbox-fade-in-animation")}(a[r],n)};const d=function(e){let s=new t("div").addClassesAndCreate(["fslightbox-invalid-file-wrapper"]);s.innerHTML="Invalid file",r(s,window.innerWidth,window.innerHeight,e)};if(this.createSourceElem=function(s){const n=document.createElement("a"),i=e.data.urls[s];if(n.href=i,"www.youtube.com"===n.hostname)e.data.videos[s]=!1,function(s,n){let i=new t("iframe").addClassesAndCreate(["fslightbox-single-source"]);i.src="//www.youtube.com/embed/"+s+"?enablejsapi=1",i.setAttribute("allowfullscreen",""),i.setAttribute("frameborder","0"),e.data.mediaHolder.holder.appendChild(i),r(i,1920,1080,n)}(function(e){let t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return t&&11==t[2].length?t[2]:"error"}(i),s);else{const n=new XMLHttpRequest;n.onreadystatechange=function(){if(2===n.readyState){if(200===n.status||206===n.status){const i=n.getResponseHeader("content-type"),a=i.slice(0,i.indexOf("/"));"image"===a?function(e,s){let n=new t("img").addClassesAndCreate(["fslightbox-single-source"]);n.src=e,n.addEventListener("load",function(){r(n,this.width,this.height,s)})}(o[s],s):"video"===a?(!function(s,n,i){let o,a,d=!1,l=new t("video").addClassesAndCreate(["fslightbox-single-source"]),c=new t("source").elem;e.data.videosPosters[n]&&(l.poster=e.data.videosPosters[n],l.style.objectFit="cover"),c.src=s,c.type=i,l.appendChild(c),l.onloadedmetadata=function(){d||(this.videoWidth&&0!==this.videoWidth?(o=this.videoWidth,a=this.videoHeight):(o=1920,a=1080),d=!0,r(l,o,a,n))};let u=0,h=setInterval(function(){if(d)clearInterval(h);else{if(l.videoWidth&&0!==l.videoWidth)o=l.videoWidth,a=l.videoHeight;else{if(u<31)return void u++;o=1920,a=1080}d=!0,r(l,o,a,n),clearInterval(h)}},100);l.setAttribute("controls","")}(o[s],s,i),e.data.videos[s]=!0):d(s)}else d(s);n.abort()}},n.open("get",i,!0),n.send(null)}},"initial"===s)e.appendMethods.renderHolderInitial(e,n,t),o.length>=1&&this.createSourceElem(i.current),o.length>=2&&this.createSourceElem(i.next),o.length>=3&&this.createSourceElem(i.previous);else switch(e.appendMethods.renderHolder(e,n,s),s){case"previous":this.createSourceElem(i.previous);break;case"current":this.createSourceElem(i.current);break;case"next":this.createSourceElem(i.next)}}},{}],5:[function(e,t,s){t.exports=function(e,t){const s=function(){let s=new t("div").addClassesAndCreate(["fslightbox-slide-number-container"]);e.data.slideCounterElem=new t("div").addClassesAndCreate(["fslightbox-slide-slide-number"]),e.data.slideCounterElem.innerHTML=e.data.slide,e.data.slideCounterElem.id="current_slide";let n=new t("div").addClassesAndCreate(["fslightbox-slide-slide-number","fslightbox-slash"]);n.innerHTML="/";let i=new t("div").addClassesAndCreate(["fslightbox-slide-slide-number"]);i.innerHTML=e.data.total_slides,s.appendChild(e.data.slideCounterElem),s.appendChild(n),s.appendChild(i),e.data.updateSlideNumber=function(t){e.data.slide=t,e.data.slideCounterElem.innerHTML=t},this.renderSlideCounter=function(t){e.data.slideCounter&&t.appendChild(s)}},n=function(s,n,i){let o=new t("div").addClassesAndCreate(["fslightbox-slide-btn","button-style"]);o.appendChild((new e.SVGIcon).getSVGIcon("0 0 20 20","1em",i)),s.appendChild(o),n.appendChild(s)};var i;e.scrollbar.showScrollbar(),e.element.id="fslightbox-container",document.body.appendChild(e.element),i=e.element,e.data.nav=new t("div").addClassesAndCreate(["fslightbox-nav"]),e.toolbar.renderToolbar(e.data.nav),(new s).renderSlideCounter(e.data.nav),i.appendChild(e.data.nav),e.data.total_slides>1&&function(s){if(!1===e.data.slideButtons)return!1;let i=new t("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-left-container"]);n(i,s,"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"),i.onclick=function(){e.appendMethods.previousSlideViaButton(e,e.data.slide)};let o=new t("div").addClassesAndCreate(["fslightbox-slide-btn-container","fslightbox-slide-btn-right-container"]);n(o,s,"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,e.data.slide)}}(e.element),e.data.holderWrapper=new t("div").addClassesAndCreate(["fslightbox-holder-wrapper"]),e.element.appendChild(e.data.holderWrapper),e.data.mediaHolder=new e.mediaHolder,e.data.mediaHolder.renderHolder(e.data.holderWrapper),e.element.classList.add(["fslightbox-fade-in-animation"]),e.data.isfirstTimeLoad=!0}},{}],6:[function(e,t,s){t.exports=function(e,t){this.toolbarElem=new t("div").addClassesAndCreate(["fslightbox-toolbar"]);const s=this;this.renderDefaultButtons=function(){let n=e.data.toolbarButtons;if(!0===n.fullscreen){let n=new t("div").addClassesAndCreate(["fslightbox-toolbar-button","button-style"]),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");n.appendChild(i),n.onclick=function(){e.data.fullscreen?s.closeFullscreen():s.openFullscreen()},this.toolbarElem.appendChild(n)}if(!0===n.close){let s=new t("div").addClassesAndCreate(["fslightbox-toolbar-button","button-style"]),n=(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");s.appendChild(n),s.onclick=function(){e.data.fadingOut||e.hide()},this.toolbarElem.appendChild(s)}},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)}}},{}]},{},[3,5,4,1,2,6]); |
{ | ||
"name": "fslightbox", | ||
"version": "1.4.11", | ||
"description": "Fullscreen media lightbox library in vanilla JS. Fullscreen Lightbox is a tool for displaying images, videos in nice overlaying box. Technologies: JavaScript, SCSS", | ||
"version": "1.5.0", | ||
"description": "Fullscreen media lightbox library written in vanilla JS. Technologies: JavaScript, SCSS", | ||
"main": "index.js", | ||
"dist-tags" : { | ||
"latest": "1.4.1" | ||
"dist-tags": { | ||
"latest": "1.5.0" | ||
}, | ||
@@ -17,8 +17,16 @@ "scripts": { | ||
"author": "", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/PiotrZdziarski/FullscreenLightbox/issues" | ||
}, | ||
"homepage": "http://fslightbox.com", | ||
"keywords": ["lightbox", "fullscreen lightbox", "fslightbox", "media player", "no jQuery"] | ||
"homepage": "https://fslightbox.com", | ||
"keywords": [ | ||
"lightbox", | ||
"javascript lightbox", | ||
"vanilla js lightbox", | ||
"fullscreen lightbox", | ||
"fslightbox", | ||
"media player", | ||
"no jQuery" | ||
] | ||
} |
@@ -1,8 +0,10 @@ | ||
# Fullscreen Lightbox | ||
# Fullscreen Lightbox Basic | ||
## Version - 1.4.1 | ||
## Version - 1.5 | ||
## Description | ||
JavaScript media box library for presenting images, videos. | ||
JavaScript lightbox library for presenting images, videos in overlaying box. | ||
Website: https://fslightbox.com | ||
Open source project. | ||
@@ -9,0 +11,0 @@ Technologies: |
Sorry, the diff of this file is not supported yet
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
14
155742
1568