Huge News!Announcing our $40M Series B led by Abstract Ventures.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.13.0 to 1.14.0

2

bower.json
{
"name": "simplelightbox",
"version": "1.13.0",
"version": "1.14.0",
"homepage": "http://andreknieriem.de/simple-lightbox",

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

/*
By André Rinas, www.andrerinas.de
Available for use under the MIT License
1.13.0
1.14.0
*/

@@ -48,3 +48,4 @@ ;( function( $, window, document, undefined )

additionalHtml: false,
history: true
history: true,
throttleInterval: 0
}, options);

@@ -130,2 +131,16 @@

},
throttle = function(func, limit) {
var inThrottle;
return function() {
var args = arguments;
var context = this;
if (!inThrottle) {
func.apply(context, args);
inThrottle = true;
setTimeout(function() {
return inThrottle = false;
}, limit);
}
};
},
prefix = 'simplelb',

@@ -280,7 +295,7 @@ overlay = $('<div>').addClass('sl-overlay'),

animating = false;
setCaption(captionText);
setCaption(captionText, imageWidth);
});
} else {
animating = false;
setCaption(captionText);
setCaption(captionText, imageWidth);
}

@@ -292,5 +307,5 @@ if(options.additionalHtml && $('.sl-additional-html').length === 0){

},
setCaption = function(captiontext){
setCaption = function(captiontext, imageWidth){
if(captiontext !== '' && typeof captiontext !== "undefined" && options.captions){
caption.html(captiontext).hide().appendTo($('.sl-image')).delay(options.captionDelay).fadeIn('fast');
caption.html(captiontext).css({'width': imageWidth + 'px'}).hide().appendTo($('.sl-image')).delay(options.captionDelay).fadeIn('fast');
}

@@ -328,7 +343,7 @@ },

// nav-buttons
nav.on('click.'+prefix, 'button', function(e){
nav.on('click.'+prefix, 'button', throttle(function(e){
e.preventDefault();
swipeDiff = 0;
loadImage( $(this).hasClass('sl-next') ? 1 : -1 );
});
}, options.throttleInterval));

@@ -522,3 +537,3 @@ // touchcontrols

if( options.enableKeyboard ){
$( document ).on( 'keyup.'+prefix, function( e ){
$( document ).on( 'keyup.'+prefix, throttle(function( e ){
swipeDiff = 0;

@@ -536,3 +551,3 @@ // keyboard control only if lightbox is open

}
});
}, options.throttleInterval));
}

@@ -539,0 +554,0 @@

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

@@ -11,3 +11,3 @@ "main": "dist/simple-lightbox.js",

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

@@ -25,6 +25,6 @@ "keywords": [

"author": {
"name": "Andre Rinas",
"url": "http://www.andrerinas.de",
"email": "info@andrerinas.de"
},
"name": "Andre Rinas",
"url": "https://www.andrerinas.de",
"email": "info@andrerinas.de"
},
"license": "MIT",

@@ -31,0 +31,0 @@ "bugs": {

@@ -75,2 +75,3 @@ # simplelightbox

| history | true | bool | enable history back closes lightbox instead of reloading the page |
| throttleInterval | 0 | int | time to wait between slides |

@@ -163,3 +164,4 @@ ### Events

### Changelog
**1.13.0 - Added featured #92 and merged pull request #98 and #99. Thankt to RaphaelHaettich
**1.14.0 - Merged pull request #107 and #108. Thanks to RaphaelHaettich**
**1.13.0 - Added featured #92 and merged pull request #98 and #99. Thanks to RaphaelHaettich**
**1.12.2 - Bugfix for #89**

@@ -216,1 +218,2 @@ **1.12.1 - Bugfix for #88,#87 and remove bind/unbind #84**

[Karl Anders](http://webseiten-anders.de/) - [Github](https://github.com/karland/)
[Raphael Hättich](https://github.com/RaphaelHaettich)
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