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

imagelightbox

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagelightbox - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.git/logs/refs/remotes/paxperscientiam/history

0

.eslintrc.json

@@ -0,0 +0,0 @@ {

85

CHANGELOG.md

@@ -10,2 +10,12 @@ # Changelog

## [1.0.1] - 2019-06-19
### Changed
- Redirected everything from rejas to marekdedic
### Fixed
- Fixed #201, a bug with videos not being preloaded if they were added to an already initialized lightbox (@marekdedic)
## [1.0.0] - 2019-05-31

@@ -223,38 +233,39 @@

[Unreleased]: https://github.com/rejas/imagelightbox/compare/1.0.0...HEAD
[1.0.0]: https://github.com/rejas/imagelightbox/compare/0.14.0...1.0.0
[0.14.0]: https://github.com/rejas/imagelightbox/compare/0.13.0...0.14.0
[0.13.0]: https://github.com/rejas/imagelightbox/compare/0.12.0...0.13.0
[0.12.0]: https://github.com/rejas/imagelightbox/compare/0.11.0...0.12.0
[0.11.0]: https://github.com/rejas/imagelightbox/compare/0.10.0...0.11.0
[0.10.0]: https://github.com/rejas/imagelightbox/compare/0.9.1...0.10.0
[0.9.1]: https://github.com/rejas/imagelightbox/compare/0.9.0...0.9.1
[0.9.0]: https://github.com/rejas/imagelightbox/compare/0.8.1...0.9.0
[0.8.1]: https://github.com/rejas/imagelightbox/compare/0.8.0...0.8.1
[0.8.0]: https://github.com/rejas/imagelightbox/compare/0.7.9...0.8.0
[0.7.9]: https://github.com/rejas/imagelightbox/compare/0.7.8...0.7.9
[0.7.8]: https://github.com/rejas/imagelightbox/compare/0.7.7...0.7.8
[0.7.7]: https://github.com/rejas/imagelightbox/compare/0.7.6...0.7.7
[0.7.6]: https://github.com/rejas/imagelightbox/compare/0.7.5...0.7.6
[0.7.5]: https://github.com/rejas/imagelightbox/compare/0.7.2...0.7.5
[0.7.2]: https://github.com/rejas/imagelightbox/compare/0.7.1...0.7.2
[0.7.1]: https://github.com/rejas/imagelightbox/compare/0.7.0...0.7.1
[0.7.0]: https://github.com/rejas/imagelightbox/compare/0.6.0...0.7.0
[0.6.0]: https://github.com/rejas/imagelightbox/compare/0.5.4...0.6.0
[0.5.4]: https://github.com/rejas/imagelightbox/compare/0.5.3...0.5.4
[0.5.3]: https://github.com/rejas/imagelightbox/compare/0.5.2...0.5.3
[0.5.2]: https://github.com/rejas/imagelightbox/compare/0.5.1...0.5.2
[0.5.1]: https://github.com/rejas/imagelightbox/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/rejas/imagelightbox/compare/0.4.3...0.5.0
[0.4.3]: https://github.com/rejas/imagelightbox/compare/0.4.2...0.4.3
[0.4.2]: https://github.com/rejas/imagelightbox/compare/0.4.1...0.4.2
[0.4.1]: https://github.com/rejas/imagelightbox/compare/0.4.0...0.4.1
[0.4.0]: https://github.com/rejas/imagelightbox/compare/v0.3.4...0.4.0
[0.3.4]: https://github.com/rejas/imagelightbox/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/rejas/imagelightbox/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/rejas/imagelightbox/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/rejas/imagelightbox/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/rejas/imagelightbox/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/rejas/imagelightbox/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/rejas/imagelightbox/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/rejas/imagelightbox/compare/ee6faa6b7573940629626ab9075adb2f60255497...v0.1.0
[Unreleased]: https://github.com/marekdedic/imagelightbox/compare/1.0.1...HEAD
[1.0.1]: https://github.com/marekdedic/imagelightbox/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/marekdedic/imagelightbox/compare/0.14.0...1.0.0
[0.14.0]: https://github.com/marekdedic/imagelightbox/compare/0.13.0...0.14.0
[0.13.0]: https://github.com/marekdedic/imagelightbox/compare/0.12.0...0.13.0
[0.12.0]: https://github.com/marekdedic/imagelightbox/compare/0.11.0...0.12.0
[0.11.0]: https://github.com/marekdedic/imagelightbox/compare/0.10.0...0.11.0
[0.10.0]: https://github.com/marekdedic/imagelightbox/compare/0.9.1...0.10.0
[0.9.1]: https://github.com/marekdedic/imagelightbox/compare/0.9.0...0.9.1
[0.9.0]: https://github.com/marekdedic/imagelightbox/compare/0.8.1...0.9.0
[0.8.1]: https://github.com/marekdedic/imagelightbox/compare/0.8.0...0.8.1
[0.8.0]: https://github.com/marekdedic/imagelightbox/compare/0.7.9...0.8.0
[0.7.9]: https://github.com/marekdedic/imagelightbox/compare/0.7.8...0.7.9
[0.7.8]: https://github.com/marekdedic/imagelightbox/compare/0.7.7...0.7.8
[0.7.7]: https://github.com/marekdedic/imagelightbox/compare/0.7.6...0.7.7
[0.7.6]: https://github.com/marekdedic/imagelightbox/compare/0.7.5...0.7.6
[0.7.5]: https://github.com/marekdedic/imagelightbox/compare/0.7.2...0.7.5
[0.7.2]: https://github.com/marekdedic/imagelightbox/compare/0.7.1...0.7.2
[0.7.1]: https://github.com/marekdedic/imagelightbox/compare/0.7.0...0.7.1
[0.7.0]: https://github.com/marekdedic/imagelightbox/compare/0.6.0...0.7.0
[0.6.0]: https://github.com/marekdedic/imagelightbox/compare/0.5.4...0.6.0
[0.5.4]: https://github.com/marekdedic/imagelightbox/compare/0.5.3...0.5.4
[0.5.3]: https://github.com/marekdedic/imagelightbox/compare/0.5.2...0.5.3
[0.5.2]: https://github.com/marekdedic/imagelightbox/compare/0.5.1...0.5.2
[0.5.1]: https://github.com/marekdedic/imagelightbox/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/marekdedic/imagelightbox/compare/0.4.3...0.5.0
[0.4.3]: https://github.com/marekdedic/imagelightbox/compare/0.4.2...0.4.3
[0.4.2]: https://github.com/marekdedic/imagelightbox/compare/0.4.1...0.4.2
[0.4.1]: https://github.com/marekdedic/imagelightbox/compare/0.4.0...0.4.1
[0.4.0]: https://github.com/marekdedic/imagelightbox/compare/v0.3.4...0.4.0
[0.3.4]: https://github.com/marekdedic/imagelightbox/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/marekdedic/imagelightbox/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/marekdedic/imagelightbox/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/marekdedic/imagelightbox/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/marekdedic/imagelightbox/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/marekdedic/imagelightbox/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/marekdedic/imagelightbox/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/marekdedic/imagelightbox/compare/ee6faa6b7573940629626ab9075adb2f60255497...v0.1.0

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

!function(F,M,D){"use strict";var R=F("<div/>").attr("class","imagelightbox-loading").append(F("<div/>")),t=F("<button/>",{type:"button",class:"imagelightbox-arrow imagelightbox-arrow-left"}),e=F("<button/>",{type:"button",class:"imagelightbox-arrow imagelightbox-arrow-right"}),z=t.add(e),X=F("<div/>",{class:"imagelightbox-caption",html:"&nbsp;"}),j=F("<button/>",{type:"button",class:"imagelightbox-close"}),N=F("<div/>",{class:"imagelightbox-overlay"}),U=F("<a/>",{href:"#",class:"imagelightbox-navitem"}),V=F("<div/>",{class:"imagelightbox-nav"}),K=F("<div/>",{class:"imagelightbox-wrapper"}),Y=F("body"),o=function(){var t=D.body||D.documentElement;return""===(t=t.style).transition?"":""===t.WebkitTransition?"-webkit-":""===t.MozTransition?"-moz-":""===t.OTransition&&"-o-"},_=!1!==o(),H=function(t,e,i){var n={},a=o();n[a+"transform"]="translateX("+e+") translateY(-50%)",n[a+"transition"]=a+"transform "+i+"s ease-in",t.css(n)},W="ontouchstart"in M,$=M.navigator.pointerEnabled||M.navigator.msPointerEnabled,B=function(t){if(W)return!0;if(!$||void 0===t||void 0===t.pointerType)return!1;if(void 0!==t.MSPOINTER_TYPE_MOUSE){if(t.MSPOINTER_TYPE_MOUSE!==t.pointerType)return!0}else if("mouse"!==t.pointerType)return!0;return!1},Q=!!(D.fullscreenEnabled||D.webkitFullscreenEnabled||D.mozFullScreenEnabled||D.msFullscreenEnabled),A=!(!M.history||!history.pushState);F.fn.imageLightbox=function(t){var i="",s=F([]),u=F(),d=F([]),r=-1,g=F(),f=0,h=!1,n=0,p=F.extend({selector:"a[data-imagelightbox]",id:"imagelightbox",allowedTypes:"png|jpg|jpeg|gif",animationSpeed:250,activity:!1,arrows:!1,button:!1,caption:!1,enableKeyboard:!0,history:!1,fullscreen:!1,gutter:10,offsetY:0,navigation:!1,overlay:!1,preloadNext:!0,quitOnEnd:!1,quitOnImgClick:!1,quitOnDocClick:!0,quitOnEscKey:!0},t),b=function(){p.activity&&y(),p.arrows&&z.css("display","block")},a=function(t,e,i){var n=e+"="+i,a="?"+n;if(t){var o=new RegExp("([?&])"+e+"=[^&]*");a=null!==t.match(o)?t.replace(o,"$1"+n):t+"&"+n}return a},o=function(){if(A&&p.history){var t=s[r].dataset.ilb2Id;t||(t=r);var e={imageLightboxIndex:t},i=s[r].dataset.imagelightbox;i&&(e.imageLightboxSet=i);var n=a(D.location.search,"imageLightboxIndex",t);i&&(n=a(n,"imageLightboxSet",i)),M.history.pushState(e,"",D.location.pathname+n)}},e=function(t,e){var i=t;if(i){var n=new RegExp("\\?"+e+"=[^&]*"),a=new RegExp("&"+e+"=[^&]*");i=(i=i.replace(n,"?")).replace(a,"")}return i},l=function(t){var e=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(D.location.search);if(e&&e[2])return decodeURIComponent(e[2].replace(/\+/g," "))},c=function(){if(A&&p.history){var t=l("imageLightboxIndex");if(t){var e=s.filter('[data-ilb2-id="'+t+'"]');0<e.length?r=s.index(e):e=F(s[r=t]);var i=l("imageLightboxSet");!e[0]||i&&i!==e[0].dataset.imagelightbox||T(e,!0)}}},m=function(){if(--r<0){if(!0===p.quitOnEnd)return void L();r=s.length-1}u=s.eq(r),o(),K.trigger("previous.ilb2",u),O(1)},v=function(){if(++r>=s.length){if(!0===p.quitOnEnd)return void L();r=0}o(),u=s.eq(r),K.trigger("next.ilb2",u),O(-1)},x=function(){K.append(R)},y=function(){F(".imagelightbox-loading").remove()},E=function(){K.append(N)},w=function(){j.appendTo(K).on("click.ilb7",function(){return L(),!1})},S=function(){X.css("opacity","0"),X.html("&nbsp;"),F(u).data("ilb2-caption")?(X.css("opacity","1"),X.html(F(u).data("ilb2-caption"))):F(u).find("img").attr("alt")&&(X.css("opacity","1"),X.html(F(u).find("img").attr("alt")))},q=function(){if(s.length){for(var t=0;t<s.length;t++)V.append(U.clone());var e=V.children("a");e.eq(s.index(u)).addClass("active"),K.on("previous.ilb2 next.ilb2",function(){e.removeClass("active").eq(s.index(u)).addClass("active")}),K.append(V),V.on("click.ilb7 touchend.ilb7",function(){return!1}).on("click.ilb7 touchend.ilb7","a",function(){var t=F(this);if(s.eq(t.index()).attr("href")!==F(".imagelightbox").attr("src")){var e=s.eq(t.index());e.length&&(n=s.index(u),u=e,O(t.index()<n?-1:1))}t.addClass("active").siblings().removeClass("active")})}},I=function(){K.append(z),z.on("click.ilb7 touchend.ilb7",function(t){return t.stopImmediatePropagation(),t.preventDefault(),F(this).hasClass("imagelightbox-arrow-left")?m():v(),!1})},k=function(){if(!g.length)return!0;var t=p.caption?X.outerHeight():0,r=F(M).width(),l=F(M).height()-t,c=Math.abs(1-p.gutter/100);function e(t,e){if(r<t||l<e){var i=r/l<t/e?t/r:e/l;t/=i,e/=i}var n=e*c,a=t*c,o=(F(M).width()-a)/2;g.css({width:a+"px",height:n+"px",left:o+"px"})}if(void 0===g.get(0).videoWidth){var i=new Image;i.src=g.attr("src"),i.onload=function(){e(i.width,i.height)}}else e(g.get(0).videoWidth,g.get(0).videoHeight)},O=function(c){if(h)return!1;if(g.length){var t={opacity:0};_?H(g,100*c-f+"px",p.animationSpeed/1e3):t.left=parseInt(g.css("left"))+100*c+"px",g.animate(t,p.animationSpeed,function(){C()}),f=0}h=!0,p.activity&&x(),p.caption&&S(),setTimeout(function(){var t,e,i=u.attr("href"),n=0,a=0,o=0,r=u.data("ilb2Video");function l(){var t={opacity:1};if(g.appendTo(K),k(),g.css("opacity",0),_)H(g,-100*c+"px",0),setTimeout(function(){H(g,"0px",p.animationSpeed/1e3)},50);else{var e=parseInt(g.css("left"));t.left=e+"px",g.css("left",e-100*c+"px")}if(g.animate(t,p.animationSpeed,function(){h=!1,b()}),p.preloadNext){var i=s.eq(s.index(u)+1);i.length||(i=s.eq(0)),F("<img />").attr("src",i.attr("href"))}K.trigger("loaded.ilb2")}r?d.each(function(){this.i===u.data("ilb2VideoId")&&(t=this.l,e=this.e,this.a&&(!1===t&&e.attr("autoplay",this.a),!0===t&&e.get(0).play()))}):e=F("<img id='"+p.id+"' />").attr("src",i),g=e.on("load.ilb7",l).on("error.ilb7",function(){b()}).on("touchstart.ilb7 pointerdown.ilb7 MSPointerDown.ilb7",function(t){if(!B(t.originalEvent)||p.quitOnImgClick)return!0;_&&(o=parseInt(g.css("left"))),n=t.originalEvent.pageX||t.originalEvent.touches[0].pageX}).on("touchmove.ilb7 pointermove.ilb7 MSPointerMove.ilb7",function(t){if(!$&&"pointermove"===t.type||!B(t.originalEvent)||p.quitOnImgClick)return!0;t.preventDefault(),a=t.originalEvent.pageX||t.originalEvent.touches[0].pageX,f=n-a,_?H(g,-f+"px",0):g.css("left",o-f+"px")}).on("touchend.ilb7 touchcancel.ilb7 pointerup.ilb7 pointercancel.ilb7 MSPointerUp.ilb7 MSPointerCancel.ilb7",function(t){if(!B(t.originalEvent)||p.quitOnImgClick)return!0;50<Math.abs(f)?f<0?m():v():_?H(g,"0px",p.animationSpeed/1e3):g.animate({left:o+"px"},p.animationSpeed/2)}),!0===t&&l(),!1===t&&(g=g.on("loadedmetadata.ilb7",l)),r||(g=g.on($?"pointerup.ilb7 MSPointerUp.ilb7":"click.ilb7",function(t){if(t.preventDefault(),p.quitOnImgClick)return L(),!1;if(B(t.originalEvent))return!0;var e=(t.pageX||t.originalEvent.pageX)-t.target.offsetLeft;t.target.width/2>e?m():v()}))},p.animationSpeed+100)},C=function(){if(!g.length)return!1;g.remove(),g=F()},T=function(t,e){if(h)return!1;h=!1,u=t,r=s.index(u),e||o(),function(){p.arrows&&I(this),p.navigation&&q(),p.overlay&&E(),p.button&&w(),p.caption&&K.append(X)}(),Y.append(K).addClass("imagelightbox-open"),K.trigger("start.ilb2",t),O(0)},L=function(t){if(r=-1,t||function(){if(A&&p.history){var t=e(D.location.search,"imageLightboxIndex");t=e(t,"imageLightboxSet"),M.history.pushState({},"",D.location.pathname+t)}}(),K.trigger("quit.ilb2"),Y.removeClass("imagelightbox-open"),!g.length)return!1;g.animate({opacity:0},p.animationSpeed,function(){C(),h=!1,K.remove().find("*").remove()})},P=function(e){e.each(function(){s=e.add(F(this))}),e.on("click.ilb7",{set:i},function(t){t.preventDefault(),i=F(t.currentTarget).data("imagelightbox"),e.filter(function(){return F(this).data("imagelightbox")===i}).filter(function(){return function(t){return"a"===F(t).prop("tagName").toLowerCase()&&(new RegExp(".("+p.allowedTypes+")$","i").test(F(t).attr("href"))||F(t).data("ilb2Video"))}(F(this))}).each(function(){s=s.add(F(this))}),s.length<1?L():T(F(this))})};return F(M).on("resize.ilb7",k),A&&p.history&&F(M).on("popstate",function(t){var e=t.originalEvent.state;if(e){var i=e.imageLightboxIndex;if(void 0!==i){var n=s.filter('[data-ilb2-id="'+i+'"]');if(0<n.length)var a=s.index(n);else n=F(s[a=i]);if(n[0]&&(!e.imageLightboxSet||e.imageLightboxSet===n[0].dataset.imagelightbox))if(r<0)T(n,!0);else{var o=1;r<a&&(o=-1),u=n,r=a,O(o)}}else L(!0)}else L(!0)}),F(D).ready(function(){p.quitOnDocClick&&F(D).on(W?"touchend.ilb7":"click.ilb7",function(t){g.length&&!F(t.target).is(g)&&(t.preventDefault(),L())}),p.fullscreen&&Q&&F(D).on("keydown.ilb7",function(t){if(!g.length)return!0;-1<[9,32,38,40].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault()),-1<[13].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault(),function(){var t=M.document,e=D.getElementById(p.id).parentElement,i=e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullScreen||e.msRequestFullscreen,n=t.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.msExitFullscreen;t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||t.msFullscreenElement?n.call(t):i.call(e)}())}),p.enableKeyboard&&F(D).on("keydown.ilb7",function(t){if(!g.length)return!0;-1<[27].indexOf(t.which)&&p.quitOnEscKey&&(t.stopPropagation(),t.preventDefault(),L()),-1<[37].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault(),m()),-1<[39].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault(),v())})}),F(D).off("click",p.selector),P(F(this)),c(),s.each(function(){var t=F(this).data("ilb2Video");if(t){var e=F(this).data("ilb2Id");e||(e="a"+(65536*(1+Math.random())|0).toString(16)),F(this).data("ilb2VideoId",e);var n={e:F("<video id='"+p.id+"' preload='metadata'>"),i:e,l:!1,a:void 0};F.each(t,function(t,e){"autoplay"===t?n.a=e:"sources"!==t&&(n.e=n.e.attr(t,e))}),t.sources&&F.each(t.sources,function(t,e){var i=F("<source>");F.each(e,function(t,e){i=i.attr(t,e)}),n.e.append(i)}),n.e.on("loadedmetadata.ilb7",function(){n.l=!0}),d=d.add(n)}}),this.addToImageLightbox=function(t){P(t)},this.openHistory=function(){c()},this.loadPreviousImage=function(){m()},this.loadNextImage=function(){v()},this.quitImageLightbox=function(){return L(),this},this.startImageLightbox=function(t){t?t.trigger("click.ilb7"):F(this).trigger("click.ilb7")},this}}("object"==typeof module&&"object"==typeof module.exports?require("jquery"):jQuery,window,document);
!function(M,D,R){"use strict";var z=M("<div/>").attr("class","imagelightbox-loading").append(M("<div/>")),t=M("<button/>",{type:"button",class:"imagelightbox-arrow imagelightbox-arrow-left"}),e=M("<button/>",{type:"button",class:"imagelightbox-arrow imagelightbox-arrow-right"}),X=t.add(e),j=M("<div/>",{class:"imagelightbox-caption",html:"&nbsp;"}),N=M("<button/>",{type:"button",class:"imagelightbox-close"}),U=M("<div/>",{class:"imagelightbox-overlay"}),V=M("<a/>",{href:"#",class:"imagelightbox-navitem"}),K=M("<div/>",{class:"imagelightbox-nav"}),Y=M("<div/>",{class:"imagelightbox-wrapper"}),_=M("body"),o=function(){var t=R.body||R.documentElement;return""===(t=t.style).transition?"":""===t.WebkitTransition?"-webkit-":""===t.MozTransition?"-moz-":""===t.OTransition&&"-o-"},H=!1!==o(),W=function(t,e,i){var n={},a=o();n[a+"transform"]="translateX("+e+") translateY(-50%)",n[a+"transition"]=a+"transform "+i+"s ease-in",t.css(n)},$="ontouchstart"in D,B=D.navigator.pointerEnabled||D.navigator.msPointerEnabled,Q=function(t){if($)return!0;if(!B||void 0===t||void 0===t.pointerType)return!1;if(void 0!==t.MSPOINTER_TYPE_MOUSE){if(t.MSPOINTER_TYPE_MOUSE!==t.pointerType)return!0}else if("mouse"!==t.pointerType)return!0;return!1},A=!!(R.fullscreenEnabled||R.webkitFullscreenEnabled||R.mozFullScreenEnabled||R.msFullscreenEnabled),G=!(!D.history||!history.pushState);M.fn.imageLightbox=function(t){var i="",s=M([]),u=M(),d=M([]),r=-1,g=M(),f=0,h=!1,n=0,p=M.extend({selector:"a[data-imagelightbox]",id:"imagelightbox",allowedTypes:"png|jpg|jpeg|gif",animationSpeed:250,activity:!1,arrows:!1,button:!1,caption:!1,enableKeyboard:!0,history:!1,fullscreen:!1,gutter:10,offsetY:0,navigation:!1,overlay:!1,preloadNext:!0,quitOnEnd:!1,quitOnImgClick:!1,quitOnDocClick:!0,quitOnEscKey:!0},t),b=function(){p.activity&&y(),p.arrows&&X.css("display","block")},a=function(t,e,i){var n=e+"="+i,a="?"+n;if(t){var o=new RegExp("([?&])"+e+"=[^&]*");a=null!==t.match(o)?t.replace(o,"$1"+n):t+"&"+n}return a},o=function(){if(G&&p.history){var t=s[r].dataset.ilb2Id;t||(t=r);var e={imageLightboxIndex:t},i=s[r].dataset.imagelightbox;i&&(e.imageLightboxSet=i);var n=a(R.location.search,"imageLightboxIndex",t);i&&(n=a(n,"imageLightboxSet",i)),D.history.pushState(e,"",R.location.pathname+n)}},e=function(t,e){var i=t;if(i){var n=new RegExp("\\?"+e+"=[^&]*"),a=new RegExp("&"+e+"=[^&]*");i=(i=i.replace(n,"?")).replace(a,"")}return i},l=function(t){var e=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(R.location.search);if(e&&e[2])return decodeURIComponent(e[2].replace(/\+/g," "))},c=function(){if(G&&p.history){var t=l("imageLightboxIndex");if(t){var e=s.filter('[data-ilb2-id="'+t+'"]');0<e.length?r=s.index(e):e=M(s[r=t]);var i=l("imageLightboxSet");!e[0]||i&&i!==e[0].dataset.imagelightbox||T(e,!0)}}},m=function(){if(--r<0){if(!0===p.quitOnEnd)return void L();r=s.length-1}u=s.eq(r),o(),Y.trigger("previous.ilb2",u),O(1)},v=function(){if(++r>=s.length){if(!0===p.quitOnEnd)return void L();r=0}o(),u=s.eq(r),Y.trigger("next.ilb2",u),O(-1)},x=function(){Y.append(z)},y=function(){M(".imagelightbox-loading").remove()},E=function(){Y.append(U)},w=function(){N.appendTo(Y).on("click.ilb7",function(){return L(),!1})},S=function(){j.css("opacity","0"),j.html("&nbsp;"),M(u).data("ilb2-caption")?(j.css("opacity","1"),j.html(M(u).data("ilb2-caption"))):M(u).find("img").attr("alt")&&(j.css("opacity","1"),j.html(M(u).find("img").attr("alt")))},q=function(){if(s.length){for(var t=0;t<s.length;t++)K.append(V.clone());var e=K.children("a");e.eq(s.index(u)).addClass("active"),Y.on("previous.ilb2 next.ilb2",function(){e.removeClass("active").eq(s.index(u)).addClass("active")}),Y.append(K),K.on("click.ilb7 touchend.ilb7",function(){return!1}).on("click.ilb7 touchend.ilb7","a",function(){var t=M(this);if(s.eq(t.index()).attr("href")!==M(".imagelightbox").attr("src")){var e=s.eq(t.index());e.length&&(n=s.index(u),u=e,O(t.index()<n?-1:1))}t.addClass("active").siblings().removeClass("active")})}},I=function(){Y.append(X),X.on("click.ilb7 touchend.ilb7",function(t){return t.stopImmediatePropagation(),t.preventDefault(),M(this).hasClass("imagelightbox-arrow-left")?m():v(),!1})},k=function(){if(!g.length)return!0;var t=p.caption?j.outerHeight():0,r=M(D).width(),l=M(D).height()-t,c=Math.abs(1-p.gutter/100);function e(t,e){if(r<t||l<e){var i=r/l<t/e?t/r:e/l;t/=i,e/=i}var n=e*c,a=t*c,o=(M(D).width()-a)/2;g.css({width:a+"px",height:n+"px",left:o+"px"})}if(void 0===g.get(0).videoWidth){var i=new Image;i.src=g.attr("src"),i.onload=function(){e(i.width,i.height)}}else e(g.get(0).videoWidth,g.get(0).videoHeight)},O=function(c){if(h)return!1;if(g.length){var t={opacity:0};H?W(g,100*c-f+"px",p.animationSpeed/1e3):t.left=parseInt(g.css("left"))+100*c+"px",g.animate(t,p.animationSpeed,function(){C()}),f=0}h=!0,p.activity&&x(),p.caption&&S(),setTimeout(function(){var t,e,i=u.attr("href"),n=0,a=0,o=0,r=u.data("ilb2Video");function l(){var t={opacity:1};if(g.appendTo(Y),k(),g.css("opacity",0),H)W(g,-100*c+"px",0),setTimeout(function(){W(g,"0px",p.animationSpeed/1e3)},50);else{var e=parseInt(g.css("left"));t.left=e+"px",g.css("left",e-100*c+"px")}if(g.animate(t,p.animationSpeed,function(){h=!1,b()}),p.preloadNext){var i=s.eq(s.index(u)+1);i.length||(i=s.eq(0)),M("<img />").attr("src",i.attr("href"))}Y.trigger("loaded.ilb2")}r?d.each(function(){this.i===u.data("ilb2VideoId")&&(t=this.l,e=this.e,this.a&&(!1===t&&e.attr("autoplay",this.a),!0===t&&e.get(0).play()))}):e=M("<img id='"+p.id+"' />").attr("src",i),g=e.on("load.ilb7",l).on("error.ilb7",function(){b()}).on("touchstart.ilb7 pointerdown.ilb7 MSPointerDown.ilb7",function(t){if(!Q(t.originalEvent)||p.quitOnImgClick)return!0;H&&(o=parseInt(g.css("left"))),n=t.originalEvent.pageX||t.originalEvent.touches[0].pageX}).on("touchmove.ilb7 pointermove.ilb7 MSPointerMove.ilb7",function(t){if(!B&&"pointermove"===t.type||!Q(t.originalEvent)||p.quitOnImgClick)return!0;t.preventDefault(),a=t.originalEvent.pageX||t.originalEvent.touches[0].pageX,f=n-a,H?W(g,-f+"px",0):g.css("left",o-f+"px")}).on("touchend.ilb7 touchcancel.ilb7 pointerup.ilb7 pointercancel.ilb7 MSPointerUp.ilb7 MSPointerCancel.ilb7",function(t){if(!Q(t.originalEvent)||p.quitOnImgClick)return!0;50<Math.abs(f)?f<0?m():v():H?W(g,"0px",p.animationSpeed/1e3):g.animate({left:o+"px"},p.animationSpeed/2)}),!0===t&&l(),!1===t&&(g=g.on("loadedmetadata.ilb7",l)),r||(g=g.on(B?"pointerup.ilb7 MSPointerUp.ilb7":"click.ilb7",function(t){if(t.preventDefault(),p.quitOnImgClick)return L(),!1;if(Q(t.originalEvent))return!0;var e=(t.pageX||t.originalEvent.pageX)-t.target.offsetLeft;t.target.width/2>e?m():v()}))},p.animationSpeed+100)},C=function(){if(!g.length)return!1;g.remove(),g=M()},T=function(t,e){if(h)return!1;h=!1,u=t,r=s.index(u),e||o(),function(){p.arrows&&I(this),p.navigation&&q(),p.overlay&&E(),p.button&&w(),p.caption&&Y.append(j)}(),_.append(Y).addClass("imagelightbox-open"),Y.trigger("start.ilb2",t),O(0)},L=function(t){if(r=-1,t||function(){if(G&&p.history){var t=e(R.location.search,"imageLightboxIndex");t=e(t,"imageLightboxSet"),D.history.pushState({},"",R.location.pathname+t)}}(),Y.trigger("quit.ilb2"),_.removeClass("imagelightbox-open"),!g.length)return!1;g.animate({opacity:0},p.animationSpeed,function(){C(),h=!1,Y.remove().find("*").remove()})},P=function(e){e.each(function(){s=e.add(M(this))}),e.on("click.ilb7",{set:i},function(t){t.preventDefault(),i=M(t.currentTarget).data("imagelightbox"),e.filter(function(){return M(this).data("imagelightbox")===i}).filter(function(){return function(t){return"a"===M(t).prop("tagName").toLowerCase()&&(new RegExp(".("+p.allowedTypes+")$","i").test(M(t).attr("href"))||M(t).data("ilb2Video"))}(M(this))}).each(function(){s=s.add(M(this))}),s.length<1?L():T(M(this))})},F=function(t){t.each(function(){var t=M(this).data("ilb2Video");if(t){var e=M(this).data("ilb2Id");e||(e="a"+(65536*(1+Math.random())|0).toString(16)),M(this).data("ilb2VideoId",e);var n={e:M("<video id='"+p.id+"' preload='metadata'>"),i:e,l:!1,a:void 0};M.each(t,function(t,e){"autoplay"===t?n.a=e:"sources"!==t&&(n.e=n.e.attr(t,e))}),t.sources&&M.each(t.sources,function(t,e){var i=M("<source>");M.each(e,function(t,e){i=i.attr(t,e)}),n.e.append(i)}),n.e.on("loadedmetadata.ilb7",function(){n.l=!0}),d=d.add(n)}})};return M(D).on("resize.ilb7",k),G&&p.history&&M(D).on("popstate",function(t){var e=t.originalEvent.state;if(e){var i=e.imageLightboxIndex;if(void 0!==i){var n=s.filter('[data-ilb2-id="'+i+'"]');if(0<n.length)var a=s.index(n);else n=M(s[a=i]);if(n[0]&&(!e.imageLightboxSet||e.imageLightboxSet===n[0].dataset.imagelightbox))if(r<0)T(n,!0);else{var o=1;r<a&&(o=-1),u=n,r=a,O(o)}}else L(!0)}else L(!0)}),M(R).ready(function(){p.quitOnDocClick&&M(R).on($?"touchend.ilb7":"click.ilb7",function(t){g.length&&!M(t.target).is(g)&&(t.preventDefault(),L())}),p.fullscreen&&A&&M(R).on("keydown.ilb7",function(t){if(!g.length)return!0;-1<[9,32,38,40].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault()),-1<[13].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault(),function(){var t=D.document,e=R.getElementById(p.id).parentElement,i=e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullScreen||e.msRequestFullscreen,n=t.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.msExitFullscreen;t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||t.msFullscreenElement?n.call(t):i.call(e)}())}),p.enableKeyboard&&M(R).on("keydown.ilb7",function(t){if(!g.length)return!0;-1<[27].indexOf(t.which)&&p.quitOnEscKey&&(t.stopPropagation(),t.preventDefault(),L()),-1<[37].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault(),m()),-1<[39].indexOf(t.which)&&(t.stopPropagation(),t.preventDefault(),v())})}),M(R).off("click",p.selector),P(M(this)),c(),F(s),this.addToImageLightbox=function(t){P(t),F(t)},this.openHistory=function(){c()},this.loadPreviousImage=function(){m()},this.loadNextImage=function(){v()},this.quitImageLightbox=function(){return L(),this},this.startImageLightbox=function(t){t?t.trigger("click.ilb7"):M(this).trigger("click.ilb7")},this}}("object"==typeof module&&"object"==typeof module.exports?require("jquery"):jQuery,window,document);

@@ -654,4 +654,4 @@ (function (factory) {

_preloadVideos = function () {
targets.each(function() {
_preloadVideos = function (elements) {
elements.each(function() {
var videoOptions = $(this).data('ilb2Video');

@@ -767,6 +767,7 @@ if (videoOptions) {

_preloadVideos();
_preloadVideos(targets);
this.addToImageLightbox = function (elements) {
_addTargets(elements);
_preloadVideos(elements);
};

@@ -773,0 +774,0 @@

@@ -0,0 +0,0 @@ $(document).ready(function() {

@@ -0,0 +0,0 @@ var gulp = require('gulp'),

{
"name": "imagelightbox",
"version": "1.0.0",
"version": "1.0.1",
"description": "Image Lightbox, Responsive and Touch‑friendly",
"homepage": "https://rejas.github.io/imagelightbox",
"homepage": "https://marekdedic.github.io/imagelightbox",
"license": "MIT",
"repository": "https://github.com/rejas/imagelightbox.git",
"repository": "https://github.com/marekdedic/imagelightbox.git",
"main": "./src/imagelightbox.js",

@@ -9,0 +9,0 @@ "style": "./src/imagelightbox.css",

@@ -5,4 +5,3 @@ imagelightbox

[![npm version](https://badge.fury.io/js/imagelightbox.svg)](https://badge.fury.io/js/imagelightbox)
[![Build Status](https://secure.travis-ci.org/rejas/imagelightbox.png?branch=master)](http://travis-ci.org/rejas/imagelightbox)
[![Greenkeeper badge](https://badges.greenkeeper.io/rejas/imagelightbox.svg)](https://greenkeeper.io/)
[![Build Status](https://secure.travis-ci.org/marekdedic/imagelightbox.png?branch=master)](http://travis-ci.org/marekdedic/imagelightbox)

@@ -13,3 +12,3 @@ Image Lightbox, Responsive and Touch‑friendly.

See most of the available options at the [Demo Page](http://rejas.github.io/imagelightbox/)
See most of the available options at the [Demo Page](http://marekdedic.github.io/imagelightbox/)

@@ -16,0 +15,0 @@ ## Requirements and Browser support

@@ -654,4 +654,4 @@ (function (factory) {

_preloadVideos = function () {
targets.each(function() {
_preloadVideos = function (elements) {
elements.each(function() {
var videoOptions = $(this).data('ilb2Video');

@@ -767,6 +767,7 @@ if (videoOptions) {

_preloadVideos();
_preloadVideos(targets);
this.addToImageLightbox = function (elements) {
_addTargets(elements);
_preloadVideos(elements);
};

@@ -773,0 +774,0 @@

@@ -0,0 +0,0 @@ const puppeteer = require('puppeteer');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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