From 7bc89f2d30acbcd40e5bebcac7375fda2678dcff Mon Sep 17 00:00:00 2001 From: Syl Date: Sun, 9 Feb 2014 22:08:20 +0100 Subject: [PATCH] released 1.3.0 --- README.md | 4 ++++ bower.json | 2 +- desoslide.jquery.json | 2 +- dist/css/jquery.desoslide.css | 2 +- dist/css/jquery.desoslide.min.css | 2 +- dist/js/jquery.desoslide.js | 2 +- dist/js/jquery.desoslide.min.js | 6 ++++++ index.html | 2 +- package.json | 2 +- 9 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 37535a0..1df5994 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ ## Changelog +09/02/2013 - **1.3.0** + +* added animate.css as a dependency (used for transitions), it needs to be loaded separately + 06/12/2013 - **1.2.4** * fixed undefined if no overlay diff --git a/bower.json b/bower.json index d21edf6..4cbc287 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "desoslide", - "version": "1.2.4", + "version": "1.3.0", "homepage": "https://github.com/sylouuu/desoslide", "description": "Simple images slider with thumbnails", "keywords": [ diff --git a/desoslide.jquery.json b/desoslide.jquery.json index eafd0a5..f6d60e2 100644 --- a/desoslide.jquery.json +++ b/desoslide.jquery.json @@ -7,7 +7,7 @@ "slider", "thumbnail" ], - "version": "1.2.4", + "version": "1.3.0", "author": { "name": "sylouuu", "url": "https://github.com/sylouuu" diff --git a/dist/css/jquery.desoslide.css b/dist/css/jquery.desoslide.css index 0e65df5..934c35d 100644 --- a/dist/css/jquery.desoslide.css +++ b/dist/css/jquery.desoslide.css @@ -1,5 +1,5 @@ /*! -* Version 1.2.4 +* Version 1.3.0 * jQuery: desoSlide plugin - jquery.desoslide.css * Copyright - 2014 - https://github.com/sylouuu/desoslide * This source code is under the MIT License diff --git a/dist/css/jquery.desoslide.min.css b/dist/css/jquery.desoslide.min.css index 3c5b5e1..9af717d 100644 --- a/dist/css/jquery.desoslide.min.css +++ b/dist/css/jquery.desoslide.min.css @@ -1,5 +1,5 @@ /*! -* Version 1.2.4 +* Version 1.3.0 * jQuery: desoSlide plugin - jquery.desoslide.css * Copyright - 2014 - https://github.com/sylouuu/desoslide * This source code is under the MIT License diff --git a/dist/js/jquery.desoslide.js b/dist/js/jquery.desoslide.js index 0df590f..895deea 100644 --- a/dist/js/jquery.desoslide.js +++ b/dist/js/jquery.desoslide.js @@ -1,5 +1,5 @@ /*! -* Version 1.2.4 +* Version 1.3.0 * jQuery: desoSlide plugin - jquery.desoslide.js * Copyright - 2014 - https://github.com/sylouuu/desoslide * This source code is under the MIT License diff --git a/dist/js/jquery.desoslide.min.js b/dist/js/jquery.desoslide.min.js index dcbf0cf..b32537a 100644 --- a/dist/js/jquery.desoslide.min.js +++ b/dist/js/jquery.desoslide.min.js @@ -1 +1,7 @@ +/*! +* Version 1.3.0 +* jQuery: desoSlide plugin - jquery.desoslide.min.js +* Copyright - 2014 - https://github.com/sylouuu/desoslide +* This source code is under the MIT License +*/ !function(e){"use strict";e.fn.desoSlide=function(n){var a,t,i,o,r,s,d,c={main:{container:!1,cssClass:"",insertion:"append"},auto:{load:!0,start:!1},first:0,interval:3e3,effect:"fade",overlay:"always",caption:!1,controls:{enable:!0,keys:!0},events:{thumbClick:!1,prev:!1,pause:!1,play:!1,next:!1,completed:!1}},l=e.extend(!0,{},c,n),p=function(){var e=0;return function(n,a){clearTimeout(e),e=setTimeout(n,a)}}(),f=this,u=f.find("li"),m=u.length,h=l.first,v=e(l.main.container).find(".desoSlide-overlay"),g=l.interval<1500?1500:l.interval,y=!1,w=!1,k={checks:function(){f.length||k.resultHandler("error",f.selector+" doesn't exist."),l.main.container?e(l.main.container).length||k.resultHandler("error",e(l.main.container).selector+" doesn't exist."):k.resultHandler("error",'You must specify the "main.container" option. Check out the documentation.');var n=["always","hover","none"];-1===n.indexOf(l.overlay)&&k.resultHandler("error",'Incorrect value for the "overlay" option. Check out the documentation.'),h>=m&&(0===m?k.resultHandler("error","You must have at least 1 thumbnail."):k.resultHandler("error",'The "first" option must be between 0 and '+(m-1)+"."))},checkData:function(){!l.caption||void 0!==i&&""!==i||k.resultHandler("warning","The captions are enabled and the data-desoslide-caption attribute is missing on a thumb. Add it or disable captions. Check out the documention."),(void 0===t||""===t)&&k.resultHandler("warning","The alt attribute is missing on a thumb, it's mandatory on tags.")},init:function(){k.checks(),k.loadImages(),k.removeSpinner(),k.addWrapper(),k.effectHandler(),k.displayImg(),k.events()},effects:{fade:{"in":"fadeIn",out:"fadeOut"},sideFade:{"in":"fadeInLeft",out:"fadeOutRight"},sideFadeBig:{"in":"fadeInLeftBig",out:"fadeOutRightBig"},flip:{"in":"flipInX",out:"flipOutX"},light:{"in":"lightSpeedIn",out:"lightSpeedOut"},roll:{"in":"rollIn",out:"rollOut"},rotate:{"in":"rotateIn",out:"rotateOut"}},loadImages:function(){l.auto.load&&u.find("a").each(function(n,a){e("",{src:a.href,alt:""}).hide().appendTo("body")})},effectHandler:function(){"random"===l.effect?s=k.getRandomEffect():k.effects.hasOwnProperty(l.effect)?s=l.effect:(s=c.effect,k.resultHandler("error",'Incorrect value for the "effect" option. Default value is used. Check out the documentation.'))},getRandomEffect:function(){var e,n=0;for(var a in k.effects)Math.random()<1/++n&&(e=a);return e},outEffect:function(){e(l.main.container).find("img").removeClass("animated "+k.effects[s].in).addClass("animated "+k.effects[s].out),setTimeout(function(){k.displayImg()},900)},addWrapper:function(){var n=e("
",{"class":"desoSlide-wrapper"}),a=e("").addClass(l.main.cssClass).css("opacity",0);switch(l.main.insertion){case"prepend":a.prependTo(e(l.main.container)).wrap(n);break;case"append":a.appendTo(e(l.main.container)).wrap(n);break;case"replace":e(l.main.container).html(a).wrapInner(n);break;default:k.resultHandler("error",'Incorrect value for the "insertion" option. Check out the documentation.')}},addSpinner:function(){d=e("
").addClass("desoSlide-spinner"),e(l.main.container).css("text-align","center").prepend(d)},removeSpinner:function(){d.length&&d.remove()},displayImg:function(){k.resultHandler(),a=0,0>h&&(h=m-1),h>=m&&(h=0),a=h;var n=u.find("a").eq(a).attr("href");t=u.find("img").eq(a).attr("alt"),i=u.find("img").eq(a).data("desoslide-caption"),o=u.find("img").eq(a).data("desoslide-href"),k.checkData(),e(l.main.container).find("img").attr({src:n,alt:t,"data-desoslide-caption":i}).one("load",function(){e(this).removeClass("animated "+k.effects[s].out).addClass("animated "+k.effects[s].in).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){k.addOverlay()}),l.auto.start&&(h++,y=setTimeout(function(){k.outEffect()},g))})},addOverlay:function(){if("none"!==l.overlay){if(l.caption||l.controls.enable){var n=e(l.main.container).find("img").position(),a=parseInt(e(l.main.container).find("img").css("border-left-width"),10),t=e(l.main.container).find("img").width()+a,i=e(l.main.container).find("img").height()+a;0===e(l.main.container).find(".desoSlide-overlay").length&&e("
",{"class":"desoSlide-overlay"}).appendTo(e(l.main.container).find(".desoSlide-wrapper")),v=e(l.main.container).find(".desoSlide-overlay");var o=parseInt(v.css("padding-top").replace("px",""),10),r=parseInt(v.css("padding-bottom").replace("px",""),10),s=parseInt(v.css("padding-left").replace("px",""),10),d=parseInt(v.css("padding-right").replace("px",""),10),c=parseInt(v.css("height").replace("px",""),10)-(s+d);c=parseInt(i,10)-c-(o+r);var p=n.top+c,f=n.left;v.css({left:f+"px",top:p+"px",width:t+"px"}),"always"===l.overlay&&v.animate({opacity:.7},500),l.caption&&(k.updateCaption(),k.addLink())}else k.addLink();l.controls.enable&&k.addControls()}},updateCaption:function(){v.html(i)},addLink:function(){var n=e(l.main.container).find("a.desoslide-link").length>0?!0:!1,a=void 0!==o&&""!==o?!0:!1,t=e("",{"class":"desoslide-link",href:o,target:"_blank"});n&&a?e(l.main.container).find("a.desoslide-link").attr("href",o):n&&!a?e(l.main.container).find("a.desoslide-link").replaceWith(t):!n&&a&&e(l.main.container).find(".desoSlide-wrapper").append(t)},addControls:function(){e(l.main.container).find(".desoSlide-controls-wrapper").remove();var n='',a='',t='',i='',o=e("
",{"class":"desoSlide-controls-wrapper"}).append(n+a+t+i);o.css({width:v.css("width"),left:v.css("left")}),o.appendTo(e(l.main.container).find("a.desoslide-link").length>0?e(l.main.container).find("a.desoslide-link"):e(l.main.container).find(".desoSlide-wrapper")),r=e(l.main.container).find(".desoSlide-controls-wrapper"),r.length&&(l.auto.start?r.find('a[href="#play"]').hide().parent().find('a[href="#pause"]').show():r.find('a[href="#pause"]').hide().parent().find('a[href="#play"]').show())},pause:function(){l.auto.start&&y&&(l.auto.start=!1,clearTimeout(y),h--,r&&r.find('a[href="#pause"]').hide().parent().find('a[href="#play"]').show())},play:function(){l.auto.start||(l.auto.start=!0,a===h&&h++,k.outEffect(),r&&r.find('a[href="#play"]').hide().parent().find('a[href="#pause"]').show())},resultHandler:function(e,n){if(!w)switch(e){case"error":void 0!==console&&console.error("desoSlide: "+n),l.events.completed&&l.events.completed("error"),w=e;break;case"warning":void 0!==console&&console.warn("desoSlide: "+n),l.events.completed&&l.events.completed("warning");break;default:l.events.completed&&l.events.completed("success")}},events:function(){u.find("a").on("click",function(n){n.preventDefault();var a=e(this),t=a.parent("li").index();t!==h&&(v.animate({opacity:0}),h=t,k.outEffect(),k.pause()),l.events.thumbClick&&l.events.thumbClick()}),u.find("img").on({mouseover:function(){e(this).stop(!0,!0).animate({opacity:.7},"normal")},mouseout:function(){e(this).stop(!0,!0).animate({opacity:1},"fast")}}),"hover"===l.overlay&&e(l.main.container).on({mouseover:function(){v.stop().animate({opacity:.7},400)},mouseleave:function(){v.stop().animate({opacity:0},400)}}),l.controls.enable&&l.controls.keys&&e(document).on("keydown",function(n){switch(n.which){case 37:e(l.main.container).trigger("prev.desoslide");break;case 39:e(l.main.container).trigger("next.desoslide");break;case 32:n.preventDefault(),e(l.main.container).trigger(l.auto.start?"pause.desoslide":"play")}}),e(l.main.container).on("click",".desoSlide-controls-wrapper a",e(l.main.container),function(n){switch(n.preventDefault(),e(this).attr("href")){case"#prev":e(l.main.container).trigger("prev.desoslide");break;case"#pause":e(l.main.container).trigger("pause.desoslide");break;case"#play":e(l.main.container).trigger("play.desoslide");break;case"#next":e(l.main.container).trigger("next.desoslide")}}),e(l.main.container).on("prev.desoslide",function(){k.pause(),h--,k.outEffect(),l.events.prev&&l.events.prev()}),e(l.main.container).on("pause.desoslide",function(){k.pause(),l.events.pause&&l.events.pause()}),e(l.main.container).on("play.desoslide",function(){k.play(),l.events.play&&l.events.play()}),e(l.main.container).on("next.desoslide",function(){k.pause(),h++,k.outEffect(),l.events.next&&l.events.next()}),"none"!==l.overlay&&e(window).bind("resize",function(){p(function(){k.addOverlay()},100)})}};return k.addSpinner(),e(window).load(function(){k.init()}),this}}(jQuery); \ No newline at end of file diff --git a/index.html b/index.html index 38ccd2c..baa31bd 100644 --- a/index.html +++ b/index.html @@ -74,7 +74,7 @@

... with thumbnails!

Download -
  • Version 1.2.4
  • +
  • Version 1.3.0
  • diff --git a/package.json b/package.json index 16625ef..61daf38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "desoslide", - "version": "1.2.4", + "version": "1.3.0", "description": "**http://sylouuu.github.io/desoslide**", "directories": { "test": "tests"