From 9057960dce4e02af6acf574cffd308c82f4c249f Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 27 Oct 2014 04:57:09 -0700 Subject: [PATCH 01/23] feat (rn-carousel): add infinite loop support --- dist/angular-carousel.css | 2 + dist/angular-carousel.js | 52 +++++++- dist/angular-carousel.min.js | 4 +- index.html | 215 ++++++++++++++++++---------------- src/directives/rn-carousel.js | 50 +++++++- 5 files changed, 214 insertions(+), 109 deletions(-) diff --git a/dist/angular-carousel.css b/dist/angular-carousel.css index a11d852..fd82fb4 100755 --- a/dist/angular-carousel.css +++ b/dist/angular-carousel.css @@ -62,3 +62,5 @@ div.rn-carousel-indicator span { right: 0.5em; } .rn-carousel-control.rn-carousel-control-next:before { content: ">"; } + +/*# sourceMappingURL=angular-carousel.css.map */ diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 60bf2a5..96f8a5f 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -1,6 +1,6 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-10-21 + * @version v0.3.5 - 2014-10-27 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT @@ -233,6 +233,9 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach isBuffered = false, repeatItem, repeatCollection; + + // check if looping is specified + var loop = angular.isDefined(tAttributes['rnCarouselLoop']); // try to find an ngRepeat expression // at this point, the attributes are not yet normalized so we need to try various syntax @@ -250,6 +253,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach if (angular.isDefined(tAttributes['rnCarouselBuffered'])) { // update the current ngRepeat expression and add a slice operator if buffered isBuffered = true; + loop = false; //disable looping if buffering repeatAttribute.value = repeatItem + ' in ' + repeatCollection + '|carouselSlice:carouselBufferIndex:carouselBufferSize'; if (trackProperty) { repeatAttribute.value += ' track by ' + trackProperty; @@ -264,6 +268,21 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach return function(scope, iElement, iAttributes, containerCtrl) { + // add virtual slides for looping + if (loop){ + var children = iElement.children(); + var firstCopy = angular.element(children[0]).clone(); + var lastCopy = angular.element(children[children.length-1]).clone(); + iElement.prepend(lastCopy); + iElement.append(firstCopy); + if (!isRepeatBased){ + // might have to add something + } + } + + //for displaying carousel controls + scope.loop = loop; + carouselId++; var defaultOptions = { @@ -299,8 +318,8 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach if(iAttributes.rnCarouselControls!==undefined) { // dont use a directive for this var tpl = ''; iElement.append($compile(angular.element(tpl))(scope)); } @@ -328,9 +347,13 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach } function updateSlidesPosition(offset) { + console.log('updateSlidesPosition'); // manually apply transformation to carousel childrens // todo : optim : apply only to visible items var x = scope.carouselBufferIndex * 100 + offset; + if (loop) { + x -= 100; + } angular.forEach(getSlidesDOM(), function(child, index) { child.style.cssText = createStyleString(computeCarouselSlideStyle(index, x, options.transitionType)); }); @@ -338,7 +361,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach scope.nextSlide = function(slideOptions) { var index = scope.carouselIndex + 1; - if (index > currentSlides.length - 1) { + if (index > currentSlides.length - 1 && !loop) { index = 0; } if (!locked) { @@ -348,7 +371,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach scope.prevSlide = function(slideOptions) { var index = scope.carouselIndex - 1; - if (index < 0) { + if (index < 0 && !loop) { index = currentSlides.length - 1; } goToSlide(index, slideOptions); @@ -384,11 +407,24 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach updateSlidesPosition(state.x); }, finish: function() { + locked = false; scope.$apply(function() { scope.carouselIndex = index; offset = index * -100; updateBufferIndex(); + console.log(currentSlides); + if (loop && index === -1){ + console.log(currentSlides.length); + index = currentSlides.length -1; + goToSlide(index, + {animate: false}); + } + if (loop && index === currentSlides.length){ + index = 0; + goToSlide(index, + {animate: false}); + } }); } }); @@ -440,6 +476,9 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach angular.forEach(getSlidesDOM(), function(node, index) { currentSlides.push({id: index}); }); + if (loop) { + currentSlides.length -= 2; + } } var autoSlider; @@ -512,6 +551,9 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach scope.$watchCollection(repeatCollection, function(newValue, oldValue) { //console.log('repeatCollection', arguments); currentSlides = newValue; + if (loop) { + currentSlides.length -= 2; + } goToSlide(scope.carouselIndex); }); } diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index ee35e4d..01b9aea 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -1,8 +1,8 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-10-21 + * @version v0.3.5 - 2014-10-27 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1;return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){K=!0,z({x:a.clientX,y:a.clientY},a)}function t(a){var b=100*l.carouselBufferIndex+a;angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,H.transitionType))})}function u(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===H.transitionType)return N=!1,J=-100*a,l.carouselIndex=a,A(),void 0;N=!0;var c=new j;c.tween({from:{x:J},to:{x:-100*a},duration:H.transitionDuration,easing:H.transitionEasing,step:function(a){t(a.x)},finish:function(){N=!1,l.$apply(function(){l.carouselIndex=a,J=-100*a,A()})}})}function v(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function w(){L=v()}function x(a){return c.bind("mouseup",q),w(),M=m[0].querySelector("li").getBoundingClientRect().left,C=!0,D=a.x,!1}function y(a){if(!N){var b,c;if(C&&(b=a.x,c=D-b,c>2||-2>c)){K=!0;var d=J+100*-c/L;t(d)}return!1}}function z(a,b){if((!b||K)&&(c.unbind("mouseup",q),C=!1,K=!1,E=D-a.x,0!==E&&!N))if(J+=100*-E/L,H.isSequential){var d=H.moveTreshold*L,e=-E,f=-Math[e>=0?"ceil":"floor"](e/L),g=Math.abs(e)>d;F&&f+l.carouselIndex>=F.length&&(f=F.length-1-l.carouselIndex),f+l.carouselIndex<0&&(f=-l.carouselIndex);var h=g?f:0;E=l.carouselIndex+h,u(E)}else l.$apply(function(){l.carouselIndex=parseInt(-J/100,10),A()})}function A(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:F&&F.lengthF.length-l.carouselBufferSize?F.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){t(J)},0,!1)):f(function(){t(J)},0,!1)}function B(){w(),u()}k++;var C,D,E,F,G={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},H=angular.extend({},G),I=!1,J=0,K=!1,L=null,M=null,N=!1;if(void 0!==n.rnCarouselControls){var O='';m.append(e(angular.element(O))(l))}a.bind(m,{start:x,move:y,end:z,cancel:function(a){z({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>F.length-1&&(b=0),N||u(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&(b=F.length-1),u(b,a)};var P=!0;l.carouselIndex=0,r||(F=[],angular.forEach(p(),function(a,b){F.push({id:b})}));var Q;if(void 0!==n.rnCarouselAutoSlide){var R=parseInt(n.rnCarouselAutoSlide,10)||H.autoSlideDuration;Q=g(function(){N||C||l.nextSlide()},1e3*R)}if(n.rnCarouselIndex){var S=function(a){T.assign(l.$parent,a)},T=d(n.rnCarouselIndex);angular.isFunction(T.assign)?(l.$watch("carouselIndex",function(a){N||S(a)}),l.$parent.$watch(T,function(a){void 0!==a&&null!==a&&(F&&a>=F.length?(a=F.length-1,S(a)):F&&0>a&&(a=0,S(a)),N||u(a,{animate:!P}),P=!1)}),I=!0):isNaN(n.rnCarouselIndex)||u(parseInt(n.rnCarouselIndex,10),{animate:!1})}else u(0,{animate:!P}),P=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){N=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){F=a,u(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=H.bufferSize;var U=angular.element(b);U.bind("orientationchange",B),U.bind("resize",B),l.$on("$destroy",function(){c.unbind("mouseup",q),U.unbind("orientationchange",B),U.unbind("resize",B)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){O=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){console.log("updateSlidesPosition");var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,L.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===L.transitionType)return R=!1,N=-100*a,l.carouselIndex=a,void B();R=!0;var c=new j;c.tween({from:{x:N},to:{x:-100*a},duration:L.transitionDuration,easing:L.transitionEasing,step:function(a){u(a.x)},finish:function(){R=!1,l.$apply(function(){l.carouselIndex=a,N=-100*a,B(),console.log(J),t&&-1===a&&(console.log(J.length),a=J.length-1,v(a,{animate:!1})),t&&a===J.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){P=w()}function y(a){return c.bind("mouseup",q),x(),Q=m[0].querySelector("li").getBoundingClientRect().left,G=!0,H=a.x,!1}function z(a){if(!R){var b,c;if(G&&(b=a.x,c=H-b,c>2||-2>c)){O=!0;var d=N+100*-c/P;u(d)}return!1}}function A(a,b){if((!b||O)&&(c.unbind("mouseup",q),G=!1,O=!1,I=H-a.x,0!==I&&!R))if(N+=100*-I/P,L.isSequential){var d=L.moveTreshold*P,e=-I,f=-Math[e>=0?"ceil":"floor"](e/P),g=Math.abs(e)>d;J&&f+l.carouselIndex>=J.length&&(f=J.length-1-l.carouselIndex),f+l.carouselIndex<0&&(f=-l.carouselIndex);var h=g?f:0;I=l.carouselIndex+h,v(I)}else l.$apply(function(){l.carouselIndex=parseInt(-N/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:J&&J.lengthJ.length-l.carouselBufferSize?J.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(N)},0,!1)):f(function(){u(N)},0,!1)}function C(){x(),v()}if(t){var D=m.children(),E=angular.element(D[0]).clone(),F=angular.element(D[D.length-1]).clone();m.prepend(F),m.append(E)}l.loop=t,k++;var G,H,I,J,K={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},L=angular.extend({},K),M=!1,N=0,O=!1,P=null,Q=null,R=!1;if(void 0!==n.rnCarouselControls){var S='';m.append(e(angular.element(S))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>J.length-1&&!t&&(b=0),R||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=J.length-1),v(b,a)};var T=!0;l.carouselIndex=0,r||(J=[],angular.forEach(p(),function(a,b){J.push({id:b})}),t&&(J.length-=2));var U;if(void 0!==n.rnCarouselAutoSlide){var V=parseInt(n.rnCarouselAutoSlide,10)||L.autoSlideDuration;U=g(function(){R||G||l.nextSlide()},1e3*V)}if(n.rnCarouselIndex){var W=function(a){X.assign(l.$parent,a)},X=d(n.rnCarouselIndex);angular.isFunction(X.assign)?(l.$watch("carouselIndex",function(a){R||W(a)}),l.$parent.$watch(X,function(a){void 0!==a&&null!==a&&(J&&a>=J.length?(a=J.length-1,W(a)):J&&0>a&&(a=0,W(a)),R||v(a,{animate:!T}),T=!1)}),M=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!T}),T=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){R=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){J=a,t&&(J.length-=2),v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=L.bufferSize;var Y=angular.element(b);Y.bind("orientationchange",C),Y.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Y.unbind("orientationchange",C),Y.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/index.html b/index.html index 34fd7b1..31647e8 100644 --- a/index.html +++ b/index.html @@ -21,106 +21,125 @@

AngularJS Touch Carousel

-

Buffered ngRepeat demo

-
A simple buffered ng-repeat with a custom template. -
- Swipe 50 slides with only 5 slides in the DOM. use builtin controls -
- -
-
-

buffered ngRepeat with auto-slide and builtin indicators

-
-
- -
-
-
-

buffered ngRepeat and custom indicators

-
-
- -
-
-
-

buffered ngRepeat with custom transition

-
Use the 'hexagon' transition. index is shared with the carousel below. -
- -
-
-
-

Custom templates without ng-repeat and auto-slide

-
-
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Custom templates with looping

+
+
+

-
-

Lockable carousel

-
-
- -
+ + + + + + + + + + + + + + +
diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 884b758..0e66064 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -133,6 +133,9 @@ isBuffered = false, repeatItem, repeatCollection; + + // check if looping is specified + var loop = angular.isDefined(tAttributes['rnCarouselLoop']); // try to find an ngRepeat expression // at this point, the attributes are not yet normalized so we need to try various syntax @@ -150,6 +153,7 @@ if (angular.isDefined(tAttributes['rnCarouselBuffered'])) { // update the current ngRepeat expression and add a slice operator if buffered isBuffered = true; + loop = false; //disable looping if buffering repeatAttribute.value = repeatItem + ' in ' + repeatCollection + '|carouselSlice:carouselBufferIndex:carouselBufferSize'; if (trackProperty) { repeatAttribute.value += ' track by ' + trackProperty; @@ -164,6 +168,21 @@ return function(scope, iElement, iAttributes, containerCtrl) { + // add virtual slides for looping + if (loop){ + var children = iElement.children(); + var firstCopy = angular.element(children[0]).clone(); + var lastCopy = angular.element(children[children.length-1]).clone(); + iElement.prepend(lastCopy); + iElement.append(firstCopy); + if (!isRepeatBased){ + // might have to add something + } + } + + //for displaying carousel controls + scope.loop = loop; + carouselId++; var defaultOptions = { @@ -199,8 +218,8 @@ if(iAttributes.rnCarouselControls!==undefined) { // dont use a directive for this var tpl = ''; iElement.append($compile(angular.element(tpl))(scope)); } @@ -228,9 +247,13 @@ } function updateSlidesPosition(offset) { + console.log('updateSlidesPosition'); // manually apply transformation to carousel childrens // todo : optim : apply only to visible items var x = scope.carouselBufferIndex * 100 + offset; + if (loop) { + x -= 100; + } angular.forEach(getSlidesDOM(), function(child, index) { child.style.cssText = createStyleString(computeCarouselSlideStyle(index, x, options.transitionType)); }); @@ -238,7 +261,7 @@ scope.nextSlide = function(slideOptions) { var index = scope.carouselIndex + 1; - if (index > currentSlides.length - 1) { + if (index > currentSlides.length - 1 && !loop) { index = 0; } if (!locked) { @@ -248,7 +271,7 @@ scope.prevSlide = function(slideOptions) { var index = scope.carouselIndex - 1; - if (index < 0) { + if (index < 0 && !loop) { index = currentSlides.length - 1; } goToSlide(index, slideOptions); @@ -284,11 +307,24 @@ updateSlidesPosition(state.x); }, finish: function() { + locked = false; scope.$apply(function() { scope.carouselIndex = index; offset = index * -100; updateBufferIndex(); + console.log(currentSlides); + if (loop && index === -1){ + console.log(currentSlides.length); + index = currentSlides.length -1; + goToSlide(index, + {animate: false}); + } + if (loop && index === currentSlides.length){ + index = 0; + goToSlide(index, + {animate: false}); + } }); } }); @@ -340,6 +376,9 @@ angular.forEach(getSlidesDOM(), function(node, index) { currentSlides.push({id: index}); }); + if (loop) { + currentSlides.length -= 2; + } } var autoSlider; @@ -412,6 +451,9 @@ scope.$watchCollection(repeatCollection, function(newValue, oldValue) { //console.log('repeatCollection', arguments); currentSlides = newValue; + if (loop) { + currentSlides.length -= 2; + } goToSlide(scope.carouselIndex); }); } From 6e44c8e9115383a784c6523df5aeb891f1e31fcc Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 27 Oct 2014 05:00:43 -0700 Subject: [PATCH 02/23] add looping for swipes --- dist/angular-carousel.js | 4 ++-- dist/angular-carousel.min.js | 2 +- src/directives/rn-carousel.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 96f8a5f..46940dd 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -582,10 +582,10 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach slidesMove = -Math[absMove >= 0 ? 'ceil' : 'floor'](absMove / elWidth), shouldMove = Math.abs(absMove) > minMove; - if (currentSlides && (slidesMove + scope.carouselIndex) >= currentSlides.length) { + if (currentSlides && (slidesMove + scope.carouselIndex) >= currentSlides.length && !loop) { slidesMove = currentSlides.length - 1 - scope.carouselIndex; } - if ((slidesMove + scope.carouselIndex) < 0) { + if ((slidesMove + scope.carouselIndex) < 0 && !loop) { slidesMove = -scope.carouselIndex; } var moveOffset = shouldMove ? slidesMove : 0; diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 01b9aea..4a7a3a9 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n
')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){O=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){console.log("updateSlidesPosition");var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,L.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===L.transitionType)return R=!1,N=-100*a,l.carouselIndex=a,void B();R=!0;var c=new j;c.tween({from:{x:N},to:{x:-100*a},duration:L.transitionDuration,easing:L.transitionEasing,step:function(a){u(a.x)},finish:function(){R=!1,l.$apply(function(){l.carouselIndex=a,N=-100*a,B(),console.log(J),t&&-1===a&&(console.log(J.length),a=J.length-1,v(a,{animate:!1})),t&&a===J.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){P=w()}function y(a){return c.bind("mouseup",q),x(),Q=m[0].querySelector("li").getBoundingClientRect().left,G=!0,H=a.x,!1}function z(a){if(!R){var b,c;if(G&&(b=a.x,c=H-b,c>2||-2>c)){O=!0;var d=N+100*-c/P;u(d)}return!1}}function A(a,b){if((!b||O)&&(c.unbind("mouseup",q),G=!1,O=!1,I=H-a.x,0!==I&&!R))if(N+=100*-I/P,L.isSequential){var d=L.moveTreshold*P,e=-I,f=-Math[e>=0?"ceil":"floor"](e/P),g=Math.abs(e)>d;J&&f+l.carouselIndex>=J.length&&(f=J.length-1-l.carouselIndex),f+l.carouselIndex<0&&(f=-l.carouselIndex);var h=g?f:0;I=l.carouselIndex+h,v(I)}else l.$apply(function(){l.carouselIndex=parseInt(-N/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:J&&J.lengthJ.length-l.carouselBufferSize?J.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(N)},0,!1)):f(function(){u(N)},0,!1)}function C(){x(),v()}if(t){var D=m.children(),E=angular.element(D[0]).clone(),F=angular.element(D[D.length-1]).clone();m.prepend(F),m.append(E)}l.loop=t,k++;var G,H,I,J,K={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},L=angular.extend({},K),M=!1,N=0,O=!1,P=null,Q=null,R=!1;if(void 0!==n.rnCarouselControls){var S='';m.append(e(angular.element(S))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>J.length-1&&!t&&(b=0),R||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=J.length-1),v(b,a)};var T=!0;l.carouselIndex=0,r||(J=[],angular.forEach(p(),function(a,b){J.push({id:b})}),t&&(J.length-=2));var U;if(void 0!==n.rnCarouselAutoSlide){var V=parseInt(n.rnCarouselAutoSlide,10)||L.autoSlideDuration;U=g(function(){R||G||l.nextSlide()},1e3*V)}if(n.rnCarouselIndex){var W=function(a){X.assign(l.$parent,a)},X=d(n.rnCarouselIndex);angular.isFunction(X.assign)?(l.$watch("carouselIndex",function(a){R||W(a)}),l.$parent.$watch(X,function(a){void 0!==a&&null!==a&&(J&&a>=J.length?(a=J.length-1,W(a)):J&&0>a&&(a=0,W(a)),R||v(a,{animate:!T}),T=!1)}),M=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!T}),T=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){R=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){J=a,t&&(J.length-=2),v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=L.bufferSize;var Y=angular.element(b);Y.bind("orientationchange",C),Y.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Y.unbind("orientationchange",C),Y.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){O=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){console.log("updateSlidesPosition");var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,L.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===L.transitionType)return R=!1,N=-100*a,l.carouselIndex=a,void B();R=!0;var c=new j;c.tween({from:{x:N},to:{x:-100*a},duration:L.transitionDuration,easing:L.transitionEasing,step:function(a){u(a.x)},finish:function(){R=!1,l.$apply(function(){l.carouselIndex=a,N=-100*a,B(),console.log(J),t&&-1===a&&(console.log(J.length),a=J.length-1,v(a,{animate:!1})),t&&a===J.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){P=w()}function y(a){return c.bind("mouseup",q),x(),Q=m[0].querySelector("li").getBoundingClientRect().left,G=!0,H=a.x,!1}function z(a){if(!R){var b,c;if(G&&(b=a.x,c=H-b,c>2||-2>c)){O=!0;var d=N+100*-c/P;u(d)}return!1}}function A(a,b){if((!b||O)&&(c.unbind("mouseup",q),G=!1,O=!1,I=H-a.x,0!==I&&!R))if(N+=100*-I/P,L.isSequential){var d=L.moveTreshold*P,e=-I,f=-Math[e>=0?"ceil":"floor"](e/P),g=Math.abs(e)>d;J&&f+l.carouselIndex>=J.length&&!t&&(f=J.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;I=l.carouselIndex+h,v(I)}else l.$apply(function(){l.carouselIndex=parseInt(-N/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:J&&J.lengthJ.length-l.carouselBufferSize?J.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(N)},0,!1)):f(function(){u(N)},0,!1)}function C(){x(),v()}if(t){var D=m.children(),E=angular.element(D[0]).clone(),F=angular.element(D[D.length-1]).clone();m.prepend(F),m.append(E)}l.loop=t,k++;var G,H,I,J,K={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},L=angular.extend({},K),M=!1,N=0,O=!1,P=null,Q=null,R=!1;if(void 0!==n.rnCarouselControls){var S='';m.append(e(angular.element(S))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>J.length-1&&!t&&(b=0),R||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=J.length-1),v(b,a)};var T=!0;l.carouselIndex=0,r||(J=[],angular.forEach(p(),function(a,b){J.push({id:b})}),t&&(J.length-=2));var U;if(void 0!==n.rnCarouselAutoSlide){var V=parseInt(n.rnCarouselAutoSlide,10)||L.autoSlideDuration;U=g(function(){R||G||l.nextSlide()},1e3*V)}if(n.rnCarouselIndex){var W=function(a){X.assign(l.$parent,a)},X=d(n.rnCarouselIndex);angular.isFunction(X.assign)?(l.$watch("carouselIndex",function(a){R||W(a)}),l.$parent.$watch(X,function(a){void 0!==a&&null!==a&&(J&&a>=J.length?(a=J.length-1,W(a)):J&&0>a&&(a=0,W(a)),R||v(a,{animate:!T}),T=!1)}),M=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!T}),T=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){R=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){J=a,t&&(J.length-=2),v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=L.bufferSize;var Y=angular.element(b);Y.bind("orientationchange",C),Y.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Y.unbind("orientationchange",C),Y.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 0e66064..4f8b98d 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -482,10 +482,10 @@ slidesMove = -Math[absMove >= 0 ? 'ceil' : 'floor'](absMove / elWidth), shouldMove = Math.abs(absMove) > minMove; - if (currentSlides && (slidesMove + scope.carouselIndex) >= currentSlides.length) { + if (currentSlides && (slidesMove + scope.carouselIndex) >= currentSlides.length && !loop) { slidesMove = currentSlides.length - 1 - scope.carouselIndex; } - if ((slidesMove + scope.carouselIndex) < 0) { + if ((slidesMove + scope.carouselIndex) < 0 && !loop) { slidesMove = -scope.carouselIndex; } var moveOffset = shouldMove ? slidesMove : 0; From eb607bd551ff2b94f1fd95a5e19112bbf7c173e2 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 27 Oct 2014 05:08:09 -0700 Subject: [PATCH 03/23] uncomment other examples in index.html --- dist/angular-carousel.js | 3 - dist/angular-carousel.min.js | 2 +- index.html | 200 +++++++++++++++++----------------- src/directives/rn-carousel.js | 3 - 4 files changed, 101 insertions(+), 107 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 46940dd..1a872f4 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -347,7 +347,6 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach } function updateSlidesPosition(offset) { - console.log('updateSlidesPosition'); // manually apply transformation to carousel childrens // todo : optim : apply only to visible items var x = scope.carouselBufferIndex * 100 + offset; @@ -413,9 +412,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach scope.carouselIndex = index; offset = index * -100; updateBufferIndex(); - console.log(currentSlides); if (loop && index === -1){ - console.log(currentSlides.length); index = currentSlides.length -1; goToSlide(index, {animate: false}); diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 4a7a3a9..7b7213f 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){O=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){console.log("updateSlidesPosition");var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,L.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===L.transitionType)return R=!1,N=-100*a,l.carouselIndex=a,void B();R=!0;var c=new j;c.tween({from:{x:N},to:{x:-100*a},duration:L.transitionDuration,easing:L.transitionEasing,step:function(a){u(a.x)},finish:function(){R=!1,l.$apply(function(){l.carouselIndex=a,N=-100*a,B(),console.log(J),t&&-1===a&&(console.log(J.length),a=J.length-1,v(a,{animate:!1})),t&&a===J.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){P=w()}function y(a){return c.bind("mouseup",q),x(),Q=m[0].querySelector("li").getBoundingClientRect().left,G=!0,H=a.x,!1}function z(a){if(!R){var b,c;if(G&&(b=a.x,c=H-b,c>2||-2>c)){O=!0;var d=N+100*-c/P;u(d)}return!1}}function A(a,b){if((!b||O)&&(c.unbind("mouseup",q),G=!1,O=!1,I=H-a.x,0!==I&&!R))if(N+=100*-I/P,L.isSequential){var d=L.moveTreshold*P,e=-I,f=-Math[e>=0?"ceil":"floor"](e/P),g=Math.abs(e)>d;J&&f+l.carouselIndex>=J.length&&!t&&(f=J.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;I=l.carouselIndex+h,v(I)}else l.$apply(function(){l.carouselIndex=parseInt(-N/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:J&&J.lengthJ.length-l.carouselBufferSize?J.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(N)},0,!1)):f(function(){u(N)},0,!1)}function C(){x(),v()}if(t){var D=m.children(),E=angular.element(D[0]).clone(),F=angular.element(D[D.length-1]).clone();m.prepend(F),m.append(E)}l.loop=t,k++;var G,H,I,J,K={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},L=angular.extend({},K),M=!1,N=0,O=!1,P=null,Q=null,R=!1;if(void 0!==n.rnCarouselControls){var S='';m.append(e(angular.element(S))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>J.length-1&&!t&&(b=0),R||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=J.length-1),v(b,a)};var T=!0;l.carouselIndex=0,r||(J=[],angular.forEach(p(),function(a,b){J.push({id:b})}),t&&(J.length-=2));var U;if(void 0!==n.rnCarouselAutoSlide){var V=parseInt(n.rnCarouselAutoSlide,10)||L.autoSlideDuration;U=g(function(){R||G||l.nextSlide()},1e3*V)}if(n.rnCarouselIndex){var W=function(a){X.assign(l.$parent,a)},X=d(n.rnCarouselIndex);angular.isFunction(X.assign)?(l.$watch("carouselIndex",function(a){R||W(a)}),l.$parent.$watch(X,function(a){void 0!==a&&null!==a&&(J&&a>=J.length?(a=J.length-1,W(a)):J&&0>a&&(a=0,W(a)),R||v(a,{animate:!T}),T=!1)}),M=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!T}),T=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){R=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){J=a,t&&(J.length-=2),v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=L.bufferSize;var Y=angular.element(b);Y.bind("orientationchange",C),Y.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Y.unbind("orientationchange",C),Y.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){O=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,L.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===L.transitionType)return R=!1,N=-100*a,l.carouselIndex=a,void B();R=!0;var c=new j;c.tween({from:{x:N},to:{x:-100*a},duration:L.transitionDuration,easing:L.transitionEasing,step:function(a){u(a.x)},finish:function(){R=!1,l.$apply(function(){l.carouselIndex=a,N=-100*a,B(),t&&-1===a&&(a=J.length-1,v(a,{animate:!1})),t&&a===J.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){P=w()}function y(a){return c.bind("mouseup",q),x(),Q=m[0].querySelector("li").getBoundingClientRect().left,G=!0,H=a.x,!1}function z(a){if(!R){var b,c;if(G&&(b=a.x,c=H-b,c>2||-2>c)){O=!0;var d=N+100*-c/P;u(d)}return!1}}function A(a,b){if((!b||O)&&(c.unbind("mouseup",q),G=!1,O=!1,I=H-a.x,0!==I&&!R))if(N+=100*-I/P,L.isSequential){var d=L.moveTreshold*P,e=-I,f=-Math[e>=0?"ceil":"floor"](e/P),g=Math.abs(e)>d;J&&f+l.carouselIndex>=J.length&&!t&&(f=J.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;I=l.carouselIndex+h,v(I)}else l.$apply(function(){l.carouselIndex=parseInt(-N/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:J&&J.lengthJ.length-l.carouselBufferSize?J.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(N)},0,!1)):f(function(){u(N)},0,!1)}function C(){x(),v()}if(t){var D=m.children(),E=angular.element(D[0]).clone(),F=angular.element(D[D.length-1]).clone();m.prepend(F),m.append(E)}l.loop=t,k++;var G,H,I,J,K={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},L=angular.extend({},K),M=!1,N=0,O=!1,P=null,Q=null,R=!1;if(void 0!==n.rnCarouselControls){var S='';m.append(e(angular.element(S))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>J.length-1&&!t&&(b=0),R||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=J.length-1),v(b,a)};var T=!0;l.carouselIndex=0,r||(J=[],angular.forEach(p(),function(a,b){J.push({id:b})}),t&&(J.length-=2));var U;if(void 0!==n.rnCarouselAutoSlide){var V=parseInt(n.rnCarouselAutoSlide,10)||L.autoSlideDuration;U=g(function(){R||G||l.nextSlide()},1e3*V)}if(n.rnCarouselIndex){var W=function(a){X.assign(l.$parent,a)},X=d(n.rnCarouselIndex);angular.isFunction(X.assign)?(l.$watch("carouselIndex",function(a){R||W(a)}),l.$parent.$watch(X,function(a){void 0!==a&&null!==a&&(J&&a>=J.length?(a=J.length-1,W(a)):J&&0>a&&(a=0,W(a)),R||v(a,{animate:!T}),T=!1)}),M=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!T}),T=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){R=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){J=a,t&&(J.length-=2),v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=L.bufferSize;var Y=angular.element(b);Y.bind("orientationchange",C),Y.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Y.unbind("orientationchange",C),Y.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/index.html b/index.html index 31647e8..96d4a83 100644 --- a/index.html +++ b/index.html @@ -21,91 +21,91 @@

AngularJS Touch Carousel

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

Buffered ngRepeat demo

+
A simple buffered ng-repeat with a custom template. +
+ Swipe 50 slides with only 5 slides in the DOM. use builtin controls +
+ +
+
+

buffered ngRepeat with auto-slide and builtin indicators

+
+
+ +
+
+
+

buffered ngRepeat and custom indicators

+
+
+ +
+
+
+

buffered ngRepeat with custom transition

+
Use the 'hexagon' transition. index is shared with the carousel below. +
+ +
+
+
+

Custom templates without ng-repeat and auto-slide

+
+
+ +
+

Custom templates with looping

@@ -125,21 +125,21 @@

Custom templates with looping


- - - - - - - - - - - - - - - +
+

Lockable carousel

+
+
+ +
diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 4f8b98d..37776aa 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -247,7 +247,6 @@ } function updateSlidesPosition(offset) { - console.log('updateSlidesPosition'); // manually apply transformation to carousel childrens // todo : optim : apply only to visible items var x = scope.carouselBufferIndex * 100 + offset; @@ -313,9 +312,7 @@ scope.carouselIndex = index; offset = index * -100; updateBufferIndex(); - console.log(currentSlides); if (loop && index === -1){ - console.log(currentSlides.length); index = currentSlides.length -1; goToSlide(index, {animate: false}); From 5f1dd0243e18cdbb6635ed7a6ea7edb8671e3715 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 27 Oct 2014 18:22:49 -0700 Subject: [PATCH 04/23] fix slide count for repeat --- src/directives/rn-carousel.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 37776aa..8ee3120 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -448,9 +448,6 @@ scope.$watchCollection(repeatCollection, function(newValue, oldValue) { //console.log('repeatCollection', arguments); currentSlides = newValue; - if (loop) { - currentSlides.length -= 2; - } goToSlide(scope.carouselIndex); }); } From 804fe7aa5699717882f7b74f639bec3a7765f003 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 27 Oct 2014 19:33:53 -0700 Subject: [PATCH 05/23] fixed problem with dom copy insertion --- dist/angular-carousel.js | 24 ++-- dist/angular-carousel.min.js | 2 +- index.html | 220 ++++++++++++++++++---------------- src/directives/rn-carousel.js | 21 ++-- 4 files changed, 137 insertions(+), 130 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 1a872f4..16521a6 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -269,15 +269,15 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach return function(scope, iElement, iAttributes, containerCtrl) { // add virtual slides for looping + // need to fix this if (loop){ - var children = iElement.children(); - var firstCopy = angular.element(children[0]).clone(); - var lastCopy = angular.element(children[children.length-1]).clone(); - iElement.prepend(lastCopy); - iElement.append(firstCopy); - if (!isRepeatBased){ - // might have to add something - } + $timeout(function(){ + var children = iElement[0].querySelectorAll('li'); + var firstCopy = angular.element(children[0]).clone(); + var lastCopy = angular.element(children[children.length-1]).clone(); + iElement.prepend(lastCopy); + iElement.append(firstCopy); + }); } //for displaying carousel controls @@ -351,7 +351,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach // todo : optim : apply only to visible items var x = scope.carouselBufferIndex * 100 + offset; if (loop) { - x -= 100; + x -= 100; } angular.forEach(getSlidesDOM(), function(child, index) { child.style.cssText = createStyleString(computeCarouselSlideStyle(index, x, options.transitionType)); @@ -473,9 +473,6 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach angular.forEach(getSlidesDOM(), function(node, index) { currentSlides.push({id: index}); }); - if (loop) { - currentSlides.length -= 2; - } } var autoSlider; @@ -548,9 +545,6 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach scope.$watchCollection(repeatCollection, function(newValue, oldValue) { //console.log('repeatCollection', arguments); currentSlides = newValue; - if (loop) { - currentSlides.length -= 2; - } goToSlide(scope.carouselIndex); }); } diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 7b7213f..87eaac4 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){O=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,L.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===L.transitionType)return R=!1,N=-100*a,l.carouselIndex=a,void B();R=!0;var c=new j;c.tween({from:{x:N},to:{x:-100*a},duration:L.transitionDuration,easing:L.transitionEasing,step:function(a){u(a.x)},finish:function(){R=!1,l.$apply(function(){l.carouselIndex=a,N=-100*a,B(),t&&-1===a&&(a=J.length-1,v(a,{animate:!1})),t&&a===J.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){P=w()}function y(a){return c.bind("mouseup",q),x(),Q=m[0].querySelector("li").getBoundingClientRect().left,G=!0,H=a.x,!1}function z(a){if(!R){var b,c;if(G&&(b=a.x,c=H-b,c>2||-2>c)){O=!0;var d=N+100*-c/P;u(d)}return!1}}function A(a,b){if((!b||O)&&(c.unbind("mouseup",q),G=!1,O=!1,I=H-a.x,0!==I&&!R))if(N+=100*-I/P,L.isSequential){var d=L.moveTreshold*P,e=-I,f=-Math[e>=0?"ceil":"floor"](e/P),g=Math.abs(e)>d;J&&f+l.carouselIndex>=J.length&&!t&&(f=J.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;I=l.carouselIndex+h,v(I)}else l.$apply(function(){l.carouselIndex=parseInt(-N/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:J&&J.lengthJ.length-l.carouselBufferSize?J.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(N)},0,!1)):f(function(){u(N)},0,!1)}function C(){x(),v()}if(t){var D=m.children(),E=angular.element(D[0]).clone(),F=angular.element(D[D.length-1]).clone();m.prepend(F),m.append(E)}l.loop=t,k++;var G,H,I,J,K={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},L=angular.extend({},K),M=!1,N=0,O=!1,P=null,Q=null,R=!1;if(void 0!==n.rnCarouselControls){var S='';m.append(e(angular.element(S))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>J.length-1&&!t&&(b=0),R||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=J.length-1),v(b,a)};var T=!0;l.carouselIndex=0,r||(J=[],angular.forEach(p(),function(a,b){J.push({id:b})}),t&&(J.length-=2));var U;if(void 0!==n.rnCarouselAutoSlide){var V=parseInt(n.rnCarouselAutoSlide,10)||L.autoSlideDuration;U=g(function(){R||G||l.nextSlide()},1e3*V)}if(n.rnCarouselIndex){var W=function(a){X.assign(l.$parent,a)},X=d(n.rnCarouselIndex);angular.isFunction(X.assign)?(l.$watch("carouselIndex",function(a){R||W(a)}),l.$parent.$watch(X,function(a){void 0!==a&&null!==a&&(J&&a>=J.length?(a=J.length-1,W(a)):J&&0>a&&(a=0,W(a)),R||v(a,{animate:!T}),T=!1)}),M=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!T}),T=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){R=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){J=a,t&&(J.length-=2),v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=L.bufferSize;var Y=angular.element(b);Y.bind("orientationchange",C),Y.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Y.unbind("orientationchange",C),Y.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){L=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,I.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===I.transitionType)return O=!1,K=-100*a,l.carouselIndex=a,void B();O=!0;var c=new j;c.tween({from:{x:K},to:{x:-100*a},duration:I.transitionDuration,easing:I.transitionEasing,step:function(a){u(a.x)},finish:function(){O=!1,l.$apply(function(){l.carouselIndex=a,K=-100*a,B(),t&&-1===a&&(a=G.length-1,v(a,{animate:!1})),t&&a===G.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){M=w()}function y(a){return c.bind("mouseup",q),x(),N=m[0].querySelector("li").getBoundingClientRect().left,D=!0,E=a.x,!1}function z(a){if(!O){var b,c;if(D&&(b=a.x,c=E-b,c>2||-2>c)){L=!0;var d=K+100*-c/M;u(d)}return!1}}function A(a,b){if((!b||L)&&(c.unbind("mouseup",q),D=!1,L=!1,F=E-a.x,0!==F&&!O))if(K+=100*-F/M,I.isSequential){var d=I.moveTreshold*M,e=-F,f=-Math[e>=0?"ceil":"floor"](e/M),g=Math.abs(e)>d;G&&f+l.carouselIndex>=G.length&&!t&&(f=G.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;F=l.carouselIndex+h,v(F)}else l.$apply(function(){l.carouselIndex=parseInt(-K/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:G&&G.lengthG.length-l.carouselBufferSize?G.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(K)},0,!1)):f(function(){u(K)},0,!1)}function C(){x(),v()}t&&f(function(){var a=m[0].querySelectorAll("li"),b=angular.element(a[0]).clone(),c=angular.element(a[a.length-1]).clone();m.prepend(c),m.append(b)}),l.loop=t,k++;var D,E,F,G,H={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},I=angular.extend({},H),J=!1,K=0,L=!1,M=null,N=null,O=!1;if(void 0!==n.rnCarouselControls){var P='';m.append(e(angular.element(P))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>G.length-1&&!t&&(b=0),O||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=G.length-1),v(b,a)};var Q=!0;l.carouselIndex=0,r||(G=[],angular.forEach(p(),function(a,b){G.push({id:b})}));var R;if(void 0!==n.rnCarouselAutoSlide){var S=parseInt(n.rnCarouselAutoSlide,10)||I.autoSlideDuration;R=g(function(){O||D||l.nextSlide()},1e3*S)}if(n.rnCarouselIndex){var T=function(a){U.assign(l.$parent,a)},U=d(n.rnCarouselIndex);angular.isFunction(U.assign)?(l.$watch("carouselIndex",function(a){O||T(a)}),l.$parent.$watch(U,function(a){void 0!==a&&null!==a&&(G&&a>=G.length?(a=G.length-1,T(a)):G&&0>a&&(a=0,T(a)),O||v(a,{animate:!Q}),Q=!1)}),J=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!Q}),Q=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){O=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){G=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=I.bufferSize;var V=angular.element(b);V.bind("orientationchange",C),V.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),V.unbind("orientationchange",C),V.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/index.html b/index.html index 96d4a83..7eb85a7 100644 --- a/index.html +++ b/index.html @@ -19,94 +19,94 @@

AngularJS Touch Carousel

Swipe these demos with your mouse or finger -
-
-

Buffered ngRepeat demo

-
A simple buffered ng-repeat with a custom template. -
- Swipe 50 slides with only 5 slides in the DOM. use builtin controls -
- -
-
-

buffered ngRepeat with auto-slide and builtin indicators

-
-
- -
-
-
-

buffered ngRepeat and custom indicators

-
-
- -
-
-
-

buffered ngRepeat with custom transition

-
Use the 'hexagon' transition. index is shared with the carousel below. -
- -
-
-
-

Custom templates without ng-repeat and auto-slide

-
-
- -
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Custom templates with looping

@@ -125,21 +125,37 @@

Custom templates with looping


-
-

Lockable carousel

-
-
- +
+
+

Looping with ng-repeat and autoscroll looping

+
+
+
+
+ + + + + + + + + + + + + + +
diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 8ee3120..1361627 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -169,15 +169,15 @@ return function(scope, iElement, iAttributes, containerCtrl) { // add virtual slides for looping + // need to fix this if (loop){ - var children = iElement.children(); - var firstCopy = angular.element(children[0]).clone(); - var lastCopy = angular.element(children[children.length-1]).clone(); - iElement.prepend(lastCopy); - iElement.append(firstCopy); - if (!isRepeatBased){ - // might have to add something - } + $timeout(function(){ + var children = iElement[0].querySelectorAll('li'); + var firstCopy = angular.element(children[0]).clone(); + var lastCopy = angular.element(children[children.length-1]).clone(); + iElement.prepend(lastCopy); + iElement.append(firstCopy); + }); } //for displaying carousel controls @@ -251,7 +251,7 @@ // todo : optim : apply only to visible items var x = scope.carouselBufferIndex * 100 + offset; if (loop) { - x -= 100; + x -= 100; } angular.forEach(getSlidesDOM(), function(child, index) { child.style.cssText = createStyleString(computeCarouselSlideStyle(index, x, options.transitionType)); @@ -373,9 +373,6 @@ angular.forEach(getSlidesDOM(), function(node, index) { currentSlides.push({id: index}); }); - if (loop) { - currentSlides.length -= 2; - } } var autoSlider; From 5b2127eae5c978540f1971cb0c0cb5c25f9747f0 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Tue, 28 Oct 2014 05:49:39 -0700 Subject: [PATCH 06/23] added id's for selection only children li, not all descendants --- dist/angular-carousel.js | 11 ++++++----- dist/angular-carousel.min.js | 4 ++-- src/directives/rn-carousel.js | 9 +++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 16521a6..24b16fb 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -1,6 +1,6 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-10-27 + * @version v0.3.5 - 2014-10-28 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT @@ -268,11 +268,14 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach return function(scope, iElement, iAttributes, containerCtrl) { + carouselId++; + + iElement[0].id = 'carousel' + carouselId; + // add virtual slides for looping - // need to fix this if (loop){ $timeout(function(){ - var children = iElement[0].querySelectorAll('li'); + var children = document.querySelectorAll('#' + iElement[0].id + '> li'); var firstCopy = angular.element(children[0]).clone(); var lastCopy = angular.element(children[children.length-1]).clone(); iElement.prepend(lastCopy); @@ -283,8 +286,6 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach //for displaying carousel controls scope.loop = loop; - carouselId++; - var defaultOptions = { transitionType: iAttributes.rnCarouselTransition || 'slide', transitionEasing: 'easeTo', diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 87eaac4..24bf260 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -1,8 +1,8 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-10-27 + * @version v0.3.5 - 2014-10-28 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){L=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,I.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===I.transitionType)return O=!1,K=-100*a,l.carouselIndex=a,void B();O=!0;var c=new j;c.tween({from:{x:K},to:{x:-100*a},duration:I.transitionDuration,easing:I.transitionEasing,step:function(a){u(a.x)},finish:function(){O=!1,l.$apply(function(){l.carouselIndex=a,K=-100*a,B(),t&&-1===a&&(a=G.length-1,v(a,{animate:!1})),t&&a===G.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){M=w()}function y(a){return c.bind("mouseup",q),x(),N=m[0].querySelector("li").getBoundingClientRect().left,D=!0,E=a.x,!1}function z(a){if(!O){var b,c;if(D&&(b=a.x,c=E-b,c>2||-2>c)){L=!0;var d=K+100*-c/M;u(d)}return!1}}function A(a,b){if((!b||L)&&(c.unbind("mouseup",q),D=!1,L=!1,F=E-a.x,0!==F&&!O))if(K+=100*-F/M,I.isSequential){var d=I.moveTreshold*M,e=-F,f=-Math[e>=0?"ceil":"floor"](e/M),g=Math.abs(e)>d;G&&f+l.carouselIndex>=G.length&&!t&&(f=G.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;F=l.carouselIndex+h,v(F)}else l.$apply(function(){l.carouselIndex=parseInt(-K/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:G&&G.lengthG.length-l.carouselBufferSize?G.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(K)},0,!1)):f(function(){u(K)},0,!1)}function C(){x(),v()}t&&f(function(){var a=m[0].querySelectorAll("li"),b=angular.element(a[0]).clone(),c=angular.element(a[a.length-1]).clone();m.prepend(c),m.append(b)}),l.loop=t,k++;var D,E,F,G,H={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},I=angular.extend({},H),J=!1,K=0,L=!1,M=null,N=null,O=!1;if(void 0!==n.rnCarouselControls){var P='';m.append(e(angular.element(P))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>G.length-1&&!t&&(b=0),O||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=G.length-1),v(b,a)};var Q=!0;l.carouselIndex=0,r||(G=[],angular.forEach(p(),function(a,b){G.push({id:b})}));var R;if(void 0!==n.rnCarouselAutoSlide){var S=parseInt(n.rnCarouselAutoSlide,10)||I.autoSlideDuration;R=g(function(){O||D||l.nextSlide()},1e3*S)}if(n.rnCarouselIndex){var T=function(a){U.assign(l.$parent,a)},U=d(n.rnCarouselIndex);angular.isFunction(U.assign)?(l.$watch("carouselIndex",function(a){O||T(a)}),l.$parent.$watch(U,function(a){void 0!==a&&null!==a&&(G&&a>=G.length?(a=G.length-1,T(a)):G&&0>a&&(a=0,T(a)),O||v(a,{animate:!Q}),Q=!1)}),J=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!Q}),Q=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){O=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){G=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=I.bufferSize;var V=angular.element(b);V.bind("orientationchange",C),V.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),V.unbind("orientationchange",C),V.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){L=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,I.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===I.transitionType)return O=!1,K=-100*a,l.carouselIndex=a,void B();O=!0;var c=new j;c.tween({from:{x:K},to:{x:-100*a},duration:I.transitionDuration,easing:I.transitionEasing,step:function(a){u(a.x)},finish:function(){O=!1,l.$apply(function(){l.carouselIndex=a,K=-100*a,B(),t&&-1===a&&(a=G.length-1,v(a,{animate:!1})),t&&a===G.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){M=w()}function y(a){return c.bind("mouseup",q),x(),N=m[0].querySelector("li").getBoundingClientRect().left,D=!0,E=a.x,!1}function z(a){if(!O){var b,c;if(D&&(b=a.x,c=E-b,c>2||-2>c)){L=!0;var d=K+100*-c/M;u(d)}return!1}}function A(a,b){if((!b||L)&&(c.unbind("mouseup",q),D=!1,L=!1,F=E-a.x,0!==F&&!O))if(K+=100*-F/M,I.isSequential){var d=I.moveTreshold*M,e=-F,f=-Math[e>=0?"ceil":"floor"](e/M),g=Math.abs(e)>d;G&&f+l.carouselIndex>=G.length&&!t&&(f=G.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;F=l.carouselIndex+h,v(F)}else l.$apply(function(){l.carouselIndex=parseInt(-K/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:G&&G.lengthG.length-l.carouselBufferSize?G.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(K)},0,!1)):f(function(){u(K)},0,!1)}function C(){x(),v()}k++,m[0].id="carousel"+k,t&&f(function(){var a=document.querySelectorAll("#"+m[0].id+"> li"),b=angular.element(a[0]).clone(),c=angular.element(a[a.length-1]).clone();m.prepend(c),m.append(b)}),l.loop=t;var D,E,F,G,H={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},I=angular.extend({},H),J=!1,K=0,L=!1,M=null,N=null,O=!1;if(void 0!==n.rnCarouselControls){var P='';m.append(e(angular.element(P))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>G.length-1&&!t&&(b=0),O||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=G.length-1),v(b,a)};var Q=!0;l.carouselIndex=0,r||(G=[],angular.forEach(p(),function(a,b){G.push({id:b})}));var R;if(void 0!==n.rnCarouselAutoSlide){var S=parseInt(n.rnCarouselAutoSlide,10)||I.autoSlideDuration;R=g(function(){O||D||l.nextSlide()},1e3*S)}if(n.rnCarouselIndex){var T=function(a){U.assign(l.$parent,a)},U=d(n.rnCarouselIndex);angular.isFunction(U.assign)?(l.$watch("carouselIndex",function(a){O||T(a)}),l.$parent.$watch(U,function(a){void 0!==a&&null!==a&&(G&&a>=G.length?(a=G.length-1,T(a)):G&&0>a&&(a=0,T(a)),O||v(a,{animate:!Q}),Q=!1)}),J=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!Q}),Q=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){O=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){G=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=I.bufferSize;var V=angular.element(b);V.bind("orientationchange",C),V.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),V.unbind("orientationchange",C),V.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 1361627..d066ea3 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -168,11 +168,14 @@ return function(scope, iElement, iAttributes, containerCtrl) { + carouselId++; + + iElement[0].id = 'carousel' + carouselId; + // add virtual slides for looping - // need to fix this if (loop){ $timeout(function(){ - var children = iElement[0].querySelectorAll('li'); + var children = document.querySelectorAll('#' + iElement[0].id + '> li'); var firstCopy = angular.element(children[0]).clone(); var lastCopy = angular.element(children[children.length-1]).clone(); iElement.prepend(lastCopy); @@ -183,8 +186,6 @@ //for displaying carousel controls scope.loop = loop; - carouselId++; - var defaultOptions = { transitionType: iAttributes.rnCarouselTransition || 'slide', transitionEasing: 'easeTo', From db7fcfe452f750b34fabb59377a3a003b0195245 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Tue, 28 Oct 2014 18:09:16 -0700 Subject: [PATCH 07/23] eliminate browser flicker --- dist/angular-carousel.js | 40 +++++++++++++++++++++++++++++++++-- dist/angular-carousel.min.js | 2 +- src/directives/rn-carousel.js | 40 +++++++++++++++++++++++++++++++++-- 3 files changed, 77 insertions(+), 5 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 24b16fb..1e63ecc 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -213,6 +213,19 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach }; }) + .directive('signalRepeatDone', function(){ + return { + restrict: 'A', + link: function(scope, element, attrs){ + if (scope.$first || scope.$last){ + scope.$emit('repeatReady', element); + } + + } + }; + + }) + .directive('rnCarousel', ['$swipe', '$window', '$document', '$parse', '$compile', '$timeout', '$interval', 'computeCarouselSlideStyle', 'createStyleString', 'Tweenable', function($swipe, $window, $document, $parse, $compile, $timeout, $interval, computeCarouselSlideStyle, createStyleString, Tweenable) { // internal ids to allow multiple instances @@ -260,6 +273,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach } } isRepeatBased = true; + angular.element(firstChild).attr('signal-repeat-done', ''); return false; } } @@ -274,13 +288,32 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach // add virtual slides for looping if (loop){ - $timeout(function(){ + if (!isRepeatBased){ var children = document.querySelectorAll('#' + iElement[0].id + '> li'); var firstCopy = angular.element(children[0]).clone(); var lastCopy = angular.element(children[children.length-1]).clone(); iElement.prepend(lastCopy); iElement.append(firstCopy); - }); + + } else { + // this eliminates flicker caused by using $timeout + var deregister = scope.$on('repeatReady', function(event, element){ + console.log(element, 'before'); + scope.$evalAsync(function(){ + console.log(element, 'after'); + var copy = element.clone(); + if (event.targetScope.$index){ + iElement.prepend(copy); + } else if (!event.targetScope.$index){ + iElement.append(copy); + } + event.stopPropagation(); + if (event.targetScope.$last){ + deregister(); + } + }); + }); + } } //for displaying carousel controls @@ -474,6 +507,9 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach angular.forEach(getSlidesDOM(), function(node, index) { currentSlides.push({id: index}); }); + if (loop) { + currentSlides.length -= 2; + } } var autoSlider; diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 24bf260..7b2b1af 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){L=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,I.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===I.transitionType)return O=!1,K=-100*a,l.carouselIndex=a,void B();O=!0;var c=new j;c.tween({from:{x:K},to:{x:-100*a},duration:I.transitionDuration,easing:I.transitionEasing,step:function(a){u(a.x)},finish:function(){O=!1,l.$apply(function(){l.carouselIndex=a,K=-100*a,B(),t&&-1===a&&(a=G.length-1,v(a,{animate:!1})),t&&a===G.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){M=w()}function y(a){return c.bind("mouseup",q),x(),N=m[0].querySelector("li").getBoundingClientRect().left,D=!0,E=a.x,!1}function z(a){if(!O){var b,c;if(D&&(b=a.x,c=E-b,c>2||-2>c)){L=!0;var d=K+100*-c/M;u(d)}return!1}}function A(a,b){if((!b||L)&&(c.unbind("mouseup",q),D=!1,L=!1,F=E-a.x,0!==F&&!O))if(K+=100*-F/M,I.isSequential){var d=I.moveTreshold*M,e=-F,f=-Math[e>=0?"ceil":"floor"](e/M),g=Math.abs(e)>d;G&&f+l.carouselIndex>=G.length&&!t&&(f=G.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;F=l.carouselIndex+h,v(F)}else l.$apply(function(){l.carouselIndex=parseInt(-K/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:G&&G.lengthG.length-l.carouselBufferSize?G.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(K)},0,!1)):f(function(){u(K)},0,!1)}function C(){x(),v()}k++,m[0].id="carousel"+k,t&&f(function(){var a=document.querySelectorAll("#"+m[0].id+"> li"),b=angular.element(a[0]).clone(),c=angular.element(a[a.length-1]).clone();m.prepend(c),m.append(b)}),l.loop=t;var D,E,F,G,H={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},I=angular.extend({},H),J=!1,K=0,L=!1,M=null,N=null,O=!1;if(void 0!==n.rnCarouselControls){var P='';m.append(e(angular.element(P))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>G.length-1&&!t&&(b=0),O||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=G.length-1),v(b,a)};var Q=!0;l.carouselIndex=0,r||(G=[],angular.forEach(p(),function(a,b){G.push({id:b})}));var R;if(void 0!==n.rnCarouselAutoSlide){var S=parseInt(n.rnCarouselAutoSlide,10)||I.autoSlideDuration;R=g(function(){O||D||l.nextSlide()},1e3*S)}if(n.rnCarouselIndex){var T=function(a){U.assign(l.$parent,a)},U=d(n.rnCarouselIndex);angular.isFunction(U.assign)?(l.$watch("carouselIndex",function(a){O||T(a)}),l.$parent.$watch(U,function(a){void 0!==a&&null!==a&&(G&&a>=G.length?(a=G.length-1,T(a)):G&&0>a&&(a=0,T(a)),O||v(a,{animate:!Q}),Q=!1)}),J=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!Q}),Q=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){O=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){G=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=I.bufferSize;var V=angular.element(b);V.bind("orientationchange",C),V.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),V.unbind("orientationchange",C),V.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("repeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){P=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void B();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){u(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,B(),t&&-1===a&&(a=K.length-1,v(a,{animate:!1})),t&&a===K.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){Q=w()}function y(a){return c.bind("mouseup",q),x(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function z(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;u(d)}return!1}}function A(a,b){if((!b||P)&&(c.unbind("mouseup",q),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,v(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(O)},0,!1)):f(function(){u(O)},0,!1)}function C(){x(),v()}if(k++,m[0].id="carousel"+k,t)if(r)var D=l.$on("repeatReady",function(a,b){console.log(b,"before"),l.$evalAsync(function(){console.log(b,"after");var c=b.clone();a.targetScope.$index?m.prepend(c):a.targetScope.$index||m.append(c),a.stopPropagation(),a.targetScope.$last&&D()})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),v(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(p(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||v(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",C),Z.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Z.unbind("orientationchange",C),Z.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index d066ea3..568a622 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -113,6 +113,19 @@ }; }) + .directive('signalRepeatDone', function(){ + return { + restrict: 'A', + link: function(scope, element, attrs){ + if (scope.$first || scope.$last){ + scope.$emit('repeatReady', element); + } + + } + }; + + }) + .directive('rnCarousel', ['$swipe', '$window', '$document', '$parse', '$compile', '$timeout', '$interval', 'computeCarouselSlideStyle', 'createStyleString', 'Tweenable', function($swipe, $window, $document, $parse, $compile, $timeout, $interval, computeCarouselSlideStyle, createStyleString, Tweenable) { // internal ids to allow multiple instances @@ -160,6 +173,7 @@ } } isRepeatBased = true; + angular.element(firstChild).attr('signal-repeat-done', ''); return false; } } @@ -174,13 +188,32 @@ // add virtual slides for looping if (loop){ - $timeout(function(){ + if (!isRepeatBased){ var children = document.querySelectorAll('#' + iElement[0].id + '> li'); var firstCopy = angular.element(children[0]).clone(); var lastCopy = angular.element(children[children.length-1]).clone(); iElement.prepend(lastCopy); iElement.append(firstCopy); - }); + + } else { + // this eliminates flicker caused by using $timeout + var deregister = scope.$on('repeatReady', function(event, element){ + console.log(element, 'before'); + scope.$evalAsync(function(){ + console.log(element, 'after'); + var copy = element.clone(); + if (event.targetScope.$index){ + iElement.prepend(copy); + } else if (!event.targetScope.$index){ + iElement.append(copy); + } + event.stopPropagation(); + if (event.targetScope.$last){ + deregister(); + } + }); + }); + } } //for displaying carousel controls @@ -374,6 +407,9 @@ angular.forEach(getSlidesDOM(), function(node, index) { currentSlides.push({id: index}); }); + if (loop) { + currentSlides.length -= 2; + } } var autoSlider; From 70c02e09dd253824538d808b1d59553aa3d99501 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Tue, 28 Oct 2014 23:21:11 -0700 Subject: [PATCH 08/23] only add signalling directive to children if looping is active --- dist/angular-carousel.js | 2 +- dist/angular-carousel.min.js | 2 +- src/directives/rn-carousel.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 1e63ecc..d8d6e22 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -273,7 +273,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach } } isRepeatBased = true; - angular.element(firstChild).attr('signal-repeat-done', ''); + if (loop) angular.element(firstChild).attr('signal-repeat-done', ''); return false; } } diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 7b2b1af..5c32c7a 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("repeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){P=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void B();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){u(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,B(),t&&-1===a&&(a=K.length-1,v(a,{animate:!1})),t&&a===K.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){Q=w()}function y(a){return c.bind("mouseup",q),x(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function z(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;u(d)}return!1}}function A(a,b){if((!b||P)&&(c.unbind("mouseup",q),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,v(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(O)},0,!1)):f(function(){u(O)},0,!1)}function C(){x(),v()}if(k++,m[0].id="carousel"+k,t)if(r)var D=l.$on("repeatReady",function(a,b){console.log(b,"before"),l.$evalAsync(function(){console.log(b,"after");var c=b.clone();a.targetScope.$index?m.prepend(c):a.targetScope.$index||m.append(c),a.stopPropagation(),a.targetScope.$last&&D()})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),v(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(p(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||v(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",C),Z.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Z.unbind("orientationchange",C),Z.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("repeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){P=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void B();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){u(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,B(),t&&-1===a&&(a=K.length-1,v(a,{animate:!1})),t&&a===K.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){Q=w()}function y(a){return c.bind("mouseup",q),x(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function z(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;u(d)}return!1}}function A(a,b){if((!b||P)&&(c.unbind("mouseup",q),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,v(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(O)},0,!1)):f(function(){u(O)},0,!1)}function C(){x(),v()}if(k++,m[0].id="carousel"+k,t)if(r)var D=l.$on("repeatReady",function(a,b){console.log(b,"before"),l.$evalAsync(function(){console.log(b,"after");var c=b.clone();a.targetScope.$index?m.prepend(c):a.targetScope.$index||m.append(c),a.stopPropagation(),a.targetScope.$last&&D()})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),v(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(p(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||v(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",C),Z.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Z.unbind("orientationchange",C),Z.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 568a622..6aaf88e 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -173,7 +173,7 @@ } } isRepeatBased = true; - angular.element(firstChild).attr('signal-repeat-done', ''); + if (loop) angular.element(firstChild).attr('signal-repeat-done', ''); return false; } } From 1b1f036a125ba1ad256aeecd9232b0cdd099c2ae Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Tue, 28 Oct 2014 23:22:07 -0700 Subject: [PATCH 09/23] namespace the emitted event --- dist/angular-carousel.js | 6 ++---- dist/angular-carousel.min.js | 2 +- src/directives/rn-carousel.js | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index d8d6e22..eaf86f7 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -218,7 +218,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach restrict: 'A', link: function(scope, element, attrs){ if (scope.$first || scope.$last){ - scope.$emit('repeatReady', element); + scope.$emit('rn-repeatReady', element); } } @@ -297,10 +297,8 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach } else { // this eliminates flicker caused by using $timeout - var deregister = scope.$on('repeatReady', function(event, element){ - console.log(element, 'before'); + var deregister = scope.$on('rn-repeatReady', function(event, element){ scope.$evalAsync(function(){ - console.log(element, 'after'); var copy = element.clone(); if (event.targetScope.$index){ iElement.prepend(copy); diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 5c32c7a..42185dd 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("repeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){P=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void B();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){u(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,B(),t&&-1===a&&(a=K.length-1,v(a,{animate:!1})),t&&a===K.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){Q=w()}function y(a){return c.bind("mouseup",q),x(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function z(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;u(d)}return!1}}function A(a,b){if((!b||P)&&(c.unbind("mouseup",q),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,v(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(O)},0,!1)):f(function(){u(O)},0,!1)}function C(){x(),v()}if(k++,m[0].id="carousel"+k,t)if(r)var D=l.$on("repeatReady",function(a,b){console.log(b,"before"),l.$evalAsync(function(){console.log(b,"after");var c=b.clone();a.targetScope.$index?m.prepend(c):a.targetScope.$index||m.append(c),a.stopPropagation(),a.targetScope.$last&&D()})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),v(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(p(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||v(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",C),Z.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Z.unbind("orientationchange",C),Z.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rn-repeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){P=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void B();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){u(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,B(),t&&-1===a&&(a=K.length-1,v(a,{animate:!1})),t&&a===K.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){Q=w()}function y(a){return c.bind("mouseup",q),x(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function z(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;u(d)}return!1}}function A(a,b){if((!b||P)&&(c.unbind("mouseup",q),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,v(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(O)},0,!1)):f(function(){u(O)},0,!1)}function C(){x(),v()}if(k++,m[0].id="carousel"+k,t)if(r)var D=l.$on("rn-repeatReady",function(a,b){l.$evalAsync(function(){var c=b.clone();a.targetScope.$index?m.prepend(c):a.targetScope.$index||m.append(c),a.stopPropagation(),a.targetScope.$last&&D()})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),v(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(p(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||v(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",C),Z.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Z.unbind("orientationchange",C),Z.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 6aaf88e..55bdaa9 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -118,7 +118,7 @@ restrict: 'A', link: function(scope, element, attrs){ if (scope.$first || scope.$last){ - scope.$emit('repeatReady', element); + scope.$emit('rn-repeatReady', element); } } @@ -197,10 +197,8 @@ } else { // this eliminates flicker caused by using $timeout - var deregister = scope.$on('repeatReady', function(event, element){ - console.log(element, 'before'); + var deregister = scope.$on('rn-repeatReady', function(event, element){ scope.$evalAsync(function(){ - console.log(element, 'after'); var copy = element.clone(); if (event.targetScope.$index){ iElement.prepend(copy); From 020b7747861750e2e91b97c6141404c8438c3dab Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Tue, 28 Oct 2014 23:35:35 -0700 Subject: [PATCH 10/23] uncomment other demos --- dist/angular-carousel.js | 1 + index.html | 208 +++++++++++++++++----------------- src/directives/rn-carousel.js | 2 + 3 files changed, 107 insertions(+), 104 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index eaf86f7..f99e0cd 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -578,6 +578,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach if (isRepeatBased) { scope.$watchCollection(repeatCollection, function(newValue, oldValue) { + // TODO: add looping support to update virtual slides //console.log('repeatCollection', arguments); currentSlides = newValue; goToSlide(scope.carouselIndex); diff --git a/index.html b/index.html index 7eb85a7..e45a55e 100644 --- a/index.html +++ b/index.html @@ -19,94 +19,94 @@

AngularJS Touch Carousel

Swipe these demos with your mouse or finger - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
+

Buffered ngRepeat demo

+
A simple buffered ng-repeat with a custom template. +
+ Swipe 50 slides with only 5 slides in the DOM. use builtin controls +
+ +
+
+

buffered ngRepeat with auto-slide and builtin indicators

+
+
+ +
+
+
+

buffered ngRepeat and custom indicators

+
+
+ +
+
+
+

buffered ngRepeat with custom transition

+
Use the 'hexagon' transition. index is shared with the carousel below. +
+ +
+
+
+

Custom templates without ng-repeat and auto-slide

+
+
+ +
+
+

Custom templates with looping

@@ -131,7 +131,7 @@

Looping with ng-repeat and autoscroll looping


- - - - - - - - - - - - - - - +
+

Lockable carousel

+
+
+ +
diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 55bdaa9..2a9c0a5 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -478,6 +478,8 @@ if (isRepeatBased) { scope.$watchCollection(repeatCollection, function(newValue, oldValue) { + // TODO: add looping support to update virtual slides + //console.log('repeatCollection', arguments); currentSlides = newValue; goToSlide(scope.carouselIndex); From 59ef8b1398d5ed6c165c939652a107b0e53070c2 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Tue, 28 Oct 2014 23:49:29 -0700 Subject: [PATCH 11/23] update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 751c21b..0300e47 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ angular.module('MyApp', ['angular-carousel']); - `rn-carousel-auto-slide` add this attribute to make the carousel slide automatically after given seconds (default=3) - `rn-carousel-transition` : transition type, can be one of `slide, zoom, hexagon, slideAndFade, none`. (default=slide) - `rn-carousel-locked`: two way binding boolean that lock/unlock the carousel + - `rn-carousel-loop` : make the carousel loop around from the first element to the last and vice versa. Note that this feature will be disabled if `rn-carousel-buffered` is also declared. ## Indicators From 2806047458c98746dec0faae293a67f9eabfb685 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Wed, 29 Oct 2014 04:46:36 -0700 Subject: [PATCH 12/23] add tests --- dist/angular-carousel.js | 3 +- dist/angular-carousel.min.js | 2 +- package.json | 3 +- test/unit/angular-carousel.js | 66 +++++++++++++++++++++++++++++++++-- 4 files changed, 68 insertions(+), 6 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index f99e0cd..facbde3 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -1,6 +1,6 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-10-28 + * @version v0.3.5 - 2014-10-29 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT @@ -579,6 +579,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach if (isRepeatBased) { scope.$watchCollection(repeatCollection, function(newValue, oldValue) { // TODO: add looping support to update virtual slides + //console.log('repeatCollection', arguments); currentSlides = newValue; goToSlide(scope.carouselIndex); diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 42185dd..c7d34f0 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -1,6 +1,6 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-10-28 + * @version v0.3.5 - 2014-10-29 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT diff --git a/package.json b/package.json index 8752676..27d9a3d 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,8 @@ "karma-requirejs": "~0.2.1", "karma-script-launcher": "~0.1.0", "load-grunt-tasks": "~0.3.0", - "requirejs": "~2.1.11" + "requirejs": "~2.1.11", + "karma-coverage": "~0.2.6" }, "scripts": { "test": "karma start test/karma.conf.js --single-run --browsers Chrome", diff --git a/test/unit/angular-carousel.js b/test/unit/angular-carousel.js index faea0e9..b4c6a8c 100755 --- a/test/unit/angular-carousel.js +++ b/test/unit/angular-carousel.js @@ -61,6 +61,7 @@ describe('carousel', function () { if (options.useBuffer) tpl += ' rn-carousel-buffered '; if (options.useWatch) tpl += ' rn-carousel-watch '; if (options.useIndex) tpl += ' rn-carousel-index="' + options.useIndex + '" '; + if (options.useLoop) tpl += ' rn-carousel-loop'; tpl += '>
  • {{ item.text }}
  • '; angular.extend(scope, sampleData.scope); // var $element = $(tpl).appendTo($sandbox); @@ -80,10 +81,69 @@ describe('carousel', function () { curMatrix = getElmTransform(elm); expect(curMatrix).toBe(expectedMatrix); } + it('should load test', function() { + expect(1).toBe(1); + }); + + + describe('looping', function () { + it('should have attribute rn-carousel-looping', function(){ + var tpl = compileTpl({useLoop: true}); + expect(tpl.attr('rn-carousel-loop')).toBeDefined(); + }); + + it('should have appended two virtual slides to the dom', function(){ + var nbItems = 25; + var tpl = compileTpl({useLoop: true, nbItems: nbItems}); + var children = tpl.find('li'); + expect(children.length).toBe(nbItems + 2); + }); + + it('should place virtual slides at proper indices, -1 and items.length', function(){ + var nbItems = 25; + var tpl = compileTpl({useLoop: true, nbItems: nbItems}); + var virtualCopy1 = tpl.find('li')[0]; // this is scope indice -1, the virtual slide + var actualSlide1 = tpl.find('li')[nbItems]; //offset because of virtual slides + var actualSlide2 = tpl.find('li')[1]; // this is real first slide + var virtualCopy2 = tpl.find('li')[nbItems + 1]; + expect(virtualCopy1.id) + .toEqual(actualSlide1.id); + expect(virtualCopy2.id) + .toEqual(actualSlide2.id); + }); + + it('should instantaneously scroll to real slide when at virtual slide', function(){ + var tpl = compileTpl({useLoop: true}); + runs(function () { + tpl.scope().prevSlide(); + scope.$digest(); + }); + waits(500); //this is time for initial animation to virtual slide + runs(function(){ + expect(tpl.scope().carouselIndex).toEqual(scope.items.length - 1); + }); + runs(function(){ + expect(tpl.scope().carouselIndex).toEqual(scope.items.length - 1); + tpl.scope().nextSlide(); + scope.$digest(); + }); + waits(500); + runs(function(){ + expect(tpl.scope().carouselIndex).toBe(0); + }); + }); + + it('should cancel itself if buffering is used', function(){ + var tpl = compileTpl({useLoop: true, useBuffer: true}); + var children = tpl.find('li'); + expect(tpl.scope().loop).toBe(false); + }); + + + + }); /* - it('should load test', function() { - expect(1).toBe(1); - }); + describe('directive', function () { it('should add a wrapper div around the ul/li', function () { From 26f010048de0356559f3fd6eed48ee19e00adc10 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Wed, 29 Oct 2014 05:45:54 -0700 Subject: [PATCH 13/23] fixed tabs as spaces emacs madness --- dist/angular-carousel.js | 29 +- dist/angular-carousel.min.js | 2 +- index.html | 2 +- src/directives/rn-carousel.js | 29 +- test/unit/angular-carousel.js | 1158 +++++++++++++++++---------------- 5 files changed, 613 insertions(+), 607 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index facbde3..c6a0b24 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -218,7 +218,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach restrict: 'A', link: function(scope, element, attrs){ if (scope.$first || scope.$last){ - scope.$emit('rn-repeatReady', element); + scope.$emit('rnRepeatReady', element); } } @@ -285,7 +285,15 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach carouselId++; iElement[0].id = 'carousel' + carouselId; - + function addVirtualClone (event, element){ + var copy = element.clone(); + if (event.targetScope.$last){ + iElement.prepend(copy); + } else if (event.targetScope.$first){ + iElement.append(copy); + } + event.stopPropagation(); + } // add virtual slides for looping if (loop){ if (!isRepeatBased){ @@ -297,18 +305,9 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach } else { // this eliminates flicker caused by using $timeout - var deregister = scope.$on('rn-repeatReady', function(event, element){ + var deregister = scope.$on('rnRepeatReady', function(event, element){ scope.$evalAsync(function(){ - var copy = element.clone(); - if (event.targetScope.$index){ - iElement.prepend(copy); - } else if (!event.targetScope.$index){ - iElement.append(copy); - } - event.stopPropagation(); - if (event.targetScope.$last){ - deregister(); - } + addVirtualClone(event, element); }); }); } @@ -380,7 +379,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach function updateSlidesPosition(offset) { // manually apply transformation to carousel childrens - // todo : optim : apply only to visible items + // todo : optim : apply only to visible items var x = scope.carouselBufferIndex * 100 + offset; if (loop) { x -= 100; @@ -413,7 +412,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach if (index === undefined) { index = scope.carouselIndex; } - + slideOptions = slideOptions || {}; if (slideOptions.animate === false || options.transitionType === 'none') { locked = false; diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index c7d34f0..a273f07 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n
    ')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rn-repeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function q(a){P=!0,A({x:a.clientX,y:a.clientY},a)}function u(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(p(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function v(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void B();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){u(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,B(),t&&-1===a&&(a=K.length-1,v(a,{animate:!1})),t&&a===K.length&&(a=0,v(a,{animate:!1}))})}})}function w(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function x(){Q=w()}function y(a){return c.bind("mouseup",q),x(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function z(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;u(d)}return!1}}function A(a,b){if((!b||P)&&(c.unbind("mouseup",q),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,v(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),B()})}function B(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){u(O)},0,!1)):f(function(){u(O)},0,!1)}function C(){x(),v()}if(k++,m[0].id="carousel"+k,t)if(r)var D=l.$on("rn-repeatReady",function(a,b){l.$evalAsync(function(){var c=b.clone();a.targetScope.$index?m.prepend(c):a.targetScope.$index||m.append(c),a.stopPropagation(),a.targetScope.$last&&D()})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:y,move:z,end:A,cancel:function(a){A({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||v(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),v(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(p(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||v(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||v(parseInt(n.rnCarouselIndex,10),{animate:!1})}else v(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,v(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",q)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",C),Z.bind("resize",C),l.$on("$destroy",function(){c.unbind("mouseup",q),Z.unbind("orientationchange",C),Z.unbind("resize",C)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c=b.clone();a.targetScope.$last?m.prepend(c):a.targetScope.$first&&m.append(c),a.stopPropagation()}function q(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function u(a){P=!0,B({x:a.clientX,y:a.clientY},a)}function v(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(q(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function w(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void C();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){v(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,C(),t&&-1===a&&(a=K.length-1,w(a,{animate:!1})),t&&a===K.length&&(a=0,w(a,{animate:!1}))})}})}function x(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function y(){Q=x()}function z(a){return c.bind("mouseup",u),y(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function A(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;v(d)}return!1}}function B(a,b){if((!b||P)&&(c.unbind("mouseup",u),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,w(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),C()})}function C(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){v(O)},0,!1)):f(function(){v(O)},0,!1)}function D(){y(),w()}if(k++,m[0].id="carousel"+k,t)if(r){l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){p(a,b)})})}else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:z,move:A,end:B,cancel:function(a){B({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||w(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),w(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(q(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||w(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||w(parseInt(n.rnCarouselIndex,10),{animate:!1})}else w(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,w(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",u)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",D),Z.bind("resize",D),l.$on("$destroy",function(){c.unbind("mouseup",u),Z.unbind("orientationchange",D),Z.unbind("resize",D)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/index.html b/index.html index e45a55e..dd819eb 100644 --- a/index.html +++ b/index.html @@ -131,7 +131,7 @@

    Looping with ng-repeat and autoscroll looping

    ')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c=b.clone();a.targetScope.$last?m.prepend(c):a.targetScope.$first&&m.append(c),a.stopPropagation()}function q(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function u(a){P=!0,B({x:a.clientX,y:a.clientY},a)}function v(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(q(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function w(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void C();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){v(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,C(),t&&-1===a&&(a=K.length-1,w(a,{animate:!1})),t&&a===K.length&&(a=0,w(a,{animate:!1}))})}})}function x(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function y(){Q=x()}function z(a){return c.bind("mouseup",u),y(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function A(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;v(d)}return!1}}function B(a,b){if((!b||P)&&(c.unbind("mouseup",u),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,w(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),C()})}function C(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){v(O)},0,!1)):f(function(){v(O)},0,!1)}function D(){y(),w()}if(k++,m[0].id="carousel"+k,t)if(r){l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){p(a,b)})})}else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:z,move:A,end:B,cancel:function(a){B({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||w(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),w(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(q(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||w(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||w(parseInt(n.rnCarouselIndex,10),{animate:!1})}else w(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,w(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",u)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",D),Z.bind("resize",D),l.$on("$destroy",function(){c.unbind("mouseup",u),Z.unbind("orientationchange",D),Z.unbind("resize",D)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c=b.clone();a.targetScope.$last?(c.addClass("rn-carousel-virtual-slide-head"),m.prepend(c)):a.targetScope.$first&&(c.addClass("rn-carousel-virtual-slide-tail"),m.append(c)),a.stopPropagation()}function q(a){var b=a.targetScope.$last?!0:!1;if(b)var c=document.querySelectorAll("#"+m[0].id+" li.rn-carousel-virtual-slide-head");else var c=document.querySelectorAll("#"+m[0].id+" li.rn-carousel-virtual-slide-tail");angular.element(c).remove()}function u(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function v(a){Q=!0,C({x:a.clientX,y:a.clientY},a)}function w(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(u(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function x(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void D();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){w(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,D(),t&&-1===a&&(a=L.length-1,x(a,{animate:!1})),t&&a===L.length&&(a=0,x(a,{animate:!1}))})}})}function y(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function z(){R=y()}function A(a){return c.bind("mouseup",v),z(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function B(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;w(d)}return!1}}function C(a,b){if((!b||Q)&&(c.unbind("mouseup",v),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,x(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),D()})}function D(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){w(P)},0,!1)):f(function(){w(P)},0,!1)}function E(){z(),x()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){q(a),p(a,b)})});else{var F=document.querySelectorAll("#"+m[0].id+"> li"),G=angular.element(F[0]).clone(),H=angular.element(F[F.length-1]).clone();m.prepend(H),m.append(G)}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:A,move:B,end:C,cancel:function(a){C({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||x(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),x(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(u(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||x(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||x(parseInt(n.rnCarouselIndex,10),{animate:!1})}else x(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,x(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",v)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",E),$.bind("resize",E),l.$on("$destroy",function(){c.unbind("mouseup",v),$.unbind("orientationchange",E),$.unbind("resize",E)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index a8eb27f..7cbea1d 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -120,7 +120,6 @@ if (scope.$first || scope.$last){ scope.$emit('rnRepeatReady', element); } - } }; @@ -188,12 +187,27 @@ function addVirtualClone (event, element){ var copy = element.clone(); if (event.targetScope.$last){ + // for identification during removal + // it's the virtual slide at front of list + copy.addClass('rn-carousel-virtual-slide-head'); iElement.prepend(copy); } else if (event.targetScope.$first){ + copy.addClass('rn-carousel-virtual-slide-tail'); iElement.append(copy); } event.stopPropagation(); } + function removeVirtualClone (event){ + //head true if we are removing front-most clone + var head = event.targetScope.$last ? true : false; + if (head){ + var eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' li.rn-carousel-virtual-slide-head'); + } else { + var eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' li.rn-carousel-virtual-slide-tail'); + } + angular.element(eleToRemove).remove(); + } + // add virtual slides for looping if (loop){ if (!isRepeatBased){ @@ -205,8 +219,9 @@ } else { // this eliminates flicker caused by using $timeout - var deregister = scope.$on('rnRepeatReady', function(event, element){ + scope.$on('rnRepeatReady', function(event, element){ scope.$evalAsync(function(){ + removeVirtualClone(event); addVirtualClone(event, element); }); }); @@ -478,7 +493,7 @@ if (isRepeatBased) { scope.$watchCollection(repeatCollection, function(newValue, oldValue) { // TODO: add looping support to update virtual slides - + //console.log('repeatCollection', arguments); currentSlides = newValue; goToSlide(scope.carouselIndex); From 25286e15c6811931f76854a012fb13b1da9028f8 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Wed, 29 Oct 2014 08:03:29 -0700 Subject: [PATCH 15/23] dom manipulation on repeatCollection change is not working in the tests, and i dont have a way to check in the application demo --- dist/angular-carousel.js | 5 +++-- dist/angular-carousel.min.js | 2 +- index.html | 2 +- src/directives/rn-carousel.js | 5 +++-- test/unit/angular-carousel.js | 9 +++++++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 851a795..0917a9e 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -300,10 +300,11 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach function removeVirtualClone (event){ //head true if we are removing front-most clone var head = event.targetScope.$last ? true : false; + var eleToRemove; if (head){ - var eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' li.rn-carousel-virtual-slide-head'); + eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head'); } else { - var eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' li.rn-carousel-virtual-slide-tail'); + eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' .rn-carousel-virtual-slide-tail'); } angular.element(eleToRemove).remove(); } diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index bfcc8d9..0095722 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c=b.clone();a.targetScope.$last?(c.addClass("rn-carousel-virtual-slide-head"),m.prepend(c)):a.targetScope.$first&&(c.addClass("rn-carousel-virtual-slide-tail"),m.append(c)),a.stopPropagation()}function q(a){var b=a.targetScope.$last?!0:!1;if(b)var c=document.querySelectorAll("#"+m[0].id+" li.rn-carousel-virtual-slide-head");else var c=document.querySelectorAll("#"+m[0].id+" li.rn-carousel-virtual-slide-tail");angular.element(c).remove()}function u(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function v(a){Q=!0,C({x:a.clientX,y:a.clientY},a)}function w(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(u(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function x(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void D();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){w(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,D(),t&&-1===a&&(a=L.length-1,x(a,{animate:!1})),t&&a===L.length&&(a=0,x(a,{animate:!1}))})}})}function y(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function z(){R=y()}function A(a){return c.bind("mouseup",v),z(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function B(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;w(d)}return!1}}function C(a,b){if((!b||Q)&&(c.unbind("mouseup",v),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,x(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),D()})}function D(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){w(P)},0,!1)):f(function(){w(P)},0,!1)}function E(){z(),x()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){q(a),p(a,b)})});else{var F=document.querySelectorAll("#"+m[0].id+"> li"),G=angular.element(F[0]).clone(),H=angular.element(F[F.length-1]).clone();m.prepend(H),m.append(G)}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:A,move:B,end:C,cancel:function(a){C({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||x(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),x(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(u(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||x(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||x(parseInt(n.rnCarouselIndex,10),{animate:!1})}else x(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,x(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",v)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",E),$.bind("resize",E),l.$on("$destroy",function(){c.unbind("mouseup",v),$.unbind("orientationchange",E),$.unbind("resize",E)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c=b.clone();a.targetScope.$last?(c.addClass("rn-carousel-virtual-slide-head"),m.prepend(c)):a.targetScope.$first&&(c.addClass("rn-carousel-virtual-slide-tail"),m.append(c)),a.stopPropagation()}function q(a){var b,c=a.targetScope.$last?!0:!1;b=document.querySelectorAll(c?"#"+m[0].id+" .rn-carousel-virtual-slide-head":"#"+m[0].id+" .rn-carousel-virtual-slide-tail"),angular.element(b).remove()}function u(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function v(a){Q=!0,C({x:a.clientX,y:a.clientY},a)}function w(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(u(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function x(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void D();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){w(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,D(),t&&-1===a&&(a=L.length-1,x(a,{animate:!1})),t&&a===L.length&&(a=0,x(a,{animate:!1}))})}})}function y(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function z(){R=y()}function A(a){return c.bind("mouseup",v),z(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function B(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;w(d)}return!1}}function C(a,b){if((!b||Q)&&(c.unbind("mouseup",v),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,x(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),D()})}function D(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){w(P)},0,!1)):f(function(){w(P)},0,!1)}function E(){z(),x()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){q(a),p(a,b)})});else{var F=document.querySelectorAll("#"+m[0].id+"> li"),G=angular.element(F[0]).clone(),H=angular.element(F[F.length-1]).clone();m.prepend(H),m.append(G)}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:A,move:B,end:C,cancel:function(a){C({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||x(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),x(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(u(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||x(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||x(parseInt(n.rnCarouselIndex,10),{animate:!1})}else x(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,x(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",v)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",E),$.bind("resize",E),l.$on("$destroy",function(){c.unbind("mouseup",v),$.unbind("orientationchange",E),$.unbind("resize",E)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/index.html b/index.html index dd819eb..28662fa 100644 --- a/index.html +++ b/index.html @@ -131,7 +131,7 @@

    Looping with ng-repeat and autoscroll looping

    ')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){if(a.targetScope.$last){var c=b.clone();c.addClass("rn-carousel-virtual-slide-head"),m.prepend(c)}if(a.targetScope.$first){var c=b.clone();c.addClass("rn-carousel-virtual-slide-tail"),m.append(c)}a.stopPropagation()}function q(a){var b,c=a.targetScope.$last?!0:!1;b=document.querySelectorAll(c?"#"+m[0].id+" .rn-carousel-virtual-slide-head":"#"+m[0].id+" .rn-carousel-virtual-slide-tail"),angular.element(b).remove()}function u(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function v(a){Q=!0,C({x:a.clientX,y:a.clientY},a)}function w(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(u(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function x(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void D();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){w(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,D(),t&&-1===a&&(a=L.length-1,x(a,{animate:!1})),t&&a===L.length&&(a=0,x(a,{animate:!1}))})}})}function y(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function z(){R=y()}function A(a){return c.bind("mouseup",v),z(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function B(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;w(d)}return!1}}function C(a,b){if((!b||Q)&&(c.unbind("mouseup",v),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,x(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),D()})}function D(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){w(P)},0,!1)):f(function(){w(P)},0,!1)}function E(){z(),x()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){q(a),p(a,b)})});else{var F=document.querySelectorAll("#"+m[0].id+"> li"),G=angular.element(F[0]).clone(),H=angular.element(F[F.length-1]).clone();m.prepend(H),m.append(G)}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:A,move:B,end:C,cancel:function(a){C({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||x(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),x(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(u(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||x(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||x(parseInt(n.rnCarouselIndex,10),{animate:!1})}else x(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,x(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",v)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",E),$.bind("resize",E),l.$on("$destroy",function(){c.unbind("mouseup",v),$.unbind("orientationchange",E),$.unbind("resize",E)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file From b5a4e14b4a7034e514d29111fd5f47a4f5d44feb Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 3 Nov 2014 12:28:40 -0800 Subject: [PATCH 19/23] fix removing for case og for case of one element --- dist/angular-carousel.js | 15 ++++++++++----- dist/angular-carousel.min.js | 2 +- src/directives/rn-carousel.js | 15 ++++++++++----- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 431c203..0b9e161 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -285,15 +285,16 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach iElement[0].id = 'carousel' + carouselId; function addVirtualClone (event, element){ + var copy; if (event.targetScope.$last){ - var copy = element.clone(); + copy = element.clone(); // for identification during removal // it's the virtual slide at front of list copy.addClass('rn-carousel-virtual-slide-head'); iElement.prepend(copy); } if (event.targetScope.$first){ - var copy = element.clone(); + copy = element.clone(); copy.addClass('rn-carousel-virtual-slide-tail'); iElement.append(copy); } @@ -302,13 +303,17 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach function removeVirtualClone (event){ //head true if we are removing front-most clone var head = event.targetScope.$last ? true : false; + var tail = event.targetScope.$first ? true : false; var eleToRemove; if (head){ - eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head'); - } else { + eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head'); + angular.element(eleToRemove).remove(); + } + if (tail){ eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' .rn-carousel-virtual-slide-tail'); + angular.element(eleToRemove).remove(); } - angular.element(eleToRemove).remove(); + } // add virtual slides for looping diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index d6e403a..75673b0 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){if(a.targetScope.$last){var c=b.clone();c.addClass("rn-carousel-virtual-slide-head"),m.prepend(c)}if(a.targetScope.$first){var c=b.clone();c.addClass("rn-carousel-virtual-slide-tail"),m.append(c)}a.stopPropagation()}function q(a){var b,c=a.targetScope.$last?!0:!1;b=document.querySelectorAll(c?"#"+m[0].id+" .rn-carousel-virtual-slide-head":"#"+m[0].id+" .rn-carousel-virtual-slide-tail"),angular.element(b).remove()}function u(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function v(a){Q=!0,C({x:a.clientX,y:a.clientY},a)}function w(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(u(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function x(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void D();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){w(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,D(),t&&-1===a&&(a=L.length-1,x(a,{animate:!1})),t&&a===L.length&&(a=0,x(a,{animate:!1}))})}})}function y(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function z(){R=y()}function A(a){return c.bind("mouseup",v),z(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function B(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;w(d)}return!1}}function C(a,b){if((!b||Q)&&(c.unbind("mouseup",v),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,x(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),D()})}function D(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){w(P)},0,!1)):f(function(){w(P)},0,!1)}function E(){z(),x()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){q(a),p(a,b)})});else{var F=document.querySelectorAll("#"+m[0].id+"> li"),G=angular.element(F[0]).clone(),H=angular.element(F[F.length-1]).clone();m.prepend(H),m.append(G)}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:A,move:B,end:C,cancel:function(a){C({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||x(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),x(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(u(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||x(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||x(parseInt(n.rnCarouselIndex,10),{animate:!1})}else x(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,x(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",v)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",E),$.bind("resize",E),l.$on("$destroy",function(){c.unbind("mouseup",v),$.unbind("orientationchange",E),$.unbind("resize",E)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c;a.targetScope.$last&&(c=b.clone(),c.addClass("rn-carousel-virtual-slide-head"),m.prepend(c)),a.targetScope.$first&&(c=b.clone(),c.addClass("rn-carousel-virtual-slide-tail"),m.append(c)),a.stopPropagation()}function q(a){var b,c=a.targetScope.$last?!0:!1,d=a.targetScope.$first?!0:!1;c&&(b=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-head"),angular.element(b).remove()),d&&(b=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-tail"),angular.element(b).remove())}function u(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function v(a){Q=!0,C({x:a.clientX,y:a.clientY},a)}function w(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(u(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function x(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void D();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){w(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,D(),t&&-1===a&&(a=L.length-1,x(a,{animate:!1})),t&&a===L.length&&(a=0,x(a,{animate:!1}))})}})}function y(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function z(){R=y()}function A(a){return c.bind("mouseup",v),z(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function B(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;w(d)}return!1}}function C(a,b){if((!b||Q)&&(c.unbind("mouseup",v),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,x(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),D()})}function D(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){w(P)},0,!1)):f(function(){w(P)},0,!1)}function E(){z(),x()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){q(a),p(a,b)})});else{var F=document.querySelectorAll("#"+m[0].id+"> li"),G=angular.element(F[0]).clone(),H=angular.element(F[F.length-1]).clone();m.prepend(H),m.append(G)}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:A,move:B,end:C,cancel:function(a){C({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||x(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),x(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(u(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||x(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||x(parseInt(n.rnCarouselIndex,10),{animate:!1})}else x(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,x(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",v)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",E),$.bind("resize",E),l.$on("$destroy",function(){c.unbind("mouseup",v),$.unbind("orientationchange",E),$.unbind("resize",E)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index d0bfa01..7641b5b 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -185,15 +185,16 @@ iElement[0].id = 'carousel' + carouselId; function addVirtualClone (event, element){ + var copy; if (event.targetScope.$last){ - var copy = element.clone(); + copy = element.clone(); // for identification during removal // it's the virtual slide at front of list copy.addClass('rn-carousel-virtual-slide-head'); iElement.prepend(copy); } if (event.targetScope.$first){ - var copy = element.clone(); + copy = element.clone(); copy.addClass('rn-carousel-virtual-slide-tail'); iElement.append(copy); } @@ -202,13 +203,17 @@ function removeVirtualClone (event){ //head true if we are removing front-most clone var head = event.targetScope.$last ? true : false; + var tail = event.targetScope.$first ? true : false; var eleToRemove; if (head){ - eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head'); - } else { + eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head'); + angular.element(eleToRemove).remove(); + } + if (tail){ eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' .rn-carousel-virtual-slide-tail'); + angular.element(eleToRemove).remove(); } - angular.element(eleToRemove).remove(); + } // add virtual slides for looping From 7b96a36eba1cdaf475f73ae0e402d37dbecbe60c Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 3 Nov 2014 16:48:04 -0800 Subject: [PATCH 20/23] simplify DOM insertion/deletion --- dist/angular-carousel.js | 47 ++++++++++++++++------------------- dist/angular-carousel.min.js | 2 +- src/directives/rn-carousel.js | 47 ++++++++++++++++------------------- 3 files changed, 45 insertions(+), 51 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 0b9e161..01f958e 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -284,36 +284,34 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach carouselId++; iElement[0].id = 'carousel' + carouselId; - function addVirtualClone (event, element){ - var copy; - if (event.targetScope.$last){ - copy = element.clone(); - // for identification during removal - // it's the virtual slide at front of list - copy.addClass('rn-carousel-virtual-slide-head'); - iElement.prepend(copy); - } - if (event.targetScope.$first){ - copy = element.clone(); - copy.addClass('rn-carousel-virtual-slide-tail'); - iElement.append(copy); - } - event.stopPropagation(); - } - function removeVirtualClone (event){ + function produceVirtualSlides(event, element){ //head true if we are removing front-most clone var head = event.targetScope.$last ? true : false; var tail = event.targetScope.$first ? true : false; - var eleToRemove; + var eleToRemove, copy; if (head){ - eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head'); - angular.element(eleToRemove).remove(); + eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head')[0]; + copy = element.clone(); + copy.addClass('rn-carousel-virtual-slide-head'); + if (eleToRemove ) { + iElement[0].replaceChild(copy[0], eleToRemove); + } else { + iElement.prepend(copy); + } } if (tail){ - eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' .rn-carousel-virtual-slide-tail'); - angular.element(eleToRemove).remove(); + eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' .rn-carousel-virtual-slide-tail')[0]; + copy = element.clone(); + copy.addClass('rn-carousel-virtual-slide-tail'); + if (eleToRemove) { + iElement[0].replaceChild(copy[0], eleToRemove); + } else { + var controlsNode = + document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-controls'); + iElement[0].insertBefore(copy[0], controlsNode[0]); + } } - + event.stopPropagation(); } // add virtual slides for looping @@ -329,8 +327,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach // this eliminates flicker caused by using $timeout scope.$on('rnRepeatReady', function(event, element){ scope.$evalAsync(function(){ - removeVirtualClone(event); - addVirtualClone(event, element); + produceVirtualSlides(event, element); }); }); } diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 75673b0..bc34b9d 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c;a.targetScope.$last&&(c=b.clone(),c.addClass("rn-carousel-virtual-slide-head"),m.prepend(c)),a.targetScope.$first&&(c=b.clone(),c.addClass("rn-carousel-virtual-slide-tail"),m.append(c)),a.stopPropagation()}function q(a){var b,c=a.targetScope.$last?!0:!1,d=a.targetScope.$first?!0:!1;c&&(b=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-head"),angular.element(b).remove()),d&&(b=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-tail"),angular.element(b).remove())}function u(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function v(a){Q=!0,C({x:a.clientX,y:a.clientY},a)}function w(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(u(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function x(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void D();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){w(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,D(),t&&-1===a&&(a=L.length-1,x(a,{animate:!1})),t&&a===L.length&&(a=0,x(a,{animate:!1}))})}})}function y(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function z(){R=y()}function A(a){return c.bind("mouseup",v),z(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function B(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;w(d)}return!1}}function C(a,b){if((!b||Q)&&(c.unbind("mouseup",v),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,x(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),D()})}function D(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){w(P)},0,!1)):f(function(){w(P)},0,!1)}function E(){z(),x()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){q(a),p(a,b)})});else{var F=document.querySelectorAll("#"+m[0].id+"> li"),G=angular.element(F[0]).clone(),H=angular.element(F[F.length-1]).clone();m.prepend(H),m.append(G)}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:A,move:B,end:C,cancel:function(a){C({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||x(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),x(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(u(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||x(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||x(parseInt(n.rnCarouselIndex,10),{animate:!1})}else x(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,x(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",v)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",E),$.bind("resize",E),l.$on("$destroy",function(){c.unbind("mouseup",v),$.unbind("orientationchange",E),$.unbind("resize",E)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c,d,e=a.targetScope.$last?!0:!1,f=a.targetScope.$first?!0:!1;if(e&&(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-head")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-head"),c?m[0].replaceChild(d[0],c):m.prepend(d)),f)if(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-tail")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-tail"),c)m[0].replaceChild(d[0],c);else{var g=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(d[0],g[0])}a.stopPropagation()}function q(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function u(a){P=!0,B({x:a.clientX,y:a.clientY},a)}function v(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(q(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function w(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void C();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){v(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,C(),t&&-1===a&&(a=K.length-1,w(a,{animate:!1})),t&&a===K.length&&(a=0,w(a,{animate:!1}))})}})}function x(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function y(){Q=x()}function z(a){return c.bind("mouseup",u),y(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function A(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;v(d)}return!1}}function B(a,b){if((!b||P)&&(c.unbind("mouseup",u),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,w(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),C()})}function C(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){v(O)},0,!1)):f(function(){v(O)},0,!1)}function D(){y(),w()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){p(a,b)})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:z,move:A,end:B,cancel:function(a){B({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||w(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),w(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(q(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||w(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||w(parseInt(n.rnCarouselIndex,10),{animate:!1})}else w(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,w(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",u)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",D),Z.bind("resize",D),l.$on("$destroy",function(){c.unbind("mouseup",u),Z.unbind("orientationchange",D),Z.unbind("resize",D)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 7641b5b..3b95049 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -184,36 +184,34 @@ carouselId++; iElement[0].id = 'carousel' + carouselId; - function addVirtualClone (event, element){ - var copy; - if (event.targetScope.$last){ - copy = element.clone(); - // for identification during removal - // it's the virtual slide at front of list - copy.addClass('rn-carousel-virtual-slide-head'); - iElement.prepend(copy); - } - if (event.targetScope.$first){ - copy = element.clone(); - copy.addClass('rn-carousel-virtual-slide-tail'); - iElement.append(copy); - } - event.stopPropagation(); - } - function removeVirtualClone (event){ + function produceVirtualSlides(event, element){ //head true if we are removing front-most clone var head = event.targetScope.$last ? true : false; var tail = event.targetScope.$first ? true : false; - var eleToRemove; + var eleToRemove, copy; if (head){ - eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head'); - angular.element(eleToRemove).remove(); + eleToRemove = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-virtual-slide-head')[0]; + copy = element.clone(); + copy.addClass('rn-carousel-virtual-slide-head'); + if (eleToRemove ) { + iElement[0].replaceChild(copy[0], eleToRemove); + } else { + iElement.prepend(copy); + } } if (tail){ - eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' .rn-carousel-virtual-slide-tail'); - angular.element(eleToRemove).remove(); + eleToRemove = document.querySelectorAll('#'+ iElement[0].id + ' .rn-carousel-virtual-slide-tail')[0]; + copy = element.clone(); + copy.addClass('rn-carousel-virtual-slide-tail'); + if (eleToRemove) { + iElement[0].replaceChild(copy[0], eleToRemove); + } else { + var controlsNode = + document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-controls'); + iElement[0].insertBefore(copy[0], controlsNode[0]); + } } - + event.stopPropagation(); } // add virtual slides for looping @@ -229,8 +227,7 @@ // this eliminates flicker caused by using $timeout scope.$on('rnRepeatReady', function(event, element){ scope.$evalAsync(function(){ - removeVirtualClone(event); - addVirtualClone(event, element); + produceVirtualSlides(event, element); }); }); } From e44e41ce3c48703dce1bb151cbfabed263ec3fe5 Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Mon, 3 Nov 2014 16:53:59 -0800 Subject: [PATCH 21/23] make sure inserted virtual node doesnt end up on top of the controls --- dist/angular-carousel.js | 4 +++- dist/angular-carousel.min.js | 2 +- src/directives/rn-carousel.js | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 01f958e..0ffb2ab 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -321,7 +321,9 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach var firstCopy = angular.element(children[0]).clone(); var lastCopy = angular.element(children[children.length-1]).clone(); iElement.prepend(lastCopy); - iElement.append(firstCopy); + var controlsNode = + document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-controls'); + iElement[0].insertBefore(copy[0], controlsNode[0]); } else { // this eliminates flicker caused by using $timeout diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index bc34b9d..6da7cde 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -5,4 +5,4 @@ * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c,d,e=a.targetScope.$last?!0:!1,f=a.targetScope.$first?!0:!1;if(e&&(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-head")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-head"),c?m[0].replaceChild(d[0],c):m.prepend(d)),f)if(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-tail")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-tail"),c)m[0].replaceChild(d[0],c);else{var g=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(d[0],g[0])}a.stopPropagation()}function q(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function u(a){P=!0,B({x:a.clientX,y:a.clientY},a)}function v(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(q(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function w(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void C();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){v(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,C(),t&&-1===a&&(a=K.length-1,w(a,{animate:!1})),t&&a===K.length&&(a=0,w(a,{animate:!1}))})}})}function x(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function y(){Q=x()}function z(a){return c.bind("mouseup",u),y(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function A(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;v(d)}return!1}}function B(a,b){if((!b||P)&&(c.unbind("mouseup",u),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,w(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),C()})}function C(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){v(O)},0,!1)):f(function(){v(O)},0,!1)}function D(){y(),w()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){p(a,b)})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G),m.append(F)}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:z,move:A,end:B,cancel:function(a){B({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||w(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),w(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(q(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||w(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||w(parseInt(n.rnCarouselIndex,10),{animate:!1})}else w(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,w(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",u)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",D),Z.bind("resize",D),l.$on("$destroy",function(){c.unbind("mouseup",u),Z.unbind("orientationchange",D),Z.unbind("resize",D)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c,d,e=a.targetScope.$last?!0:!1,f=a.targetScope.$first?!0:!1;if(e&&(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-head")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-head"),c?m[0].replaceChild(d[0],c):m.prepend(d)),f)if(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-tail")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-tail"),c)m[0].replaceChild(d[0],c);else{var g=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(d[0],g[0])}a.stopPropagation()}function q(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function u(a){P=!0,B({x:a.clientX,y:a.clientY},a)}function v(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(q(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function w(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void C();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){v(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,C(),t&&-1===a&&(a=K.length-1,w(a,{animate:!1})),t&&a===K.length&&(a=0,w(a,{animate:!1}))})}})}function x(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function y(){Q=x()}function z(a){return c.bind("mouseup",u),y(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function A(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;v(d)}return!1}}function B(a,b){if((!b||P)&&(c.unbind("mouseup",u),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,w(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),C()})}function C(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){v(O)},0,!1)):f(function(){v(O)},0,!1)}function D(){y(),w()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){p(a,b)})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=(angular.element(E[0]).clone(),angular.element(E[E.length-1]).clone());m.prepend(F);var G=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(copy[0],G[0])}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:z,move:A,end:B,cancel:function(a){B({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||w(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),w(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(q(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||w(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||w(parseInt(n.rnCarouselIndex,10),{animate:!1})}else w(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,w(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",u)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",D),Z.bind("resize",D),l.$on("$destroy",function(){c.unbind("mouseup",u),Z.unbind("orientationchange",D),Z.unbind("resize",D)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 3b95049..16281f2 100755 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -221,7 +221,9 @@ var firstCopy = angular.element(children[0]).clone(); var lastCopy = angular.element(children[children.length-1]).clone(); iElement.prepend(lastCopy); - iElement.append(firstCopy); + var controlsNode = + document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-controls'); + iElement[0].insertBefore(copy[0], controlsNode[0]); } else { // this eliminates flicker caused by using $timeout From 9b6b968f458fc9de911e621a43c8a6b2964674ee Mon Sep 17 00:00:00 2001 From: dcjohnston Date: Sun, 9 Nov 2014 11:12:46 -0800 Subject: [PATCH 22/23] fix copy reference in non-ngrepeat element insertion --- dist/angular-carousel.js | 4 ++-- dist/angular-carousel.min.js | 4 ++-- index.html | 2 +- src/directives/rn-carousel.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/angular-carousel.js b/dist/angular-carousel.js index 0ffb2ab..745674b 100644 --- a/dist/angular-carousel.js +++ b/dist/angular-carousel.js @@ -1,6 +1,6 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-11-03 + * @version v0.3.5 - 2014-11-09 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT @@ -323,7 +323,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach iElement.prepend(lastCopy); var controlsNode = document.querySelectorAll('#' + iElement[0].id + ' .rn-carousel-controls'); - iElement[0].insertBefore(copy[0], controlsNode[0]); + iElement[0].insertBefore(firstCopy[0], controlsNode[0]); } else { // this eliminates flicker caused by using $timeout diff --git a/dist/angular-carousel.min.js b/dist/angular-carousel.min.js index 6da7cde..676842e 100644 --- a/dist/angular-carousel.min.js +++ b/dist/angular-carousel.min.js @@ -1,8 +1,8 @@ /** * Angular Carousel - Mobile friendly touch carousel for AngularJS - * @version v0.3.5 - 2014-11-03 + * @version v0.3.5 - 2014-11-09 * @link http://revolunet.github.com/angular-carousel * @author Julien Bouquillon * @license MIT License, http://www.opensource.org/licenses/MIT */ -angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c,d,e=a.targetScope.$last?!0:!1,f=a.targetScope.$first?!0:!1;if(e&&(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-head")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-head"),c?m[0].replaceChild(d[0],c):m.prepend(d)),f)if(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-tail")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-tail"),c)m[0].replaceChild(d[0],c);else{var g=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(d[0],g[0])}a.stopPropagation()}function q(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function u(a){P=!0,B({x:a.clientX,y:a.clientY},a)}function v(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(q(),function(a,c){a.style.cssText=i(h(c,b,M.transitionType))})}function w(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===M.transitionType)return S=!1,O=-100*a,l.carouselIndex=a,void C();S=!0;var c=new j;c.tween({from:{x:O},to:{x:-100*a},duration:M.transitionDuration,easing:M.transitionEasing,step:function(a){v(a.x)},finish:function(){S=!1,l.$apply(function(){l.carouselIndex=a,O=-100*a,C(),t&&-1===a&&(a=K.length-1,w(a,{animate:!1})),t&&a===K.length&&(a=0,w(a,{animate:!1}))})}})}function x(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function y(){Q=x()}function z(a){return c.bind("mouseup",u),y(),R=m[0].querySelector("li").getBoundingClientRect().left,H=!0,I=a.x,!1}function A(a){if(!S){var b,c;if(H&&(b=a.x,c=I-b,c>2||-2>c)){P=!0;var d=O+100*-c/Q;v(d)}return!1}}function B(a,b){if((!b||P)&&(c.unbind("mouseup",u),H=!1,P=!1,J=I-a.x,0!==J&&!S))if(O+=100*-J/Q,M.isSequential){var d=M.moveTreshold*Q,e=-J,f=-Math[e>=0?"ceil":"floor"](e/Q),g=Math.abs(e)>d;K&&f+l.carouselIndex>=K.length&&!t&&(f=K.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;J=l.carouselIndex+h,w(J)}else l.$apply(function(){l.carouselIndex=parseInt(-O/100,10),C()})}function C(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:K&&K.lengthK.length-l.carouselBufferSize?K.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){v(O)},0,!1)):f(function(){v(O)},0,!1)}function D(){y(),w()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){p(a,b)})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=(angular.element(E[0]).clone(),angular.element(E[E.length-1]).clone());m.prepend(F);var G=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(copy[0],G[0])}l.loop=t;var H,I,J,K,L={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},M=angular.extend({},L),N=!1,O=0,P=!1,Q=null,R=null,S=!1;if(void 0!==n.rnCarouselControls){var T='';m.append(e(angular.element(T))(l))}a.bind(m,{start:z,move:A,end:B,cancel:function(a){B({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>K.length-1&&!t&&(b=0),S||w(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=K.length-1),w(b,a)};var U=!0;l.carouselIndex=0,r||(K=[],angular.forEach(q(),function(a,b){K.push({id:b})}),t&&(K.length-=2));var V;if(void 0!==n.rnCarouselAutoSlide){var W=parseInt(n.rnCarouselAutoSlide,10)||M.autoSlideDuration;V=g(function(){S||H||l.nextSlide()},1e3*W)}if(n.rnCarouselIndex){var X=function(a){Y.assign(l.$parent,a)},Y=d(n.rnCarouselIndex);angular.isFunction(Y.assign)?(l.$watch("carouselIndex",function(a){S||X(a)}),l.$parent.$watch(Y,function(a){void 0!==a&&null!==a&&(K&&a>=K.length?(a=K.length-1,X(a)):K&&0>a&&(a=0,X(a)),S||w(a,{animate:!U}),U=!1)}),N=!0):isNaN(n.rnCarouselIndex)||w(parseInt(n.rnCarouselIndex,10),{animate:!1})}else w(0,{animate:!U}),U=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){S=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){K=a,w(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",u)}),l.carouselBufferIndex=0,l.carouselBufferSize=M.bufferSize;var Z=angular.element(b);Z.bind("orientationchange",D),Z.bind("resize",D),l.$on("$destroy",function(){c.unbind("mouseup",u),Z.unbind("orientationchange",D),Z.unbind("resize",D)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file +angular.module("angular-carousel",["ngTouch","angular-carousel.shifty"]),angular.module("angular-carousel").directive("rnCarouselAutoSlide",["$timeout",function(a){return{restrict:"A",link:function(b,c,d){var e=Math.round(1e3*parseFloat(d.rnCarouselAutoSlide)),f=increment=!1,g=c.children().length;b.carouselExposedIndex||(b.carouselExposedIndex=0),stopAutoplay=function(){angular.isDefined(f)&&a.cancel(f),f=void 0},increment=function(){b.carouselExposedIndex=b.carouselExposedIndex\n')}]),function(){"use strict";angular.module("angular-carousel").service("DeviceCapabilities",function(){function a(){var a="transform";return"undefined"!=typeof document.body.style[a]?["webkit","moz","o","ms"].every(function(b){var c="-"+b+"-transform";return"undefined"!=typeof document.body.style[c]?(a=c,!1):!0}):a=void 0,a}function b(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));return document.body.removeChild(b),void 0!==a&&a.length>0&&"none"!==a}return{has3d:b(),transformProperty:a()}}).service("computeCarouselSlideStyle",["DeviceCapabilities",function(a){return function(b,c,d){var e,f={display:"inline-block"},g=100*b+c,h=a.has3d?"translate3d("+g+"%, 0, 0)":"translate3d("+g+"%, 0)",i=(100-Math.abs(g))/100;if(a.transformProperty)if("fadeAndSlide"==d)f[a.transformProperty]=h,e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e;else if("hexagon"==d){var j=100,k=0,l=60*(i-1);j=-100*b>c?100:0,k=-100*b>c?l:-l,f[a.transformProperty]=h+" rotateY("+k+"deg)",f["transform-origin"]=j+"% 50%"}else if("zoom"==d){f[a.transformProperty]=h;var m=1;Math.abs(g)<100&&(m=1+2*(1-i)),f[a.transformProperty]+=" scale("+m+")",f["transform-origin"]="50% 50%",e=0,Math.abs(g)<100&&(e=.3+.7*i),f.opacity=e}else f[a.transformProperty]=h;else f["margin-left"]=g+"%";return f}}]).service("createStyleString",function(){return function(a){var b=[];return angular.forEach(a,function(a,c){b.push(c+":"+a)}),b.join(";")}}).directive("signalRepeatDone",function(){return{restrict:"A",link:function(a,b){(a.$first||a.$last)&&a.$emit("rnRepeatReady",b)}}}).directive("rnCarousel",["$swipe","$window","$document","$parse","$compile","$timeout","$interval","computeCarouselSlideStyle","createStyleString","Tweenable",function(a,b,c,d,e,f,g,h,i,j){{var k=0;b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame}return{restrict:"A",scope:!0,compile:function(l,m){var n,o,p=l[0].querySelector("li"),q=p?p.attributes:[],r=!1,s=!1,t=angular.isDefined(m.rnCarouselLoop);return["ng-repeat","data-ng-repeat","ng:repeat","x-ng-repeat"].every(function(a){var b=q[a];if(angular.isDefined(b)){var c=b.value.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),d=c[3];if(n=c[1],o=c[2],n)return angular.isDefined(m.rnCarouselBuffered)&&(s=!0,t=!1,b.value=n+" in "+o+"|carouselSlice:carouselBufferIndex:carouselBufferSize",d&&(b.value+=" track by "+d)),r=!0,t&&angular.element(p).attr("signal-repeat-done",""),!1}return!0}),function(l,m,n){function p(a,b){var c,d,e=a.targetScope.$last?!0:!1,f=a.targetScope.$first?!0:!1;if(e&&(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-head")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-head"),c?m[0].replaceChild(d[0],c):m.prepend(d)),f)if(c=document.querySelectorAll("#"+m[0].id+" .rn-carousel-virtual-slide-tail")[0],d=b.clone(),d.addClass("rn-carousel-virtual-slide-tail"),c)m[0].replaceChild(d[0],c);else{var g=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(d[0],g[0])}a.stopPropagation()}function q(){return m[0].querySelectorAll("ul[rn-carousel] > li")}function u(a){Q=!0,B({x:a.clientX,y:a.clientY},a)}function v(a){var b=100*l.carouselBufferIndex+a;t&&(b-=100),angular.forEach(q(),function(a,c){a.style.cssText=i(h(c,b,N.transitionType))})}function w(a,b){if(void 0===a&&(a=l.carouselIndex),b=b||{},b.animate===!1||"none"===N.transitionType)return T=!1,P=-100*a,l.carouselIndex=a,void C();T=!0;var c=new j;c.tween({from:{x:P},to:{x:-100*a},duration:N.transitionDuration,easing:N.transitionEasing,step:function(a){v(a.x)},finish:function(){T=!1,l.$apply(function(){l.carouselIndex=a,P=-100*a,C(),t&&-1===a&&(a=L.length-1,w(a,{animate:!1})),t&&a===L.length&&(a=0,w(a,{animate:!1}))})}})}function x(){var a=m[0].getBoundingClientRect();return a.width?a.width:a.right-a.left}function y(){R=x()}function z(a){return c.bind("mouseup",u),y(),S=m[0].querySelector("li").getBoundingClientRect().left,I=!0,J=a.x,!1}function A(a){if(!T){var b,c;if(I&&(b=a.x,c=J-b,c>2||-2>c)){Q=!0;var d=P+100*-c/R;v(d)}return!1}}function B(a,b){if((!b||Q)&&(c.unbind("mouseup",u),I=!1,Q=!1,K=J-a.x,0!==K&&!T))if(P+=100*-K/R,N.isSequential){var d=N.moveTreshold*R,e=-K,f=-Math[e>=0?"ceil":"floor"](e/R),g=Math.abs(e)>d;L&&f+l.carouselIndex>=L.length&&!t&&(f=L.length-1-l.carouselIndex),f+l.carouselIndex<0&&!t&&(f=-l.carouselIndex);var h=g?f:0;K=l.carouselIndex+h,w(K)}else l.$apply(function(){l.carouselIndex=parseInt(-P/100,10),C()})}function C(){var a=0,b=(l.carouselBufferSize-1)/2;s?(a=l.carouselIndex<=b?0:L&&L.lengthL.length-l.carouselBufferSize?L.length-l.carouselBufferSize:l.carouselIndex-b,l.carouselBufferIndex=a,f(function(){v(P)},0,!1)):f(function(){v(P)},0,!1)}function D(){y(),w()}if(k++,m[0].id="carousel"+k,t)if(r)l.$on("rnRepeatReady",function(a,b){l.$evalAsync(function(){p(a,b)})});else{var E=document.querySelectorAll("#"+m[0].id+"> li"),F=angular.element(E[0]).clone(),G=angular.element(E[E.length-1]).clone();m.prepend(G);var H=document.querySelectorAll("#"+m[0].id+" .rn-carousel-controls");m[0].insertBefore(F[0],H[0])}l.loop=t;var I,J,K,L,M={transitionType:n.rnCarouselTransition||"slide",transitionEasing:"easeTo",transitionDuration:300,isSequential:!0,autoSlideDuration:3,bufferSize:5,moveTreshold:.1},N=angular.extend({},M),O=!1,P=0,Q=!1,R=null,S=null,T=!1;if(void 0!==n.rnCarouselControls){var U='';m.append(e(angular.element(U))(l))}a.bind(m,{start:z,move:A,end:B,cancel:function(a){B({},a)}}),l.nextSlide=function(a){var b=l.carouselIndex+1;b>L.length-1&&!t&&(b=0),T||w(b,a)},l.prevSlide=function(a){var b=l.carouselIndex-1;0>b&&!t&&(b=L.length-1),w(b,a)};var V=!0;l.carouselIndex=0,r||(L=[],angular.forEach(q(),function(a,b){L.push({id:b})}),t&&(L.length-=2));var W;if(void 0!==n.rnCarouselAutoSlide){var X=parseInt(n.rnCarouselAutoSlide,10)||N.autoSlideDuration;W=g(function(){T||I||l.nextSlide()},1e3*X)}if(n.rnCarouselIndex){var Y=function(a){Z.assign(l.$parent,a)},Z=d(n.rnCarouselIndex);angular.isFunction(Z.assign)?(l.$watch("carouselIndex",function(a){T||Y(a)}),l.$parent.$watch(Z,function(a){void 0!==a&&null!==a&&(L&&a>=L.length?(a=L.length-1,Y(a)):L&&0>a&&(a=0,Y(a)),T||w(a,{animate:!V}),V=!1)}),O=!0):isNaN(n.rnCarouselIndex)||w(parseInt(n.rnCarouselIndex,10),{animate:!1})}else w(0,{animate:!V}),V=!1;n.rnCarouselLocked&&l.$watch(n.rnCarouselLocked,function(a){T=a===!0?!0:!1}),r&&l.$watchCollection(o,function(a){L=a,w(l.carouselIndex)}),l.$on("$destroy",function(){c.unbind("mouseup",u)}),l.carouselBufferIndex=0,l.carouselBufferSize=N.bufferSize;var $=angular.element(b);$.bind("orientationchange",D),$.bind("resize",D),l.$on("$destroy",function(){c.unbind("mouseup",u),$.unbind("orientationchange",D),$.unbind("resize",D)})}}}}])}(),angular.module("angular-carousel.shifty",[]).factory("Tweenable",function(){return function(a,b){"undefined"==typeof SHIFTY_DEBUG_NOW&&(SHIFTY_DEBUG_NOW=function(){return+new Date});var c=function(){"use strict";function c(){}function d(a,b){var c;for(c in a)Object.hasOwnProperty.call(a,c)&&b(c)}function e(a,b){return d(b,function(c){a[c]=b[c]}),a}function f(a,b){d(b,function(c){"undefined"==typeof a[c]&&(a[c]=b[c])})}function g(a,b,c,d,e,f,g){var i,j=(a-f)/e;for(i in b)b.hasOwnProperty(i)&&(b[i]=h(c[i],d[i],m[g[i]],j));return b}function h(a,b,c,d){return a+(b-a)*c(d)}function i(a,b){var c=l.prototype.filter,e=a._filterArgs;d(c,function(d){"undefined"!=typeof c[d][b]&&c[d][b].apply(a,e)})}function j(a,b,c,d,e,f,h,j,k){t=b+c,u=Math.min(s(),t),v=u>=t,a.isPlaying()&&!v?(k(a._timeoutHandler,q),i(a,"beforeTween"),g(u,d,e,f,c,b,h),i(a,"afterTween"),j(d)):v&&(j(f),a.stop(!0))}function k(a,b){var c={};return"string"==typeof b?d(a,function(a){c[a]=b}):d(a,function(a){c[a]||(c[a]=b[a]||o)}),c}function l(a,b){this._currentState=a||{},this._configured=!1,this._scheduleFunction=n,"undefined"!=typeof b&&this.setConfig(b)}var m,n,o="linear",p=500,q=1e3/60,r=Date.now?Date.now:function(){return+new Date},s=SHIFTY_DEBUG_NOW?SHIFTY_DEBUG_NOW:r;n="undefined"!=typeof b?b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||b.mozCancelRequestAnimationFrame&&b.mozRequestAnimationFrame||setTimeout:setTimeout;var t,u,v;return l.prototype.tween=function(a){return this._isTweening?this:(void 0===a&&this._configured||this.setConfig(a),this._start(this.get()),this.resume())},l.prototype.setConfig=function(a){a=a||{},this._configured=!0,this._pausedAtTime=null,this._start=a.start||c,this._step=a.step||c,this._finish=a.finish||c,this._duration=a.duration||p,this._currentState=a.from||this.get(),this._originalState=this.get(),this._targetState=a.to||this.get(),this._timestamp=s();var b=this._currentState,d=this._targetState;return f(d,b),this._easing=k(b,a.easing||o),this._filterArgs=[b,this._originalState,d,this._easing],i(this,"tweenCreated"),this},l.prototype.get=function(){return e({},this._currentState)},l.prototype.set=function(a){this._currentState=a},l.prototype.pause=function(){return this._pausedAtTime=s(),this._isPaused=!0,this},l.prototype.resume=function(){this._isPaused&&(this._timestamp+=s()-this._pausedAtTime),this._isPaused=!1,this._isTweening=!0;var a=this;return this._timeoutHandler=function(){j(a,a._timestamp,a._duration,a._currentState,a._originalState,a._targetState,a._easing,a._step,a._scheduleFunction)},this._timeoutHandler(),this},l.prototype.stop=function(a){return this._isTweening=!1,this._isPaused=!1,this._timeoutHandler=c,a&&(e(this._currentState,this._targetState),i(this,"afterTweenEnd"),this._finish.call(this,this._currentState)),this},l.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused},l.prototype.setScheduleFunction=function(a){this._scheduleFunction=a},l.prototype.dispose=function(){var a;for(a in this)this.hasOwnProperty(a)&&delete this[a]},l.prototype.filter={},l.prototype.formula={linear:function(a){return a}},m=l.prototype.formula,e(l,{now:s,each:d,tweenProps:g,tweenProp:h,applyFilter:i,shallowCopy:e,defaults:f,composeEasingObject:k}),"function"==typeof SHIFTY_DEBUG_NOW&&(a.timeoutHandler=j),"object"==typeof exports?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):"undefined"==typeof a.Tweenable&&(a.Tweenable=l),l}();b.Tweenable=c,function(){c.shallowCopy(c.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return 0===a?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return 0===a?0:1===a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin(2*(6*a-1)*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?2-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function a(a,b,c,d,e,f){function g(a){return((n*a+o)*a+p)*a}function h(a){return((q*a+r)*a+s)*a}function i(a){return(3*n*a+2*o)*a+p}function j(a){return 1/(200*a)}function k(a,b){return h(m(a,b))}function l(a){return a>=0?a:0-a}function m(a,b){var c,d,e,f,h,j;for(e=a,j=0;8>j;j++){if(f=g(e)-a,l(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),l(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e}var n=0,o=0,p=0,q=0,r=0,s=0;return p=3*b,o=3*(d-b)-p,n=1-p-o,s=3*c,r=3*(e-c)-s,q=1-s-r,k(a,j(f))}function b(b,c,d,e){return function(f){return a(f,b,c,d,e,1)}}c.setBezierFunction=function(a,d,e,f,g){var h=b(d,e,f,g);return h.x1=d,h.y1=e,h.x2=f,h.y2=g,c.prototype.formula[a]=h},c.unsetBezierFunction=function(a){delete c.prototype.formula[a]}}(),function(){function a(a,b,d,e,f){return c.tweenProps(e,b,a,d,1,0,f)}var b=new c;b._filterArgs=[],c.interpolate=function(d,e,f,g){var h=c.shallowCopy({},d),i=c.composeEasingObject(d,g||"linear");b.set({});var j=b._filterArgs;j.length=0,j[0]=h,j[1]=d,j[2]=e,j[3]=i,c.applyFilter(b,"tweenCreated"),c.applyFilter(b,"beforeTween");var k=a(d,h,e,f,i);return c.applyFilter(b,"afterTween"),k}}(),function(a){function b(a,b){B.length=0;var c,d=a.length;for(c=0;d>c;c++)B.push("_"+b+"_"+c);return B}function c(a){var b=a.match(v);return b?(1===b.length||a[0].match(u))&&b.unshift(""):b=["",""],b.join(A)}function d(b){a.each(b,function(a){var c=b[a];"string"==typeof c&&c.match(z)&&(b[a]=e(c))})}function e(a){return i(z,a,f)}function f(a){var b=g(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function g(a){return a=a.replace(/#/,""),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),C[0]=h(a.substr(0,2)),C[1]=h(a.substr(2,2)),C[2]=h(a.substr(4,2)),C}function h(a){return parseInt(a,16)}function i(a,b,c){var d=b.match(a),e=b.replace(a,A);if(d)for(var f,g=d.length,h=0;g>h;h++)f=d.shift(),e=e.replace(A,c(f));return e}function j(a){return i(x,a,k)}function k(a){for(var b=a.match(w),c=b.length,d=a.match(y)[0],e=0;c>e;e++)d+=parseInt(b[e],10)+",";return d=d.slice(0,-1)+")"}function l(d){var e={};return a.each(d,function(a){var f=d[a];if("string"==typeof f){var g=r(f);e[a]={formatString:c(f),chunkNames:b(g,a)}}}),e}function m(b,c){a.each(c,function(a){for(var d=b[a],e=r(d),f=e.length,g=0;f>g;g++)b[c[a].chunkNames[g]]=+e[g];delete b[a]})}function n(b,c){a.each(c,function(a){var d=b[a],e=o(b,c[a].chunkNames),f=p(e,c[a].chunkNames);d=q(c[a].formatString,f),b[a]=j(d)})}function o(a,b){for(var c,d={},e=b.length,f=0;e>f;f++)c=b[f],d[c]=a[c],delete a[c];return d}function p(a,b){D.length=0;for(var c=b.length,d=0;c>d;d++)D.push(a[b[d]]);return D}function q(a,b){for(var c=a,d=b.length,e=0;d>e;e++)c=c.replace(A,+b[e].toFixed(4));return c}function r(a){return a.match(w)}function s(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g=b[a].split(" "),h=g[g.length-1],i=0;f>i;i++)b[e[i]]=g[i]||h;delete b[a]})}function t(b,c){a.each(c,function(a){for(var d=c[a],e=d.chunkNames,f=e.length,g="",h=0;f>h;h++)g+=" "+b[e[h]],delete b[e[h]];b[a]=g.substr(1)})}var u=/(\d|\-|\.)/,v=/([^\-0-9\.]+)/g,w=/[0-9.\-]+/g,x=new RegExp("rgb\\("+w.source+/,\s*/.source+w.source+/,\s*/.source+w.source+"\\)","g"),y=/^.*\(/,z=/#([0-9]|[a-f]){3,6}/gi,A="VAL",B=[],C=[],D=[];a.prototype.filter.token={tweenCreated:function(a,b,c){d(a),d(b),d(c),this._tokenData=l(a)},beforeTween:function(a,b,c,d){s(d,this._tokenData),m(a,this._tokenData),m(b,this._tokenData),m(c,this._tokenData)},afterTween:function(a,b,c,d){n(a,this._tokenData),n(b,this._tokenData),n(c,this._tokenData),t(d,this._tokenData)}}}(c)}(this,window),window.Tweenable}),function(){"use strict";angular.module("angular-carousel").filter("carouselSlice",function(){return function(a,b,c){return angular.isArray(a)?a.slice(b,b+c):angular.isObject(a)?a:void 0}})}(); \ No newline at end of file diff --git a/index.html b/index.html index 28662fa..216821c 100644 --- a/index.html +++ b/index.html @@ -163,7 +163,7 @@

    Lockable carousel

    - +