New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simplelightbox

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplelightbox - npm Package Compare versions

Comparing version 1.16.2 to 1.16.3

2

bower.json
{
"name": "simplelightbox",
"version": "1.16.2",
"version": "1.16.3",
"homepage": "http://simplelightbox.com/",

@@ -5,0 +5,0 @@ "authors": [

@@ -1,6 +0,6 @@

/*
/*!
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
1.16.2
1.16.3
*/

@@ -416,2 +416,5 @@ ;( function( $, window, document, undefined )

{
if (e.target.tagName === 'A' && e.type == 'touchstart') {
return true;
}
e = e.originalEvent;

@@ -418,0 +421,0 @@ if(e.type == 'mousedown') {

@@ -5,4 +5,4 @@ /*

Available for use under the MIT License
1.16.2
1.16.3
*/
!function(ot,lt,rt,t){"use strict";ot.fn.simpleLightbox=function(z){z=ot.extend({sourceAttr:"href",overlay:!0,spinner:!0,nav:!0,navText:["&lsaquo;","&rsaquo;"],captions:!0,captionDelay:0,captionSelector:"img",captionType:"attr",captionsData:"title",captionPosition:"bottom",captionClass:"",close:!0,closeText:"×",swipeClose:!0,showCounter:!0,fileExt:"png|jpg|jpeg|gif",animationSlide:!0,animationSpeed:250,preloading:!0,enableKeyboard:!0,loop:!0,rel:!1,docClose:!0,swipeTolerance:50,className:"simple-lightbox",widthRatio:.8,heightRatio:.9,scaleImageToRatio:!1,disableRightClick:!1,disableScroll:!0,alertError:!0,alertErrorMessage:"Image not found, next image will be loaded",additionalHtml:!1,history:!0,throttleInterval:0,doubleTapZoom:2,maxZoom:10,htmlClass:"has-lightbox"},z);var h,t,H="ontouchstart"in lt,L=(lt.navigator.pointerEnabled||lt.navigator.msPointerEnabled,0),Z=0,F=ot(),i=function(){var t=rt.body||rt.documentElement;return""===(t=t.style).WebkitTransition?"-webkit-":""===t.MozTransition?"-moz-":""===t.OTransition?"-o-":""===t.transition&&""},N=!1,d=[],j=z.rel&&!1!==z.rel?(t=z.rel,ot(this).filter(function(){return ot(this).attr("rel")===t})):this,p=(i=i(),0),K=!1!==i,a="pushState"in history,u=!1,n=lt.location,$=function(){return n.hash.substring(1)},B=$(),g=function(){$();var t="pid="+(J+1),e=n.href.split("#")[0]+"#"+t;a?history[u?"replaceState":"pushState"]("",rt.title,e):u?n.replace(e):n.hash=t,u=!0},Q=function(e,a){var n;return function(){var t=arguments;n||(e.apply(this,t),n=!0,setTimeout(function(){return n=!1},a))}},U="simplelb",e=ot("<div>").addClass("sl-overlay"),s=ot("<button>").addClass("sl-close").html(z.closeText),f=ot("<div>").addClass("sl-spinner").html("<div></div>"),G=ot("<div>").addClass("sl-navigation").html('<button class="sl-prev">'+z.navText[0]+'</button><button class="sl-next">'+z.navText[1]+"</button>"),o=ot("<div>").addClass("sl-counter").html('<span class="sl-current"></span>/<span class="sl-total"></span>'),m=!1,J=0,v=0,l=ot("<div>").addClass("sl-caption "+z.captionClass+" pos-"+z.captionPosition),V=ot("<div>").addClass("sl-image"),r=ot("<div>").addClass("sl-wrapper").addClass(z.className),c=function(t){t.trigger(ot.Event("show.simplelightbox")),z.disableScroll&&(p=C("hide")),z.htmlClass&&""!=z.htmlClass&&ot("html").addClass(z.htmlClass),r.appendTo("body"),V.appendTo(r),z.overlay&&e.appendTo(ot("body")),m=!0,J=j.index(t),F=ot("<img/>").hide().attr("src",t.attr(z.sourceAttr)).attr("data-scale",1).attr("data-translate-x",0).attr("data-translate-y",0),-1==d.indexOf(t.attr(z.sourceAttr))&&d.push(t.attr(z.sourceAttr)),V.html("").attr("style",""),F.appendTo(V),b(),e.fadeIn("fast"),ot(".sl-close").fadeIn("fast"),f.show(),G.fadeIn("fast"),ot(".sl-wrapper .sl-counter .sl-current").text(J+1),o.fadeIn("fast"),_(),z.preloading&&y(),setTimeout(function(){t.trigger(ot.Event("shown.simplelightbox"))},z.animationSpeed)},_=function(o){if(F.length){var l=new Image,r=lt.innerWidth*z.widthRatio,c=lt.innerHeight*z.heightRatio;l.src=F.attr("src"),F.data("scale",1),F.data("translate-x",0),F.data("translate-y",0),et(0,0,1),ot(l).on("error",function(t){j.eq(J).trigger(ot.Event("error.simplelightbox")),N=!(m=!1),f.hide();var e=1==o||-1==o;v===J&&e?st():(z.alertError&&alert(z.alertErrorMessage),it(e?o:1))}),l.onload=function(){void 0!==o&&j.eq(J).trigger(ot.Event("changed.simplelightbox")).trigger(ot.Event((1===o?"nextDone":"prevDone")+".simplelightbox")),z.history&&(u?h=setTimeout(g,800):g()),-1==d.indexOf(F.attr("src"))&&d.push(F.attr("src"));var t=l.width,e=l.height;if(z.scaleImageToRatio||r<t||c<e){var a=r/c<t/e?t/r:e/c;t/=a,e/=a}ot(".sl-image").css({top:(lt.innerHeight-e)/2+"px",left:(lt.innerWidth-t-p)/2+"px",width:t+"px",height:e+"px"}),f.hide(),F.fadeIn("fast"),N=!0;var n,i="self"==z.captionSelector?j.eq(J):j.eq(J).find(z.captionSelector);if(n="data"==z.captionType?i.data(z.captionsData):"text"==z.captionType?i.html():i.prop(z.captionsData),z.loop||(0===J&&ot(".sl-prev").hide(),J>=j.length-1&&ot(".sl-next").hide(),0<J&&ot(".sl-prev").show(),J<j.length-1&&ot(".sl-next").show()),1==j.length&&ot(".sl-prev, .sl-next").hide(),1==o||-1==o){var s={opacity:1};z.animationSlide&&(K?(tt(0,100*o+"px"),setTimeout(function(){tt(z.animationSpeed/1e3,"0px")},50)):s.left=parseInt(ot(".sl-image").css("left"))+100*o+"px"),ot(".sl-image").animate(s,z.animationSpeed,function(){m=!1,x(n,t)})}else m=!1,x(n,t);z.additionalHtml&&0===ot(".sl-additional-html").length&&ot("<div>").html(z.additionalHtml).addClass("sl-additional-html").appendTo(ot(".sl-image"))}}},x=function(t,e){""!==t&&void 0!==t&&z.captions&&l.html(t).css({width:e+"px"}).hide().appendTo(ot(".sl-image")).delay(z.captionDelay).fadeIn("fast")},tt=function(t,e){var a={};a[i+"transform"]="translateX("+e+")",a[i+"transition"]=i+"transform "+t+"s linear",ot(".sl-image").css(a)},et=function(t,e,a){var n={};n[i+"transform"]="translate("+t+","+e+") scale("+a+")",F.css(n)},at=function(t,e,a){return t<e?e:a<t?a:t},nt=function(t,e,a){F.data("scale",t),F.data("translate-x",e),F.data("translate-y",a)},b=function(){ot(lt).on("resize."+U,_),ot(rt).on("click."+U+" touchstart."+U,".sl-close",function(t){t.preventDefault(),N&&st()}),z.history&&setTimeout(function(){ot(lt).on("hashchange."+U,function(){N&&$()===B&&st()})},40),G.on("click."+U,"button",Q(function(t){t.preventDefault(),L=0,it(ot(this).hasClass("sl-next")?1:-1)},z.throttleInterval));var e,a,n,i,s,o,l,r,c,h,d,p,u,g,f,m,v,x,b,y,C,T,w,E,S,I,M,k=0,q=0,D=0,R=0,X=!1,A=!1,O=0,Y=!1,W=at(1,1,z.maxZoom),P=!1;V.on("touchstart."+U+" mousedown."+U,function(t){if("mousedown"==(t=t.originalEvent).type);else{if(M=t.touches.length,c=t.touches[0].clientX,h=t.touches[0].clientY,e=V.height(),a=V.width(),s=F.height(),o=F.width(),n=V.position().left,i=V.position().top,1===M){if(P)return F.addClass("sl-transition"),X=X?(nt(0,0,W=1),et("0px","0px",W),!1):(W=z.doubleTapZoom,nt(0,0,W),et("0px","0px",W),ot(".sl-caption").fadeOut(200),!0),setTimeout(function(){F.removeClass("sl-transition")},200),!1;P=!0,setTimeout(function(){P=!1},300),l=parseFloat(F.data("translate-x")),r=parseFloat(F.data("translate-y"))}else 2===M&&(d=t.touches[1].clientX,p=t.touches[1].clientY,l=parseFloat(F.data("translate-x")),r=parseFloat(F.data("translate-y")),C=(c+d)/2,T=(h+p)/2,u=Math.sqrt((c-d)*(c-d)+(h-p)*(h-p)));Y=!0}return!!A||(K&&(O=parseInt(V.css("left"))),A=!0,Z=L=0,k=t.pageX||t.touches[0].pageX,D=t.pageY||t.touches[0].pageY,!1)}).on("touchmove."+U+" mousemove."+U+" MSPointerMove",function(t){if(!A)return!0;if(t.preventDefault(),"touchmove"==(t=t.originalEvent).type){if(!1===Y)return!1;g=t.touches[0].clientX,f=t.touches[0].clientY,M=t.touches.length,0,1<M?(m=t.touches[1].clientX,v=t.touches[1].clientY,I=Math.sqrt((g-m)*(g-m)+(f-v)*(f-v)),null===u&&(u=I),1<=Math.abs(u-I)&&(y=at(I/u*W,1,z.maxZoom),w=(o*y-a)/2,E=(s*y-e)/2,S=y-W,x=o*y<=a?0:at(l-(C-n-a/2-l)/(y-S)*S,-1*w,w),b=s*y<=e?0:at(r-(T-i-e/2-r)/(y-S)*S,-1*E,E),et(x+"px",b+"px",y),1<y&&(X=!0,ot(".sl-caption").fadeOut(200)),u=I,W=y,l=x,r=b)):(w=(o*(y=W)-a)/2,E=(s*y-e)/2,x=o*y<=a?0:at(g-(c-l),-1*w,w),b=s*y<=e?0:at(f-(h-r),-1*E,E),Math.abs(x)===Math.abs(w)&&(l=x,c=g),Math.abs(b)===Math.abs(E)&&(r=b,h=f),nt(W,x,b),et(x+"px",b+"px",y))}X||(q=t.pageX||t.touches[0].pageX,R=t.pageY||t.touches[0].pageY,L=k-q,Z=D-R,z.animationSlide&&(K?tt(0,-L+"px"):V.css("left",O-L+"px")))}).on("touchend."+U+" mouseup."+U+" touchcancel."+U+" mouseleave."+U+" pointerup pointercancel MSPointerUp MSPointerCancel",function(t){if(t=t.originalEvent,H&&"touchend"==t.type&&(0===(M=t.touches.length)?(nt(W,x,b),1==W&&(X=!1,ot(".sl-caption").fadeIn(200)),u=null,Y=!1):1===M?(c=t.touches[0].clientX,h=t.touches[0].clientY):1<M&&(u=null)),A){var e=!(A=!1);z.loop||(0===J&&L<0&&(e=!1),J>=j.length-1&&0<L&&(e=!1)),Math.abs(L)>z.swipeTolerance&&e?it(0<L?1:-1):z.animationSlide&&(K?tt(z.animationSpeed/1e3,"0px"):V.animate({left:O+"px"},z.animationSpeed/2)),z.swipeClose&&50<Math.abs(Z)&&Math.abs(L)<z.swipeTolerance&&st()}})},y=function(){var t=J+1<0?j.length-1:J+1>=j.length-1?0:J+1,e=J-1<0?j.length-1:J-1>=j.length-1?0:J-1;ot("<img />").attr("src",j.eq(t).attr(z.sourceAttr)).on("load",function(){-1==d.indexOf(ot(this).attr("src"))&&d.push(ot(this).attr("src")),j.eq(J).trigger(ot.Event("nextImageLoaded.simplelightbox"))}),ot("<img />").attr("src",j.eq(e).attr(z.sourceAttr)).on("load",function(){-1==d.indexOf(ot(this).attr("src"))&&d.push(ot(this).attr("src")),j.eq(J).trigger(ot.Event("prevImageLoaded.simplelightbox"))})},it=function(e){j.eq(J).trigger(ot.Event("change.simplelightbox")).trigger(ot.Event((1===e?"next":"prev")+".simplelightbox"));var t=J+e;if(!(m||(t<0||t>=j.length)&&!1===z.loop)){J=t<0?j.length-1:t>j.length-1?0:t,ot(".sl-wrapper .sl-counter .sl-current").text(J+1);var a={opacity:0};z.animationSlide&&(K?tt(z.animationSpeed/1e3,-100*e-L+"px"):a.left=parseInt(ot(".sl-image").css("left"))+-100*e+"px"),ot(".sl-image").animate(a,z.animationSpeed,function(){setTimeout(function(){var t=j.eq(J);F.attr("src",t.attr(z.sourceAttr)),-1==d.indexOf(t.attr(z.sourceAttr))&&f.show(),ot(".sl-caption").remove(),_(e),z.preloading&&y()},100)})}},st=function(){if(!m){var t=j.eq(J),e=!1;t.trigger(ot.Event("close.simplelightbox")),z.history&&(a?history.pushState("",rt.title,n.pathname+n.search):n.hash="",clearTimeout(h)),ot(".sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter").fadeOut("fast",function(){z.disableScroll&&C("show"),z.htmlClass&&""!=z.htmlClass&&ot("html").removeClass(z.htmlClass),ot(".sl-wrapper, .sl-overlay").remove(),G.off("click","button"),ot(rt).off("click."+U,".sl-close"),ot(lt).off("resize."+U),ot(lt).off("hashchange."+U),e||t.trigger(ot.Event("closed.simplelightbox")),e=!0}),F=ot(),m=N=!1}},C=function(t){var e=0;if("hide"==t){var a=lt.innerWidth;if(!a){var n=rt.documentElement.getBoundingClientRect();a=n.right-Math.abs(n.left)}if(rt.body.clientWidth<a){var i=rt.createElement("div"),s=parseInt(ot("body").css("padding-right"),10);i.className="sl-scrollbar-measure",ot("body").append(i),e=i.offsetWidth-i.clientWidth,ot(rt.body)[0].removeChild(i),ot("body").data("padding",s),0<e&&ot("body").addClass("hidden-scroll").css({"padding-right":s+e})}}else ot("body").removeClass("hidden-scroll").css({"padding-right":ot("body").data("padding")});return e};return z.close&&s.appendTo(r),z.showCounter&&1<j.length&&(o.appendTo(r),o.find(".sl-total").text(j.length)),z.nav&&G.appendTo(r),z.spinner&&f.appendTo(r),j.on("click."+U,function(t){if(function(t){if(!z.fileExt)return!0;var e=ot(t).attr(z.sourceAttr).match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim);return e&&"a"==ot(t).prop("tagName").toLowerCase()&&new RegExp(".("+z.fileExt+")$","i").test(e)}(this)){if(t.preventDefault(),m)return!1;var e=ot(this);v=j.index(e),c(e)}}),ot(rt).on("click."+U+" touchstart."+U,function(t){N&&z.docClose&&0===ot(t.target).closest(".sl-image").length&&0===ot(t.target).closest(".sl-navigation").length&&st()}),z.disableRightClick&&ot(rt).on("contextmenu",".sl-image img",function(t){return!1}),z.enableKeyboard&&ot(rt).on("keyup."+U,Q(function(t){L=0;var e=t.keyCode;m&&27==e&&(F.attr("src",""),m=!1,st()),N&&(t.preventDefault(),27==e&&st(),37!=e&&39!=t.keyCode||it(39==t.keyCode?1:-1))},z.throttleInterval)),this.open=function(t){t=t||ot(this[0]),v=j.index(t),c(t)},this.next=function(){it(1)},this.prev=function(){it(-1)},this.close=function(){st()},this.destroy=function(){ot(rt).off("click."+U).off("keyup."+U),st(),ot(".sl-overlay, .sl-wrapper").remove(),this.off("click")},this.refresh=function(){this.destroy(),ot(this).simpleLightbox(z)},this}}(jQuery,window,document);
!function(ot,lt,rt,t){"use strict";ot.fn.simpleLightbox=function(z){z=ot.extend({sourceAttr:"href",overlay:!0,spinner:!0,nav:!0,navText:["&lsaquo;","&rsaquo;"],captions:!0,captionDelay:0,captionSelector:"img",captionType:"attr",captionsData:"title",captionPosition:"bottom",captionClass:"",close:!0,closeText:"×",swipeClose:!0,showCounter:!0,fileExt:"png|jpg|jpeg|gif",animationSlide:!0,animationSpeed:250,preloading:!0,enableKeyboard:!0,loop:!0,rel:!1,docClose:!0,swipeTolerance:50,className:"simple-lightbox",widthRatio:.8,heightRatio:.9,scaleImageToRatio:!1,disableRightClick:!1,disableScroll:!0,alertError:!0,alertErrorMessage:"Image not found, next image will be loaded",additionalHtml:!1,history:!0,throttleInterval:0,doubleTapZoom:2,maxZoom:10,htmlClass:"has-lightbox"},z);var h,t,H="ontouchstart"in lt,L=(lt.navigator.pointerEnabled||lt.navigator.msPointerEnabled,0),N=0,Z=ot(),i=function(){var t=rt.body||rt.documentElement;return""===(t=t.style).WebkitTransition?"-webkit-":""===t.MozTransition?"-moz-":""===t.OTransition?"-o-":""===t.transition&&""},F=!1,d=[],j=z.rel&&!1!==z.rel?(t=z.rel,ot(this).filter(function(){return ot(this).attr("rel")===t})):this,p=(i=i(),0),K=!1!==i,a="pushState"in history,u=!1,n=lt.location,$=function(){return n.hash.substring(1)},B=$(),g=function(){$();var t="pid="+(J+1),e=n.href.split("#")[0]+"#"+t;a?history[u?"replaceState":"pushState"]("",rt.title,e):u?n.replace(e):n.hash=t,u=!0},Q=function(e,a){var n;return function(){var t=arguments;n||(e.apply(this,t),n=!0,setTimeout(function(){return n=!1},a))}},U="simplelb",e=ot("<div>").addClass("sl-overlay"),s=ot("<button>").addClass("sl-close").html(z.closeText),f=ot("<div>").addClass("sl-spinner").html("<div></div>"),G=ot("<div>").addClass("sl-navigation").html('<button class="sl-prev">'+z.navText[0]+'</button><button class="sl-next">'+z.navText[1]+"</button>"),o=ot("<div>").addClass("sl-counter").html('<span class="sl-current"></span>/<span class="sl-total"></span>'),m=!1,J=0,v=0,l=ot("<div>").addClass("sl-caption "+z.captionClass+" pos-"+z.captionPosition),V=ot("<div>").addClass("sl-image"),r=ot("<div>").addClass("sl-wrapper").addClass(z.className),c=function(t){t.trigger(ot.Event("show.simplelightbox")),z.disableScroll&&(p=C("hide")),z.htmlClass&&""!=z.htmlClass&&ot("html").addClass(z.htmlClass),r.appendTo("body"),V.appendTo(r),z.overlay&&e.appendTo(ot("body")),m=!0,J=j.index(t),Z=ot("<img/>").hide().attr("src",t.attr(z.sourceAttr)).attr("data-scale",1).attr("data-translate-x",0).attr("data-translate-y",0),-1==d.indexOf(t.attr(z.sourceAttr))&&d.push(t.attr(z.sourceAttr)),V.html("").attr("style",""),Z.appendTo(V),b(),e.fadeIn("fast"),ot(".sl-close").fadeIn("fast"),f.show(),G.fadeIn("fast"),ot(".sl-wrapper .sl-counter .sl-current").text(J+1),o.fadeIn("fast"),_(),z.preloading&&y(),setTimeout(function(){t.trigger(ot.Event("shown.simplelightbox"))},z.animationSpeed)},_=function(o){if(Z.length){var l=new Image,r=lt.innerWidth*z.widthRatio,c=lt.innerHeight*z.heightRatio;l.src=Z.attr("src"),Z.data("scale",1),Z.data("translate-x",0),Z.data("translate-y",0),et(0,0,1),ot(l).on("error",function(t){j.eq(J).trigger(ot.Event("error.simplelightbox")),F=!(m=!1),f.hide();var e=1==o||-1==o;v===J&&e?st():(z.alertError&&alert(z.alertErrorMessage),it(e?o:1))}),l.onload=function(){void 0!==o&&j.eq(J).trigger(ot.Event("changed.simplelightbox")).trigger(ot.Event((1===o?"nextDone":"prevDone")+".simplelightbox")),z.history&&(u?h=setTimeout(g,800):g()),-1==d.indexOf(Z.attr("src"))&&d.push(Z.attr("src"));var t=l.width,e=l.height;if(z.scaleImageToRatio||r<t||c<e){var a=r/c<t/e?t/r:e/c;t/=a,e/=a}ot(".sl-image").css({top:(lt.innerHeight-e)/2+"px",left:(lt.innerWidth-t-p)/2+"px",width:t+"px",height:e+"px"}),f.hide(),Z.fadeIn("fast"),F=!0;var n,i="self"==z.captionSelector?j.eq(J):j.eq(J).find(z.captionSelector);if(n="data"==z.captionType?i.data(z.captionsData):"text"==z.captionType?i.html():i.prop(z.captionsData),z.loop||(0===J&&ot(".sl-prev").hide(),J>=j.length-1&&ot(".sl-next").hide(),0<J&&ot(".sl-prev").show(),J<j.length-1&&ot(".sl-next").show()),1==j.length&&ot(".sl-prev, .sl-next").hide(),1==o||-1==o){var s={opacity:1};z.animationSlide&&(K?(tt(0,100*o+"px"),setTimeout(function(){tt(z.animationSpeed/1e3,"0px")},50)):s.left=parseInt(ot(".sl-image").css("left"))+100*o+"px"),ot(".sl-image").animate(s,z.animationSpeed,function(){m=!1,x(n,t)})}else m=!1,x(n,t);z.additionalHtml&&0===ot(".sl-additional-html").length&&ot("<div>").html(z.additionalHtml).addClass("sl-additional-html").appendTo(ot(".sl-image"))}}},x=function(t,e){""!==t&&void 0!==t&&z.captions&&l.html(t).css({width:e+"px"}).hide().appendTo(ot(".sl-image")).delay(z.captionDelay).fadeIn("fast")},tt=function(t,e){var a={};a[i+"transform"]="translateX("+e+")",a[i+"transition"]=i+"transform "+t+"s linear",ot(".sl-image").css(a)},et=function(t,e,a){var n={};n[i+"transform"]="translate("+t+","+e+") scale("+a+")",Z.css(n)},at=function(t,e,a){return t<e?e:a<t?a:t},nt=function(t,e,a){Z.data("scale",t),Z.data("translate-x",e),Z.data("translate-y",a)},b=function(){ot(lt).on("resize."+U,_),ot(rt).on("click."+U+" touchstart."+U,".sl-close",function(t){t.preventDefault(),F&&st()}),z.history&&setTimeout(function(){ot(lt).on("hashchange."+U,function(){F&&$()===B&&st()})},40),G.on("click."+U,"button",Q(function(t){t.preventDefault(),L=0,it(ot(this).hasClass("sl-next")?1:-1)},z.throttleInterval));var e,a,n,i,s,o,l,r,c,h,d,p,u,g,f,m,v,x,b,y,C,T,w,E,S,I,M,k=0,q=0,D=0,A=0,R=!1,X=!1,O=0,Y=!1,W=at(1,1,z.maxZoom),P=!1;V.on("touchstart."+U+" mousedown."+U,function(t){if("A"===t.target.tagName&&"touchstart"==t.type)return!0;if("mousedown"==(t=t.originalEvent).type);else{if(M=t.touches.length,c=t.touches[0].clientX,h=t.touches[0].clientY,e=V.height(),a=V.width(),s=Z.height(),o=Z.width(),n=V.position().left,i=V.position().top,1===M){if(P)return Z.addClass("sl-transition"),R=R?(nt(0,0,W=1),et("0px","0px",W),!1):(W=z.doubleTapZoom,nt(0,0,W),et("0px","0px",W),ot(".sl-caption").fadeOut(200),!0),setTimeout(function(){Z.removeClass("sl-transition")},200),!1;P=!0,setTimeout(function(){P=!1},300),l=parseFloat(Z.data("translate-x")),r=parseFloat(Z.data("translate-y"))}else 2===M&&(d=t.touches[1].clientX,p=t.touches[1].clientY,l=parseFloat(Z.data("translate-x")),r=parseFloat(Z.data("translate-y")),C=(c+d)/2,T=(h+p)/2,u=Math.sqrt((c-d)*(c-d)+(h-p)*(h-p)));Y=!0}return!!X||(K&&(O=parseInt(V.css("left"))),X=!0,N=L=0,k=t.pageX||t.touches[0].pageX,D=t.pageY||t.touches[0].pageY,!1)}).on("touchmove."+U+" mousemove."+U+" MSPointerMove",function(t){if(!X)return!0;if(t.preventDefault(),"touchmove"==(t=t.originalEvent).type){if(!1===Y)return!1;g=t.touches[0].clientX,f=t.touches[0].clientY,M=t.touches.length,0,1<M?(m=t.touches[1].clientX,v=t.touches[1].clientY,I=Math.sqrt((g-m)*(g-m)+(f-v)*(f-v)),null===u&&(u=I),1<=Math.abs(u-I)&&(y=at(I/u*W,1,z.maxZoom),w=(o*y-a)/2,E=(s*y-e)/2,S=y-W,x=o*y<=a?0:at(l-(C-n-a/2-l)/(y-S)*S,-1*w,w),b=s*y<=e?0:at(r-(T-i-e/2-r)/(y-S)*S,-1*E,E),et(x+"px",b+"px",y),1<y&&(R=!0,ot(".sl-caption").fadeOut(200)),u=I,W=y,l=x,r=b)):(w=(o*(y=W)-a)/2,E=(s*y-e)/2,x=o*y<=a?0:at(g-(c-l),-1*w,w),b=s*y<=e?0:at(f-(h-r),-1*E,E),Math.abs(x)===Math.abs(w)&&(l=x,c=g),Math.abs(b)===Math.abs(E)&&(r=b,h=f),nt(W,x,b),et(x+"px",b+"px",y))}R||(q=t.pageX||t.touches[0].pageX,A=t.pageY||t.touches[0].pageY,L=k-q,N=D-A,z.animationSlide&&(K?tt(0,-L+"px"):V.css("left",O-L+"px")))}).on("touchend."+U+" mouseup."+U+" touchcancel."+U+" mouseleave."+U+" pointerup pointercancel MSPointerUp MSPointerCancel",function(t){if(t=t.originalEvent,H&&"touchend"==t.type&&(0===(M=t.touches.length)?(nt(W,x,b),1==W&&(R=!1,ot(".sl-caption").fadeIn(200)),u=null,Y=!1):1===M?(c=t.touches[0].clientX,h=t.touches[0].clientY):1<M&&(u=null)),X){var e=!(X=!1);z.loop||(0===J&&L<0&&(e=!1),J>=j.length-1&&0<L&&(e=!1)),Math.abs(L)>z.swipeTolerance&&e?it(0<L?1:-1):z.animationSlide&&(K?tt(z.animationSpeed/1e3,"0px"):V.animate({left:O+"px"},z.animationSpeed/2)),z.swipeClose&&50<Math.abs(N)&&Math.abs(L)<z.swipeTolerance&&st()}})},y=function(){var t=J+1<0?j.length-1:J+1>=j.length-1?0:J+1,e=J-1<0?j.length-1:J-1>=j.length-1?0:J-1;ot("<img />").attr("src",j.eq(t).attr(z.sourceAttr)).on("load",function(){-1==d.indexOf(ot(this).attr("src"))&&d.push(ot(this).attr("src")),j.eq(J).trigger(ot.Event("nextImageLoaded.simplelightbox"))}),ot("<img />").attr("src",j.eq(e).attr(z.sourceAttr)).on("load",function(){-1==d.indexOf(ot(this).attr("src"))&&d.push(ot(this).attr("src")),j.eq(J).trigger(ot.Event("prevImageLoaded.simplelightbox"))})},it=function(e){j.eq(J).trigger(ot.Event("change.simplelightbox")).trigger(ot.Event((1===e?"next":"prev")+".simplelightbox"));var t=J+e;if(!(m||(t<0||t>=j.length)&&!1===z.loop)){J=t<0?j.length-1:t>j.length-1?0:t,ot(".sl-wrapper .sl-counter .sl-current").text(J+1);var a={opacity:0};z.animationSlide&&(K?tt(z.animationSpeed/1e3,-100*e-L+"px"):a.left=parseInt(ot(".sl-image").css("left"))+-100*e+"px"),ot(".sl-image").animate(a,z.animationSpeed,function(){setTimeout(function(){var t=j.eq(J);Z.attr("src",t.attr(z.sourceAttr)),-1==d.indexOf(t.attr(z.sourceAttr))&&f.show(),ot(".sl-caption").remove(),_(e),z.preloading&&y()},100)})}},st=function(){if(!m){var t=j.eq(J),e=!1;t.trigger(ot.Event("close.simplelightbox")),z.history&&(a?history.pushState("",rt.title,n.pathname+n.search):n.hash="",clearTimeout(h)),ot(".sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter").fadeOut("fast",function(){z.disableScroll&&C("show"),z.htmlClass&&""!=z.htmlClass&&ot("html").removeClass(z.htmlClass),ot(".sl-wrapper, .sl-overlay").remove(),G.off("click","button"),ot(rt).off("click."+U,".sl-close"),ot(lt).off("resize."+U),ot(lt).off("hashchange."+U),e||t.trigger(ot.Event("closed.simplelightbox")),e=!0}),Z=ot(),m=F=!1}},C=function(t){var e=0;if("hide"==t){var a=lt.innerWidth;if(!a){var n=rt.documentElement.getBoundingClientRect();a=n.right-Math.abs(n.left)}if(rt.body.clientWidth<a){var i=rt.createElement("div"),s=parseInt(ot("body").css("padding-right"),10);i.className="sl-scrollbar-measure",ot("body").append(i),e=i.offsetWidth-i.clientWidth,ot(rt.body)[0].removeChild(i),ot("body").data("padding",s),0<e&&ot("body").addClass("hidden-scroll").css({"padding-right":s+e})}}else ot("body").removeClass("hidden-scroll").css({"padding-right":ot("body").data("padding")});return e};return z.close&&s.appendTo(r),z.showCounter&&1<j.length&&(o.appendTo(r),o.find(".sl-total").text(j.length)),z.nav&&G.appendTo(r),z.spinner&&f.appendTo(r),j.on("click."+U,function(t){if(function(t){if(!z.fileExt)return!0;var e=ot(t).attr(z.sourceAttr).match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim);return e&&"a"==ot(t).prop("tagName").toLowerCase()&&new RegExp(".("+z.fileExt+")$","i").test(e)}(this)){if(t.preventDefault(),m)return!1;var e=ot(this);v=j.index(e),c(e)}}),ot(rt).on("click."+U+" touchstart."+U,function(t){F&&z.docClose&&0===ot(t.target).closest(".sl-image").length&&0===ot(t.target).closest(".sl-navigation").length&&st()}),z.disableRightClick&&ot(rt).on("contextmenu",".sl-image img",function(t){return!1}),z.enableKeyboard&&ot(rt).on("keyup."+U,Q(function(t){L=0;var e=t.keyCode;m&&27==e&&(Z.attr("src",""),m=!1,st()),F&&(t.preventDefault(),27==e&&st(),37!=e&&39!=t.keyCode||it(39==t.keyCode?1:-1))},z.throttleInterval)),this.open=function(t){t=t||ot(this[0]),v=j.index(t),c(t)},this.next=function(){it(1)},this.prev=function(){it(-1)},this.close=function(){st()},this.destroy=function(){ot(rt).off("click."+U).off("keyup."+U),st(),ot(".sl-overlay, .sl-wrapper").remove(),this.off("click")},this.refresh=function(){this.destroy(),ot(this).simpleLightbox(z)},this}}(jQuery,window,document);
{
"name": "simplelightbox",
"version": "1.16.2",
"version": "1.16.3",
"description": "Touch-friendly image lightbox for mobile and desktop with jQuery",
"main": "dist/simple-lightbox.js",
"style": "dist/simplelightbox.scss",
"style": "dist/simplelightbox.scss",
"repository": {

@@ -12,3 +12,3 @@ "type": "git",

"dependencies": {
"jquery": ">=1.7.0"
"jquery": ">=1.7.0"
},

@@ -35,3 +35,9 @@ "keywords": [

},
"homepage": "http://simplelightbox.com/"
"homepage": "http://simplelightbox.com/",
"scripts": {
"minify": "uglifyjs dist/simple-lightbox.js --compress --comments '/^\/*!/' --mangle --output dist/simple-lightbox.min.js"
},
"devDependencies": {
"uglify-js": "^3.4.9"
}
}

@@ -80,3 +80,3 @@ # simplelightbox

| maxZoom | 10 | int | maximum zoom level on pinching |
| htmlClass | 'has-lightbox' | string or false | added class to html element if lightbox is open. If empty or false no class is set |
| htmlClass | 'has-lightbox' | string or false | adds class to html element if lightbox is open. If empty or false no class is set |
### Events

@@ -170,2 +170,3 @@ | Name | Description |

### Changelog
**1.16.3 - Merged pull request #126,#127 - Thanks to jieter**
**1.16.2 - Added featured #124 - Add a class to html element if lightbox is open**

@@ -221,3 +222,3 @@ **1.16.1 - Fixed pinch to zoom offset error on scrolling #123**

### Author
[Andre Rinas](http://andrerinas.de/) - [Github](https://github.com/andreknieriem/)
[Andre Rinas](https://www.andrerinas.de/) - [Github](https://github.com/andreknieriem/)

@@ -224,0 +225,0 @@ ### Contributors

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc