diff --git a/.gitignore b/.gitignore index 1ed654d68..4b5eddf67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,21 @@ -# Build and Release Folders -bin-debug/ -bin-release/ - -# Project property files -.actionScriptProperties -.flexProperties -.settings/ -.project \ No newline at end of file +.DS_Store +.AppleDouble +.LSOverride +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ \ No newline at end of file diff --git a/changelog.txt b/changelog.txt new file mode 100755 index 000000000..5b72981c7 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,161 @@ +CHANGE LOG : GREENSOCK ANIMATION PLATFORM (GSAP) +------------------------------------------------ + +2012-09-19: +--------------------------------------------- + - Works around an IE8 (and earlier) bug that renders elements incorrectly when a rotational transform is applied to an object that already has an opacity/alpha filter on it. The matrix filter must come BEFORE the alpha in the "filters" list. + - Minor code refinements + +2012-09-17 +--------------------------------------------- + - Fixed issue in IE8 (and earlier) where reversing a tween that handled "backgroundPosition" (of CSSPlugin) would throw an error when it arrived at its beginning position. + - Reworked transform code (for things like scale, rotation, x, y, skew, etc.) so that it should work with browsers that don't require a browser prefix for "transform". + - Fixed issue that caused TweenMax.killAll() to kill the tweens in the reverse order that they were created. + +2012-09-06 +--------------------------------------------- + - Fixed issue that could cause zIndex:0 to get added to an object only in iOS when a transform property was tweened and the element had a z-index defined in a class instead of directly on the element itself (its style). + +2012-09-04 +--------------------------------------------- + - Added killChildTweensOf() method to TweenMax that kills tweens of the child DOM elements of a particular element. + +2012-08-31 +--------------------------------------------- + - Fixed issue that caused "{self}" references in a TimelineLite.staggerTo() or staggerFrom() or staggerFromTo() to always point at the first tween instead of each individual one. + +2012-08-22 +--------------------------------------------- + - Worked around a bug in Android 4.x default browser that causes it to ignore changes to "top" and "left" CSS properties when they are made on the same frame as any transform property (like scale, rotation, skew, etc.). + +2012-08-16 +--------------------------------------------- + - Fixed error in TimelineMax's onRepeat callback + - Fixed an issue that could cause an error in tween that was controlling a color that was set to "transparent" in IE8 or below and it was reversed and reached its beginning. + +2012-07-28 +--------------------------------------------- + - Fixed issue in CSSPlugin and CSSRulePlugin that caused an error in IE8 and earlier when you try tweening to a color of "transparent". + +2012-07-26 +--------------------------------------------- + - Worked around another Safari (iOS) bug that caused elements to randomly flicker when changing size (related to setting WebkitPerspective, so now we set WebkitBackfaceVisibility to "hidden" instead to work around 2 other Safari bugs previously mentioned) + - Updated the Elastic eases so that you can define an amplitude below 1. + +2012-07-25 +--------------------------------------------- + - Worked around Safari bug that could cause elements to render incorrectly when a WebkitPerspective wasn't defined. Now a default WebkitPerspective value of 500px is applied to any element tweened with CSSPlugin (only in non-Android safari) + - Enhanced ScrollToPlugin so that you can simply pass a number and it will assume you meant "y" (rather than having to pass {y:YOUR_VALUE}) + +2012-07-24 +--------------------------------------------- + - Added code to helpe CSSPlugin handle zero-duration tweens that alter the className of the target so that they skip any parsing of the class and simply apply it which helps when there are transitions applied to the css class. + +2012-07-23 +--------------------------------------------- + - Reworked BezierPlugin's "thru" algorithm to make it more natural and fix a particular scenario when it broke down with the previous algorithm. + - Fixed problem in BezierPlugin that could cause 1 frame to render incorrectly when a tween goes backwards (once for each segment) + - Added "thruBasic" type to BezierPlugin (might remove, pending community feedback) + - Fixed issue in CSSPlugin that could prevent IE8, IE7, and IE6 from interpreting the initial opacity of an element if there were spaces in its filter alpha CSS definition (like filter:alpha(opacity = 50)) + - Fixed an issue that could cause animations on the page to act as though they're not starting from exactly 0 when the page loads (like they're skipping the beginning) + - Fixed an issue that could cause color tweens to throw an error in IE8, IE7, and IE6 if the new color is the same as the old color. + +2012-07-18 +--------------------------------------------- + - Added BezierPlugin + - Added hooks in CSSPlugin to recognize Bezier tweens + - Added conditional logic in CSSPlugin and CSSRulePlugin so that display:"none" would be applied at the END of the tween (all other non-tweening properties are applied when the tween starts) + +2012-06-30 +--------------------------------------------- + - Added logic to TimelineLite/Max so that if you insert/append a child that extends the duration and the timeline had already finished, it will adjust its startTime and resume playback (as long as it wasn't paused of course) + +2012-06-19 +--------------------------------------------- + - Fixed issue that could cause RaphaelPlugin to incorrectly render the pivot point of transforms + - Implemented a workaround for a bug in certain (older) versions of the Android browser that could prevent transforms (like rotation) from rendering correctly by the CSSPlugin + - Fixed issue that could cause zero-duration tweens with a delay to prematurely get removed from their parent timeline. + +2012-06-05 +--------------------------------------------- + - Worked around a bug in older versions of IE that could cause marginRight and/or marginBottom to render incorrectly or incorrectly deal with concurrent tweens of one of the margins while rotating the object in old versions of IE. + - Fixed issue that could cause skewX/skewY to affect the objects scaleY in certain browsers when rotation is 0 + - Fixed missing variable in RaphaelPlugin + - Now autoAlpha in CSSPlugin will look to see if the element starts out with a visibility of "hidden" and opacity is 1, and if so it will force opacity to 0 as a convenience. + - Fixed missing variable in TweenMax.killAll() method. + - Added ability for CSSPlugin to parse numeric colors like 0xFF0000 + +2012-06-02 +--------------------------------------------- + - Fixed problem that caused ScrollToPlugin to interpret the starting scrollTop/scrollLeft incorrectly (inverted). + - Added "ticker" to TweenMax for convenience. + +2012-05-29 +--------------------------------------------- + - Fixed issue that could cause rotation to be read as 0 on a new tween when scaleX/scale was tweened to 0 previously. + - Added ability for ScrollToPlugin to control the scroll of a div rather than just the window. + +2012-05-24 +--------------------------------------------- + - Added SteppedEase to the EasePack + - Fixed issue that could cause a tween to be overwritten if it is nested inside a TimelineLite/Max that's nested inside another and both are back-to-back and tween the identical value (very rare). + - Fixed issue that could cause an incorrect conversion from pixels to % or ems (swapping horizontal percentage for vertical in a very rare case) + +2012-05-23 +--------------------------------------------- + - Added RaphaelPlugin that allows you to tween the properties of a Raphael element (see http://www.raphaeljs.com) + +2012-05-22 +--------------------------------------------- + - Fixed issue that could cause a skewY css tween to prevent scale/rotation from working properly in very specific scenarios (rare). + - Implemented code that snaps extremely small decimal values to 0 when being applied to CSS properties in CSSPlugin to avoid issues with a few browsers. + +2012-05-17 +--------------------------------------------- + - Added ability for CSSPlugin to recognize the key word "center" within a transformOrigin value + - Fixed issue in IE8/7/6 that could cause rotations to change the width of the target slightly after a few rotations + - You can now define a window.GreenSockAMDPath variable (a string) that will get prepended to GreenSock-related AMD define() calls. So, for example, if you put the GreenSock .js files in a libs/greensock/ directory, you can set window.GreenSockAMDPath = "libs/greensock" so that when TweenMax is loaded, its definition will be "libs/greensock/TweenMax" instead of simply "TweenMax". This helps to make things compatible with systems like Dojo. + - Added ScrollToPlugin + - Changed behavior when AMD loader like RequireJS or Dojo is found - previously if one was found, the main classes like TweenLite, TweenMax, Power1, strong, etc. were NOT added to the global scope (window). However, since Dojo uses a different define() technique that appears to require only one define() per file which would fail, we now always add the main classes to the global scope so that they can be used regardless. Also added a line of code that looks for a window.GreenSockGlobals and if one is found, it will add all the globals to that object instead of window, thus you can easily control where the globals go. For example, set window.GreenSockGlobals = {} before loading any GreenSock files and none of the GreenSock code will "pollute" the global scope - they will be added to your custom object instead. + - Fixed missing "var" in TweenPlugin's _addTween() method + - Changed name of the internally-used _gsRequre() method to _gsDefine() but that shouldn't affect any code you wrote because it isn't intended to be a public method. Please make sure you update ALL of your GreenSock js files, however, because they all reference that method. + +2012-05-15 +--------------------------------------------- + - Worked around a bug in Chrome that could cause odd transform results when the values hit no transform (translate(0px,0px) scale(1,1) rotate(0) skew(0,0)). Apparently it's a bad idea to set transform to "" after it has been something else. + +2012-05-11 +--------------------------------------------- + - Fixed issue that caused skewY values in CSSPlugin to always be treated as relative. So, for example, if you tweened skewY to 10 and then did another skewY of the same object to 10, it would end up looking like 20. + + +2012-05-06 +--------------------------------------------- + - Fixed issue that could cause jQuery objects not to be tweened properly if the page was subloaded by another page that used jQuery (thus the global jQuery object reference was updated, throwing off detection of jQuery instances using instanceof). + +2012-05-03 +---------------------------------------------- + - Fixed issue that could cause autoAlpha not to function properly in IE7 and IE8 (due to browser bugs) + +2012-05-01 +---------------------------------------------- + - Added static set() method to TweenLite and TweenMax (a simple way to do a zero-duration tween) + - Added a new getLabelsArray() method to TimelineMax + - Fixed issue that caused a relative CSS tween to jump to its end value right away when the starting value matched exactly the amount of relative change (very rare). + +2012-04-26 +---------------------------------------------- + - Improved compatibility with jQuery so that you can pass an array of jQuery instances as the target of a tween (previously you could pass a jQuery object as the target, but not an array of them). + +2012-04-23 +---------------------------------------------- + - Fixed compatibility issue with RequireJS + +2012-04-10 +---------------------------------------------- +beta 1.02 + - Added ability to tween backgroundPosition + - Added ability to tween "border" (like border:"5px solid red") + - Worked around Safari bug that caused "top" and "left" changes to be ignored when they are tweened at the same time as transform values (like rotation or scaleX, etc.) + - Fixed occasional [very slight] misrendering of what should be rotation of 0 (if rounding errors caused it to be extremely small, it could appear slightly askew previously). + - Changed behavior so that tweens with a duration of 0 and delay of 0 will default to immediateRender:true \ No newline at end of file diff --git a/src/minified/TimelineLite.min.js b/src/minified/TimelineLite.min.js new file mode 100755 index 000000000..d8c18c56f --- /dev/null +++ b/src/minified/TimelineLite.min.js @@ -0,0 +1,13 @@ +/** + * VERSION: beta 1.486 + * DATE: 2012-08-31 + * JavaScript (ActionScript 3 and 2 also available) + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + **/ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(m,j,g){var h=function(b){j.call(this,b);this._labels={};this.autoRemoveChildren=!0==this.vars.autoRemoveChildren;this.smoothChildTiming=!0==this.vars.smoothChildTiming;this._sortChildren=!0;this._onUpdate=this.vars.onUpdate;for(var b=n.length,c,a;-1<--b;)if(a=this.vars[n[b]])for(c=a.length;-1<--c;)"{self}"===a[c]&&(a=this.vars[n[b]]=a.concat(),a[c]=this);this.vars.tweens instanceof Array&&this.insertMultiple(this.vars.tweens,0,this.vars.align||"normal",this.vars.stagger||0)},n=["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"],o=[],p=function(b){var c={},a;for(a in b)c[a]=b[a];return c},d=h.prototype=new j;d.constructor=h;d.kill()._gc=!1;d.to=function(b,c,a,f,e){return this.insert(new g(b,c,a),this._parseTimeOrLabel(e)+(f||0))};d.from=function(b,c,a,f,e){return this.insert(g.from(b,c,a),this._parseTimeOrLabel(e)+(f||0))};d.fromTo= function(b,c,a,f,e,d){return this.insert(g.fromTo(b,c,a,f),this._parseTimeOrLabel(d)+(e||0))};d.staggerTo=function(b,c,a,f,e,d,i,k,q){i=new h({onComplete:i,onCompleteParams:k,onCompleteScope:q});f=f||0;for(k=0;k=f){this._totalTime=this._time=f;if(!this._reversed&&!this._hasPausedChild()&&(h=!0,l="onComplete",0===this._duration&&(0===b||0>this._rawPrevTime)))this._rawPrevTime!== b&&(a=!0);this._rawPrevTime=b;b=f+1E-6}else if(0>=b){this._totalTime=this._time=0;if(0!==e||0===this._duration&&0b?(this._active=!1,0===this._duration&&0<=this._rawPrevTime&&(a=!0)):this._initted||(a=!0);this._rawPrevTime=b;b=-1E-6}else this._totalTime=this._time=this._rawPrevTime=b;if(this._time!==e||a){this._initted||(this._initted=!0);0===e&&this.vars.onStart&&0!==this._time&&(c||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams|| o));if(this._time>e)for(a=this._first;a;){j=a._next;if(this._paused&&!g)break;else if(a._active||a._startTime<=this._time&&!a._paused&&!a._gc)a._reversed?a.render((!a._dirty?a._totalDuration:a.totalDuration())-(b-a._startTime)*a._timeScale,c,!1):a.render((b-a._startTime)*a._timeScale,c,!1);a=j}else for(a=this._last;a;){j=a._prev;if(this._paused&&!g)break;else if(a._active||a._startTime<=e&&!a._paused&&!a._gc)a._reversed?a.render((!a._dirty?a._totalDuration:a.totalDuration())-(b-a._startTime)*a._timeScale, c,!1):a.render((b-a._startTime)*a._timeScale,c,!1);a=j}this._onUpdate&&(c||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||o));if(l&&!this._gc&&(d===this._startTime||i!=this._timeScale))if(0===this._time||f>=this.totalDuration())h&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),c||this.vars[l]&&this.vars[l].apply(this.vars[l+"Scope"]||this,this.vars[l+"Params"]||o)}};d._hasPausedChild=function(){for(var b=this._first;b;){if(b._paused||b instanceof h&&b._hasPausedChild())return!0;b=b._next}return!1};d.getChildren=function(b,c,a,f){for(var f=f||-9999999999,e=[],d=this._first,i=0;d;)d._startTime=a&&(d._startTime+=b),d=d._next;if(c)for(var e in this._labels)this._labels[e]>=a&&(this._labels[e]+=b);return this._uncache(!0)};d._kill=function(b,c){if(null==b&&null==c)return this._enabled(!1,!1);for(var a=null==c?this.getChildren(!0,!0,!1):this.getTweensOf(c),d=a.length,e=!1;-1<--d;)a[d]._kill(b,c)&&(e=!0);return e};d.clear=function(b){var c=this.getChildren(!1,!0,!0),a=c.length;for(this._time=this._totalTime= 0;-1<--a;)c[a]._enabled(!1,!1);!1!=b&&(this._labels={});return this._uncache(!0)};d.invalidate=function(){for(var b=this._first;b;)b.invalidate(),b=b._next;return this};d._enabled=function(b,c){if(b==this._gc)for(var a=this._first;a;)a._enabled(b,!0),a=a._next;return j.prototype._enabled.call(this,b,c)};d.progress=function(b){return!arguments.length?this._time/this.duration():this.totalTime(this.duration()*b,!1)};d.duration=function(b){if(!arguments.length)return this._dirty&&this.totalDuration(), this._duration;0!==this.duration()&&0!==b&&this.timeScale(this._duration/b);return this};d.totalDuration=function(b){if(!arguments.length){if(this._dirty){for(var c=0,a=this._first,d=-999999999999,e;a;)e=a._next,a._startTimea._startTime&&(c-=a._startTime,this.shiftChildren(-a._startTime,!1,-9999999999)),a=a._startTime+(!a._dirty?a._totalDuration:a.totalDuration())/a._timeScale,a>c&&(c=a),a=e;this._duration=this._totalDuration= c;this._dirty=!1}return this._totalDuration}0!==this.totalDuration()&&0!==b&&this.timeScale(this._totalDuration/b);return this};d.usesFrames=function(){for(var b=this._timeline;b._timeline;)b=b._timeline;return b===m._rootFramesTimeline};d.rawTime=function(){return this._paused||0!==this._totalTime&&this._totalTime!==this._totalDuration?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale};return h},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/TimelineMax.min.js b/src/minified/TimelineMax.min.js new file mode 100755 index 000000000..3924c7af8 --- /dev/null +++ b/src/minified/TimelineMax.min.js @@ -0,0 +1,13 @@ +/*! + * VERSION: beta 1.486 + * DATE: 2012-08-31 + * JavaScript (ActionScript 3 and 2 also available) + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(h,k,f){var g=function(c){h.call(this,c);this._repeat=this.vars.repeat||0;this._repeatDelay=this.vars.repeatDelay||0;this._cycle=0;this._yoyo=!0==this.vars.yoyo;this._dirty=!0},n=[],q=new f(null,null,1,0),f=g.prototype=new h;f.constructor=g;f.kill()._gc=!1;g.version=12;f.invalidate=function(){this._yoyo=!0==this.vars.yoyo;this._repeat=this.vars.repeat||0;this._repeatDelay= this.vars.repeatDelay||0;this._uncache(!0);return h.prototype.invalidate.call(this)};f.addCallback=function(c,d,a,e){return this.insert(k.delayedCall(0,c,a,e),d)};f.removeCallback=function(c,d){if(null==d)this._kill(null,c);else for(var a=this.getTweensOf(c,!1),e=a.length,b=this._parseTimeOrLabel(d,!1);-1<--e;)a[e]._startTime===b&&a[e]._enabled(!1,!1);return this};f.tweenTo=function(c,d){var d=d||{},a={ease:q,overwrite:2,useFrames:this.usesFrames(),immediateRender:!1},e,b;for(e in d)a[e]=d[e];a.time= this._parseTimeOrLabel(c,!1);b=new k(this,Math.abs(Number(a.time)-this._time)/this._timeScale||0.001,a);a.onStart=function(){b.target.paused(!0);b.vars.time!=b.target.time()&&b.duration(Math.abs(b.vars.time-b.target.time())/b.target._timeScale);d.onStart&&d.onStart.apply(d.onStartScope||b,d.onStartParams||n)};return b};f.tweenFromTo=function(c,d,a){a=a||{};a.startAt={time:this._parseTimeOrLabel(c,!1)};c=this.tweenTo(d,a);return c.duration(Math.abs(c.vars.time-c.vars.startAt.time)/this._timeScale|| 0.001)};f.render=function(c,d,a){this._gc&&this._enabled(!0,!1);this._active=!this._paused;var e=!this._dirty?this._totalDuration:this.totalDuration(),b=this._time,j=this._totalTime,i=this._startTime,f=this._timeScale,p=this._rawPrevTime,o=this._paused,l=this._cycle,g,m;if(c>=e){this._locked||(this._totalTime=e,this._cycle=this._repeat);if(!this._reversed&&!this._hasPausedChild()&&(g=!0,m="onComplete",0===this._duration&&(0===c||0>this._rawPrevTime)))this._rawPrevTime!==c&&(a=!0);this._rawPrevTime= c;this._yoyo&&0!==(this._cycle&1)?(this._time=0,c=-1E-6):(this._time=this._duration,c=this._duration+1E-6)}else if(0>=c){this._locked||(this._totalTime=this._cycle=0);this._time=0;if(0!==b||0===this._duration&&0c?(this._active=!1,0===this._duration&&0<=this._rawPrevTime&&(a=!0)):this._initted||(a=!0);this._rawPrevTime=c;c=-1E-6}else if(this._time=this._rawPrevTime=c,!this._locked&&(this._totalTime=c,0!==this._repeat))(c=this._duration+this._repeatDelay, this._cycle=this._totalTime/c>>0,0!==this._cycle&&this._cycle===this._totalTime/c&&this._cycle--,this._time=this._totalTime-this._cycle*c,this._yoyo&&0!=(this._cycle&1)&&(this._time=this._duration-this._time),this._time>this._duration)?(this._time=this._duration,c=this._duration+1E-6):0>this._time?(this._time=0,c=-1E-6):c=this._time;if(this._cycle!==l&&!this._locked){var h=this._yoyo&&0!==(l&1),k=h===(this._yoyo&&0!==(this._cycle&1)),q=this._totalTime,s=this._cycle,t=this._rawPrevTime,u=this._time; this._totalTime=l*this._duration;this._cycleb)for(a=this._first;a;){j=a._next;if(this._paused&&!o)break;else if(a._active||a._startTime<=this._time&&!a._paused&&!a._gc)a._reversed?a.render((!a._dirty?a._totalDuration:a.totalDuration())-(c-a._startTime)*a._timeScale,d,!1):a.render((c-a._startTime)*a._timeScale,d,!1);a=j}else for(a=this._last;a;){j=a._prev;if(this._paused&&!o)break;else if(a._active|| a._startTime<=b&&!a._paused&&!a._gc)a._reversed?a.render((!a._dirty?a._totalDuration:a.totalDuration())-(c-a._startTime)*a._timeScale,d,!1):a.render((c-a._startTime)*a._timeScale,d,!1);a=j}this._onUpdate&&(d||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n));if(m&&!this._locked&&!this._gc&&(i===this._startTime||f!=this._timeScale))if(0===this._time||e>=this.totalDuration())g&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),d||this.vars[m]&& this.vars[m].apply(this.vars[m+"Scope"]||this,this.vars[m+"Params"]||n)}};f.getActive=function(c,d,a){null==c&&(c=!0);null==d&&(d=!0);null==a&&(a=!1);var e=[],c=this.getChildren(c,d,a),d=0,a=c.length,b,j;for(b=0;b=j._startTime&&j._timeline._timec)return d[e].name;return null};f.getLabelBefore=function(c){null==c&&(c=this._time);for(var d=this.getLabelsArray(),a=d.length;-1<--a;)if(d[a].timethis._duration&&(c=this._duration);this._yoyo&&0!==(this._cycle&1)?c=this._duration-c+this._cycle*(this._duration+this._repeatDelay):0!=this._repeat&&(c+=this._cycle*(this._duration+this._repeatDelay));return this.totalTime(c,d)};f.repeat=function(c){if(!arguments.length)return this._repeat;this._repeat=c;return this._uncache(!0)};f.repeatDelay=function(c){if(!arguments.length)return this._repeatDelay;this._repeatDelay=c;return this._uncache(!0)};f.yoyo=function(c){if(!arguments.length)return this._yoyo; this._yoyo=c;return this};f.currentLabel=function(c){return!arguments.length?this.getLabelBefore(this._time+1E-8):this.seek(c,!0)};return g},!0);_gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(h,k,f){var g=function(a){k.call(this,a);this._labels={};this.autoRemoveChildren=!0==this.vars.autoRemoveChildren;this.smoothChildTiming=!0==this.vars.smoothChildTiming;this._sortChildren=!0;this._onUpdate=this.vars.onUpdate;for(var a=n.length,e,b;-1<--a;)if(b=this.vars[n[a]])for(e= b.length;-1<--e;)"{self}"===b[e]&&(b=this.vars[n[a]]=b.concat(),b[e]=this);this.vars.tweens instanceof Array&&this.insertMultiple(this.vars.tweens,0,this.vars.align||"normal",this.vars.stagger||0)},n=["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"],q=[],c=function(a){var e={},b;for(b in a)e[b]=a[b];return e},d=g.prototype=new k;d.constructor=g;d.kill()._gc=!1;d.to=function(a,e,b,c,d){return this.insert(new f(a,e,b),this._parseTimeOrLabel(d)+(c||0))}; d.from=function(a,e,b,c,d){return this.insert(f.from(a,e,b),this._parseTimeOrLabel(d)+(c||0))};d.fromTo=function(a,e,b,c,d,r){return this.insert(f.fromTo(a,e,b,c),this._parseTimeOrLabel(r)+(d||0))};d.staggerTo=function(a,e,b,d,i,r,p,o,l){p=new g({onComplete:p,onCompleteParams:o,onCompleteScope:l});d=d||0;for(o=0;o=d){this._totalTime= this._time=d;if(!this._reversed&&!this._hasPausedChild()&&(l=!0,m="onComplete",0===this._duration&&(0===a||0>this._rawPrevTime)))this._rawPrevTime!==a&&(b=!0);this._rawPrevTime=a;a=d+1E-6}else if(0>=a){this._totalTime=this._time=0;if(0!==f||0===this._duration&&0a?(this._active=!1,0===this._duration&&0<=this._rawPrevTime&&(b=!0)):this._initted||(b=!0);this._rawPrevTime=a;a=-1E-6}else this._totalTime=this._time=this._rawPrevTime=a;if(this._time!== f||b){this._initted||(this._initted=!0);0===f&&this.vars.onStart&&0!==this._time&&(c||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||q));if(this._time>f)for(b=this._first;b;){n=b._next;if(this._paused&&!k)break;else if(b._active||b._startTime<=this._time&&!b._paused&&!b._gc)b._reversed?b.render((!b._dirty?b._totalDuration:b.totalDuration())-(a-b._startTime)*b._timeScale,c,!1):b.render((a-b._startTime)*b._timeScale,c,!1);b=n}else for(b=this._last;b;){n=b._prev;if(this._paused&& !k)break;else if(b._active||b._startTime<=f&&!b._paused&&!b._gc)b._reversed?b.render((!b._dirty?b._totalDuration:b.totalDuration())-(a-b._startTime)*b._timeScale,c,!1):b.render((a-b._startTime)*b._timeScale,c,!1);b=n}this._onUpdate&&(c||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||q));if(m&&!this._gc&&(g===this._startTime||h!=this._timeScale))if(0===this._time||d>=this.totalDuration())l&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),c||this.vars[m]&& this.vars[m].apply(this.vars[m+"Scope"]||this,this.vars[m+"Params"]||q)}};d._hasPausedChild=function(){for(var a=this._first;a;){if(a._paused||a instanceof g&&a._hasPausedChild())return!0;a=a._next}return!1};d.getChildren=function(a,c,b,d){for(var d=d||-9999999999,i=[],g=this._first,h=0;g;)g._startTime=b&&(d._startTime+=a),d=d._next;if(c)for(var f in this._labels)this._labels[f]>=b&&(this._labels[f]+=a);return this._uncache(!0)};d._kill=function(a,c){if(null==a&&null==c)return this._enabled(!1,!1);for(var b=null==c?this.getChildren(!0,!0,!1):this.getTweensOf(c), d=b.length,f=!1;-1<--d;)b[d]._kill(a,c)&&(f=!0);return f};d.clear=function(a){var c=this.getChildren(!1,!0,!0),b=c.length;for(this._time=this._totalTime=0;-1<--b;)c[b]._enabled(!1,!1);!1!=a&&(this._labels={});return this._uncache(!0)};d.invalidate=function(){for(var a=this._first;a;)a.invalidate(),a=a._next;return this};d._enabled=function(a,c){if(a==this._gc)for(var b=this._first;b;)b._enabled(a,!0),b=b._next;return k.prototype._enabled.call(this,a,c)};d.progress=function(a){return!arguments.length? this._time/this.duration():this.totalTime(this.duration()*a,!1)};d.duration=function(a){if(!arguments.length)return this._dirty&&this.totalDuration(),this._duration;0!==this.duration()&&0!==a&&this.timeScale(this._duration/a);return this};d.totalDuration=function(a){if(!arguments.length){if(this._dirty){for(var c=0,b=this._first,d=-999999999999,f;b;)f=b._next,b._startTimeb._startTime&&(c-=b._startTime,this.shiftChildren(-b._startTime, !1,-9999999999)),b=b._startTime+(!b._dirty?b._totalDuration:b.totalDuration())/b._timeScale,b>c&&(c=b),b=f;this._duration=this._totalDuration=c;this._dirty=!1}return this._totalDuration}0!==this.totalDuration()&&0!==a&&this.timeScale(this._totalDuration/a);return this};d.usesFrames=function(){for(var a=this._timeline;a._timeline;)a=a._timeline;return a===h._rootFramesTimeline};d.rawTime=function(){return this._paused||0!==this._totalTime&&this._totalTime!==this._totalDuration?this._totalTime:(this._timeline.rawTime()- this._startTime)*this._timeScale};return g},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/TweenLite.min.js b/src/minified/TweenLite.min.js new file mode 100755 index 000000000..507d37bf6 --- /dev/null +++ b/src/minified/TweenLite.min.js @@ -0,0 +1,13 @@ +/*! + * VERSION: beta 1.5 + * DATE: 2012-09-04 + * JavaScript + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(function(m){var F=function(a){var a=a.split("."),c=m,b;for(b=0;ba?2*a:2*(1-a);1===b?j*=j:2===b?j*=j*j:3===b?j*=j*j*j:4===b&&(j*=j*j*j*j);return 1===c?1-j:2===c?j:0.5>a?j/2:1-j/2};o=["Linear","Quad","Cubic","Quart","Quint"];for(k=o.length;-1<--k;)d=q("easing."+o[k],function(){},!0),z=q("easing.Power"+k,function(){},!0),d.easeOut=z.easeOut=new s(null, null,1,k),d.easeIn=z.easeIn=new s(null,null,2,k),d.easeInOut=z.easeInOut=new s(null,null,3,k);q("easing.Strong",n.easing.Power4,!0);n.easing.Linear.easeNone=n.easing.Linear.easeIn;d=q("events.EventDispatcher",function(a){this._listeners={};this._eventTarget=a||this}).prototype;d.addEventListener=function(a,c,b,j,e){var e=e||0,d=this._listeners[a],h=0,f;null==d&&(this._listeners[a]=d=[]);for(f=d.length;-1<--f;)a=d[f],a.c===c?d.splice(f,1):0===h&&a.pr=l)b.frame++,l=b.time+g-(b.time-l)-5E-4,l<=b.time&&(l=b.time+0.001),b.dispatchEvent("tick");f=h(b.tick)};this.fps=function(a){if(!arguments.length)return i;i=a;g=1/(i||60);l=this.time+g;h=0===i?function(){}:!d||!A?function(a){return m.setTimeout(a,1E3*(l-b.time)+1>>0||1)}:A;B(f);f=h(b.tick)}; this.useRAF=function(a){if(!arguments.length)return d;d=a;this.fps(i)};this.fps(a)});d=n.Ticker.prototype=new n.events.EventDispatcher;d.constructor=n.Ticker;var p=q("core.Animation",function(a,c){this.vars=c||{};this._duration=this._totalDuration=a||0;this._delay=Number(this.vars.delay)||0;this._timeScale=1;this._active=!0==this.vars.immediateRender;this.data=this.vars.data;this._reversed=!0==this.vars.reversed;if(t){G||(r.tick(),G=!0);var b=this.vars.useFrames?w:t;b.insert(this,b._time);this.vars.paused&& this.paused(!0)}}),r=p.ticker=new n.Ticker;d=p.prototype;d._dirty=d._gc=d._initted=d._paused=!1;d._totalTime=d._time=0;d._rawPrevTime=-1;d._next=d._last=d._onUpdate=d._timeline=d.timeline=null;d._paused=!1;d.play=function(a,c){arguments.length&&this.seek(a,c);this.reversed(!1);return this.paused(!1)};d.pause=function(a,c){arguments.length&&this.seek(a,c);return this.paused(!0)};d.resume=function(a,c){arguments.length&&this.seek(a,c);return this.paused(!1)};d.seek=function(a,c){return this.totalTime(Number(a), !1!=c)};d.restart=function(a,c){this.reversed(!1);this.paused(!1);return this.totalTime(a?-this._delay:0,!1!=c)};d.reverse=function(a,c){arguments.length&&this.seek(a||this.totalDuration(),c);this.reversed(!0);return this.paused(!1)};d.render=function(){};d.invalidate=function(){return this};d._enabled=function(a,c){this._gc=!a;this._active=a&&!this._paused&&0this._duration&&(a=this._duration);return this.totalTime(a,c)};d.totalTime=function(a,c){if(!arguments.length)return this._totalTime;if(this._timeline){0>a&&(a+=this.totalDuration());if(this._timeline.smoothChildTiming&&(this._dirty&&this.totalDuration(),a>this._totalDuration&& (a=this._totalDuration),this._startTime=(this._paused?this._pauseTime:this._timeline._time)-(!this._reversed?a:this._totalDuration-a)/this._timeScale,this._timeline._dirty||this._uncache(!1),!this._timeline._active))for(var b=this._timeline;b._timeline;)b.totalTime(b._totalTime,!0),b=b._timeline;this._gc&&this._enabled(!0,!1);this._totalTime!=a&&this.render(a,c,!1)}return this};d.startTime=function(a){if(!arguments.length)return this._startTime;a!=this._startTime&&(this._startTime=a,this.timeline&& this.timeline._sortChildren&&this.timeline.insert(this,a-this._delay));return this};d.timeScale=function(a){if(!arguments.length)return this._timeScale;a=a||1E-6;if(this._timeline&&this._timeline.smoothChildTiming){var c=this._pauseTime||0==this._pauseTime?this._pauseTime:this._timeline._totalTime;this._startTime=c-(c-this._startTime)*this._timeScale/a}this._timeScale=a;return this._uncache(!1)};d.reversed=function(a){if(!arguments.length)return this._reversed;a!=this._reversed&&(this._reversed=a, this.totalTime(this._totalTime,!0));return this};d.paused=function(a){if(!arguments.length)return this._paused;a!=this._paused&&this._timeline&&(!a&&this._timeline.smoothChildTiming&&(this._startTime+=this._timeline.rawTime()-this._pauseTime,this._uncache(!1)),this._pauseTime=a?this._timeline.rawTime():null,this._paused=a,this._active=!this._paused&&0d;)b=b._prev;b?(a._next= b._next,b._next=a):(a._next=this._first,this._first=a);a._next?a._next._prev=a:this._last=a;a._prev=b;this._timeline&&this._uncache(!0);return this};d._remove=function(a,c){a.timeline===this&&(c||a._enabled(!1,!0),a.timeline=null,a._prev?a._prev._next=a._next:this._first===a&&(this._first=a._next),a._next?a._next._prev=a._prev:this._last===a&&(this._last=a._prev),this._timeline&&this._uncache(!0));return this};d.render=function(a,c){var b=this._first,d;for(this._totalTime=this._time=this._rawPrevTime= a;b;){d=b._next;if(b._active||a>=b._startTime&&!b._paused)b._reversed?b.render((!b._dirty?b._totalDuration:b.totalDuration())-(a-b._startTime)*b._timeScale,c,!1):b.render((a-b._startTime)*b._timeScale,c,!1);b=d}};d.rawTime=function(){return this._totalTime};var g=q("TweenLite",function(a,c,b){p.call(this,c,b);if(null==a)throw"Cannot tween an undefined reference.";this.target=a;this._overwrite=null==this.vars.overwrite?J[g.defaultOverwrite]:"number"===typeof this.vars.overwrite?this.vars.overwrite>> 0:J[this.vars.overwrite];if((a instanceof Array||a.jquery)&&"object"===typeof a[0]){this._targets=a.slice(0);this._propLookup=[];this._siblings=[];for(a=0;ag&&((0===c._duration||!f._initted)&&2E-10>=g-f._startTime||(l[k++]=f));for(i=k;-1<--i;)if(f=l[i],2=== d&&f._kill(b,a)&&(h=!0),2!==d||!f._firstPT&&f._initted)f._enabled(!1,!1)&&(h=!0);return h},L=function(a,c){for(var b=a._timeline,d=b._timeScale,e=a._startTime;b._timeline;){e+=b._startTime;d*=b._timeScale;if(b._paused)return-100;b=b._timeline}e/=d;return e>c?e-c:!a._initted&&2E-10>e-c?1E-10:(e+=a.totalDuration()/a._timeScale/d)>c?0:e-c-1E-10};d._init=function(){this.vars.startAt&&(this.vars.startAt.overwrite=0,this.vars.startAt.immediateRender=!0,g.to(this.target,0,this.vars.startAt));var a,c;this._ease= this.vars.ease instanceof s?this.vars.easeParams instanceof Array?this.vars.ease.config.apply(this.vars.ease,this.vars.easeParams):this.vars.ease:"function"===typeof this.vars.ease?new s(this.vars.ease,this.vars.easeParams):g.defaultEase;this._easeType=this._ease._type;this._easePower=this._ease._power;this._firstPT=null;if(this._targets)for(a=this._targets.length;-1<--a;){if(this._initProps(this._targets[a],this._propLookup[a]={},this._siblings[a],this._overwrittenProps?this._overwrittenProps[a]: null))c=!0}else c=this._initProps(this.target,this._propLookup,this._siblings,this._overwrittenProps);c&&g._onPluginEvent("_onInitAllProps",this);this._overwrittenProps&&null==this._firstPT&&"function"!==typeof this.target&&this._enabled(!1,!1);if(this.vars.runBackwards)for(a=this._firstPT;a;)a.s+=a.c,a.c=-a.c,a=a._next;this._onUpdate=this.vars.onUpdate;this._initted=!0};d._initProps=function(a,c,b,d){var e,i,h,f,g,l;if(null==a)return!1;for(e in this.vars){if(N[e]){if("onStartParams"===e||"onUpdateParams"=== e||"onCompleteParams"===e||"onReverseCompleteParams"===e||"onRepeatParams"===e)if(g=this.vars[e])for(i=g.length;-1<--i;)"{self}"===g[i]&&(g=this.vars[e]=g.concat(),g[i]=this)}else if(K[e]&&(f=new K[e])._onInitTween(a,this.vars[e],this)){this._firstPT=l={_next:this._firstPT,t:f,p:"setRatio",s:0,c:1,f:!0,n:e,pg:!0,pr:f._priority};for(i=f._overwriteProps.length;-1<--i;)c[f._overwriteProps[i]]=this._firstPT;if(f._priority||f._onInitAllProps)h=!0;if(f._onDisable||f._onEnable)this._notifyPluginsOfEnabled= !0}else this._firstPT=c[e]=l={_next:this._firstPT,t:a,p:e,f:"function"===typeof a[e],n:e,pg:!1,pr:0},l.s=!l.f?parseFloat(a[e]):a[e.indexOf("set")||"function"!==typeof a["get"+e.substr(3)]?e:"get"+e.substr(3)](),i=this.vars[e],l.c="number"===typeof i?i-l.s:"string"===typeof i&&"="===i.charAt(1)?parseInt(i.charAt(0)+"1")*Number(i.substr(2)):Number(i)||0;l&&l._next&&(l._next._prev=l)}return d&&this._kill(d,a)?this._initProps(a,c,b,d):1=this._duration){if(this._totalTime=this._time=this._duration,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(e=!0,i="onComplete"),0===this._duration){if(0===a||0>this._rawPrevTime)this._rawPrevTime!==a&&(b=!0);this._rawPrevTime=a}}else if(0>=a){this._totalTime=this._time=0;this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0;if(0!==d||0===this._duration&&0a?(this._active=!1,0===this._duration&&(0<=this._rawPrevTime&&(b=!0),this._rawPrevTime=a)):this._initted||(b=!0)}else if(this._totalTime=this._time=a,this._easeType){var h=a/this._duration,f=this._easeType,g=this._easePower;if(1===f||3===f&&0.5<=h)h=1-h;3===f&&(h*=2);1===g?h*=h:2===g?h*=h*h:3===g?h*=h*h*h:4===g&&(h*=h*h*h*h);this.ratio=1===f?1-h:2===f?h:0.5>a/this._duration?h/2:1-h/2}else this.ratio=this._ease.getRatio(a/this._duration);if(this._time!==d||b){this._initted|| (this._init(),!e&&this._time&&(this.ratio=this._ease.getRatio(this._time/this._duration)));!this._active&&!this._paused&&(this._active=!0);if(0===d&&this.vars.onStart&&(0!==this._time||0===this._duration))c||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||D);for(a=this._firstPT;a;){if(a.f)a.t[a.p](a.c*this.ratio+a.s);else a.t[a.p]=a.c*this.ratio+a.s;a=a._next}this._onUpdate&&(c||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||D));i&&!this._gc&& (e&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),c||this.vars[i]&&this.vars[i].apply(this.vars[i+"Scope"]||this,this.vars[i+"Params"]||D))}};d._kill=function(a,c){"all"===a&&(a=null);if(null==a&&(null==c||c==this.target))return this._enabled(!1,!1);var c=c||this._targets||this.target,b,d,e,i,g,f,k;if((c instanceof Array||c.jquery)&&"object"===typeof c[0])for(b=c.length;-1<--b;)this._kill(a,c[b])&&(g=!0);else{if(this._targets)for(b=this._targets.length;-1<--b;){if(c=== this._targets[b]){i=this._propLookup[b]||{};this._overwrittenProps=this._overwrittenProps||[];d=this._overwrittenProps[b]=a?this._overwrittenProps[b]||{}:"all";break}}else{if(c!==this.target)return!1;i=this._propLookup;d=this._overwrittenProps=a?this._overwrittenProps||{}:"all"}if(i)for(e in f=a||i,k=a!=d&&"all"!=d&&a!=i&&(null==a||!0!=a._tempKill),f){if(b=i[e]){b.pg&&b.t._kill(f)&&(g=!0);if(!b.pg||0===b.t._overwriteProps.length)b._prev?b._prev._next=b._next:b===this._firstPT&&(this._firstPT=b._next), b._next&&(b._next._prev=b._prev),b._next=b._prev=null;delete i[e]}k&&(d[e]=1)}}return g};d.invalidate=function(){this._notifyPluginsOfEnabled&&g._onPluginEvent("_onDisable",this);this._onUpdate=this._overwrittenProps=this._firstPT=null;this._initted=this._active=this._notifyPluginsOfEnabled=!1;this._propLookup=this._targets?{}:[];return this};d._enabled=function(a,c){if(a&&this._gc)if(this._targets)for(var b=this._targets.length;-1<--b;)this._siblings[b]=x(this._targets[b],this,!0);else this._siblings= x(this.target,this,!0);p.prototype._enabled.call(this,a,c);return this._notifyPluginsOfEnabled&&this._firstPT?g._onPluginEvent(a?"_onEnable":"_onDisable",this):!1};g.to=function(a,c,b){return new g(a,c,b)};g.from=function(a,c,b){b.runBackwards=!0;!1!=b.immediateRender&&(b.immediateRender=!0);return new g(a,c,b)};g.fromTo=function(a,c,b,d){d.startAt=b;b.immediateRender&&(d.immediateRender=!0);return new g(a,c,d)};g.delayedCall=function(a,c,b,d,e){return new g(c,0,{delay:a,onComplete:c,onCompleteParams:b, onCompleteScope:d,onReverseComplete:c,onReverseCompleteParams:b,onReverseCompleteScope:d,immediateRender:!1,useFrames:e,overwrite:0})};g.set=function(a,c){return new g(a,0,c)};g.killTweensOf=g.killDelayedCallsTo=function(a,c){for(var b=g.getTweensOf(a),d=b.length;-1<--d;)b[d]._kill(c,a)};g.getTweensOf=function(a){if(null!=a){var c,b,d;if((a instanceof Array||a.jquery)&&"object"===typeof a[0]){c=a.length;for(b=[];-1<--c;)b=b.concat(g.getTweensOf(a[c]));for(c=b.length;-1<--c;){d=b[c];for(a=c;-1<--a;)d=== b[a]&&b.splice(c,1)}}else{b=x(a).concat();for(c=b.length;-1<--c;)b[c]._gc&&b.splice(c,1)}return b}};var y=q("plugins.TweenPlugin",function(a,c){this._overwriteProps=(a||"").split(",");this._propName=this._overwriteProps[0];this._priority=c||0},!0);d=y.prototype;y.version=12;y.API=2;d._firstPT=null;d._addTween=function(a,c,b,d,e,g){var h;if(null!=d&&(h="number"===typeof d||"="!==d.charAt(1)?Number(d)-b:parseInt(d.charAt(0)+"1")*Number(d.substr(2))))this._firstPT=a={_next:this._firstPT,t:a,p:c,s:b, c:h,f:"function"===typeof a[c],n:e||c,r:g},a._next&&(a._next._prev=a)};d.setRatio=function(a){for(var c=this._firstPT,b;c;){b=c.c*a+c.s;c.r&&(b=b+(0>0);if(c.f)c.t[c.p](b);else c.t[c.p]=b;c=c._next}};d._kill=function(a){if(null!=a[this._propName])this._overwriteProps=[];else for(var c=this._overwriteProps.length;-1<--c;)null!=a[this._overwriteProps[c]]&&this._overwriteProps.splice(c,1);for(c=this._firstPT;c;)null!=a[c.n]&&((c._next&&(c._next._prev=c._prev),c._prev)?(c._prev._next=c._next, c._prev=null):this._firstPT===c&&(this._firstPT=c._next)),c=c._next;return!1};d._roundProps=function(a,c){for(var b=this._firstPT;b;){if(a[this._propName]||null!=b.n&&a[b.n.split(this._propName+"_").join("")])b.r=c;b=b._next}};g._onPluginEvent=function(a,c){var b=c._firstPT,d;if("_onInitAllProps"===a){for(var e,g,h,f;b;){f=b._next;for(e=g;e&&e.pr>b.pr;)e=e._next;(b._prev=e?e._prev:h)?b._prev._next=b:g=b;(b._next=e)?e._prev=b:h=b;b=f}b=c._firstPT=g}for(;b;)b.pg&&"function"===typeof b.t[a]&&b.t[a]()&& (d=!0),b=b._next;return d};y.activate=function(a){for(var c=a.length;-1<--c;)a[c].API===y.API&&(g._plugins[(new a[c])._propName]=a[c]);return!0};if(o=m._gsQueue){for(k=0;k=k){if(this._totalTime=k,this._cycle=this._repeat,this._yoyo&&0!== (this._cycle&1)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=this._duration,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(w=!0,m="onComplete"),0===this._duration){if(0===b||0>this._rawPrevTime)this._rawPrevTime!==b&&(f=!0);this._rawPrevTime=b}}else if(0>=b){this._totalTime=this._time=this._cycle=0;this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0;if(0!==s||0===this._duration&&0b?(this._active=!1,0===this._duration&&(0<=this._rawPrevTime&&(f=!0),this._rawPrevTime=b)):this._initted||(f=!0)}else if(this._totalTime=this._time=b,0!==this._repeat&&((b=this._duration+this._repeatDelay,this._cycle=this._totalTime/b>>0,0!==this._cycle&&this._cycle===this._totalTime/b&&this._cycle--,this._time=this._totalTime-this._cycle*b,this._yoyo&&0!==(this._cycle&1)&&(this._time=this._duration-this._time),this._time>this._duration)?this._time=this._duration:0>this._time&&(this._time=0)),this._easeType){var b= this._time/this._duration,k=this._easeType,A=this._easePower;if(1===k||3===k&&0.5<=b)b=1-b;3===k&&(b*=2);1===A?b*=b:2===A?b*=b*b:3===A?b*=b*b*b:4===A&&(b*=b*b*b*b);this.ratio=1===k?1-b:2===k?b:0.5>this._time/this._duration?b/2:1-b/2}else this.ratio=this._ease.getRatio(this._time/this._duration);if(z!==this._time||f){this._initted||(this._init(),!w&&this._time&&(this.ratio=this._ease.getRatio(this._time/this._duration)));!this._active&&!this._paused&&(this._active=!0);if(0==s&&this.vars.onStart&&(0!== this._totalTime||0===this._duration))d||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||c);for(f=this._firstPT;f;){if(f.f)f.t[f.p](f.c*this.ratio+f.s);else f.t[f.p]=f.c*this.ratio+f.s;f=f._next}this._onUpdate&&(d||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||c));this._cycle!=e&&(d||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||c));m&&!this._gc&&(w&&(this._timeline.autoRemoveChildren&& this._enabled(!1,!1),this._active=!1),d||this.vars[m]&&this.vars[m].apply(this.vars[m+"Scope"]||this,this.vars[m+"Params"]||c))}};p.to=function(b,d,f){return new p(b,d,f)};p.from=function(b,d,f){f.runBackwards=!0;!1!=f.immediateRender&&(f.immediateRender=!0);return new p(b,d,f)};p.fromTo=function(b,d,f,k){k.startAt=f;f.immediateRender&&(k.immediateRender=!0);return new p(b,d,k)};p.staggerTo=p.allTo=function(b,d,f,k,z,c,s){var k=k||0,w=[],m=b.length,e=f.delay||0,o,i,q;for(i=0;ithis._duration&&(b=this._duration);this._yoyo&&0!==(this._cycle&1)?b=this._duration-b+this._cycle*(this._duration+this._repeatDelay):0!=this._repeat&&(b+=this._cycle*(this._duration+this._repeatDelay));return this.totalTime(b, d)};q.totalDuration=function(b){return!arguments.length?(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration):-1==this._repeat?this:this.duration((b-this._repeat*this._repeatDelay)/(this._repeat+1))};q.repeat=function(b){if(!arguments.length)return this._repeat;this._repeat=b;return this._uncache(!0)};q.repeatDelay=function(b){if(!arguments.length)return this._repeatDelay;this._repeatDelay= b;return this._uncache(!0)};q.yoyo=function(b){if(!arguments.length)return this._yoyo;this._yoyo=b;return this};return p},!0);_gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(x,v,i){var p=function(b){v.call(this,b);this._labels={};this.autoRemoveChildren=!0==this.vars.autoRemoveChildren;this.smoothChildTiming=!0==this.vars.smoothChildTiming;this._sortChildren=!0;this._onUpdate=this.vars.onUpdate;for(var b=q.length,h,d;-1<--b;)if(d=this.vars[q[b]])for(h=d.length;-1< --h;)"{self}"===d[h]&&(d=this.vars[q[b]]=d.concat(),d[h]=this);this.vars.tweens instanceof Array&&this.insertMultiple(this.vars.tweens,0,this.vars.align||"normal",this.vars.stagger||0)},q=["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"],c=[],s=function(b){var h={},d;for(d in b)h[d]=b[d];return h},e=p.prototype=new v;e.constructor=p;e.kill()._gc=!1;e.to=function(b,h,d,f,k){return this.insert(new i(b,h,d),this._parseTimeOrLabel(k)+(f||0))};e.from=function(b, h,d,f,k){return this.insert(i.from(b,h,d),this._parseTimeOrLabel(k)+(f||0))};e.fromTo=function(b,h,d,f,k,z){return this.insert(i.fromTo(b,h,d,f),this._parseTimeOrLabel(z)+(k||0))};e.staggerTo=function(b,h,d,f,k,z,c,e,w){c=new p({onComplete:c,onCompleteParams:e,onCompleteScope:w});f=f||0;for(e=0;e=f){this._totalTime= this._time=f;if(!this._reversed&&!this._hasPausedChild()&&(w=!0,A="onComplete",0===this._duration&&(0===b||0>this._rawPrevTime)))this._rawPrevTime!==b&&(d=!0);this._rawPrevTime=b;b=f+1E-6}else if(0>=b){this._totalTime=this._time=0;if(0!==k||0===this._duration&&0b?(this._active=!1,0===this._duration&&0<=this._rawPrevTime&&(d=!0)):this._initted||(d=!0);this._rawPrevTime=b;b=-1E-6}else this._totalTime=this._time=this._rawPrevTime=b;if(this._time!== k||d){this._initted||(this._initted=!0);0===k&&this.vars.onStart&&0!==this._time&&(h||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||c));if(this._time>k)for(d=this._first;d;){m=d._next;if(this._paused&&!i)break;else if(d._active||d._startTime<=this._time&&!d._paused&&!d._gc)d._reversed?d.render((!d._dirty?d._totalDuration:d.totalDuration())-(b-d._startTime)*d._timeScale,h,!1):d.render((b-d._startTime)*d._timeScale,h,!1);d=m}else for(d=this._last;d;){m=d._prev;if(this._paused&& !i)break;else if(d._active||d._startTime<=k&&!d._paused&&!d._gc)d._reversed?d.render((!d._dirty?d._totalDuration:d.totalDuration())-(b-d._startTime)*d._timeScale,h,!1):d.render((b-d._startTime)*d._timeScale,h,!1);d=m}this._onUpdate&&(h||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||c));if(A&&!this._gc&&(s===this._startTime||e!=this._timeScale))if(0===this._time||f>=this.totalDuration())w&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),h||this.vars[A]&& this.vars[A].apply(this.vars[A+"Scope"]||this,this.vars[A+"Params"]||c)}};e._hasPausedChild=function(){for(var b=this._first;b;){if(b._paused||b instanceof p&&b._hasPausedChild())return!0;b=b._next}return!1};e.getChildren=function(b,c,d,f){for(var f=f||-9999999999,k=[],s=this._first,e=0;s;)s._startTime=d&&(f._startTime+=b),f=f._next;if(c)for(var k in this._labels)this._labels[k]>=d&&(this._labels[k]+=b);return this._uncache(!0)};e._kill=function(b,c){if(null==b&&null==c)return this._enabled(!1,!1);for(var d=null==c?this.getChildren(!0,!0,!1):this.getTweensOf(c), f=d.length,k=!1;-1<--f;)d[f]._kill(b,c)&&(k=!0);return k};e.clear=function(b){var c=this.getChildren(!1,!0,!0),d=c.length;for(this._time=this._totalTime=0;-1<--d;)c[d]._enabled(!1,!1);!1!=b&&(this._labels={});return this._uncache(!0)};e.invalidate=function(){for(var b=this._first;b;)b.invalidate(),b=b._next;return this};e._enabled=function(b,c){if(b==this._gc)for(var d=this._first;d;)d._enabled(b,!0),d=d._next;return v.prototype._enabled.call(this,b,c)};e.progress=function(b){return!arguments.length? this._time/this.duration():this.totalTime(this.duration()*b,!1)};e.duration=function(b){if(!arguments.length)return this._dirty&&this.totalDuration(),this._duration;0!==this.duration()&&0!==b&&this.timeScale(this._duration/b);return this};e.totalDuration=function(b){if(!arguments.length){if(this._dirty){for(var c=0,d=this._first,f=-999999999999,k;d;)k=d._next,d._startTimed._startTime&&(c-=d._startTime,this.shiftChildren(-d._startTime, !1,-9999999999)),d=d._startTime+(!d._dirty?d._totalDuration:d.totalDuration())/d._timeScale,d>c&&(c=d),d=k;this._duration=this._totalDuration=c;this._dirty=!1}return this._totalDuration}0!==this.totalDuration()&&0!==b&&this.timeScale(this._totalDuration/b);return this};e.usesFrames=function(){for(var b=this._timeline;b._timeline;)b=b._timeline;return b===x._rootFramesTimeline};e.rawTime=function(){return this._paused||0!==this._totalTime&&this._totalTime!==this._totalDuration?this._totalTime:(this._timeline.rawTime()- this._startTime)*this._timeScale};return p},!0);_gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(x,v,i){var p=function(c){x.call(this,c);this._repeat=this.vars.repeat||0;this._repeatDelay=this.vars.repeatDelay||0;this._cycle=0;this._yoyo=!0==this.vars.yoyo;this._dirty=!0},q=[],c=new i(null,null,1,0),i=p.prototype=new x;i.constructor=p;i.kill()._gc=!1;p.version=12;i.invalidate=function(){this._yoyo=!0==this.vars.yoyo;this._repeat=this.vars.repeat||0;this._repeatDelay=this.vars.repeatDelay|| 0;this._uncache(!0);return x.prototype.invalidate.call(this)};i.addCallback=function(c,e,b,h){return this.insert(v.delayedCall(0,c,b,h),e)};i.removeCallback=function(c,e){if(null==e)this._kill(null,c);else for(var b=this.getTweensOf(c,!1),h=b.length,d=this._parseTimeOrLabel(e,!1);-1<--h;)b[h]._startTime===d&&b[h]._enabled(!1,!1);return this};i.tweenTo=function(s,e){var e=e||{},b={ease:c,overwrite:2,useFrames:this.usesFrames(),immediateRender:!1},h,d;for(h in e)b[h]=e[h];b.time=this._parseTimeOrLabel(s, !1);d=new v(this,Math.abs(Number(b.time)-this._time)/this._timeScale||0.001,b);b.onStart=function(){d.target.paused(!0);d.vars.time!=d.target.time()&&d.duration(Math.abs(d.vars.time-d.target.time())/d.target._timeScale);e.onStart&&e.onStart.apply(e.onStartScope||d,e.onStartParams||q)};return d};i.tweenFromTo=function(c,e,b){b=b||{};b.startAt={time:this._parseTimeOrLabel(c,!1)};c=this.tweenTo(e,b);return c.duration(Math.abs(c.vars.time-c.vars.startAt.time)/this._timeScale||0.001)};i.render=function(c, e,b){this._gc&&this._enabled(!0,!1);this._active=!this._paused;var h=!this._dirty?this._totalDuration:this.totalDuration(),d=this._time,f=this._totalTime,k=this._startTime,z=this._timeScale,i=this._rawPrevTime,p=this._paused,w=this._cycle,m,A;if(c>=h){this._locked||(this._totalTime=h,this._cycle=this._repeat);if(!this._reversed&&!this._hasPausedChild()&&(m=!0,A="onComplete",0===this._duration&&(0===c||0>this._rawPrevTime)))this._rawPrevTime!==c&&(b=!0);this._rawPrevTime=c;this._yoyo&&0!==(this._cycle& 1)?(this._time=0,c=-1E-6):(this._time=this._duration,c=this._duration+1E-6)}else if(0>=c){this._locked||(this._totalTime=this._cycle=0);this._time=0;if(0!==d||0===this._duration&&0c?(this._active=!1,0===this._duration&&0<=this._rawPrevTime&&(b=!0)):this._initted||(b=!0);this._rawPrevTime=c;c=-1E-6}else if(this._time=this._rawPrevTime=c,!this._locked&&(this._totalTime=c,0!==this._repeat))(c=this._duration+this._repeatDelay,this._cycle=this._totalTime/ c>>0,0!==this._cycle&&this._cycle===this._totalTime/c&&this._cycle--,this._time=this._totalTime-this._cycle*c,this._yoyo&&0!=(this._cycle&1)&&(this._time=this._duration-this._time),this._time>this._duration)?(this._time=this._duration,c=this._duration+1E-6):0>this._time?(this._time=0,c=-1E-6):c=this._time;if(this._cycle!==w&&!this._locked){var o=this._yoyo&&0!==(w&1),O=o===(this._yoyo&&0!==(this._cycle&1)),v=this._totalTime,x=this._cycle,E=this._rawPrevTime,B=this._time;this._totalTime=w*this._duration; this._cycled)for(b=this._first;b;){f=b._next;if(this._paused&&!p)break;else if(b._active||b._startTime<=this._time&&!b._paused&&!b._gc)b._reversed?b.render((!b._dirty?b._totalDuration:b.totalDuration())-(c-b._startTime)*b._timeScale,e,!1):b.render((c-b._startTime)*b._timeScale,e,!1);b=f}else for(b=this._last;b;){f=b._prev;if(this._paused&&!p)break;else if(b._active||b._startTime<=d&&!b._paused&&!b._gc)b._reversed? b.render((!b._dirty?b._totalDuration:b.totalDuration())-(c-b._startTime)*b._timeScale,e,!1):b.render((c-b._startTime)*b._timeScale,e,!1);b=f}this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||q));if(A&&!this._locked&&!this._gc&&(k===this._startTime||z!=this._timeScale))if(0===this._time||h>=this.totalDuration())m&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),e||this.vars[A]&&this.vars[A].apply(this.vars[A+"Scope"]||this,this.vars[A+ "Params"]||q)}};i.getActive=function(c,e,b){null==c&&(c=!0);null==e&&(e=!0);null==b&&(b=!1);var h=[],c=this.getChildren(c,e,b),e=0,b=c.length,d,f;for(d=0;d=f._startTime&&f._timeline._time c)return e[h].name;return null};i.getLabelBefore=function(c){null==c&&(c=this._time);for(var e=this.getLabelsArray(),b=e.length;-1<--b;)if(e[b].timethis._duration&&(c=this._duration);this._yoyo&&0!==(this._cycle&1)?c=this._duration-c+this._cycle*(this._duration+this._repeatDelay):0!=this._repeat&&(c+=this._cycle*(this._duration+this._repeatDelay));return this.totalTime(c,e)};i.repeat=function(c){if(!arguments.length)return this._repeat;this._repeat=c;return this._uncache(!0)};i.repeatDelay=function(c){if(!arguments.length)return this._repeatDelay;this._repeatDelay=c;return this._uncache(!0)};i.yoyo=function(c){if(!arguments.length)return this._yoyo; this._yoyo=c;return this};i.currentLabel=function(c){return!arguments.length?this.getLabelBefore(this._time+1E-8):this.seek(c,!0)};return p},!0);_gsDefine("plugins.BezierPlugin",["plugins.TweenPlugin"],function(x){var v=function(){x.call(this,"bezier",-1);this._overwriteProps.pop();this._func={};this._round={}},i=v.prototype=new x("bezier",1),p=180/Math.PI,q=[],c=[],s=[],e={},b=function(b,c,d,e){this.a=b;this.b=c;this.c=d;this.d=e;this.da=e-b;this.ca=d-b;this.ba=c-b},h=v.bezierThrough=function(f, k,z,h,i,w){var m={},A=[],o,p,i="string"===typeof i?","+i+",":",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,";null==k&&(k=1);for(p in f[0])A.push(p);q.length=c.length=s.length=0;for(o=A.length;-1<--o;){p=A[o];e[p]=-1!==i.indexOf(","+p+",");var v=m,x=p,E;E=f;var B=p,n=e[p],C=w,G=[],F=void 0,y=void 0,D=void 0,g=void 0,t=void 0,F=void 0;if(C){E=[C].concat(E);for(y=E.length;-1<--y;)if("string"=== typeof(F=E[y][B]))"="===F.charAt(1)&&(E[y][B]=C[B]+Number(F.charAt(0)+F.substr(2)))}F=E.length-2;if(0>F)G[0]=new b(E[0][B],0,0,E[-1>F?0:1][B]);else{for(y=0;y>0||6;p=[];s=[];i=v=0;d=m-1;o=[];e=[];for(A in w){q=w[A];B=p;n=m;C=1/n;G=q.length; for(var y=void 0,D=void 0,g=x=F=D=void 0,t=y=void 0,u=void 0,u=g=void 0;-1<--G;){g=q[G];D=g.a;F=g.d-D;x=g.c-D;g=g.b-D;D=0;for(t=1;t<=n;t++)y=C*t,u=1-y,y=D-(D=(y*y*F+3*u*(y*x+u*g))*y),u=G*n+t-1,B[u]=(B[u]||0)+y*y}}w=p.length;for(A=0;A>0,o[q]=e,s[q]=i,v=0,e=[]);this._length=i;this._lengths=s;this._segments=o;this._l1=this._li=this._s1=this._si=0;this._l2=this._lengths[0];this._curSeg=this._segments[0];this._s2=this._curSeg[0];this._prec=1/this._curSeg.length}if(e= this._autoRotate){e[0]instanceof Array||(this._autoRotate=e=[e]);for(w=e.length;-1<--w;)for(A=0;3>A;A++)m=e[w][A],this._func[m]="function"===typeof c[m]?c[m.indexOf("set")||"function"!==typeof c["get"+m.substr(3)]?m:"get"+m.substr(3)]:!1}return!0};i.setRatio=function(b){var d=this._segCount,c=this._func,e=this._target,i,h,m,q,o;if(this._timeRes){i=this._lengths;q=this._curSeg;b*=this._length;h=this._li;if(b>this._l2&&h=b;);0===h&&bthis._s2&&h=b;);0===h&&bb?0:1<=b?d-1:d*b>>0,q=(b-i*(1/d))*d;d=1-q;for(h=this._props.length;-1<--h;)if(b=this._props[h],m=this._beziers[b][i],o=(q*q*m.da+3*d*(q*m.ca+d*m.ba))*q+m.a,this._round[b]&&(o=o+(0>0),c[b])e[b](o);else e[b]=o;if(this._autoRotate){var d=this._autoRotate,s,v,x,E,B;for(h=d.length;-1<--h;)b=d[h][2],E=d[h][3]||0,B=!0==d[h][4]?1:p,m=this._beziers[d[h][0]][i],o=this._beziers[d[h][1]][i],s=m.a+(m.b-m.a)*q,v=m.b+(m.c-m.b)*q,s+=(v-s)* q,v+=(m.c+(m.d-m.c)*q-v)*q,m=o.a+(o.b-o.a)*q,x=o.b+(o.c-o.b)*q,m+=(x-m)*q,x+=(o.c+(o.d-o.c)*q-x)*q,o=Math.atan2(x-m,v-s)*B+E,c[b]?c[b].call(e,o):e[b]=o}};i._roundProps=function(b,d){for(var c=this._overwriteProps,e=c.length;-1<--e;)if(b[c[e]]||b.bezier||b.bezierThrough)this._round[c[e]]=d};i._kill=function(b){var d=this._props,c,e;for(c in _beziers)if(c in b){delete this._beziers[c];delete this._func[c];for(e=d.length;-1<--e;)d[e]===c&&d.splice(e,1)}return x.prototype._kill.call(this,b)};x.activate([v]); return v},!0);_gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(x){var v=function(){x.call(this,"css");this._overwriteProps.pop()},i=v.prototype=new x("css");i.constructor=v;v.API=2;v.suffixMap={top:"px",right:"px",bottom:"px",left:"px",width:"px",height:"px",fontSize:"px",padding:"px",margin:"px"};var p=/[^\d\-\.]/g,q=/(\d|\-|\+|=|#|\.)*/g,c=/(\d|\.)+/g,s=/opacity *= *([^)]*)/,e=/opacity:([^;]*)/,b=/([A-Z])/g,h=/-([a-z])/gi,d=function(b,g){return g.toUpperCase()},f=/(Left|Right|Width)/i, k=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,z=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,K=Math.PI/180,N=180/Math.PI,w={},m=document,A=m.createElement("div"),o=navigator.userAgent,O,L,M,E,B,n=o.indexOf("Android"),C=m.createElement("div");M=-1!==o.indexOf("Safari")&&-1===o.indexOf("Chrome")&&(-1===n||3a";B=(o=C.getElementsByTagName("a")[0])?/^0.55/.test(o.style.opacity): !1;var G=function(b){if(!b||""===b)return Q.black;if(Q[b])return Q[b];if("number"===typeof b)return[b>>16,b>>8&255,b&255];if("#"===b.charAt(0)){if(4===b.length)var g=b.charAt(1),d=b.charAt(2),b=b.charAt(3),b="#"+g+g+d+d+b+b;b=parseInt(b.substr(1),16);return[b>>16,b>>8&255,b&255]}return b.match(c)||Q.transparent},F=function(b){return s.test("string"===typeof b?b:(b.currentStyle?b.currentStyle.filter:b.style.filter)||"")?parseFloat(RegExp.$1)/100:1},y=m.defaultView?m.defaultView.getComputedStyle:function(){}, D=function(g,d,c,u){return!B&&"opacity"===d?F(g):!u&&g.style[d]?g.style[d]:(c=c||y(g,null))?(g=c.getPropertyValue(d.replace(b,"-$1").toLowerCase()))||c.length?g:c[d]:g.currentStyle?(c=g.currentStyle,u=c[d],!u&&"backgroundPosition"===d?c[d+"X"]+" "+c[d+"Y"]:u):null},g=function(b,g){var c={},u;if(g=g||y(b,null))if(u=g.length)for(;-1<--u;)c[g[u].replace(h,d)]=g.getPropertyValue(g[u]);else for(u in g)c[u]=g[u];else if(g=b.currentStyle||b.style)for(u in g)c[u.replace(h,d)]=g[u];B||(c.opacity=F(b));u=R(b, g,!1);c.rotation=u.rotation*N;c.skewX=u.skewX*N;c.scaleX=u.scaleX;c.scaleY=u.scaleY;c.x=u.x;c.y=u.y;null!=c.filters&&delete c.filters;return c},t=function(b,g,d,c){var u={},t,n;for(n in g)if("cssText"!==n&&"length"!==n&&isNaN(n)&&b[n]!=(t=g[n]))if(t!==I&&("number"===typeof t||"string"===typeof t))u[n]=(""===t||"auto"===t)&&"string"===typeof b[n]&&""!==b[n].replace(p,"")?0:t,c&&c.props.push(n);if(d)for(n in d)"className"!==n&&(u[n]=d[n]);return u},u={scaleX:1,scaleY:1,x:1,y:1,rotation:1,shortRotation:1, skewX:1,skewY:1,scale:1},H="",J="",I=function(b,g){var g=g||m.body||m.documentElement,d=y(g,""),c,u;if(D(g,b))return b;b=b.substr(0,1).toUpperCase()+b.substr(1);c=["O","Moz","ms","Ms","Webkit"];for(u=5;-1<--u&&!D(g,c[u]+b,d););return 0<=u?(J=3===u?"ms":c[u],H="-"+J.toLowerCase()+"-",J+b):null}("transform"),V=H+"transform",R=function(b,g,d){var c=b._gsTransform,u;I?u=D(b,V,g,!0):b.currentStyle&&(u=(u=b.currentStyle.filter.match(k))&&4===u.length?u[0].substr(4)+","+Number(u[2].substr(4))+","+Number(u[1].substr(4))+ ","+u[3].substr(4)+","+(c?c.x:0)+","+(c?c.y:0):null);var g=(u||"").replace(/[^\d\-\.e,]/g,"").split(","),t=(u=6<=g.length)?Number(g[0]):1,n=u?Number(g[1]):0,f=u?Number(g[2]):0,e=u?Number(g[3]):1,c=d?c||{skewY:0}:{skewY:0},h=0>c.scaleX;c.x=u?Number(g[4]):0;c.y=u?Number(g[5]):0;c.scaleX=Math.sqrt(t*t+n*n);c.scaleY=Math.sqrt(e*e+f*f);c.rotation=t||n?Math.atan2(n,t):c.rotation||0;c.skewX=f||e?Math.atan2(f,e)+c.rotation:c.skewX||0;Math.abs(c.skewX)>Math.PI/2&&(h?(c.scaleX*=-1,c.skewX+=0>=c.rotation?Math.PI: -Math.PI,c.rotation+=0>=c.rotation?Math.PI:-Math.PI):(c.scaleY*=-1,c.skewX+=0>=c.skewX?Math.PI:-Math.PI));if(1E-6>c.rotation&&-1E-6c.skewX&&-1E-6c;h&&(c=-c);e.cssText="border-style:solid; border-width:0; position:absolute; line-height:0;"; "%"===d||"em"===d||!n.appendChild?(n=b.parentNode||m.body,e[t?"width":"height"]=c+d):e[t?"borderLeftWidth":"borderTopWidth"]=c+d;n.appendChild(A);t=parseFloat(A[t?"offsetWidth":"offsetHeight"]);n.removeChild(A);0===t&&!u&&(t=P(b,g,c,d,!0));return h?-t:t},U=function(b,g){if(null==b||""===b||"auto"===b||"auto auto"===b)b="0 0";var g=g||{},c=-1!==b.indexOf("left")?"0%":-1!==b.indexOf("right")?"100%":b.split(" ")[0],d=-1!==b.indexOf("top")?"0%":-1!==b.indexOf("bottom")?"100%":b.split(" ")[1];null==d? d="0":"center"===d&&(d="50%");"center"===c&&(c="50%");g.oxp=-1!==c.indexOf("%");g.oyp=-1!==d.indexOf("%");g.oxr="="===c.charAt(1);g.oyr="="===d.charAt(1);g.ox=parseFloat(c.replace(p,""));g.oy=parseFloat(d.replace(p,""));return g},S=function(b,g){return null==b?g:"string"===typeof b&&1===b.indexOf("=")?Number(b.split("=").join(""))+g:Number(b)},T=function(b,g){var c=-1===b.indexOf("rad")?K:1,d=1===b.indexOf("="),b=Number(b.replace(p,""))*c;return d?b+g:b},Q={aqua:[0,255,255],lime:[0,255,0],silver:[192, 192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]};i._onInitTween=function(b,c,d){if(!b.nodeType)return!1;this._target=b;this._tween=d;this._classData=this._transform=null;O=c.autoRound;var u=this._style=b.style,n=y(b,""),f,h;if(L&&""=== u.zIndex&&(h=D(b,"zIndex",n),"auto"===h||""===h))u.zIndex=0;"string"===typeof c?(f=u.cssText,d=g(b,n),u.cssText=f+";"+c,h=t(d,g(b)),!B&&e.test(c)&&(val.opacity=parseFloat(RegExp.$1)),c=h,u.cssText=f):c.className&&(f=b.className,this._classData={b:f,e:"="!==c.className.charAt(1)?c.className:"+"===c.className.charAt(0)?b.className+" "+c.className.substr(2):b.className.split(c.className.substr(2)).join(""),props:[]},d._duration?(d=g(b,n),b.className=this._classData.e,c=t(d,g(b),c,this._classData),b.className= f):c={});this._parseVars(c,b,n,c.suffixMap||v.suffixMap);return!0};i._parseVars=function(b,g,c,d){var t=this._style,n,f,e,h,k,i,o;for(n in b)if(f=b[n],"transform"===n||n===I)this._parseTransform(g,f,c,d);else if(u[n]||"transformOrigin"===n)this._parseTransform(g,b,c,d);else{if("alpha"===n||"autoAlpha"===n)n="opacity";else if("margin"===n||"padding"===n){f=(f+"").split(" ");k=f.length;e={};e[n+"Top"]=f[0];e[n+"Right"]=1k.length?1:Number(k[3]),e.ac=(4>f.length?1:Number(f[3]))-e.as,e.type=2;else if(0==f[3]&&(e.e=e.i="transparent", e.type=-1),0==k[3])e.b="transparent"}else{i=h.replace(q,"");if(""===h||"auto"===h)if("width"===n||"height"===n){var H=n;i=g;o=c;h=parseFloat("width"===H?i.offsetWidth:i.offsetHeight);var H=W[H],m=H.length;for(o=o||y(i,null);-1<--m;)h-=parseFloat(D(i,"padding"+H[m],o,!0))||0,h-=parseFloat(D(i,"border"+H[m]+"Width",o,!0))||0;o=h;i="px"}else o="opacity"!==n?0:1,i="";else o=-1===h.indexOf(" ")?parseFloat(h.replace(p,"")):NaN;k?(k="="===f.charAt(1),h=f.replace(q,""),f=-1===f.indexOf(" ")?parseFloat(f.replace(p, "")):NaN):(k=!1,h="");""===h&&(h=d[n]||i);e.e=f||0===f?(k?f+o:f)+h:b[n];if(i!==h&&""!==h&&(f||0===f))if(o||0===o)if(o=P(g,n,o,i),"%"===h?(o/=P(g,n,100,"%")/100,100f?2:-2)),e.rotation=d.rotation+f):e.rotation=null==g.rotation?d.rotation:"number"===typeof g.rotation?g.rotation*K:T(g.rotation,d.rotation);e.skewX=null==g.skewX?d.skewX:"number"===typeof g.skewX?g.skewX*K:T(g.skewX,d.skewX);e.skewY=null==g.skewY?d.skewY:"number"===typeof g.skewY?g.skewY*K:T(g.skewY,d.skewY);if(f=e.skewY-d.skewY)e.skewX+=f,e.rotation+=f;1E-6>e.skewY&&-1E-6e.skewX&&-1E-6e.rotation&&-1E-6>0:n-0.5>>0:n-d&&(n=0),g.type?1===g.type?g.t[g.p]="rgb("+(n>>0)+", "+(g.gs+b*g.gc>>0)+", "+(g.bs+b*g.bc>>0)+")":2===g.type?g.t[g.p]="rgba("+(n>>0)+", "+(g.gs+b*g.gc>>0)+", "+(g.bs+b*g.bc>>0)+", "+(g.as+b*g.ac)+")":-1===g.type?g.t[g.p]=g.i:3===g.type?(c=g.ys+b* g.yc,g.r&&(c=0>0:c-0.5>>0),g.t[g.p]=n+g.sfx+" "+c+g.ysfx):(g.dup&&(g.t.filter=g.t.filter||"alpha(opacity=100)"),g.t.filter=-1===g.t.filter.indexOf("opacity")?g.t.filter+(" alpha(opacity="+(100*n>>0)+")"):g.t.filter.replace(s,"opacity="+(100*n>>0))):g.t[g.p]=n+g.sfx,g=g._next;else for(;g;)g.t[g.p]=g.b,4===g.type&&1===g.s&&(this._style.removeAttribute("filter"),D(this._target,"filter")&&(g.t[g.p]=g.b)),g=g._next;if(this._transform)if(g=this._transform,I&&!g.rotation&&!g.skewX)this._style[I]= (g.x||g.y?"translate("+g.x+"px,"+g.y+"px) ":"")+(1!==g.scaleX||1!==g.scaleY?"scale("+g.scaleX+","+g.scaleY+")":"")||"translate(0px,0px)";else{var e=I?g.rotation:-g.rotation,t=I?e-g.skewX:e+g.skewX,c=Math.cos(e)*g.scaleX,e=Math.sin(e)*g.scaleX,f=Math.sin(t)*-g.scaleY,t=Math.cos(t)*g.scaleY,h;c-d&&(c=0);e-d&&(e=0);f-d&&(f=0);t-d&&(t=0);if(I)this._style[I]="matrix("+c+","+e+","+f+","+t+","+g.x+","+g.y+")";else if(h=this._target.currentStyle){d=e;e=-f;f=-d;d=h.filter;this._style.filter= "";u=this._target.offsetWidth;n=this._target.offsetHeight;var k="absolute"!==h.position,i="progid:DXImageTransform.Microsoft.Matrix(M11="+c+", M12="+e+", M21="+f+", M22="+t,m=g.x,o=g.y,p,H;null!=g.ox&&(p=(g.oxp?0.01*u*g.ox:g.ox)-u/2,H=(g.oyp?0.01*n*g.oy:g.oy)-n/2,m=p-(p*c+H*e)+g.x,o=H-(p*f+H*t)+g.y);if(k)p=u/2,H=n/2,i+=", Dx="+(p-(p*c+H*e)+m)+", Dy="+(H-(p*f+H*t)+o)+")";else{var J=8>E?1:-1;p=g.ieOffsetX||0;H=g.ieOffsetY||0;g.ieOffsetX=Math.round((u-((0>c?-c:c)*u+(0>e?-e:e)*n))/2+m);g.ieOffsetY=Math.round((n- ((0>t?-t:t)*n+(0>f?-f:f)*u))/2+o);for(u=0;4>u;u++)m=X[u],n=h[m],n=-1!==n.indexOf("px")?parseFloat(n):P(this._target,m,parseFloat(n),n.replace(q,""))||0,o=n!==g[m]?2>u?-g.ieOffsetX:-g.ieOffsetY:2>u?p-g.ieOffsetX:H-g.ieOffsetY,this._style[m]=(g[m]=Math.round(n-o*(0===u||2===u?1:J)))+"px";i+=", sizingMethod='auto expand')"}this._style.filter=-1!==d.indexOf("progid:DXImageTransform.Microsoft.Matrix(")?d.replace(z,i):i+" "+d;if(0===b||1===b)if(1===c&&0===e&&0===f&&1===t&&(!k||-1!==i.indexOf("Dx=0, Dy=0")))(!s.test(d)|| 100===parseFloat(RegExp.$1))&&this._style.removeAttribute("filter")}}if(this._classData)if(g=this._classData,1===b&&(this._tween._time===this._tween._duration||0===this._tween._time)){for(u=g.props.length;-1<--u;)this._style[g.props[u]]="";this._target.className=g.e}else this._target.className!==g.b&&(this._target.className=g.b)};i._kill=function(g){var b=g,c;if(g.autoAlpha||g.alpha){b={};for(c in g)b[c]=g[c];b.opacity=1;b.autoAlpha&&(b.visibility=1)}return x.prototype._kill.call(this,b)};x.activate([v]); return v},!0);_gsDefine("plugins.RoundPropsPlugin",["plugins.TweenPlugin"],function(x){var v=function(){x.call(this,"roundProps",-1);this._overwriteProps.length=0},i=v.prototype=new x("roundProps",-1);i.constructor=v;v.API=2;i._onInitTween=function(i,q,c){this._tween=c;return!0};i._onInitAllProps=function(){for(var i=this._tween,q=i.vars.roundProps instanceof Array?i.vars.roundProps:i.vars.roundProps.split(","),c=q.length,s={},e=i._propLookup.roundProps,b,h,d;-1<--c;)s[q[c]]=1;for(c=q.length;-1<--c;){b= q[c];for(h=i._firstPT;h;)d=h._next,h.pg?h.t._roundProps(s,!0):h.n===b&&(this._add(h.t,b,h.s,h.c),d&&(d._prev=h._prev),h._prev?h._prev._next=d:_tween._firstPT===h&&(i._firstPT=d),h._next=h._prev=null,i._propLookup[b]=e),h=d}return!1};i._add=function(i,q,c,s){this._addTween(i,q,c,c+s,q,!0);this._overwriteProps.push(q)};x.activate([v]);return v},!0);_gsDefine("easing.Back",["easing.Ease"],function(x){var v=window.com.greensock._class,i=function(b,c){var d=v("easing."+b,function(){},!0),e=d.prototype= new x;e.constructor=d;e.getRatio=c;return d},p=function(b,c){var d=v("easing."+b,function(b){this._p1=b||0===b?b:1.70158;this._p2=1.525*this._p1},!0),e=d.prototype=new x;e.constructor=d;e.getRatio=c;e.config=function(b){return new d(b)};return d},q=p("BackOut",function(b){return(b-=1)*b*((this._p1+1)*b+this._p1)+1}),c=p("BackIn",function(b){return b*b*((this._p1+1)*b-this._p1)}),p=p("BackInOut",function(b){return 1>(b*=2)?0.5*b*b*((this._p2+1)*b-this._p2):0.5*((b-=2)*b*((this._p2+1)*b+this._p2)+2)}), s=i("BounceOut",function(b){return b<1/2.75?7.5625*b*b:b<2/2.75?7.5625*(b-=1.5/2.75)*b+0.75:b<2.5/2.75?7.5625*(b-=2.25/2.75)*b+0.9375:7.5625*(b-=2.625/2.75)*b+0.984375}),e=i("BounceIn",function(b){return(b=1-b)<1/2.75?1-7.5625*b*b:b<2/2.75?1-(7.5625*(b-=1.5/2.75)*b+0.75):b<2.5/2.75?1-(7.5625*(b-=2.25/2.75)*b+0.9375):1-(7.5625*(b-=2.625/2.75)*b+0.984375)}),b=i("BounceInOut",function(b){var c=0.5>b,b=c?1-2*b:2*b-1,b=b<1/2.75?7.5625*b*b:b<2/2.75?7.5625*(b-=1.5/2.75)*b+0.75:b<2.5/2.75?7.5625*(b-=2.25/ 2.75)*b+0.9375:7.5625*(b-=2.625/2.75)*b+0.984375;return c?0.5*(1-b):0.5*b+0.5}),h=i("CircOut",function(b){return Math.sqrt(1-(b-=1)*b)}),d=i("CircIn",function(b){return-(Math.sqrt(1-b*b)-1)}),f=i("CircInOut",function(b){return 1>(b*=2)?-0.5*(Math.sqrt(1-b*b)-1):0.5*(Math.sqrt(1-(b-=2)*b)+1)}),k=2*Math.PI,z=function(b,c,d){var e=v("easing."+b,function(b,c){this._p1=b||1;this._p2=c||d;this._p3=this._p2/k*(Math.asin(1/this._p1)||0)},!0),b=e.prototype=new x;b.constructor=e;b.getRatio=c;b.config=function(b, c){return new e(b,c)};return e},K=z("ElasticOut",function(b){return this._p1*Math.pow(2,-10*b)*Math.sin((b-this._p3)*k/this._p2)+1},0.3),N=z("ElasticIn",function(b){return-(this._p1*Math.pow(2,10*(b-=1))*Math.sin((b-this._p3)*k/this._p2))},0.3),z=z("ElasticInOut",function(b){return 1>(b*=2)?-0.5*this._p1*Math.pow(2,10*(b-=1))*Math.sin((b-this._p3)*k/this._p2):0.5*this._p1*Math.pow(2,-10*(b-=1))*Math.sin((b-this._p3)*k/this._p2)+1},0.45),w=i("ExpoOut",function(b){return 1-Math.pow(2,-10*b)}),m=i("ExpoIn", function(b){return Math.pow(2,10*(b-1))-0.001}),A=i("ExpoInOut",function(b){return 1>(b*=2)?0.5*Math.pow(2,10*(b-1)):0.5*(2-Math.pow(2,-10*(b-1)))}),o=Math.PI/2,O=i("SineOut",function(b){return Math.sin(b*o)}),L=i("SineIn",function(b){return-Math.cos(b*o)+1}),i=i("SineInOut",function(b){return-0.5*(Math.cos(Math.PI*b)-1)}),M=v("easing.SlowMo",function(b,c,d){null==b?b=0.7:1this._p3?this._calcEnd?1-(b=(b-this._p3)/this._p1)*b:c+(b-c)*(b=(b-this._p3)/this._p1)*b*b*b:this._calcEnd?1:c};M.ease=new M(0.7,0.7);E.config=M.config=function(b,c,d){return new M(b,c,d)};var B=v("easing.SteppedEase",function(b){b=b||1;this._p1=1/b;this._p2=b+1},!0),E=B.prototype=new x;E.constructor=B;E.getRatio=function(b){0>b?b=0:1<=b&&(b=0.999999999); return(this._p2*b>>0)*this._p1};E.config=B.config=function(b){return new B(b)};v("easing.Bounce",{easeOut:new s,easeIn:new e,easeInOut:new b},!0);v("easing.Circ",{easeOut:new h,easeIn:new d,easeInOut:new f},!0);v("easing.Elastic",{easeOut:new K,easeIn:new N,easeInOut:new z},!0);v("easing.Expo",{easeOut:new w,easeIn:new m,easeInOut:new A},!0);v("easing.Sine",{easeOut:new O,easeIn:new L,easeInOut:new i},!0);return{easeOut:new q,easeIn:new c,easeInOut:new p}},!0)}); (function(x){var v=function(b){var b=b.split("."),c=x,d;for(d=0;db?2*b:2*(1-b);1===d?e*=e:2===d?e*=e*e:3===d?e*=e*e*e:4===d&&(e*=e*e*e*e);return 1===c?1-e:2===c?e:0.5>b?e/2:1-e/2};p=["Linear","Quad","Cubic","Quart","Quint"];for(q=p.length;-1<--q;)c=d("easing."+p[q],function(){},!0),s=d("easing.Power"+q,function(){},!0),c.easeOut=s.easeOut=new z(null, null,1,q),c.easeIn=s.easeIn=new z(null,null,2,q),c.easeInOut=s.easeInOut=new z(null,null,3,q);d("easing.Strong",i.easing.Power4,!0);i.easing.Linear.easeNone=i.easing.Linear.easeIn;c=d("events.EventDispatcher",function(b){this._listeners={};this._eventTarget=b||this}).prototype;c.addEventListener=function(b,c,d,e,f){var f=f||0,h=this._listeners[b],i=0,k;null==h&&(this._listeners[b]=h=[]);for(k=h.length;-1<--k;)b=h[k],b.c===c?h.splice(k,1):0===i&&b.pr=n)d.frame++,n=d.time+m-(d.time-n)-5E-4,n<=d.time&&(n=d.time+0.001),d.dispatchEvent("tick");k=i(d.tick)};this.fps=function(b){if(!arguments.length)return h;h=b;m=1/(h||60);n=this.time+m;i=0===h?function(){}:!f||!K?function(b){return x.setTimeout(b,1E3*(n-d.time)+1>>0||1)}:K;N(k);k=i(d.tick)}; this.useRAF=function(b){if(!arguments.length)return f;f=b;this.fps(h)};this.fps(b)});c=i.Ticker.prototype=new i.events.EventDispatcher;c.constructor=i.Ticker;var m=d("core.Animation",function(b,c){this.vars=c||{};this._duration=this._totalDuration=b||0;this._delay=Number(this.vars.delay)||0;this._timeScale=1;this._active=!0==this.vars.immediateRender;this.data=this.vars.data;this._reversed=!0==this.vars.reversed;if(C){e||(A.tick(),e=!0);var d=this.vars.useFrames?n:C;d.insert(this,d._time);this.vars.paused&& this.paused(!0)}}),A=m.ticker=new i.Ticker;c=m.prototype;c._dirty=c._gc=c._initted=c._paused=!1;c._totalTime=c._time=0;c._rawPrevTime=-1;c._next=c._last=c._onUpdate=c._timeline=c.timeline=null;c._paused=!1;c.play=function(b,c){arguments.length&&this.seek(b,c);this.reversed(!1);return this.paused(!1)};c.pause=function(b,c){arguments.length&&this.seek(b,c);return this.paused(!0)};c.resume=function(b,c){arguments.length&&this.seek(b,c);return this.paused(!1)};c.seek=function(b,c){return this.totalTime(Number(b), !1!=c)};c.restart=function(b,c){this.reversed(!1);this.paused(!1);return this.totalTime(b?-this._delay:0,!1!=c)};c.reverse=function(b,c){arguments.length&&this.seek(b||this.totalDuration(),c);this.reversed(!0);return this.paused(!1)};c.render=function(){};c.invalidate=function(){return this};c._enabled=function(b,c){this._gc=!b;this._active=b&&!this._paused&&0this._duration&&(b=this._duration);return this.totalTime(b,c)};c.totalTime=function(b,c){if(!arguments.length)return this._totalTime;if(this._timeline){0>b&&(b+=this.totalDuration());if(this._timeline.smoothChildTiming&&(this._dirty&&this.totalDuration(),b>this._totalDuration&& (b=this._totalDuration),this._startTime=(this._paused?this._pauseTime:this._timeline._time)-(!this._reversed?b:this._totalDuration-b)/this._timeScale,this._timeline._dirty||this._uncache(!1),!this._timeline._active))for(var d=this._timeline;d._timeline;)d.totalTime(d._totalTime,!0),d=d._timeline;this._gc&&this._enabled(!0,!1);this._totalTime!=b&&this.render(b,c,!1)}return this};c.startTime=function(b){if(!arguments.length)return this._startTime;b!=this._startTime&&(this._startTime=b,this.timeline&& this.timeline._sortChildren&&this.timeline.insert(this,b-this._delay));return this};c.timeScale=function(b){if(!arguments.length)return this._timeScale;b=b||1E-6;if(this._timeline&&this._timeline.smoothChildTiming){var c=this._pauseTime||0==this._pauseTime?this._pauseTime:this._timeline._totalTime;this._startTime=c-(c-this._startTime)*this._timeScale/b}this._timeScale=b;return this._uncache(!1)};c.reversed=function(b){if(!arguments.length)return this._reversed;b!=this._reversed&&(this._reversed=b, this.totalTime(this._totalTime,!0));return this};c.paused=function(b){if(!arguments.length)return this._paused;b!=this._paused&&this._timeline&&(!b&&this._timeline.smoothChildTiming&&(this._startTime+=this._timeline.rawTime()-this._pauseTime,this._uncache(!1)),this._pauseTime=b?this._timeline.rawTime():null,this._paused=b,this._active=!this._paused&&0e;)d=d._prev;d?(b._next= d._next,d._next=b):(b._next=this._first,this._first=b);b._next?b._next._prev=b:this._last=b;b._prev=d;this._timeline&&this._uncache(!0);return this};c._remove=function(b,c){b.timeline===this&&(c||b._enabled(!1,!0),b.timeline=null,b._prev?b._prev._next=b._next:this._first===b&&(this._first=b._next),b._next?b._next._prev=b._prev:this._last===b&&(this._last=b._prev),this._timeline&&this._uncache(!0));return this};c.render=function(b,c){var d=this._first,e;for(this._totalTime=this._time=this._rawPrevTime= b;d;){e=d._next;if(d._active||b>=d._startTime&&!d._paused)d._reversed?d.render((!d._dirty?d._totalDuration:d.totalDuration())-(b-d._startTime)*d._timeScale,c,!1):d.render((b-d._startTime)*d._timeScale,c,!1);d=e}};c.rawTime=function(){return this._totalTime};var o=d("TweenLite",function(b,c,d){m.call(this,c,d);if(null==b)throw"Cannot tween an undefined reference.";this.target=b;this._overwrite=null==this.vars.overwrite?B[o.defaultOverwrite]:"number"===typeof this.vars.overwrite?this.vars.overwrite>> 0:B[this.vars.overwrite];if((b instanceof Array||b.jquery)&&"object"===typeof b[0]){this._targets=b.slice(0);this._propLookup=[];this._siblings=[];for(b=0;bm&&((0===c._duration||!k._initted)&&2E-10>=m-k._startTime||(n[o++]=k));for(h=o;-1<--h;)if(k=n[h],2=== e&&k._kill(d,b)&&(i=!0),2!==e||!k._firstPT&&k._initted)k._enabled(!1,!1)&&(i=!0);return i},y=function(b,c){for(var d=b._timeline,e=d._timeScale,f=b._startTime;d._timeline;){f+=d._startTime;e*=d._timeScale;if(d._paused)return-100;d=d._timeline}f/=e;return f>c?f-c:!b._initted&&2E-10>f-c?1E-10:(f+=b.totalDuration()/b._timeScale/e)>c?0:f-c-1E-10};c._init=function(){this.vars.startAt&&(this.vars.startAt.overwrite=0,this.vars.startAt.immediateRender=!0,o.to(this.target,0,this.vars.startAt));var b,c;this._ease= this.vars.ease instanceof z?this.vars.easeParams instanceof Array?this.vars.ease.config.apply(this.vars.ease,this.vars.easeParams):this.vars.ease:"function"===typeof this.vars.ease?new z(this.vars.ease,this.vars.easeParams):o.defaultEase;this._easeType=this._ease._type;this._easePower=this._ease._power;this._firstPT=null;if(this._targets)for(b=this._targets.length;-1<--b;){if(this._initProps(this._targets[b],this._propLookup[b]={},this._siblings[b],this._overwrittenProps?this._overwrittenProps[b]: null))c=!0}else c=this._initProps(this.target,this._propLookup,this._siblings,this._overwrittenProps);c&&o._onPluginEvent("_onInitAllProps",this);this._overwrittenProps&&null==this._firstPT&&"function"!==typeof this.target&&this._enabled(!1,!1);if(this.vars.runBackwards)for(b=this._firstPT;b;)b.s+=b.c,b.c=-b.c,b=b._next;this._onUpdate=this.vars.onUpdate;this._initted=!0};c._initProps=function(b,c,d,e){var f,h,k,i,m,n;if(null==b)return!1;for(f in this.vars){if(E[f]){if("onStartParams"===f||"onUpdateParams"=== f||"onCompleteParams"===f||"onReverseCompleteParams"===f||"onRepeatParams"===f)if(m=this.vars[f])for(h=m.length;-1<--h;)"{self}"===m[h]&&(m=this.vars[f]=m.concat(),m[h]=this)}else if(O[f]&&(i=new O[f])._onInitTween(b,this.vars[f],this)){this._firstPT=n={_next:this._firstPT,t:i,p:"setRatio",s:0,c:1,f:!0,n:f,pg:!0,pr:i._priority};for(h=i._overwriteProps.length;-1<--h;)c[i._overwriteProps[h]]=this._firstPT;if(i._priority||i._onInitAllProps)k=!0;if(i._onDisable||i._onEnable)this._notifyPluginsOfEnabled= !0}else this._firstPT=c[f]=n={_next:this._firstPT,t:b,p:f,f:"function"===typeof b[f],n:f,pg:!1,pr:0},n.s=!n.f?parseFloat(b[f]):b[f.indexOf("set")||"function"!==typeof b["get"+f.substr(3)]?f:"get"+f.substr(3)](),n.c="number"===typeof this.vars[f]?this.vars[f]-n.s:"string"===typeof this.vars[f]?parseFloat(this.vars[f].split("=").join("")):0;n&&n._next&&(n._next._prev=n)}return e&&this._kill(e,b)?this._initProps(b,c,d,e):1=this._duration){if(this._totalTime=this._time=this._duration,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(f=!0,h="onComplete"),0===this._duration){if(0===b||0>this._rawPrevTime)this._rawPrevTime!==b&&(d=!0);this._rawPrevTime=b}}else if(0>=b){this._totalTime=this._time=0;this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0;if(0!==e||0===this._duration&&0b?(this._active=!1,0===this._duration&&(0<=this._rawPrevTime&&(d=!0),this._rawPrevTime=b)):this._initted||(d=!0)}else if(this._totalTime=this._time=b,this._easeType){var i=b/this._duration,m=this._easeType,n=this._easePower;if(1===m||3===m&&0.5<=i)i=1-i;3===m&&(i*=2);1===n?i*=i:2===n?i*=i*i:3===n?i*=i*i*i:4===n&&(i*=i*i*i*i);this.ratio=1===m?1-i:2===m?i:0.5>b/this._duration?i/2:1-i/2}else this.ratio=this._ease.getRatio(b/this._duration);if(this._time!==e||d){this._initted||(this._init(), !f&&this._time&&(this.ratio=this._ease.getRatio(this._time/this._duration)));!this._active&&!this._paused&&(this._active=!0);if(0===e&&this.vars.onStart&&(0!==this._time||0===this._duration))c||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||k);for(b=this._firstPT;b;){if(b.f)b.t[b.p](b.c*this.ratio+b.s);else b.t[b.p]=b.c*this.ratio+b.s;b=b._next}this._onUpdate&&(c||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||k));h&&!this._gc&&(f&&(this._timeline.autoRemoveChildren&& this._enabled(!1,!1),this._active=!1),c||this.vars[h]&&this.vars[h].apply(this.vars[h+"Scope"]||this,this.vars[h+"Params"]||k))}};c._kill=function(b,c){"all"===b&&(b=null);if(null==b&&(null==c||c==this.target))return this._enabled(!1,!1);var c=c||this._targets||this.target,d,e,f,h,i,k,m;if((c instanceof Array||c.jquery)&&"object"===typeof c[0])for(d=c.length;-1<--d;)this._kill(b,c[d])&&(i=!0);else{if(this._targets)for(d=this._targets.length;-1<--d;){if(c===this._targets[d]){h=this._propLookup[d]|| {};this._overwrittenProps=this._overwrittenProps||[];e=this._overwrittenProps[d]=b?this._overwrittenProps[d]||{}:"all";break}}else{if(c!==this.target)return!1;h=this._propLookup;e=this._overwrittenProps=b?this._overwrittenProps||{}:"all"}if(h)for(f in k=b||h,m=b!=e&&"all"!=e&&b!=h&&(null==b||!0!=b._tempKill),k){if(d=h[f]){d.pg&&d.t._kill(k)&&(i=!0);if(!d.pg||0===d.t._overwriteProps.length)d._prev?d._prev._next=d._next:d===this._firstPT&&(this._firstPT=d._next),d._next&&(d._next._prev=d._prev),d._next= d._prev=null;delete h[f]}m&&(e[f]=1)}}return i};c.invalidate=function(){this._notifyPluginsOfEnabled&&o._onPluginEvent("_onDisable",this);this._onUpdate=this._overwrittenProps=this._firstPT=null;this._initted=this._active=this._notifyPluginsOfEnabled=!1;this._propLookup=this._targets?{}:[];return this};c._enabled=function(b,c){if(b&&this._gc)if(this._targets)for(var d=this._targets.length;-1<--d;)this._siblings[d]=G(this._targets[d],this,!0);else this._siblings=G(this.target,this,!0);m.prototype._enabled.call(this, b,c);return this._notifyPluginsOfEnabled&&this._firstPT?o._onPluginEvent(b?"_onEnable":"_onDisable",this):!1};o.to=function(b,c,d){return new o(b,c,d)};o.from=function(b,c,d){d.runBackwards=!0;!1!=d.immediateRender&&(d.immediateRender=!0);return new o(b,c,d)};o.fromTo=function(b,c,d,e){e.startAt=d;d.immediateRender&&(e.immediateRender=!0);return new o(b,c,e)};o.delayedCall=function(b,c,d,e,f){return new o(c,0,{delay:b,onComplete:c,onCompleteParams:d,onCompleteScope:e,onReverseComplete:c,onReverseCompleteParams:d, onReverseCompleteScope:e,immediateRender:!1,useFrames:f,overwrite:0})};o.set=function(b,c){return new o(b,0,c)};o.killTweensOf=o.killDelayedCallsTo=function(b,c){for(var d=o.getTweensOf(b),e=d.length;-1<--e;)d[e]._kill(c,b)};o.getTweensOf=function(b){if(null!=b){var c,d,e;if((b instanceof Array||b.jquery)&&"object"===typeof b[0]){c=b.length;for(d=[];-1<--c;)d=d.concat(o.getTweensOf(b[c]));for(c=d.length;-1<--c;){e=d[c];for(b=c;-1<--b;)e===d[b]&&d.splice(c,1)}}else{d=G(b).concat();for(c=d.length;-1< --c;)d[c]._gc&&d.splice(c,1)}return d}};var D=d("plugins.TweenPlugin",function(b,c){this._overwriteProps=(b||"").split(",");this._propName=this._overwriteProps[0];this._priority=c||0},!0);c=D.prototype;D.version=12;D.API=2;c._firstPT=null;c._addTween=function(b,c,d,e,f,h){var i;if(null!=e&&(i="number"===typeof e||"="!==e.charAt(1)?Number(e)-d:Number(e.split("=").join(""))))this._firstPT={_next:this._firstPT,t:b,p:c,s:d,c:i,f:"function"===typeof b[c],n:f||c,r:h},this._firstPT._next&&(this._firstPT._next._prev= this._firstPT)};c.setRatio=function(b){for(var c=this._firstPT,d;c;){d=c.c*b+c.s;c.r&&(d=d+(0>0);if(c.f)c.t[c.p](d);else c.t[c.p]=d;c=c._next}};c._kill=function(b){if(null!=b[this._propName])this._overwriteProps=[];else for(var c=this._overwriteProps.length;-1<--c;)null!=b[this._overwriteProps[c]]&&this._overwriteProps.splice(c,1);for(c=this._firstPT;c;)null!=b[c.n]&&((c._next&&(c._next._prev=c._prev),c._prev)?(c._prev._next=c._next,c._prev=null):this._firstPT===c&&(this._firstPT=c._next)), c=c._next;return!1};c._roundProps=function(b,c){for(var d=this._firstPT;d;){if(b[this._propName]||null!=d.n&&b[d.n.split(this._propName+"_").join("")])d.r=c;d=d._next}};o._onPluginEvent=function(b,c){var d=c._firstPT,e;if("_onInitAllProps"===b){for(var f,h,i,k;d;){k=d._next;for(f=h;f&&f.pr>d.pr;)f=f._next;(d._prev=f?f._prev:i)?d._prev._next=d:h=d;(d._next=f)?f._prev=d:i=d;d=k}d=c._firstPT=h}for(;d;)d.pg&&"function"===typeof d.t[b]&&d.t[b]()&&(e=!0),d=d._next;return e};D.activate=function(b){for(var c= b.length;-1<--c;)b[c].API===D.API&&(o._plugins[(new b[c])._propName]=b[c]);return!0};if(p=x._gsQueue){for(q=0;q(a*=2)?0.5*a*a*((this._p2+1)*a-this._p2):0.5*((a-=2)*a*((this._p2+1)*a+this._p2)+2)}),p=b("BounceOut",function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375}),q=b("BounceIn",function(a){return(a=1-a)<1/2.75?1-7.5625*a*a:a<2/2.75?1-(7.5625*(a-=1.5/2.75)*a+0.75):a<2.5/2.75?1-(7.5625*(a-= 2.25/2.75)*a+0.9375):1-(7.5625*(a-=2.625/2.75)*a+0.984375)}),r=b("BounceInOut",function(a){var b=0.5>a,a=b?1-2*a:2*a-1,a=a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375;return b?0.5*(1-a):0.5*a+0.5}),s=b("CircOut",function(a){return Math.sqrt(1-(a-=1)*a)}),t=b("CircIn",function(a){return-(Math.sqrt(1-a*a)-1)}),u=b("CircInOut",function(a){return 1>(a*=2)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)}),i= 2*Math.PI,j=function(a,b,e){var d=c("easing."+a,function(a,b){this._p1=a||1;this._p2=b||e;this._p3=this._p2/i*(Math.asin(1/this._p1)||0)},!0),a=d.prototype=new g;a.constructor=d;a.getRatio=b;a.config=function(a,b){return new d(a,b)};return d},v=j("ElasticOut",function(a){return this._p1*Math.pow(2,-10*a)*Math.sin((a-this._p3)*i/this._p2)+1},0.3),w=j("ElasticIn",function(a){return-(this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*i/this._p2))},0.3),j=j("ElasticInOut",function(a){return 1>(a*=2)? -0.5*this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*i/this._p2):0.5*this._p1*Math.pow(2,-10*(a-=1))*Math.sin((a-this._p3)*i/this._p2)+1},0.45),x=b("ExpoOut",function(a){return 1-Math.pow(2,-10*a)}),y=b("ExpoIn",function(a){return Math.pow(2,10*(a-1))-0.001}),z=b("ExpoInOut",function(a){return 1>(a*=2)?0.5*Math.pow(2,10*(a-1)):0.5*(2-Math.pow(2,-10*(a-1)))}),m=Math.PI/2,A=b("SineOut",function(a){return Math.sin(a*m)}),B=b("SineIn",function(a){return-Math.cos(a*m)+1}),b=b("SineInOut",function(a){return-0.5* (Math.cos(Math.PI*a)-1)}),f=c("easing.SlowMo",function(a,b,c){null==a?a=0.7:1this._p3?this._calcEnd?1-(a=(a-this._p3)/this._p1)*a:b+(a-b)*(a=(a-this._p3)/this._p1)*a*a*a:this._calcEnd?1:b};f.ease=new f(0.7,0.7);e.config= f.config=function(a,b,c){return new f(a,b,c)};var k=c("easing.SteppedEase",function(a){a=a||1;this._p1=1/a;this._p2=a+1},!0),e=k.prototype=new g;e.constructor=k;e.getRatio=function(a){0>a?a=0:1<=a&&(a=0.999999999);return(this._p2*a>>0)*this._p1};e.config=k.config=function(a){return new k(a)};c("easing.Bounce",{easeOut:new p,easeIn:new q,easeInOut:new r},!0);c("easing.Circ",{easeOut:new s,easeIn:new t,easeInOut:new u},!0);c("easing.Elastic",{easeOut:new v,easeIn:new w,easeInOut:new j},!0);c("easing.Expo", {easeOut:new x,easeIn:new y,easeInOut:new z},!0);c("easing.Sine",{easeOut:new A,easeIn:new B,easeInOut:new b},!0);return{easeOut:new n,easeIn:new o,easeInOut:new h}},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/plugins/BezierPlugin.min.js b/src/minified/plugins/BezierPlugin.min.js new file mode 100755 index 000000000..4922f165b --- /dev/null +++ b/src/minified/plugins/BezierPlugin.min.js @@ -0,0 +1,13 @@ +/*! + * VERSION: beta 1.11 + * DATE: 2012-07-26 + * JavaScript (also available in AS3 and AS2) + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("plugins.BezierPlugin",["plugins.TweenPlugin"],function(H){var B=function(){H.call(this,"bezier",-1);this._overwriteProps.pop();this._func={};this._round={}},G=B.prototype=new H("bezier",1),K=180/Math.PI,C=[],D=[],E=[],I={},F=function(b,d,i,n){this.a=b;this.b=d;this.c=i;this.d=n;this.da=n-b;this.ca=i-b;this.ba=d-b},L=B.bezierThrough=function(b,d,i,n,m,c){var e={},f=[],g,k,m="string"===typeof m?","+m+",":",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,"; null==d&&(d=1);for(k in b[0])f.push(k);C.length=D.length=E.length=0;for(g=f.length;-1<--g;){k=f[g];I[k]=-1!==m.indexOf(","+k+",");var t=e,v=k,q;q=b;var p=k,y=I[k],o=c,u=[],s=void 0,h=void 0,x=void 0,w=void 0,z=void 0,s=void 0;if(o){q=[o].concat(q);for(h=q.length;-1<--h;)if("string"===typeof(s=q[h][p]))"="===s.charAt(1)&&(q[h][p]=o[p]+Number(s.charAt(0)+s.substr(2)))}s=q.length-2;if(0>s)u[0]=new F(q[0][p],0,0,q[-1>s?0:1][p]);else{for(h=0;h>0||6;m=[];t=[];n=v=0;d=e-1;g=[];i=[];for(f in c){k=c[f];p=m;y=e;o=1/y;u=k.length;for(var h=void 0,x=void 0,w=q=s=x=void 0,z=h=void 0,A=void 0,A=w=void 0;-1<--u;){w=k[u];x=w.a;s=w.d-x;q=w.c-x;w=w.b-x;x=0;for(z=1;z<=y;z++)h=o*z,A=1-h,h=x-(x=(h*h*s+3*A*(h*q+A*w))*h),A=u*y+z-1,p[A]=(p[A]||0)+ h*h}}c=m.length;for(f=0;f>0,g[k]=i,t[k]=n,v=0,i=[]);this._length=n;this._lengths=t;this._segments=g;this._l1=this._li=this._s1=this._si=0;this._l2=this._lengths[0];this._curSeg=this._segments[0];this._s2=this._curSeg[0];this._prec=1/this._curSeg.length}if(i=this._autoRotate){i[0]instanceof Array||(this._autoRotate=i=[i]);for(c=i.length;-1<--c;)for(f=0;3>f;f++)e=i[c][f],this._func[e]="function"===typeof b[e]?b[e.indexOf("set")||"function"!== typeof b["get"+e.substr(3)]?e:"get"+e.substr(3)]:!1}return!0};G.setRatio=function(b){var d=this._segCount,i=this._func,n=this._target,m,c,e,f,g;if(this._timeRes){m=this._lengths;f=this._curSeg;b*=this._length;c=this._li;if(b>this._l2&&c=b;);0===c&&bthis._s2&&c=b;);0===c&&bb?0:1<=b?d-1:d*b>>0,f=(b-m*(1/d))*d;d=1-f;for(c=this._props.length;-1<--c;)if(b=this._props[c],e=this._beziers[b][m],g=(f* f*e.da+3*d*(f*e.ca+d*e.ba))*f+e.a,this._round[b]&&(g=g+(0>0),i[b])n[b](g);else n[b]=g;if(this._autoRotate){var d=this._autoRotate,k,t,v,q,p;for(c=d.length;-1<--c;)b=d[c][2],q=d[c][3]||0,p=!0==d[c][4]?1:K,e=this._beziers[d[c][0]][m],g=this._beziers[d[c][1]][m],k=e.a+(e.b-e.a)*f,t=e.b+(e.c-e.b)*f,k+=(t-k)*f,t+=(e.c+(e.d-e.c)*f-t)*f,e=g.a+(g.b-g.a)*f,v=g.b+(g.c-g.b)*f,e+=(v-e)*f,v+=(g.c+(g.d-g.c)*f-v)*f,g=Math.atan2(v-e,t-k)*p+q,i[b]?i[b].call(n,g):n[b]=g}};G._roundProps=function(b,d){for(var i= this._overwriteProps,n=i.length;-1<--n;)if(b[i[n]]||b.bezier||b.bezierThrough)this._round[i[n]]=d};G._kill=function(b){var d=this._props,i,n;for(i in _beziers)if(i in b){delete this._beziers[i];delete this._func[i];for(n=d.length;-1<--n;)d[n]===i&&d.splice(n,1)}return H.prototype._kill.call(this,b)};H.activate([B]);return B},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/plugins/CSSPlugin.min.js b/src/minified/plugins/CSSPlugin.min.js new file mode 100755 index 000000000..72876c5d7 --- /dev/null +++ b/src/minified/plugins/CSSPlugin.min.js @@ -0,0 +1,13 @@ +/*! + * VERSION: beta 1.53 + * DATE: 2012-09-19 + * JavaScript + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(B){var n=function(){B.call(this,"css");this._overwriteProps.pop()},m=n.prototype=new B("css");m.constructor=n;n.API=2;n.suffixMap={top:"px",right:"px",bottom:"px",left:"px",width:"px",height:"px",fontSize:"px",padding:"px",margin:"px"};var w=/[^\d\-\.]/g,J=/(\d|\-|\+|=|#|\.)*/g,ba=/(\d|\.)+/g,K=/opacity *= *([^)]*)/,ca=/opacity:([^;]*)/,da=/([A-Z])/g,O=/-([a-z])/gi,P= function(b,a){return a.toUpperCase()},ea=/(Left|Right|Width)/i,fa=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,ga=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,z=Math.PI/180,Q=180/Math.PI,C={},u=document,D=u.createElement("div"),v=navigator.userAgent,R,S,T,U,x,V=v.indexOf("Android"),W=u.createElement("div");T=-1!==v.indexOf("Safari")&&-1===v.indexOf("Chrome")&&(-1===V||3a"; x=(v=W.getElementsByTagName("a")[0])?/^0.55/.test(v.style.opacity):!1;var X=function(b){if(!b||""===b)return E.black;if(E[b])return E[b];if("number"===typeof b)return[b>>16,b>>8&255,b&255];if("#"===b.charAt(0)){if(4===b.length)var a=b.charAt(1),g=b.charAt(2),b=b.charAt(3),b="#"+a+a+g+g+b+b;b=parseInt(b.substr(1),16);return[b>>16,b>>8&255,b&255]}return b.match(ba)||E.transparent},Y=function(b){return K.test("string"===typeof b?b:(b.currentStyle?b.currentStyle.filter:b.style.filter)||"")?parseFloat(RegExp.$1)/ 100:1},A=u.defaultView?u.defaultView.getComputedStyle:function(){},s=function(b,a,g,c){return!x&&"opacity"===a?Y(b):!c&&b.style[a]?b.style[a]:(g=g||A(b,null))?(b=g.getPropertyValue(a.replace(da,"-$1").toLowerCase()))||g.length?b:g[a]:b.currentStyle?(g=b.currentStyle,c=g[a],!c&&"backgroundPosition"===a?g[a+"X"]+" "+g[a+"Y"]:c):null},G=function(b,a){var g={},c;if(a=a||A(b,null))if(c=a.length)for(;-1<--c;)g[a[c].replace(O,P)]=a.getPropertyValue(a[c]);else for(c in a)g[c]=a[c];else if(a=b.currentStyle|| b.style)for(c in a)g[c.replace(O,P)]=a[c];x||(g.opacity=Y(b));c=F(b,a,!1);g.rotation=c.rotation*Q;g.skewX=c.skewX*Q;g.scaleX=c.scaleX;g.scaleY=c.scaleY;g.x=c.x;g.y=c.y;null!=g.filters&&delete g.filters;return g},Z=function(b,a,g,c){var h={},f,d;for(d in a)if("cssText"!==d&&"length"!==d&&isNaN(d)&&b[d]!=(f=a[d]))if(f!==p&&("number"===typeof f||"string"===typeof f))h[d]=(""===f||"auto"===f)&&"string"===typeof b[d]&&""!==b[d].replace(w,"")?0:f,c&&c.props.push(d);if(g)for(d in g)"className"!==d&&(h[d]= g[d]);return h},$={scaleX:1,scaleY:1,x:1,y:1,rotation:1,shortRotation:1,skewX:1,skewY:1,scale:1},aa="",L="",p=function(b,a){var a=a||u.body||u.documentElement,g=A(a,""),c,h;if(s(a,b))return b;b=b.substr(0,1).toUpperCase()+b.substr(1);c=["O","Moz","ms","Ms","Webkit"];for(h=5;-1<--h&&!s(a,c[h]+b,g););return 0<=h?(L=3===h?"ms":c[h],aa="-"+L.toLowerCase()+"-",L+b):null}("transform"),ha=aa+"transform",F=function(b,a,g){var c=b._gsTransform,h;p?h=s(b,ha,a,!0):b.currentStyle&&(h=(h=b.currentStyle.filter.match(fa))&& 4===h.length?h[0].substr(4)+","+Number(h[2].substr(4))+","+Number(h[1].substr(4))+","+h[3].substr(4)+","+(c?c.x:0)+","+(c?c.y:0):null);var a=(h||"").replace(/[^\d\-\.e,]/g,"").split(","),f=(h=6<=a.length)?Number(a[0]):1,d=h?Number(a[1]):0,e=h?Number(a[2]):0,i=h?Number(a[3]):1,c=g?c||{skewY:0}:{skewY:0},l=0>c.scaleX;c.x=h?Number(a[4]):0;c.y=h?Number(a[5]):0;c.scaleX=Math.sqrt(f*f+d*d);c.scaleY=Math.sqrt(i*i+e*e);c.rotation=f||d?Math.atan2(d,f):c.rotation||0;c.skewX=e||i?Math.atan2(e,i)+c.rotation: c.skewX||0;Math.abs(c.skewX)>Math.PI/2&&(l?(c.scaleX*=-1,c.skewX+=0>=c.rotation?Math.PI:-Math.PI,c.rotation+=0>=c.rotation?Math.PI:-Math.PI):(c.scaleY*=-1,c.skewX+=0>=c.skewX?Math.PI:-Math.PI));if(1E-6>c.rotation&&-1E-6c.skewX&&-1E-6g;i&&(g=-g);e.cssText="border-style:solid; border-width:0; position:absolute; line-height:0;";"%"===c||"em"===c||!d.appendChild?(d=b.parentNode||u.body,e[f?"width":"height"]=g+c):e[f?"borderLeftWidth":"borderTopWidth"]=g+c;d.appendChild(D);f=parseFloat(D[f?"offsetWidth":"offsetHeight"]);d.removeChild(D);0===f&&!h&&(f=y(b,a,g,c,!0));return i?-f:f},M=function(b,a){if(null==b||""===b||"auto"===b||"auto auto"===b)b="0 0";var a=a||{},g=-1!==b.indexOf("left")? "0%":-1!==b.indexOf("right")?"100%":b.split(" ")[0],c=-1!==b.indexOf("top")?"0%":-1!==b.indexOf("bottom")?"100%":b.split(" ")[1];null==c?c="0":"center"===c&&(c="50%");"center"===g&&(g="50%");a.oxp=-1!==g.indexOf("%");a.oyp=-1!==c.indexOf("%");a.oxr="="===g.charAt(1);a.oyr="="===c.charAt(1);a.ox=parseFloat(g.replace(w,""));a.oy=parseFloat(c.replace(w,""));return a},H=function(b,a){return null==b?a:"string"===typeof b&&1===b.indexOf("=")?Number(b.split("=").join(""))+a:Number(b)},I=function(b,a){var g= -1===b.indexOf("rad")?z:1,c=1===b.indexOf("="),b=Number(b.replace(w,""))*g;return c?b+a:b},E={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]};m._onInitTween=function(b,a,g){if(!b.nodeType)return!1; this._target=b;this._tween=g;this._classData=this._transform=null;R=a.autoRound;var c=this._style=b.style,h=A(b,""),f,d;if(S&&""===c.zIndex&&(d=s(b,"zIndex",h),"auto"===d||""===d))c.zIndex=0;"string"===typeof a?(f=c.cssText,g=G(b,h),c.cssText=f+";"+a,d=Z(g,G(b)),!x&&ca.test(a)&&(val.opacity=parseFloat(RegExp.$1)),a=d,c.cssText=f):a.className&&(f=b.className,this._classData={b:f,e:"="!==a.className.charAt(1)?a.className:"+"===a.className.charAt(0)?b.className+" "+a.className.substr(2):b.className.split(a.className.substr(2)).join(""), props:[]},g._duration?(g=G(b,h),b.className=this._classData.e,a=Z(g,G(b),a,this._classData),b.className=f):a={});this._parseVars(a,b,h,a.suffixMap||n.suffixMap);return!0};m._parseVars=function(b,a,g,c){var h=this._style,f,d,e,i,l,r,k;for(f in b)if(d=b[f],"transform"===f||f===p)this._parseTransform(a,d,g,c);else if($[f]||"transformOrigin"===f)this._parseTransform(a,b,g,c);else{if("alpha"===f||"autoAlpha"===f)f="opacity";else if("margin"===f||"padding"===f){d=(d+"").split(" ");l=d.length;e={};e[f+"Top"]= d[0];e[f+"Right"]=1l.length? 1:Number(l[3]),e.ac=(4>d.length?1:Number(d[3]))-e.as,e.type=2;else if(0==d[3]&&(e.e=e.i="transparent",e.type=-1),0==l[3])e.b="transparent"}else{r=i.replace(J,"");if(""===i||"auto"===i)if("width"===f||"height"===f){var q=f;r=a;k=g;i=parseFloat("width"===q?r.offsetWidth:r.offsetHeight);var q=ia[q],N=q.length;for(k=k||A(r,null);-1<--N;)i-=parseFloat(s(r,"padding"+q[N],k,!0))||0,i-=parseFloat(s(r,"border"+q[N]+"Width",k,!0))||0;k=i;r="px"}else k="opacity"!==f?0:1,r="";else k=-1===i.indexOf(" ")?parseFloat(i.replace(w, "")):NaN;l?(l="="===d.charAt(1),i=d.replace(J,""),d=-1===d.indexOf(" ")?parseFloat(d.replace(w,"")):NaN):(l=!1,i="");""===i&&(i=c[f]||r);e.e=d||0===d?(l?d+k:d)+i:b[f];if(r!==i&&""!==i&&(d||0===d))if(k||0===k)if(k=y(a,f,k,r),"%"===i?(k/=y(a,f,100,"%")/100,100d?2:-2)),f.rotation=c.rotation+d):f.rotation=null==a.rotation?c.rotation:"number"===typeof a.rotation?a.rotation*z:I(a.rotation,c.rotation);f.skewX=null==a.skewX?c.skewX:"number"===typeof a.skewX?a.skewX*z:I(a.skewX,c.skewX);f.skewY=null==a.skewY?c.skewY:"number"===typeof a.skewY?a.skewY*z:I(a.skewY,c.skewY);if(d=f.skewY-c.skewY)f.skewX+= d,f.rotation+=d;1E-6>f.skewY&&-1E-6f.skewX&&-1E-6f.rotation&&-1E-6>0:h-0.5>>0:h-c&&(h=0),a.type?1===a.type?a.t[a.p]="rgb("+(h>>0)+", "+(a.gs+b*a.gc>>0)+", "+(a.bs+b*a.bc>>0)+")":2===a.type?a.t[a.p]="rgba("+(h>>0)+", "+(a.gs+b*a.gc>>0)+", "+ (a.bs+b*a.bc>>0)+", "+(a.as+b*a.ac)+")":-1===a.type?a.t[a.p]=a.i:3===a.type?(g=a.ys+b*a.yc,a.r&&(g=0>0:g-0.5>>0),a.t[a.p]=h+a.sfx+" "+g+a.ysfx):(a.dup&&(a.t.filter=a.t.filter||"alpha(opacity=100)"),a.t.filter=-1===a.t.filter.indexOf("opacity")?a.t.filter+(" alpha(opacity="+(100*h>>0)+")"):a.t.filter.replace(K,"opacity="+(100*h>>0))):a.t[a.p]=h+a.sfx,a=a._next;else for(;a;)a.t[a.p]=a.b,4===a.type&&1===a.s&&(this._style.removeAttribute("filter"),s(this._target,"filter")&&(a.t[a.p]=a.b)),a= a._next;if(this._transform)if(a=this._transform,p&&!a.rotation&&!a.skewX)this._style[p]=(a.x||a.y?"translate("+a.x+"px,"+a.y+"px) ":"")+(1!==a.scaleX||1!==a.scaleY?"scale("+a.scaleX+","+a.scaleY+")":"")||"translate(0px,0px)";else{var d=p?a.rotation:-a.rotation,i=p?d-a.skewX:d+a.skewX,g=Math.cos(d)*a.scaleX,d=Math.sin(d)*a.scaleX,e=Math.sin(i)*-a.scaleY,i=Math.cos(i)*a.scaleY,l;g-c&&(g=0);d-c&&(d=0);e-c&&(e=0);i-c&&(i=0);if(p)this._style[p]="matrix("+g+","+d+","+e+","+i+","+ a.x+","+a.y+")";else if(l=this._target.currentStyle){c=d;d=-e;e=-c;c=l.filter;this._style.filter="";f=this._target.offsetWidth;h=this._target.offsetHeight;var r="absolute"!==l.position,k="progid:DXImageTransform.Microsoft.Matrix(M11="+g+", M12="+d+", M21="+e+", M22="+i,q=a.x,n=a.y,m,o;null!=a.ox&&(m=(a.oxp?0.01*f*a.ox:a.ox)-f/2,o=(a.oyp?0.01*h*a.oy:a.oy)-h/2,q=m-(m*g+o*d)+a.x,n=o-(m*e+o*i)+a.y);if(r)m=f/2,o=h/2,k+=", Dx="+(m-(m*g+o*d)+q)+", Dy="+(o-(m*e+o*i)+n)+")";else{var j=8>U?1:-1;m=a.ieOffsetX|| 0;o=a.ieOffsetY||0;a.ieOffsetX=Math.round((f-((0>g?-g:g)*f+(0>d?-d:d)*h))/2+q);a.ieOffsetY=Math.round((h-((0>i?-i:i)*h+(0>e?-e:e)*f))/2+n);for(f=0;4>f;f++)q=ja[f],h=l[q],h=-1!==h.indexOf("px")?parseFloat(h):y(this._target,q,parseFloat(h),h.replace(J,""))||0,n=h!==a[q]?2>f?-a.ieOffsetX:-a.ieOffsetY:2>f?m-a.ieOffsetX:o-a.ieOffsetY,this._style[q]=(a[q]=Math.round(h-n*(0===f||2===f?1:j)))+"px";k+=", sizingMethod='auto expand')"}this._style.filter=-1!==c.indexOf("DXImageTransform.Microsoft.Matrix(")?c.replace(ga, k):k+" "+c;if(0===b||1===b)if(1===g&&0===d&&0===e&&1===i&&(!r||-1!==k.indexOf("Dx=0, Dy=0")))(!K.test(c)||100===parseFloat(RegExp.$1))&&this._style.removeAttribute("filter")}}if(this._classData)if(a=this._classData,1===b&&(this._tween._time===this._tween._duration||0===this._tween._time)){for(f=a.props.length;-1<--f;)this._style[a.props[f]]="";this._target.className=a.e}else this._target.className!==a.b&&(this._target.className=a.b)};m._kill=function(b){var a=b,g;if(b.autoAlpha||b.alpha){a={};for(g in b)a[g]= b[g];a.opacity=1;a.autoAlpha&&(a.visibility=1)}return B.prototype._kill.call(this,a)};B.activate([n]);return n},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/plugins/CSSRulePlugin.min.js b/src/minified/plugins/CSSRulePlugin.min.js new file mode 100755 index 000000000..ca7dcfafb --- /dev/null +++ b/src/minified/plugins/CSSRulePlugin.min.js @@ -0,0 +1,13 @@ +/*! + * VERSION: beta 0.42 + * DATE: 2012-09-19 + * JavaScript + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("plugins.CSSRulePlugin",["plugins.TweenPlugin","TweenLite"],function(r){var l=function(){r.call(this,"cssRule");this._overwriteProps.pop()},n=l.prototype=new r("cssRule");n.constructor=l;l.API=2;l.suffixMap={top:"px",right:"px",bottom:"px",left:"px",width:"px",height:"px",fontSize:"px",padding:"px",margin:"px"};var p=/[^\d\-\.]/g,A=/(\d|\-|\+|=|#|\.)*/g,L=/(\d|\.)+/g,B=/opacity *= *([^)]*)/,M=/([A-Z])/g,N=/(M11|M12|M21|M22)=[\d\-\.e]+/gi, O=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,q=Math.PI/180,m=document,s=m.createElement("div"),o=navigator.userAgent,C,D,t,E=o.indexOf("Android"),F=m.createElement("div");D=-1!==o.indexOf("Safari")&&-1===o.indexOf("Chrome")&&(-1===E||3a";t=(o=F.getElementsByTagName("a")[0])?/^0.55/.test(o.style.opacity):!1;var G=function(c){if(!c||""===c)return u.black;if(u[c])return u[c];if("number"===typeof c)return[c>>16,c>>8& 255,c&255];if("#"===c.charAt(0)){if(4===c.length)var a=c.charAt(1),d=c.charAt(2),c=c.charAt(3),c="#"+a+a+d+d+c+c;c=parseInt(c.substr(1),16);return[c>>16,c>>8&255,c&255]}return c.match(L)||u.transparent},H=m.defaultView?m.defaultView.getComputedStyle:function(){},x=function(c,a,d,b){return!t&&"opacity"===a?B.test("string"===typeof c?c:(c.currentStyle?c.currentStyle.filter:c.style.filter)||"")?parseFloat(RegExp.$1)/100:1:!b&&c.style[a]?c.style[a]:(d=d||H(c,null))?(c=d.getPropertyValue(a.replace(M,"-$1").toLowerCase()))|| d.length?c:d[a]:c.currentStyle?(d=c.currentStyle,b=d[a],!b&&"backgroundPosition"===a?d[a+"X"]+" "+d[a+"Y"]:b):null},I={scaleX:1,scaleY:1,x:1,y:1,rotation:1,shortRotation:1,skewX:1,skewY:1,scale:1},J="",y="",i=function(c,a){var a=a||m.body||m.documentElement,d=H(a,""),b,e;if(x(a,c))return c;c=c.substr(0,1).toUpperCase()+c.substr(1);b=["O","Moz","ms","Ms","Webkit"];for(e=5;-1<--e&&!x(a,b[e]+c,d););return 0<=e?(y=3===e?"ms":b[e],J="-"+y.toLowerCase()+"-",y+c):null}("transform"),P=J+"transform";l.getRule= function(c){var a=m.all?"rules":"cssRules",d=m.styleSheets,b=d.length,e=":"===c.charAt(0),f,g,h,c=(e?"":",")+c+",";for(e&&(h=[]);-1<--b;){g=d[b][a];for(f=g.length;-1<--f;)if(-1!==(","+g[f].selectorText.split("::").join(":")+",").indexOf(c))if(e)h.push(g[f].style);else return g[f].style}return h};var K=function(c,a){s.cssText=c.cssText;var d=c._gsTransform,b;i?b=x(s,P,null,!0):s.currentStyle&&(b=(b=s.currentStyle.filter.match(N))&&4===b.length?b[0].substr(4)+","+Number(b[2].substr(4))+","+Number(b[1].substr(4))+ ","+b[3].substr(4)+","+(d?d.x:0)+","+(d?d.y:0):null);b=(b||"").replace(/[^\d\-\.e,]/g,"").split(",");var e=6<=b.length,f=e?Number(b[0]):1,g=e?Number(b[1]):0,h=e?Number(b[2]):0,j=e?Number(b[3]):1,d=a?d||{skewY:0}:{skewY:0},k=0>d.scaleX;d.x=e?Number(b[4]):0;d.y=e?Number(b[5]):0;d.scaleX=Math.sqrt(f*f+g*g);d.scaleY=Math.sqrt(j*j+h*h);d.rotation=f||g?Math.atan2(g,f):d.rotation||0;d.skewX=h||j?Math.atan2(h,j)+d.rotation:d.skewX||0;Math.abs(d.skewX)>Math.PI/2&&(k?(d.scaleX*=-1,d.skewX+=0>=d.rotation?Math.PI: -Math.PI,d.rotation+=0>=d.rotation?Math.PI:-Math.PI):(d.scaleY*=-1,d.skewX+=0>=d.skewX?Math.PI:-Math.PI));if(1E-6>d.rotation&&-1E-6d.skewX&&-1E-6h.length?1:Number(h[3]),f.ac=(4>e.length?1:Number(e[3]))-f.as,f.type=2;else if(0==e[3]&&(f.e=f.i="transparent",f.type=-1),0==h[3])f.b="transparent"}else{h=g.replace(A,"");k=""===g||"auto"===g?"opacity"!==b?0:1:-1===g.indexOf(" ")?parseFloat(g.replace(p,"")):NaN;"string"=== typeof e?(g="="===e.charAt(1),j=e.replace(A,""),e=-1===e.indexOf(" ")?parseFloat(e.replace(p,"")):NaN):(g=!1,j="");""===j&&(j=d[b]||h);f.e=e||0===e?(g?e+k:e)+j:c[b];if(h!==j&&""!==j&&(e||0===e))if(k||0===k)throw"CSSRulePlugin error: starting and ending units don't match on tween of "+b+" ("+h+" vs "+j+")";if((k||0===k)&&(e||0===e)&&(f.c=g?e:e-k))if(f.s=k,f.sfx=j,"opacity"===b)t||(f.type=4,f.p="filter",f.b="alpha(opacity="+100*f.s+")",f.e="alpha(opacity="+100*(f.s+f.c)+")",f.dup=null!=c.autoAlpha, this._style.zoom=1);else{if(!1!==c.autoRound&&("px"===j||"zIndex"===b))f.r=!0}else f.type=-1,f.i="display"===b&&"none"===f.e?f.b:f.e,f.s=f.c=0}this._overwriteProps.push("css_"+b);f._next&&(f._next._prev=f)}};n._parseTransform=function(c,a){if(!this._transform){var d=this._transform=K(c,!0),b,e,f;if("object"===typeof a){b={scaleX:v(null!=a.scaleX?a.scaleX:a.scale,d.scaleX),scaleY:v(null!=a.scaleY?a.scaleY:a.scale,d.scaleY),x:v(a.x,d.x),y:v(a.y,d.y)};null!=a.shortRotation?(b.rotation="number"===typeof a.shortRotation? a.shortRotation*q:w(a.shortRotation,d.rotation),e=(b.rotation-d.rotation)%(2*Math.PI),e!==e%Math.PI&&(e+=Math.PI*(0>e?2:-2)),b.rotation=d.rotation+e):b.rotation=null==a.rotation?d.rotation:"number"===typeof a.rotation?a.rotation*q:w(a.rotation,d.rotation);b.skewX=null==a.skewX?d.skewX:"number"===typeof a.skewX?a.skewX*q:w(a.skewX,d.skewX);b.skewY=null==a.skewY?d.skewY:"number"===typeof a.skewY?a.skewY*q:w(a.skewY,d.skewY);if(e=b.skewY-d.skewY)b.skewX+=e,b.rotation+=e;1E-6>b.skewY&&-1E-6b.skewX&&-1E-6b.rotation&&-1E-6>0:b-0.5>> 0:b-d&&(b=0),a.type?1===a.type?a.t[a.p]="rgb("+(b>>0)+", "+(a.gs+c*a.gc>>0)+", "+(a.bs+c*a.bc>>0)+")":2===a.type?a.t[a.p]="rgba("+(b>>0)+", "+(a.gs+c*a.gc>>0)+", "+(a.bs+c*a.bc>>0)+", "+(a.as+c*a.ac)+")":-1===a.type?a.t[a.p]=a.i:3===a.type?(e=a.ys+c*a.yc,a.r&&(e=0>0:e-0.5>>0),a.t[a.p]=b+a.sfx+" "+e+a.ysfx):(a.dup&&(a.t.filter=a.t.filter||"alpha(opacity=100)"),a.t.filter=-1===a.t.filter.indexOf("opacity")?a.t.filter+(" alpha(opacity="+(100*b>>0)+")"):a.t.filter.replace(B,"opacity="+ (100*b>>0))):a.t[a.p]=b+a.sfx,a=a._next;else for(;a;)a.t[a.p]=a.b,a=a._next;if(this._transform)if(a=this._transform,i&&!a.rotation&&!a.skewX)this._style[i]=(a.x||a.y?"translate("+a.x+"px,"+a.y+"px) ":"")+(1!==a.scaleX||1!==a.scaleY?"scale("+a.scaleX+","+a.scaleY+")":"")||"translate(0px,0px)";else{b=i?a.rotation:-a.rotation;e=i?b-a.skewX:b+a.skewX;c=Math.cos(b)*a.scaleX;b=Math.sin(b)*a.scaleX;var f=Math.sin(e)*-a.scaleY;e=Math.cos(e)*a.scaleY;c-d&&(c=0);b-d&&(b=0);f-d&&(f=0);e-d&&(e=0);i?this._style[i]="matrix("+c+","+b+","+f+","+e+","+a.x+","+a.y+")":(d=b,b=-f,a=this._style.filter,this._style.filter="",d="progid:DXImageTransform.Microsoft.Matrix(M11="+c+", M12="+b+", M21="+-d+", M22="+e+",sizingMethod='auto expand')",this._style.filter=-1!==a.indexOf("DXImageTransform.Microsoft.Matrix(")?a.replace(O,d):d+" "+a)}};n._kill=function(c){var a=c,d;if(c.autoAlpha||c.alpha){a={};for(d in c)a[d]=c[d];a.opacity=1;a.autoAlpha&&(a.visibility=1)}return r.prototype._kill.call(this, a)};r.activate([l]);return l},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/plugins/ColorPropsPlugin.min.js b/src/minified/plugins/ColorPropsPlugin.min.js new file mode 100755 index 000000000..61c807bb5 --- /dev/null +++ b/src/minified/plugins/ColorPropsPlugin.min.js @@ -0,0 +1,13 @@ +/*! + * VERSION: beta 1.0 + * DATE: 2012-06-19 + * JavaScript + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("plugins.ColorPropsPlugin",["plugins.TweenPlugin"],function(i){var g=function(){i.call(this,"colorProps",-1);this._overwriteProps.pop()},j=g.prototype=new i("colorProps",-1),l=/(\d|\.)+/g,k=function(a){return""===a||null==a||"none"===a?h.transparent:h[a]?h[a]:"number"===typeof a?[a>>16,a>>8&255,a&255]:"#"===a.charAt(0)?(4===a.length&&(a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)),a=parseInt(a.substr(1), 16),[a>>16,a>>8&255,a&255]):a.match(l)||h.transparent},h={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]};j.constructor=g;g.API=2;j._onInitTween=function(a,b){this._target=a;var d,e,f,c;for(d in b){f= k(b[d]);this._firstPT=c={_next:this._firstPT,p:d,f:"function"===typeof a[d],n:d,r:!1};e=k(!c.f?a[d]:a[d.indexOf("set")||"function"!==typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]());c.s=Number(e[0]);c.c=Number(f[0])-c.s;c.gs=Number(e[1]);c.gc=Number(f[1])-c.gs;c.bs=Number(e[2]);c.bc=Number(f[2])-c.bs;if(c.rgba=3e.length?1:Number(e[3]),console.log("as "+c.as),c.ac=(4>f.length?1:Number(f[3]))-c.as;c._next&&(c._next._prev=c)}return!0};j.setRatio=function(a){for(var b= this._firstPT,d;b;){d=(b.rgba?"rgba(":"rgb(")+(b.s+a*b.c>>0)+", "+(b.gs+a*b.gc>>0)+", "+(b.bs+a*b.bc>>0)+(b.rgba?", "+(b.as+a*b.ac):"")+")";if(b.f)this._target[b.p](d);else this._target[b.p]=d;b=b._next}};i.activate([g]);return g},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/plugins/EaselPlugin.min.js b/src/minified/plugins/EaselPlugin.min.js new file mode 100755 index 000000000..6aa4a153e --- /dev/null +++ b/src/minified/plugins/EaselPlugin.min.js @@ -0,0 +1,13 @@ +/** + * VERSION: beta 0.1 + * DATE: 2012-06-08 + * JavaScript + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + **/ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("plugins.EaselPlugin",["plugins.TweenPlugin"],function(m){var h=function(){m.call(this,"easel",-1);this._overwriteProps.pop()},n=h.prototype=new m("easel",-1),o=/(\d|\.)+/g,p="redMultiplier greenMultiplier blueMultiplier alphaMultiplier redOffset greenOffset blueOffset alphaOffset".split(" "),q=function(a){return""===a||null==a||"none"===a?l.transparent:l[a]?l[a]:"number"===typeof a?[a>>16,a>>8&255,a&255]:"#"===a.charAt(0)?(4===a.length&& (a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)),a=parseInt(a.substr(1),16),[a>>16,a>>8&255,a&255]):a.match(o)||l.transparent},l={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255, 255,255,0]};n.constructor=h;h.API=2;n._onInitTween=function(a,d){this._target=a;var b,f,g;for(b in d)if("colorFilter"===b||"tint"===b||"tintAmount"===b||"exposure"===b||"brightness"===b){if(!g){f=a;g=d.colorFilter||d;if(!window.ColorFilter)throw"EaselPlugin error: The EaselJS ColorFilter JavaScript file wasn't loaded.";for(var h=f.filters||[],k=h.length,e=void 0,j=void 0,c=void 0,i=void 0,e=void 0;-1<--k;)if(h[k]instanceof ColorFilter){j=h[k];break}j||(j=new ColorFilter,h.push(j),f.filters=h);c=j.clone(); if(null!=g.tint)e=q(g.tint),i=null!=g.tintAmount?Number(g.tintAmount):1,c.redOffset=Number(e[0])*i,c.greenOffset=Number(e[1])*i,c.blueOffset=Number(e[2])*i,c.redMultiplier=c.greenMultiplier=c.blueMultiplier=1-i;else for(e in g)"exposure"!==e&&"brightness"!==e&&(c[e]=Number(g[e]));null!=g.exposure?(c.redOffset=c.greenOffset=c.blueOffset=255*(Number(g.exposure)-1),c.redMultiplier=c.greenMultiplier=c.blueMultiplier=1):null!=g.brightness&&(i=Number(g.brightness)-1,c.redOffset=c.greenOffset=c.blueOffset= 0>0);if(d.f)d.t[d.p](b);else d.t[d.p]=b;d=d._next}this._target.cacheID&&this._target.updateCache()};m.activate([h]);return h},!0)});window._gsDefine&&_gsQueue.pop()(); \ No newline at end of file diff --git a/src/minified/plugins/RaphaelPlugin.min.js b/src/minified/plugins/RaphaelPlugin.min.js new file mode 100755 index 000000000..56b987695 --- /dev/null +++ b/src/minified/plugins/RaphaelPlugin.min.js @@ -0,0 +1,13 @@ +/*! + * VERSION: beta 0.14 + * DATE: 2012-06-19 + * JavaScript + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("plugins.RaphaelPlugin",["plugins.TweenPlugin","TweenLite"],function(o){var i=function(){o.call(this,"raphael");this._overwriteProps.pop()},k=i.prototype=new o("raphael");k.constructor=i;i.API=2;var p=/[^\d\-\.]/g,j=Math.PI/180,t=/(\d|\.)+/g,q=function(b){return"number"===typeof b?[b>>16,b>>8&255,b&255]:""===b||null==b||"none"===b||"string"!==typeof b?l.transparent:l[b]?l[b]:"#"===b.charAt(0)?(4===b.length&&(b="#"+b.charAt(1)+b.charAt(1)+ b.charAt(2)+b.charAt(2)+b.charAt(3)+b.charAt(3)),b=parseInt(b.substr(1),16),[b>>16,b>>8&255,b&255]):b.match(t)||l.transparent},r={scaleX:1,scaleY:1,tx:1,ty:1,rotation:1,shortRotation:1,skewX:1,skewY:1,scale:1},s=function(b,a){var c=b.matrix,e=c.a,d=c.b,g=c.c,f=c.d,h=a?b._gsTransform||{skewY:0}:{skewY:0},i=0>h.scaleX;h.tx=c.e-(h.ox||0);h.ty=c.f-(h.oy||0);h.scaleX=Math.sqrt(e*e+d*d);h.scaleY=Math.sqrt(f*f+g*g);h.rotation=e||d?Math.atan2(d,e):h.rotation||0;h.skewX=g||f?Math.atan2(g,f)+h.rotation:h.skewX|| 0;Math.abs(h.skewX)>Math.PI/2&&(i?(h.scaleX*=-1,h.skewX+=0>=h.rotation?Math.PI:-Math.PI,h.rotation+=0>=h.rotation?Math.PI:-Math.PI):(h.scaleY*=-1,h.skewX+=0>=h.skewX?Math.PI:-Math.PI));if(1.0E-6>h.rotation&&-1.0E-6h.skewX&&-1.0E-6d.length?1:Number(d[3]),g.ac=(4>f.length?1: Number(f[3]))-g.as,g.type=2):g.type=1):(d="string"===typeof d?parseFloat(d.replace(p,"")):Number(d),"string"===typeof c?(f="="===c.charAt(1),c=parseFloat(c.replace(p,""))):f=!1,g.e=c||0===c?f?c+d:c:a[e],(d||0===d)&&(c||0===c)&&(g.c=f?c:c-d))?g.s=d:(g.type=-1,g.i=a[e],g.s=g.c=0),this._overwriteProps.push("raphael_"+e),g._next&&(g._next._prev=g));return!0};k._parseTransform=function(b,a){if(!this._transform){var c=this._transform=s(b,!0),e,d,g,f,h;if("object"===typeof a){e={scaleX:m(null!=a.scaleX? a.scaleX:a.scale,c.scaleX),scaleY:m(null!=a.scaleY?a.scaleY:a.scale,c.scaleY),tx:m(a.tx,c.tx),ty:m(a.ty,c.ty)};null!=a.shortRotation?(e.rotation="number"===typeof a.shortRotation?a.shortRotation*j:n(a.shortRotation,c.rotation),d=(e.rotation-c.rotation)%(2*Math.PI),d!==d%Math.PI&&(d+=Math.PI*(0>d?2:-2)),e.rotation=c.rotation+d):e.rotation=null==a.rotation?c.rotation:"number"===typeof a.rotation?a.rotation*j:n(a.rotation,c.rotation);e.skewX=null==a.skewX?c.skewX:"number"===typeof a.skewX?a.skewX*j: n(a.skewX,c.skewX);e.skewY=null==a.skewY?c.skewY:"number"===typeof a.skewY?a.skewY*j:n(a.skewY,c.skewY);if(d=e.skewY-c.skewY)e.skewX+=d,e.rotation+=d;1.0E-6>e.skewY&&-1.0E-6e.skewX&&-1.0E-6e.rotation&&-1.0E-6>0:c-0.5>>0),a.type?1===a.type?a.t[a.p]="rgb("+(c>>0)+", "+(a.gs+b*a.gc>>0)+", "+(a.bs+b*a.bc>>0)+")":2===a.type?a.t[a.p]="rgba("+(c>>0)+", "+(a.gs+b*a.gc>>0)+", "+(a.bs+b*a.bc>>0)+", "+(a.as+b*a.ac)+")":-1===a.type&&(a.t[a.p]=a.i):a.t[a.p]=c,a=a._next;this._target.attr(this._props);if(this._transform){a= this._transform;c=a.rotation;var e=c-a.skewX,b=Math.cos(c)*a.scaleX;c=Math.sin(c)*a.scaleX;var d=Math.sin(e)*-a.scaleY,e=Math.cos(e)*a.scaleY,g=this._pxl,f=this._pyl;1.0E-6>c&&-1.0E-6d&&-1.0E-6 -1) { + if ((a = this.vars[_paramProps[i]])) { + j = a.length; + while (--j > -1) { + if (a[j] === "{self}") { + a = this.vars[_paramProps[i]] = a.concat(); //copy the array in case the user referenced the same array in multiple timelines/tweens (each {self} should be unique) + a[j] = this; + } + } + } + } + if (this.vars.tweens instanceof Array) { + this.insertMultiple(this.vars.tweens, 0, this.vars.align || "normal", this.vars.stagger || 0); + } + }, + _paramProps = ["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"], + _blankArray = [], + _copy = function(vars) { + var copy = {}, p; + for (p in vars) { + copy[p] = vars[p]; + } + return copy; + }, + p = TimelineLite.prototype = new SimpleTimeline(); + + p.constructor = TimelineLite; + p.kill()._gc = false; + + p.to = function(target, duration, vars, offset, baseTimeOrLabel) { + return this.insert( new TweenLite(target, duration, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.from = function(target, duration, vars, offset, baseTimeOrLabel) { + return this.insert( TweenLite.from(target, duration, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.fromTo = function(target, duration, fromVars, toVars, offset, baseTimeOrLabel) { + return this.insert( TweenLite.fromTo(target, duration, fromVars, toVars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.staggerTo = function(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, onCompleteScope:onCompleteAllScope}); + stagger = stagger || 0; + for (var i = 0; i < targets.length; i++) { + if (vars.startAt != null) { + vars.startAt = _copy(vars.startAt); + } + tl.insert( new TweenLite(targets[i], duration, _copy(vars)), i * stagger); + } + return this.insert(tl, this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.staggerFrom = function(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + if (vars.immediateRender == null) { + vars.immediateRender = true; + } + vars.runBackwards = true; + return this.staggerTo(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + } + + p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + if (fromVars.immediateRender) { + toVars.immediateRender = true; + } + return this.staggerTo(targets, duration, toVars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + } + + p.call = function(callback, params, scope, offset, baseTimeOrLabel) { + return this.insert( TweenLite.delayedCall(0, callback, params, scope), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.set = function(target, vars, offset, baseTimeOrLabel) { + vars.immediateRender = false; + return this.insert( new TweenLite(target, 0, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { + vars = vars || {}; + if (vars.smoothChildTiming == null) { + vars.smoothChildTiming = true; + } + var tl = new TimelineLite(vars), + root = tl._timeline; + if (ignoreDelayedCalls == null) { + ignoreDelayedCalls = true; + } + root._remove(tl, true); + tl._startTime = 0; + tl._rawPrevTime = tl._time = tl._totalTime = root._time; + var tween = root._first, next; + while (tween) { + next = tween._next; + if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target == tween.vars.onComplete)) { + tl.insert(tween, tween._startTime - tween._delay); + } + tween = next; + } + root.insert(tl, 0); + return tl; + } + + p.insert = function(value, timeOrLabel) { + if (value instanceof Animation) { + //continue... + } else if (value instanceof Array) { + return this.insertMultiple(value, timeOrLabel); + } else if (typeof(value) === "string") { + return this.addLabel(value, this._parseTimeOrLabel(timeOrLabel || 0, true)); + } else if (typeof(value) === "function") { + value = TweenLite.delayedCall(0, value); + } else { + throw ("ERROR: Cannot insert() " + value + " into the TimelineLite/Max because it is neither a tween, timeline, function, nor a String."); + return this; + } + + SimpleTimeline.prototype.insert.call(this, value, this._parseTimeOrLabel(timeOrLabel || 0, true)); + + //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. + if (this._gc) if (!this._paused) if (this._time === this._duration) if (this._time < this.duration()) { + //in case any of the anscestors had completed but should now be enabled... + var tl = this; + while (tl._gc && tl._timeline) { + if (tl._timeline.smoothChildTiming) { + tl.totalTime(tl._totalTime, true); //also enables them + } else { + tl._enabled(true, false); + } + tl = tl._timeline; + } + } + return this; + } + + p.remove = function(value) { + if (value instanceof Animation) { + return this._remove(value, false); + } else if (value instanceof Array) { + var i = value.length; + while (--i > -1) { + this.remove(value[i]); + } + return this; + } else if (typeof(value) === "string") { + return this.removeLabel(value); + } + return this.kill(null, value); + } + + p.append = function(value, offset) { + return this.insert(value, this.duration() + (offset || 0)); + } + + p.insertMultiple = function(tweens, timeOrLabel, align, stagger) { + align = align || "normal"; + stagger = stagger || 0; + var i, tween, curTime = this._parseTimeOrLabel(timeOrLabel || 0, true), l = tweens.length; + for (i = 0; i < l; i++) { + if ((tween = tweens[i]) instanceof Array) { + tween = new TimelineLite({tweens:tween}); + } + this.insert(tween, curTime); + if (typeof(tween) === "string" || typeof(tween) === "function") { + //do nothing + } else if (align === "sequence") { + curTime = tween._startTime + (tween.totalDuration() / tween._timeScale); + } else if (align === "start") { + tween._startTime -= tween.delay(); + } + curTime += stagger; + } + return this._uncache(true); + } + + p.appendMultiple = function(tweens, offset, align, stagger) { + return this.insertMultiple(tweens, this.duration() + (offset || 0), align, stagger); + } + + p.addLabel = function(label, time) { + this._labels[label] = time; + return this; + } + + p.removeLabel = function(label) { + delete this._labels[label]; + return this; + } + + p.getLabelTime = function(label) { + return (this._labels[label] != null) ? this._labels[label] : -1; + } + + p._parseTimeOrLabel = function(timeOrLabel, appendIfAbsent) { + if (timeOrLabel == null) { + return this.duration(); + } else if (typeof(timeOrLabel) === "string" && isNaN(timeOrLabel)) { + if (this._labels[timeOrLabel] == null) { + return (appendIfAbsent) ? (this._labels[timeOrLabel] = this.duration()) : 0; + } + return this._labels[timeOrLabel]; + } + return Number(timeOrLabel); + } + + p.seek = function(timeOrLabel, suppressEvents) { + return this.totalTime(this._parseTimeOrLabel(timeOrLabel, false), (suppressEvents != false)); + } + + p.stop = function() { + return this.paused(true); + } + + p.gotoAndPlay = function(timeOrLabel, suppressEvents) { + return SimpleTimeline.prototype.play.call(this, timeOrLabel, suppressEvents); + } + + p.gotoAndStop = function(timeOrLabel, suppressEvents) { + return this.pause(timeOrLabel, suppressEvents); + } + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + this._active = !this._paused; + var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(), + prevTime = this._time, + prevStart = this._startTime, + prevTimeScale = this._timeScale, + prevPaused = this._paused, + tween, isComplete, next, callback; + if (time >= totalDur) { + this._totalTime = this._time = totalDur; + if (!this._reversed) if (!this._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0) if (this._rawPrevTime !== time) { //In order to accommodate zero-duration timelines, we must discern the momentum/direction of time in order to render values properly when the "playhead" goes past 0 in the forward direction or lands directly on it, and also when it moves past it in the backward direction (from a postitive time to a negative time). + force = true; + } + } + this._rawPrevTime = time; + time = totalDur + 0.000001; //to avoid occassional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off) + + } else if (time <= 0) { + this._totalTime = this._time = 0; + if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime > 0)) { + callback = "onReverseComplete"; + isComplete = this._reversed; + } + if (time < 0) { + this._active = false; + if (this._duration === 0) if (this._rawPrevTime >= 0) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + force = true; + } + } else if (!this._initted) { + force = true; + } + this._rawPrevTime = time; + time = -0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off) + + } else { + this._totalTime = this._time = this._rawPrevTime = time; + } + + if (this._time === prevTime && !force) { + return; + } else if (!this._initted) { + this._initted = true; + } + if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0) if (!suppressEvents) { + this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray); + } + + if (this._time > prevTime) { + tween = this._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering + break; + } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) { + + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false); + } + + } + tween = next; + } + } else { + tween = this._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false); + } + + } + tween = next; + } + } + + if (this._onUpdate) if (!suppressEvents) { + this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray); + } + + if (callback) if (!this._gc) if (prevStart === this._startTime || prevTimeScale != this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (this._timeline.autoRemoveChildren) { + this._enabled(false, false); + } + this._active = false; + } + if (!suppressEvents) if (this.vars[callback]) { + this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray); + } + } + + } + + p._hasPausedChild = function() { + var tween = this._first; + while (tween) { + if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { + return true; + } + tween = tween._next; + } + return false; + } + + p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || -9999999999; + var a = [], + tween = this._first, + cnt = 0; + while (tween) { + if (tween._startTime < ignoreBeforeTime) { + //do nothing + } else if (tween instanceof TweenLite) { + if (tweens != false) { + a[cnt++] = tween; + } + } else { + if (timelines != false) { + a[cnt++] = tween; + } + if (nested != false) { + a = a.concat(tween.getChildren(true, tweens, timelines)); + cnt = a.length; + } + } + tween = tween._next; + } + return a; + } + + p.getTweensOf = function(target, nested) { + var tweens = TweenLite.getTweensOf(target), + i = tweens.length, + a = [], + cnt = 0; + while (--i > -1) { + if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { + a[cnt++] = tweens[i]; + } + } + return a; + } + + p._contains = function(tween) { + var tl = tween.timeline; + while (tl) { + if (tl === this) { + return true; + } + tl = tl.timeline; + } + return false; + } + + p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || 0; + var tween = this._first; + while (tween) { + if (tween._startTime >= ignoreBeforeTime) { + tween._startTime += amount; + } + tween = tween._next; + } + if (adjustLabels) { + for (var p in this._labels) { + if (this._labels[p] >= ignoreBeforeTime) { + this._labels[p] += amount; + } + } + } + return this._uncache(true); + } + + p._kill = function(vars, target) { + if (vars == null) if (target == null) { + return this._enabled(false, false); + } + var tweens = (target == null) ? this.getChildren(true, true, false) : this.getTweensOf(target), + i = tweens.length, + changed = false; + while (--i > -1) { + if (tweens[i]._kill(vars, target)) { + changed = true; + } + } + return changed; + } + + p.clear = function(labels) { + var tweens = this.getChildren(false, true, true), + i = tweens.length; + this._time = this._totalTime = 0; + while (--i > -1) { + tweens[i]._enabled(false, false); + } + if (labels != false) { + this._labels = {}; + } + return this._uncache(true); + } + + p.invalidate = function() { + var tween = this._first; + while (tween) { + tween.invalidate(); + tween = tween._next; + } + return this; + } + + p._enabled = function(enabled, ignoreTimeline) { + if (enabled == this._gc) { + var tween = this._first; + while (tween) { + tween._enabled(enabled, true); + tween = tween._next; + } + } + return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); + } + + p.progress = function(value) { + return (!arguments.length) ? this._time / this.duration() : this.totalTime(this.duration() * value, false); + } + + p.duration = function(value) { + if (!arguments.length) { + if (this._dirty) { + this.totalDuration(); //just triggers recalculation + } + return this._duration; + } + if (this.duration() !== 0) if (value !== 0) { + this.timeScale(this._duration / value); + } + return this; + } + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + var max = 0, + tween = this._first, + prevStart = -999999999999, + next, end; + while (tween) { + next = tween._next; //record it here in case the tween changes position in the sequence... + + if (tween._startTime < prevStart && this._sortChildren) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence + this.insert(tween, tween._startTime - tween._delay); + } else { + prevStart = tween._startTime; + } + if (tween._startTime < 0) {//children aren't allowed to have negative startTimes, so adjust here if one is found. + max -= tween._startTime; + this.shiftChildren(-tween._startTime, false, -9999999999); + } + end = tween._startTime + ((!tween._dirty ? tween._totalDuration : tween.totalDuration()) / tween._timeScale); + if (end > max) { + max = end; + } + + tween = next; + } + this._duration = this._totalDuration = max; + this._dirty = false; + } + return this._totalDuration; + } + if (this.totalDuration() !== 0) if (value !== 0) { + this.timeScale(this._totalDuration / value); + } + return this; + } + + p.usesFrames = function() { + var tl = this._timeline; + while (tl._timeline) { + tl = tl._timeline; + } + return (tl === Animation._rootFramesTimeline); + } + + p.rawTime = function() { + return (this._paused || (this._totalTime !== 0 && this._totalTime !== this._totalDuration)) ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale; + } + + return TimelineLite; + + }, true); + + +}); if (window._gsDefine) { _gsQueue.pop()(); } \ No newline at end of file diff --git a/src/uncompressed/TimelineMax.js b/src/uncompressed/TimelineMax.js new file mode 100755 index 000000000..3bdfce4a1 --- /dev/null +++ b/src/uncompressed/TimelineMax.js @@ -0,0 +1,981 @@ +/*! + * VERSION: beta 1.486 + * DATE: 2012-08-31 + * JavaScript (ActionScript 3 and 2 also available) + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ + +(window._gsQueue || (window._gsQueue = [])).push( function() { + + _gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) { + + var TimelineMax = function(vars) { + TimelineLite.call(this, vars); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._cycle = 0; + this._yoyo = (this.vars.yoyo == true); + this._dirty = true; + }, + _blankArray = [], + _easeNone = new Ease(null, null, 1, 0), + _getGlobalPaused = function(tween) { + while (tween) { + if (tween._paused) { + return true; + } + tween = tween._timeline; + } + return false; + }, + p = TimelineMax.prototype = new TimelineLite(); + + p.constructor = TimelineMax; + p.kill()._gc = false; + TimelineMax.version = 12.0; + + p.invalidate = function() { + this._yoyo = (this.vars.yoyo == true); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._uncache(true); + return TimelineLite.prototype.invalidate.call(this); + } + + p.addCallback = function(callback, timeOrLabel, params, scope) { + return this.insert( TweenLite.delayedCall(0, callback, params, scope), timeOrLabel); + } + + p.removeCallback = function(callback, timeOrLabel) { + if (timeOrLabel == null) { + this._kill(null, callback); + } else { + var a = this.getTweensOf(callback, false), + i = a.length, + time = this._parseTimeOrLabel(timeOrLabel, false); + while (--i > -1) { + if (a[i]._startTime === time) { + a[i]._enabled(false, false); + } + } + } + return this; + } + + p.tweenTo = function(timeOrLabel, vars) { + vars = vars || {}; + var copy = {ease:_easeNone, overwrite:2, useFrames:this.usesFrames(), immediateRender:false}, p, t; + for (p in vars) { + copy[p] = vars[p]; + } + copy.time = this._parseTimeOrLabel(timeOrLabel, false); + t = new TweenLite(this, (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001, copy); + copy.onStart = function() { + t.target.paused(true); + if (t.vars.time != t.target.time()) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. + t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ); + } + if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it. + vars.onStart.apply(vars.onStartScope || t, vars.onStartParams || _blankArray); + } + } + return t; + } + + p.tweenFromTo = function(fromTimeOrLabel, toTimeOrLabel, vars) { + vars = vars || {}; + vars.startAt = {time:this._parseTimeOrLabel(fromTimeOrLabel, false)}; + var t = this.tweenTo(toTimeOrLabel, vars); + return t.duration((Math.abs( t.vars.time - t.vars.startAt.time) / this._timeScale) || 0.001); + } + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + this._active = !this._paused; + var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(), + prevTime = this._time, + prevTotalTime = this._totalTime, + prevStart = this._startTime, + prevTimeScale = this._timeScale, + prevRawPrevTime = this._rawPrevTime, + prevPaused = this._paused, + prevCycle = this._cycle, + tween, isComplete, next, dur, callback; + if (time >= totalDur) { + if (!this._locked) { + this._totalTime = totalDur; + this._cycle = this._repeat; + } + if (!this._reversed) if (!this._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0) if (this._rawPrevTime !== time) { //In order to accommodate zero-duration timelines, we must discern the momentum/direction of time in order to render values properly when the "playhead" goes past 0 in the forward direction or lands directly on it, and also when it moves past it in the backward direction (from a postitive time to a negative time). + force = true; + } + } + this._rawPrevTime = time; + if (this._yoyo && (this._cycle & 1) !== 0) { + this._time = 0; + time = -0.000001; //to avoid occassional floating point rounding errors - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off) + } else { + this._time = this._duration; + time = this._duration + 0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off) + } + + } else if (time <= 0) { + if (!this._locked) { + this._totalTime = this._cycle = 0; + } + this._time = 0; + if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime > 0)) { + callback = "onReverseComplete"; + isComplete = this._reversed; + } + if (time < 0) { + this._active = false; + if (this._duration === 0) if (this._rawPrevTime >= 0) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + force = true; + } + } else if (!this._initted) { + force = true; + } + this._rawPrevTime = time; + time = -0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off) + + } else { + this._time = this._rawPrevTime = time; + if (!this._locked) { + this._totalTime = time; + if (this._repeat !== 0) { + var cycleDuration = this._duration + this._repeatDelay; + this._cycle = (this._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but Flash reports it as 0.79999999!) + if (this._cycle !== 0) if (this._cycle === this._totalTime / cycleDuration) { + this._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + this._time = this._totalTime - (this._cycle * cycleDuration); + if (this._yoyo) if ((this._cycle & 1) != 0) { + this._time = this._duration - this._time; + } + if (this._time > this._duration) { + this._time = this._duration; + time = this._duration + 0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off) + } else if (this._time < 0) { + this._time = 0; + time = -0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off) + } else { + time = this._time; + } + } + } + } + + if (this._cycle !== prevCycle) if (!this._locked) { + /* + make sure children at the end/beginning of the timeline are rendered properly. If, for example, + a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which + would get transated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there + could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So + we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must + ensure that zero-duration tweens at the very beginning or end of the TimelineMax work. + */ + var backwards = (this._yoyo && (prevCycle & 1) !== 0), + wrap = (backwards === (this._yoyo && (this._cycle & 1) !== 0)), + recTotalTime = this._totalTime, + recCycle = this._cycle, + recRawPrevTime = this._rawPrevTime, + recTime = this._time; + + this._totalTime = prevCycle * this._duration; + if (this._cycle < prevCycle) { + backwards = !backwards; + } else { + this._totalTime += this._duration; + } + this._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method. + + this._rawPrevTime = prevRawPrevTime; + this._cycle = prevCycle; + this._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render() + prevTime = (backwards) ? 0 : this._duration; + this.render(prevTime, suppressEvents, false); + if (!suppressEvents) if (!this._gc) { + if (this.vars.onRepeat) { + this.vars.onRepeat.apply(this.vars.onRepeatScope || this, this.vars.onRepeatParams || _blankArray); + } + } + if (wrap) { + prevTime = (backwards) ? this._duration + 0.000001 : -0.000001; + this.render(prevTime, true, false); + } + this._time = recTime; + this._totalTime = recTotalTime; + this._cycle = recCycle; + this._rawPrevTime = recRawPrevTime; + this._locked = false; + } + + if (this._time === prevTime && !force) { + return; + } else if (!this._initted) { + this._initted = true; + } + + if (prevTotalTime === 0) if (this.vars.onStart) if (this._totalTime !== 0) if (!suppressEvents) { + this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray); + } + + if (this._time > prevTime) { + tween = this._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering + break; + } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) { + + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false); + } + + } + tween = next; + } + } else { + tween = this._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false); + } + + } + tween = next; + } + } + + if (this._onUpdate) if (!suppressEvents) { + this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray); + } + + if (callback) if (!this._locked) if (!this._gc) if (prevStart === this._startTime || prevTimeScale != this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (this._timeline.autoRemoveChildren) { + this._enabled(false, false); + } + this._active = false; + } + if (!suppressEvents) if (this.vars[callback]) { + this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray); + } + } + } + + p.getActive = function(nested, tweens, timelines) { + if (nested == null) { + nested = true; + } + if (tweens == null) { + tweens = true; + } + if (timelines == null) { + timelines = false; + } + var a = [], + all = this.getChildren(nested, tweens, timelines), + cnt = 0, + l = all.length, + i, tween; + for (i = 0; i < l; i++) { + tween = all[i]; + //note: we cannot just check tween.active because timelines that contain paused children will continue to have "active" set to true even after the playhead passes their end point (technically a timeline can only be considered complete after all of its children have completed too, but paused tweens are...well...just waiting and until they're unpaused we don't know where their end point will be). + if (!tween._paused) if (tween._timeline._time >= tween._startTime) if (tween._timeline._time < tween._startTime + tween._totalDuration / tween._timeScale) if (!_getGlobalPaused(tween._timeline)) { + a[cnt++] = tween; + } + } + return a; + } + + + p.getLabelAfter = function(time) { + if (!time) if (time !== 0) { //faster than isNan() + time = this._time; + } + var labels = this.getLabelsArray(), + l = labels.length, + i; + for (i = 0; i < l; i++) { + if (labels[i].time > time) { + return labels[i].name; + } + } + return null; + } + + p.getLabelBefore = function(time) { + if (time == null) { + time = this._time; + } + var labels = this.getLabelsArray(), + i = labels.length; + while (--i > -1) { + if (labels[i].time < time) { + return labels[i].name; + } + } + return null; + } + + p.getLabelsArray = function() { + var a = [], + cnt = 0, + p; + for (p in this._labels) { + a[cnt++] = {time:this._labels[p], name:p}; + } + a.sort(function(a,b) { + return a.time - b.time; + }); + return a; + } + + +//---- GETTERS / SETTERS ------------------------------------------------------------------------------------------------------- + + p.progress = function(value) { + return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * value + (this._cycle * this._duration), false); + } + + p.totalProgress = function(value) { + return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, false); + } + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + TimelineLite.prototype.totalDuration.call(this); //just forces refresh + //Instead of Infinity, we use 999999999999 so that we can accommodate reverses. + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + } + return this._totalDuration; + } + return (this._repeat == -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) ); + } + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + if (value > this._duration) { + value = this._duration; + } + if (this._yoyo && (this._cycle & 1) !== 0) { + value = (this._duration - value) + (this._cycle * (this._duration + this._repeatDelay)); + } else if (this._repeat != 0) { + value += this._cycle * (this._duration + this._repeatDelay); + } + return this.totalTime(value, suppressEvents); + } + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + } + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + } + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + } + + p.currentLabel = function(value) { + if (!arguments.length) { + return this.getLabelBefore(this._time + 0.00000001); + } + return this.seek(value, true); + } + + return TimelineMax; + + }, true); + + + + + +/* + * ---------------------------------------------------------------- + * TimelineLite + * ---------------------------------------------------------------- + */ + _gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { + + "use strict"; + + var TimelineLite = function(vars) { + SimpleTimeline.call(this, vars); + this._labels = {}; + this.autoRemoveChildren = (this.vars.autoRemoveChildren == true); + this.smoothChildTiming = (this.vars.smoothChildTiming == true); + this._sortChildren = true; + this._onUpdate = this.vars.onUpdate; + var i = _paramProps.length, + j, a; + while (--i > -1) { + if ((a = this.vars[_paramProps[i]])) { + j = a.length; + while (--j > -1) { + if (a[j] === "{self}") { + a = this.vars[_paramProps[i]] = a.concat(); //copy the array in case the user referenced the same array in multiple timelines/tweens (each {self} should be unique) + a[j] = this; + } + } + } + } + if (this.vars.tweens instanceof Array) { + this.insertMultiple(this.vars.tweens, 0, this.vars.align || "normal", this.vars.stagger || 0); + } + }, + _paramProps = ["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"], + _blankArray = [], + _copy = function(vars) { + var copy = {}, p; + for (p in vars) { + copy[p] = vars[p]; + } + return copy; + }, + p = TimelineLite.prototype = new SimpleTimeline(); + + p.constructor = TimelineLite; + p.kill()._gc = false; + + p.to = function(target, duration, vars, offset, baseTimeOrLabel) { + return this.insert( new TweenLite(target, duration, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.from = function(target, duration, vars, offset, baseTimeOrLabel) { + return this.insert( TweenLite.from(target, duration, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.fromTo = function(target, duration, fromVars, toVars, offset, baseTimeOrLabel) { + return this.insert( TweenLite.fromTo(target, duration, fromVars, toVars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.staggerTo = function(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, onCompleteScope:onCompleteAllScope}); + stagger = stagger || 0; + for (var i = 0; i < targets.length; i++) { + if (vars.startAt != null) { + vars.startAt = _copy(vars.startAt); + } + tl.insert( new TweenLite(targets[i], duration, _copy(vars)), i * stagger); + } + return this.insert(tl, this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.staggerFrom = function(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + if (vars.immediateRender == null) { + vars.immediateRender = true; + } + vars.runBackwards = true; + return this.staggerTo(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + } + + p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + if (fromVars.immediateRender) { + toVars.immediateRender = true; + } + return this.staggerTo(targets, duration, toVars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + } + + p.call = function(callback, params, scope, offset, baseTimeOrLabel) { + return this.insert( TweenLite.delayedCall(0, callback, params, scope), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + p.set = function(target, vars, offset, baseTimeOrLabel) { + vars.immediateRender = false; + return this.insert( new TweenLite(target, 0, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0)); + } + + TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { + vars = vars || {}; + if (vars.smoothChildTiming == null) { + vars.smoothChildTiming = true; + } + var tl = new TimelineLite(vars), + root = tl._timeline; + if (ignoreDelayedCalls == null) { + ignoreDelayedCalls = true; + } + root._remove(tl, true); + tl._startTime = 0; + tl._rawPrevTime = tl._time = tl._totalTime = root._time; + var tween = root._first, next; + while (tween) { + next = tween._next; + if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target == tween.vars.onComplete)) { + tl.insert(tween, tween._startTime - tween._delay); + } + tween = next; + } + root.insert(tl, 0); + return tl; + } + + p.insert = function(value, timeOrLabel) { + if (value instanceof Animation) { + //continue... + } else if (value instanceof Array) { + return this.insertMultiple(value, timeOrLabel); + } else if (typeof(value) === "string") { + return this.addLabel(value, this._parseTimeOrLabel(timeOrLabel || 0, true)); + } else if (typeof(value) === "function") { + value = TweenLite.delayedCall(0, value); + } else { + throw ("ERROR: Cannot insert() " + value + " into the TimelineLite/Max because it is neither a tween, timeline, function, nor a String."); + return this; + } + + SimpleTimeline.prototype.insert.call(this, value, this._parseTimeOrLabel(timeOrLabel || 0, true)); + + //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. + if (this._gc) if (!this._paused) if (this._time === this._duration) if (this._time < this.duration()) { + //in case any of the anscestors had completed but should now be enabled... + var tl = this; + while (tl._gc && tl._timeline) { + if (tl._timeline.smoothChildTiming) { + tl.totalTime(tl._totalTime, true); //also enables them + } else { + tl._enabled(true, false); + } + tl = tl._timeline; + } + } + return this; + } + + p.remove = function(value) { + if (value instanceof Animation) { + return this._remove(value, false); + } else if (value instanceof Array) { + var i = value.length; + while (--i > -1) { + this.remove(value[i]); + } + return this; + } else if (typeof(value) === "string") { + return this.removeLabel(value); + } + return this.kill(null, value); + } + + p.append = function(value, offset) { + return this.insert(value, this.duration() + (offset || 0)); + } + + p.insertMultiple = function(tweens, timeOrLabel, align, stagger) { + align = align || "normal"; + stagger = stagger || 0; + var i, tween, curTime = this._parseTimeOrLabel(timeOrLabel || 0, true), l = tweens.length; + for (i = 0; i < l; i++) { + if ((tween = tweens[i]) instanceof Array) { + tween = new TimelineLite({tweens:tween}); + } + this.insert(tween, curTime); + if (typeof(tween) === "string" || typeof(tween) === "function") { + //do nothing + } else if (align === "sequence") { + curTime = tween._startTime + (tween.totalDuration() / tween._timeScale); + } else if (align === "start") { + tween._startTime -= tween.delay(); + } + curTime += stagger; + } + return this._uncache(true); + } + + p.appendMultiple = function(tweens, offset, align, stagger) { + return this.insertMultiple(tweens, this.duration() + (offset || 0), align, stagger); + } + + p.addLabel = function(label, time) { + this._labels[label] = time; + return this; + } + + p.removeLabel = function(label) { + delete this._labels[label]; + return this; + } + + p.getLabelTime = function(label) { + return (this._labels[label] != null) ? this._labels[label] : -1; + } + + p._parseTimeOrLabel = function(timeOrLabel, appendIfAbsent) { + if (timeOrLabel == null) { + return this.duration(); + } else if (typeof(timeOrLabel) === "string" && isNaN(timeOrLabel)) { + if (this._labels[timeOrLabel] == null) { + return (appendIfAbsent) ? (this._labels[timeOrLabel] = this.duration()) : 0; + } + return this._labels[timeOrLabel]; + } + return Number(timeOrLabel); + } + + p.seek = function(timeOrLabel, suppressEvents) { + return this.totalTime(this._parseTimeOrLabel(timeOrLabel, false), (suppressEvents != false)); + } + + p.stop = function() { + return this.paused(true); + } + + p.gotoAndPlay = function(timeOrLabel, suppressEvents) { + return SimpleTimeline.prototype.play.call(this, timeOrLabel, suppressEvents); + } + + p.gotoAndStop = function(timeOrLabel, suppressEvents) { + return this.pause(timeOrLabel, suppressEvents); + } + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + this._active = !this._paused; + var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(), + prevTime = this._time, + prevStart = this._startTime, + prevTimeScale = this._timeScale, + prevPaused = this._paused, + tween, isComplete, next, callback; + if (time >= totalDur) { + this._totalTime = this._time = totalDur; + if (!this._reversed) if (!this._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0) if (this._rawPrevTime !== time) { //In order to accommodate zero-duration timelines, we must discern the momentum/direction of time in order to render values properly when the "playhead" goes past 0 in the forward direction or lands directly on it, and also when it moves past it in the backward direction (from a postitive time to a negative time). + force = true; + } + } + this._rawPrevTime = time; + time = totalDur + 0.000001; //to avoid occassional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off) + + } else if (time <= 0) { + this._totalTime = this._time = 0; + if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime > 0)) { + callback = "onReverseComplete"; + isComplete = this._reversed; + } + if (time < 0) { + this._active = false; + if (this._duration === 0) if (this._rawPrevTime >= 0) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + force = true; + } + } else if (!this._initted) { + force = true; + } + this._rawPrevTime = time; + time = -0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off) + + } else { + this._totalTime = this._time = this._rawPrevTime = time; + } + + if (this._time === prevTime && !force) { + return; + } else if (!this._initted) { + this._initted = true; + } + if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0) if (!suppressEvents) { + this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray); + } + + if (this._time > prevTime) { + tween = this._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering + break; + } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) { + + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false); + } + + } + tween = next; + } + } else { + tween = this._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false); + } + + } + tween = next; + } + } + + if (this._onUpdate) if (!suppressEvents) { + this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray); + } + + if (callback) if (!this._gc) if (prevStart === this._startTime || prevTimeScale != this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (this._timeline.autoRemoveChildren) { + this._enabled(false, false); + } + this._active = false; + } + if (!suppressEvents) if (this.vars[callback]) { + this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray); + } + } + + } + + p._hasPausedChild = function() { + var tween = this._first; + while (tween) { + if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { + return true; + } + tween = tween._next; + } + return false; + } + + p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || -9999999999; + var a = [], + tween = this._first, + cnt = 0; + while (tween) { + if (tween._startTime < ignoreBeforeTime) { + //do nothing + } else if (tween instanceof TweenLite) { + if (tweens != false) { + a[cnt++] = tween; + } + } else { + if (timelines != false) { + a[cnt++] = tween; + } + if (nested != false) { + a = a.concat(tween.getChildren(true, tweens, timelines)); + cnt = a.length; + } + } + tween = tween._next; + } + return a; + } + + p.getTweensOf = function(target, nested) { + var tweens = TweenLite.getTweensOf(target), + i = tweens.length, + a = [], + cnt = 0; + while (--i > -1) { + if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { + a[cnt++] = tweens[i]; + } + } + return a; + } + + p._contains = function(tween) { + var tl = tween.timeline; + while (tl) { + if (tl === this) { + return true; + } + tl = tl.timeline; + } + return false; + } + + p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || 0; + var tween = this._first; + while (tween) { + if (tween._startTime >= ignoreBeforeTime) { + tween._startTime += amount; + } + tween = tween._next; + } + if (adjustLabels) { + for (var p in this._labels) { + if (this._labels[p] >= ignoreBeforeTime) { + this._labels[p] += amount; + } + } + } + return this._uncache(true); + } + + p._kill = function(vars, target) { + if (vars == null) if (target == null) { + return this._enabled(false, false); + } + var tweens = (target == null) ? this.getChildren(true, true, false) : this.getTweensOf(target), + i = tweens.length, + changed = false; + while (--i > -1) { + if (tweens[i]._kill(vars, target)) { + changed = true; + } + } + return changed; + } + + p.clear = function(labels) { + var tweens = this.getChildren(false, true, true), + i = tweens.length; + this._time = this._totalTime = 0; + while (--i > -1) { + tweens[i]._enabled(false, false); + } + if (labels != false) { + this._labels = {}; + } + return this._uncache(true); + } + + p.invalidate = function() { + var tween = this._first; + while (tween) { + tween.invalidate(); + tween = tween._next; + } + return this; + } + + p._enabled = function(enabled, ignoreTimeline) { + if (enabled == this._gc) { + var tween = this._first; + while (tween) { + tween._enabled(enabled, true); + tween = tween._next; + } + } + return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); + } + + p.progress = function(value) { + return (!arguments.length) ? this._time / this.duration() : this.totalTime(this.duration() * value, false); + } + + p.duration = function(value) { + if (!arguments.length) { + if (this._dirty) { + this.totalDuration(); //just triggers recalculation + } + return this._duration; + } + if (this.duration() !== 0) if (value !== 0) { + this.timeScale(this._duration / value); + } + return this; + } + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + var max = 0, + tween = this._first, + prevStart = -999999999999, + next, end; + while (tween) { + next = tween._next; //record it here in case the tween changes position in the sequence... + + if (tween._startTime < prevStart && this._sortChildren) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence + this.insert(tween, tween._startTime - tween._delay); + } else { + prevStart = tween._startTime; + } + if (tween._startTime < 0) {//children aren't allowed to have negative startTimes, so adjust here if one is found. + max -= tween._startTime; + this.shiftChildren(-tween._startTime, false, -9999999999); + } + end = tween._startTime + ((!tween._dirty ? tween._totalDuration : tween.totalDuration()) / tween._timeScale); + if (end > max) { + max = end; + } + + tween = next; + } + this._duration = this._totalDuration = max; + this._dirty = false; + } + return this._totalDuration; + } + if (this.totalDuration() !== 0) if (value !== 0) { + this.timeScale(this._totalDuration / value); + } + return this; + } + + p.usesFrames = function() { + var tl = this._timeline; + while (tl._timeline) { + tl = tl._timeline; + } + return (tl === Animation._rootFramesTimeline); + } + + p.rawTime = function() { + return (this._paused || (this._totalTime !== 0 && this._totalTime !== this._totalDuration)) ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale; + } + + return TimelineLite; + + }, true); + + +}); if (window._gsDefine) { _gsQueue.pop()(); } \ No newline at end of file diff --git a/src/uncompressed/TweenLite.js b/src/uncompressed/TweenLite.js new file mode 100755 index 000000000..972aec4f2 --- /dev/null +++ b/src/uncompressed/TweenLite.js @@ -0,0 +1,1372 @@ +/*! + * VERSION: beta 1.5 + * DATE: 2012-9-04 + * JavaScript (ActionScript 3 and 2 also available) + * UPDATES AND DOCS AT: http://www.greensock.com + * + * Copyright (c) 2008-2012, GreenSock. All rights reserved. + * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(function(window) { + + "use strict"; + var _namespace = function(ns) { + var a = ns.split("."), + p = window, i; + for (i = 0; i < a.length; i++) { + p[a[i]] = p = p[a[i]] || {}; + } + return p; + }, + gs = _namespace("com.greensock"), + a, i, e, e2, p, _gsInit, + _classLookup = {}, + + //_DepClass is for defining a dependent class. ns = namespace (leaving off "com.greensock." as that's assumed), dep = an array of namespaces that are required, def = the function that will return the class definition (this function will be passed each dependency in order as soon as they arrive), global = if true, the class is added to the global scope (window) or if requirejs is being used, it will tap into that instead. + _DepClass = function(ns, dep, def, global) { + this.sc = (_classLookup[ns]) ? _classLookup[ns].sc : []; //subclasses + _classLookup[ns] = this; + this.gsClass = null; + this.def = def; + var _dep = dep || [], + _classes = []; + this.check = function(init) { + var i = _dep.length, cnt = 0, cur; + while (--i > -1) { + if ((cur = _classLookup[_dep[i]] || new _DepClass(_dep[i])).gsClass) { + _classes[i] = cur.gsClass; + } else { + cnt++; + if (init) { + cur.sc.push(this); + } + } + } + if (cnt === 0 && def) { + var a = ("com.greensock." + ns).split("."), + n = a.pop(), + cl = _namespace(a.join("."))[n] = this.gsClass = def.apply(def, _classes); + + //exports to multiple environments + if (global) { + (window.GreenSockGlobals || window)[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.) + if (typeof(define) === "function" && define.amd){ //AMD + define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").join("/"), [], function() { return cl; }); + } else if (typeof(module) !== "undefined" && module.exports){ //node + module.exports = cl; + } + } + + for (i = 0; i < this.sc.length; i++) { + this.sc[i].check(false); + } + + } + }; + this.check(true); + }, + //a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class). + _class = gs._class = function(ns, f, g) { + new _DepClass(ns, [], function(){ return f; }, g); + return f; + }; + + //used to create _DepClass instances (which basically registers a class that has dependencies). ns = namespace, dep = dependencies (array), f = initialization function which should return the class, g = global (whether or not the class should be added to the global namespace (or if RequireJS is used, it will be defined as a named module instead) + window._gsDefine = function(ns, dep, f, g) { + return new _DepClass(ns, dep, f, g); + }; + + + +/* + * ---------------------------------------------------------------- + * Ease + * ---------------------------------------------------------------- + */ + var _baseParams = [0, 0, 1, 1], + _blankArray = [], + Ease = _class("easing.Ease", function(func, extraParams, type, power) { + this._func = func; + this._type = type || 0; + this._power = power || 0; + this._params = extraParams ? _baseParams.concat(extraParams) : _baseParams; + }, true); + + p = Ease.prototype; + p._calcEnd = false; + p.getRatio = function(p) { + if (this._func) { + this._params[0] = p; + return this._func.apply(null, this._params); + } else { + var t = this._type, + pw = this._power, + r = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2; + if (pw === 1) { + r *= r; + } else if (pw === 2) { + r *= r * r; + } else if (pw === 3) { + r *= r * r * r; + } else if (pw === 4) { + r *= r * r * r * r; + } + return (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2); + } + }; + + //create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut) + a = ["Linear","Quad","Cubic","Quart","Quint"]; + i = a.length; + while(--i > -1) { + e = _class("easing." + a[i], function(){}, true); + e2 = _class("easing.Power" + i, function(){}, true); + e.easeOut = e2.easeOut = new Ease(null, null, 1, i); + e.easeIn = e2.easeIn = new Ease(null, null, 2, i); + e.easeInOut = e2.easeInOut = new Ease(null, null, 3, i); + } + _class("easing.Strong", gs.easing.Power4, true); + gs.easing.Linear.easeNone = gs.easing.Linear.easeIn; + + +/* + * ---------------------------------------------------------------- + * EventDispatcher + * ---------------------------------------------------------------- + */ + p = _class("events.EventDispatcher", function(target) { + this._listeners = {}; + this._eventTarget = target || this; + }).prototype; + + p.addEventListener = function(type, callback, scope, useParam, priority) { + priority = priority || 0; + var list = this._listeners[type], + index = 0, + listener, i; + if (list == null) { + this._listeners[type] = list = []; + } + i = list.length; + while (--i > -1) { + listener = list[i]; + if (listener.c === callback) { + list.splice(i, 1); + } else if (index === 0 && listener.pr < priority) { + index = i + 1; + } + } + list.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority}); + }; + + p.removeEventListener = function(type, callback) { + var list = this._listeners[type]; + if (list) { + var i = list.length; + while (--i > -1) { + if (list[i].c === callback) { + list.splice(i, 1); + return; + } + } + } + }; + + p.dispatchEvent = function(type) { + var list = this._listeners[type]; + if (list) { + var i = list.length, listener, + t = this._eventTarget; + while (--i > -1) { + listener = list[i]; + if (listener.up) { + listener.c.call(listener.s || t, {type:type, target:t}); + } else { + listener.c.call(listener.s || t); + } + } + } + }; + + +/* + * ---------------------------------------------------------------- + * Ticker + * ---------------------------------------------------------------- + */ + var _reqAnimFrame = window.requestAnimationFrame, + _cancelAnimFrame = window.cancelAnimationFrame, + _getTime = Date.now || function() {return new Date().getTime();}; + + //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill. + a = ["ms","moz","webkit","o"]; + i = a.length; + while (--i > -1 && !_reqAnimFrame) { + _reqAnimFrame = window[a[i] + "RequestAnimationFrame"]; + _cancelAnimFrame = window[a[i] + "CancelAnimationFrame"] || window[a[i] + "CancelRequestAnimationFrame"]; + } + if (!_cancelAnimFrame) { + _cancelAnimFrame = function(id) { + window.clearTimeout(id); + } + } + + _class("Ticker", function(fps, useRAF) { + this.time = 0; + this.frame = 0; + var _self = this, + _startTime = _getTime(), + _useRAF = (useRAF !== false), + _fps, _req, _id, _gap, _nextTime; + + this.tick = function() { + _self.time = (_getTime() - _startTime) / 1000; + if (!_fps || _self.time >= _nextTime) { + _self.frame++; + _nextTime = _self.time + _gap - (_self.time - _nextTime) - 0.0005; + if (_nextTime <= _self.time) { + _nextTime = _self.time + 0.001; + } + _self.dispatchEvent("tick"); + } + _id = _req( _self.tick ); + }; + + this.fps = function(value) { + if (!arguments.length) { + return _fps; + } + _fps = value; + _gap = 1 / (_fps || 60); + _nextTime = this.time + _gap; + _req = (_fps === 0) ? function(f){} : (!_useRAF || !_reqAnimFrame) ? function(f) { return window.setTimeout( f, (((_nextTime - _self.time) * 1000 + 1) >> 0) || 1); } : _reqAnimFrame; + _cancelAnimFrame(_id); + _id = _req( _self.tick ); + }; + + this.useRAF = function(value) { + if (!arguments.length) { + return _useRAF + } + _useRAF = value; + this.fps(_fps); + }; + + this.fps(fps); + }); + + p = gs.Ticker.prototype = new gs.events.EventDispatcher(); + p.constructor = gs.Ticker; + + +/* + * ---------------------------------------------------------------- + * Animation + * ---------------------------------------------------------------- + */ + var Animation = _class("core.Animation", function(duration, vars) { + this.vars = vars || {}; + this._duration = this._totalDuration = duration || 0; + this._delay = Number(this.vars.delay) || 0; + this._timeScale = 1; + this._active = (this.vars.immediateRender == true); + this.data = this.vars.data; + this._reversed = (this.vars.reversed == true); + + if (!_rootTimeline) { + return; + } + if (!_gsInit) { + _ticker.tick(); //the first time an animation (tween or timeline) is created, we should refresh the time in order to avoid a gap. The Ticker's initial time that it records might be very early in the load process and the user may have loaded several other large scripts in the mean time, but we want tweens to act as though they started when the page's onload was fired. Also remember that the requestAnimationFrame likely won't be called until the first screen redraw. + _gsInit = true; + } + + var tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline; + tl.insert(this, tl._time); + + if (this.vars.paused) { + this.paused(true); + } + }), + _ticker = Animation.ticker = new gs.Ticker(); + + p = Animation.prototype; + p._dirty = p._gc = p._initted = p._paused = false; + p._totalTime = p._time = 0; + p._rawPrevTime = -1; + p._next = p._last = p._onUpdate = p._timeline = p.timeline = null; + p._paused = false; + + p.play = function(from, suppressEvents) { + if (arguments.length) { + this.seek(from, suppressEvents); + } + this.reversed(false); + return this.paused(false); + }; + + p.pause = function(atTime, suppressEvents) { + if (arguments.length) { + this.seek(atTime, suppressEvents); + } + return this.paused(true); + }; + + p.resume = function(from, suppressEvents) { + if (arguments.length) { + this.seek(from, suppressEvents); + } + return this.paused(false); + }; + + p.seek = function(time, suppressEvents) { + return this.totalTime(Number(time), (suppressEvents != false)); + }; + + p.restart = function(includeDelay, suppressEvents) { + this.reversed(false); + this.paused(false); + return this.totalTime((includeDelay) ? -this._delay : 0, (suppressEvents != false)); + }; + + p.reverse = function(from, suppressEvents) { + if (arguments.length) { + this.seek((from || this.totalDuration()), suppressEvents); + } + this.reversed(true); + return this.paused(false); + }; + + p.render = function() { + + }; + + p.invalidate = function() { + return this; + }; + + p._enabled = function (enabled, ignoreTimeline) { + this._gc = !enabled; + this._active = (enabled && !this._paused && this._totalTime > 0 && this._totalTime < this._totalDuration); + if (ignoreTimeline != true) { + if (enabled && this.timeline == null) { + this._timeline.insert(this, this._startTime - this._delay); + } else if (!enabled && this.timeline != null) { + this._timeline._remove(this, true); + } + } + return false; + }; + + + p._kill = function(vars, target) { + return this._enabled(false, false); + }; + + p.kill = function(vars, target) { + this._kill(vars, target); + return this; + }; + + p._uncache = function(includeSelf) { + var tween = includeSelf ? this : this.timeline; + while (tween) { + tween._dirty = true; + tween = tween.timeline; + } + return this; + }; + +//----Animation getters/setters -------------------------------------------------------- + + p.eventCallback = function(type, callback, params, scope) { + if (type == null) { + return null; + } else if (type.substr(0,2) === "on") { + if (arguments.length === 1) { + return this.vars[type]; + } + if (callback == null) { + delete this.vars[type]; + } else { + this.vars[type] = callback; + this.vars[type + "Params"] = params; + this.vars[type + "Scope"] = scope; + if (params) { + var i = params.length; + while (--i > -1) { + if (params[i] === "{self}") { + params = this.vars[type + "Params"] = params.concat(); //copying the array avoids situations where the same array is passed to multiple tweens/timelines and {self} doesn't correctly point to each individual instance. + params[i] = this; + } + } + } + } + if (type === "onUpdate") { + this._onUpdate = callback; + } + } + return this; + } + + p.delay = function(value) { + if (!arguments.length) { + return this._delay; + } + if (this._timeline.smoothChildTiming) { + this.startTime( this._startTime + value - this._delay ); + } + this._delay = value; + return this; + }; + + p.duration = function(value) { + if (!arguments.length) { + this._dirty = false; + return this._duration; + } + this._duration = this._totalDuration = value; + this._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration. + if (this._timeline.smoothChildTiming) if (this._active) if (value != 0) { + this.totalTime(this._totalTime * (value / this._duration), true); + } + return this; + }; + + p.totalDuration = function(value) { + this._dirty = false; + return (!arguments.length) ? this._totalDuration : this.duration(value); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + if (value > this._duration) { + value = this._duration; + } + return this.totalTime(value, suppressEvents); + }; + + p.totalTime = function(time, suppressEvents) { + if (!arguments.length) { + return this._totalTime; + } + if (this._timeline) { + if (time < 0) { + time += this.totalDuration(); + } + if (this._timeline.smoothChildTiming) { + if (this._dirty) { + this.totalDuration(); + } + if (time > this._totalDuration) { + time = this._totalDuration; + } + this._startTime = (this._paused ? this._pauseTime : this._timeline._time) - ((!this._reversed ? time : this._totalDuration - time) / this._timeScale); + if (!this._timeline._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the anscestors as dirty too, so skip the function call here. + this._uncache(false); + } + if (!this._timeline._active) { + //in case any of the anscestors had completed but should now be enabled... + var tl = this._timeline; + while (tl._timeline) { + tl.totalTime(tl._totalTime, true); + tl = tl._timeline; + } + } + } + if (this._gc) { + this._enabled(true, false); + } + if (this._totalTime != time) { + this.render(time, suppressEvents, false); + } + } + return this; + }; + + p.startTime = function(value) { + if (!arguments.length) { + return this._startTime; + } + if (value != this._startTime) { + this._startTime = value; + if (this.timeline) if (this.timeline._sortChildren) { + this.timeline.insert(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. + } + } + return this; + }; + + p.timeScale = function(value) { + if (!arguments.length) { + return this._timeScale; + } + value = value || 0.000001; //can't allow zero because it'll throw the math off + if (this._timeline && this._timeline.smoothChildTiming) { + var t = (this._pauseTime || this._pauseTime == 0) ? this._pauseTime : this._timeline._totalTime; + this._startTime = t - ((t - this._startTime) * this._timeScale / value); + } + this._timeScale = value; + return this._uncache(false); + }; + + p.reversed = function(value) { + if (!arguments.length) { + return this._reversed; + } + if (value != this._reversed) { + this._reversed = value; + this.totalTime(this._totalTime, true); + } + return this; + }; + + p.paused = function(value) { + if (!arguments.length) { + return this._paused; + } + if (value != this._paused) if (this._timeline) { + if (!value && this._timeline.smoothChildTiming) { + this._startTime += this._timeline.rawTime() - this._pauseTime; + this._uncache(false); + } + this._pauseTime = (value) ? this._timeline.rawTime() : null; + this._paused = value; + this._active = (!this._paused && this._totalTime > 0 && this._totalTime < this._totalDuration); + } + if (this._gc) if (!value) { + this._enabled(true, false); + } + return this; + }; + + +/* + * ---------------------------------------------------------------- + * SimpleTimeline + * ---------------------------------------------------------------- + */ + var SimpleTimeline = _class("core.SimpleTimeline", function(vars) { + Animation.call(this, 0, vars); + this.autoRemoveChildren = this.smoothChildTiming = true; + }); + + p = SimpleTimeline.prototype = new Animation(); + p.constructor = SimpleTimeline; + p.kill()._gc = false; + p._first = p._last = null; + p._sortChildren = false; + + p.insert = function(tween, time) { + tween._startTime = Number(time || 0) + tween._delay; + if (tween._paused) if (this !== tween._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order). + tween._pauseTime = tween._startTime + ((this.rawTime() - tween._startTime) / tween._timeScale); + } + if (tween.timeline) { + tween.timeline._remove(tween, true); //removes from existing timeline so that it can be properly added to this one. + } + tween.timeline = tween._timeline = this; + if (tween._gc) { + tween._enabled(true, true); + } + + var prevTween = this._last; + if (this._sortChildren) { + var st = tween._startTime; + while (prevTween && prevTween._startTime > st) { + prevTween = prevTween._prev; + } + } + if (prevTween) { + tween._next = prevTween._next; + prevTween._next = tween; + } else { + tween._next = this._first; + this._first = tween; + } + if (tween._next) { + tween._next._prev = tween; + } else { + this._last = tween; + } + tween._prev = prevTween; + + if (this._timeline) { + this._uncache(true); + } + return this; + }; + + p._remove = function(tween, skipDisable) { + if (tween.timeline === this) { + if (!skipDisable) { + tween._enabled(false, true); + } + tween.timeline = null; + + if (tween._prev) { + tween._prev._next = tween._next; + } else if (this._first === tween) { + this._first = tween._next; + } + if (tween._next) { + tween._next._prev = tween._prev; + } else if (this._last === tween) { + this._last = tween._prev; + } + + if (this._timeline) { + this._uncache(true); + } + } + return this; + }; + + p.render = function(time, suppressEvents, force) { + var tween = this._first, + next; + this._totalTime = this._time = this._rawPrevTime = time; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (tween._active || (time >= tween._startTime && !tween._paused)) { + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false); + } + } + tween = next; + } + }; + + p.rawTime = function() { + return this._totalTime; + }; + + +/* + * ---------------------------------------------------------------- + * TweenLite + * ---------------------------------------------------------------- + */ + var TweenLite = _class("TweenLite", function(target, duration, vars) { + Animation.call(this, duration, vars); + + if (target == null) { + throw "Cannot tween an undefined reference."; + } + this.target = target; + + this._overwrite = (this.vars.overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(this.vars.overwrite) === "number") ? this.vars.overwrite >> 0 : _overwriteLookup[this.vars.overwrite]; + + var jq, i, targ; + if ((target instanceof Array || target.jquery) && typeof(target[0]) === "object") { + this._targets = target.slice(0); //works for both jQuery and Array instances + this._propLookup = []; + this._siblings = []; + for (i = 0; i < this._targets.length; i++) { + targ = this._targets[i]; + //in case the user is passing in an array of jQuery objects, for example, we need to check one more level and pull things out if necessary... + if (targ.jquery) { + this._targets.splice(i--, 1); + this._targets = this._targets.concat(targ.constructor.makeArray(targ)); + continue; + } + this._siblings[i] = _register(targ, this, false); + if (this._overwrite === 1) if (this._siblings[i].length > 1) { + _applyOverwrite(targ, this, null, 1, this._siblings[i]); + } + } + + } else { + this._propLookup = {}; + this._siblings = _register(target, this, false); + if (this._overwrite === 1) if (this._siblings.length > 1) { + _applyOverwrite(target, this, null, 1, this._siblings); + } + } + + if (this.vars.immediateRender || (duration === 0 && this._delay === 0 && this.vars.immediateRender != false)) { + this.render(-this._delay, false, true); + } + }, true); + + p = TweenLite.prototype = new Animation(); + p.constructor = TweenLite; + p.kill()._gc = false; + +//----TweenLite defaults, overwrite management, and root updates ---------------------------------------------------- + + p.ratio = 0; + p._firstPT = p._targets = p._overwrittenProps = null; + p._notifyPluginsOfEnabled = false; + + TweenLite.version = 12; + TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); + TweenLite.defaultOverwrite = "auto"; + TweenLite.ticker = _ticker; + + var _plugins = TweenLite._plugins = {}, + _tweenLookup = TweenLite._tweenLookup = {}, + _tweenLookupNum = 0, + _reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, orientToBezier:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1}, + _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0}, + _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(), + _rootTimeline = Animation._rootTimeline = new SimpleTimeline(); + + _rootTimeline._startTime = _ticker.time; + _rootFramesTimeline._startTime = _ticker.frame; + _rootTimeline._active = _rootFramesTimeline._active = true; + + Animation._updateRoot = function() { + _rootTimeline.render((_ticker.time - _rootTimeline._startTime) * _rootTimeline._timeScale, false, false); + _rootFramesTimeline.render((_ticker.frame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale, false, false); + if (!(_ticker.frame % 120)) { //dump garbage every 120 frames... + var i, a, p; + for (p in _tweenLookup) { + a = _tweenLookup[p].tweens; + i = a.length; + while (--i > -1) { + if (a[i]._gc) { + a.splice(i, 1); + } + } + if (a.length === 0) { + delete _tweenLookup[p]; + } + } + } + }; + + _ticker.addEventListener("tick", Animation._updateRoot); + + var _register = function(target, tween, scrub) { + var id = target._gsTweenID, a, i; + if (!_tweenLookup[id || (target._gsTweenID = id = "t" + (_tweenLookupNum++))]) { + _tweenLookup[id] = {target:target, tweens:[]}; + } + if (tween) { + a = _tweenLookup[id].tweens; + a[(i = a.length)] = tween; + if (scrub) { + while (--i > -1) { + if (a[i] === tween) { + a.splice(i, 1); + } + } + } + } + return _tweenLookup[id].tweens; + }, + + _applyOverwrite = function(target, tween, props, mode, siblings) { + var i, changed, curTween; + if (mode === 1 || mode >= 4) { + var l = siblings.length; + for (i = 0; i < l; i++) { + if ((curTween = siblings[i]) !== tween) { + if (!curTween._gc) if (curTween._enabled(false, false)) { + changed = true; + } + } else if (mode === 5) { + break; + } + } + return changed; + } + //NOTE: Add 0.0000000001 to overcome floating point errors that can cause the startTime to be VERY slightly off (when a tween's time() is set for example) + var startTime = tween._startTime + 0.0000000001, + overlaps = [], + oCount = 0, + globalStart; + i = siblings.length; + while (--i > -1) { + if ((curTween = siblings[i]) === tween || curTween._gc || curTween._paused) { + //ignore + } else if (curTween._timeline !== tween._timeline) { + globalStart = globalStart || _checkOverlap(tween, 0); + if (_checkOverlap(curTween, globalStart) === 0) { + overlaps[oCount++] = curTween; + } + } else if (curTween._startTime <= startTime) if (curTween._startTime + curTween.totalDuration() / curTween._timeScale + 0.0000000001 > startTime) if (!((tween._duration === 0 || !curTween._initted) && startTime - curTween._startTime <= 0.0000000002)) { + overlaps[oCount++] = curTween; + } + } + + i = oCount; + while (--i > -1) { + curTween = overlaps[i]; + if (mode === 2) if (curTween._kill(props, target)) { + changed = true; + } + if (mode !== 2 || (!curTween._firstPT && curTween._initted)) { + if (curTween._enabled(false, false)) { //if all property tweens have been overwritten, kill the tween. + changed = true; + } + } + } + return changed; + }, + + _checkOverlap = function(tween, reference) { + var tl = tween._timeline, + ts = tl._timeScale, + t = tween._startTime; + while (tl._timeline) { + t += tl._startTime; + ts *= tl._timeScale; + if (tl._paused) { + return -100; + } + tl = tl._timeline; + } + t /= ts; + return (t > reference) ? t - reference : (!tween._initted && t - reference < 0.0000000002) ? 0.0000000001 : ((t = t + tween.totalDuration() / tween._timeScale / ts) > reference) ? 0 : t - reference - 0.0000000001; + }; + + +//---- TweenLite instance methods ----------------------------------------------------------------------------- + + p._init = function() { + if (this.vars.startAt) { + this.vars.startAt.overwrite = 0; + this.vars.startAt.immediateRender = true; + TweenLite.to(this.target, 0, this.vars.startAt); + } + var i, initPlugins, pt; + if (this.vars.ease instanceof Ease) { + this._ease = (this.vars.easeParams instanceof Array) ? this.vars.ease.config.apply(this.vars.ease, this.vars.easeParams) : this.vars.ease; + } else if (typeof(this.vars.ease) === "function") { + this._ease = new Ease(this.vars.ease, this.vars.easeParams); + } else { + this._ease = TweenLite.defaultEase; + } + this._easeType = this._ease._type; + this._easePower = this._ease._power; + this._firstPT = null; + + if (this._targets) { + i = this._targets.length; + while (--i > -1) { + if ( this._initProps( this._targets[i], (this._propLookup[i] = {}), this._siblings[i], (this._overwrittenProps ? this._overwrittenProps[i] : null)) ) { + initPlugins = true; + } + } + } else { + initPlugins = this._initProps(this.target, this._propLookup, this._siblings, this._overwrittenProps); + } + + if (initPlugins) { + TweenLite._onPluginEvent("_onInitAllProps", this); //reorders the array in order of priority. Uses a static TweenPlugin method in order to minimize file size in TweenLite + } + if (this._overwrittenProps) if (this._firstPT == null) if (typeof(this.target) !== "function") { //if all tweening properties have been overwritten, kill the tween. If the target is a function, it's probably a delayedCall so let it live. + this._enabled(false, false); + } + if (this.vars.runBackwards) { + pt = this._firstPT; + while (pt) { + pt.s += pt.c; + pt.c = -pt.c; + pt = pt._next; + } + } + this._onUpdate = this.vars.onUpdate; + this._initted = true; + }; + + p._initProps = function(target, propLookup, siblings, overwrittenProps) { + var p, i, initPlugins, plugin, a, pt, v; + if (target == null) { + return false; + } + for (p in this.vars) { + if (_reservedProps[p]) { + if (p === "onStartParams" || p === "onUpdateParams" || p === "onCompleteParams" || p === "onReverseCompleteParams" || p === "onRepeatParams") if ((a = this.vars[p])) { + i = a.length; + while (--i > -1) { + if (a[i] === "{self}") { + a = this.vars[p] = a.concat(); //copy the array in case the user referenced the same array in multiple tweens/timelines (each {self} should be unique) + a[i] = this; + } + } + } + + } else if (_plugins[p] && (plugin = new _plugins[p]())._onInitTween(target, this.vars[p], this)) { + + //t - target [object] + //p - property [string] + //s - start [number] + //c - change [number] + //f - isFunction [boolean] + //n - name [string] + //pg - isPlugin [boolean] + //pr - priority [number] + this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:true, n:p, pg:true, pr:plugin._priority}; + i = plugin._overwriteProps.length; + while (--i > -1) { + propLookup[plugin._overwriteProps[i]] = this._firstPT; + } + if (plugin._priority || plugin._onInitAllProps) { + initPlugins = true; + } + if (plugin._onDisable || plugin._onEnable) { + this._notifyPluginsOfEnabled = true; + } + + } else { + this._firstPT = propLookup[p] = pt = {_next:this._firstPT, t:target, p:p, f:(typeof(target[p]) === "function"), n:p, pg:false, pr:0}; + pt.s = (!pt.f) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ](); + v = this.vars[p]; + pt.c = (typeof(v) === "number") ? v - pt.s : (typeof(v) === "string" && v.charAt(1) === "=") ? parseInt(v.charAt(0)+"1") * Number(v.substr(2)) : Number(v) || 0; //previously, we used Number(v.split("=").join("")) but that wouldn't adequately handle a value like "+=-500" or "-=-500". + } + if (pt) if (pt._next) { + pt._next._prev = pt; + } + } + + if (overwrittenProps) if (this._kill(overwrittenProps, target)) { //another tween may have tried to overwrite properties of this tween before init() was called (like if two tweens start at the same time, the one created second will run first) + return this._initProps(target, propLookup, siblings, overwrittenProps); + } + if (this._overwrite > 1) if (this._firstPT) if (siblings.length > 1) if (_applyOverwrite(target, this, propLookup, this._overwrite, siblings)) { + this._kill(propLookup, target); + return this._initProps(target, propLookup, siblings, overwrittenProps); + } + return initPlugins; + }; + + p.render = function(time, suppressEvents, force) { + var prevTime = this._time, + isComplete, callback, pt; + if (time >= this._duration) { + this._totalTime = this._time = this._duration; + this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1; + if (!this._reversed) { + isComplete = true; + callback = "onComplete"; + } + if (this._duration === 0) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (time === 0 || this._rawPrevTime < 0) if (this._rawPrevTime !== time) { + force = true; + } + this._rawPrevTime = time; + } + + } else if (time <= 0) { + this._totalTime = this._time = 0; + this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0; + if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime > 0)) { + callback = "onReverseComplete"; + isComplete = this._reversed; + } + if (time < 0) { + this._active = false; + if (this._duration === 0) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (this._rawPrevTime >= 0) { + force = true; + } + this._rawPrevTime = time; + } + } else if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. + force = true; + } + + } else { + this._totalTime = this._time = time; + + if (this._easeType) { + var r = time / this._duration, type = this._easeType, pow = this._easePower; + if (type === 1 || (type === 3 && r >= 0.5)) { + r = 1 - r; + } + if (type === 3) { + r *= 2; + } + if (pow === 1) { + r *= r; + } else if (pow === 2) { + r *= r * r; + } else if (pow === 3) { + r *= r * r * r; + } else if (pow === 4) { + r *= r * r * r * r; + } + + if (type === 1) { + this.ratio = 1 - r; + } else if (type === 2) { + this.ratio = r; + } else if (time / this._duration < 0.5) { + this.ratio = r / 2; + } else { + this.ratio = 1 - (r / 2); + } + + } else { + this.ratio = this._ease.getRatio(time / this._duration); + } + + } + + if (this._time === prevTime && !force) { + return; + } else if (!this._initted) { + this._init(); + if (!isComplete && this._time) { //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. + this.ratio = this._ease.getRatio(this._time / this._duration); + } + } + + if (!this._active) if (!this._paused) { + this._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done. + } + if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0 || this._duration === 0) if (!suppressEvents) { + this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray); + } + + pt = this._firstPT; + while (pt) { + if (pt.f) { + pt.t[pt.p](pt.c * this.ratio + pt.s); + } else { + pt.t[pt.p] = pt.c * this.ratio + pt.s; + } + pt = pt._next; + } + + + if (this._onUpdate) if (!suppressEvents) { + this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray); + } + + if (callback) if (!this._gc) { //check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (this._timeline.autoRemoveChildren) { + this._enabled(false, false); + } + this._active = false; + } + if (!suppressEvents) if (this.vars[callback]) { + this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray); + } + } + + }; + + p._kill = function(vars, target) { + if (vars === "all") { + vars = null; + } + if (vars == null) if (target == null || target == this.target) { + return this._enabled(false, false); + } + target = target || this._targets || this.target; + var i, overwrittenProps, p, pt, propLookup, changed, killProps, record; + if ((target instanceof Array || target.jquery) && typeof(target[0]) === "object") { + i = target.length; + while (--i > -1) { + if (this._kill(vars, target[i])) { + changed = true; + } + } + } else { + if (this._targets) { + i = this._targets.length; + while (--i > -1) { + if (target === this._targets[i]) { + propLookup = this._propLookup[i] || {}; + this._overwrittenProps = this._overwrittenProps || []; + overwrittenProps = this._overwrittenProps[i] = vars ? this._overwrittenProps[i] || {} : "all"; + break; + } + } + } else if (target !== this.target) { + return false; + } else { + propLookup = this._propLookup; + overwrittenProps = this._overwrittenProps = vars ? this._overwrittenProps || {} : "all"; + } + + if (propLookup) { + killProps = vars || propLookup; + record = (vars != overwrittenProps && overwrittenProps != "all" && vars != propLookup && (vars == null || vars._tempKill != true)); //_tempKill is a super-secret way to delete a particular tweening property but NOT have it remembered as an official overwritten property (like in BezierPlugin) + for (p in killProps) { + if ((pt = propLookup[p])) { + if (pt.pg && pt.t._kill(killProps)) { + changed = true; //some plugins need to be notified so they can perform cleanup tasks first + } + if (!pt.pg || pt.t._overwriteProps.length === 0) { + if (pt._prev) { + pt._prev._next = pt._next; + } else if (pt === this._firstPT) { + this._firstPT = pt._next; + } + if (pt._next) { + pt._next._prev = pt._prev; + } + pt._next = pt._prev = null; + } + delete propLookup[p]; + } + if (record) { + overwrittenProps[p] = 1; + } + } + } + } + return changed; + }; + + p.invalidate = function() { + if (this._notifyPluginsOfEnabled) { + TweenLite._onPluginEvent("_onDisable", this); + } + this._firstPT = null; + this._overwrittenProps = null; + this._onUpdate = null; + this._initted = this._active = this._notifyPluginsOfEnabled = false; + this._propLookup = (this._targets) ? {} : []; + return this; + }; + + p._enabled = function(enabled, ignoreTimeline) { + if (enabled && this._gc) { + if (this._targets) { + var i = this._targets.length; + while (--i > -1) { + this._siblings[i] = _register(this._targets[i], this, true); + } + } else { + this._siblings = _register(this.target, this, true); + } + } + Animation.prototype._enabled.call(this, enabled, ignoreTimeline); + if (this._notifyPluginsOfEnabled) if (this._firstPT) { + return TweenLite._onPluginEvent(((enabled) ? "_onEnable" : "_onDisable"), this); + } + return false; + }; + + +//----TweenLite static methods ----------------------------------------------------- + + TweenLite.to = function(target, duration, vars) { + return new TweenLite(target, duration, vars); + }; + + TweenLite.from = function(target, duration, vars) { + vars.runBackwards = true; + if (vars.immediateRender != false) { + vars.immediateRender = true; + } + return new TweenLite(target, duration, vars); + }; + + TweenLite.fromTo = function(target, duration, fromVars, toVars) { + toVars.startAt = fromVars; + if (fromVars.immediateRender) { + toVars.immediateRender = true; + } + return new TweenLite(target, duration, toVars); + }; + + TweenLite.delayedCall = function(delay, callback, params, scope, useFrames) { + return new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, onCompleteScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, onReverseCompleteScope:scope, immediateRender:false, useFrames:useFrames, overwrite:0}); + }; + + TweenLite.set = function(target, vars) { + return new TweenLite(target, 0, vars); + }; + + TweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, vars) { + var a = TweenLite.getTweensOf(target), + i = a.length; + while (--i > -1) { + a[i]._kill(vars, target); + } + }; + + TweenLite.getTweensOf = function(target) { + if (target == null) { return; } + var i, a, j, t; + if ((target instanceof Array || target.jquery) && typeof(target[0]) === "object") { + i = target.length; + a = []; + while (--i > -1) { + a = a.concat(TweenLite.getTweensOf(target[i])); + } + i = a.length; + //now get rid of any duplicates (tweens of arrays of objects could cause duplicates) + while (--i > -1) { + t = a[i]; + j = i; + while (--j > -1) { + if (t === a[j]) { + a.splice(i, 1); + } + } + } + } else { + a = _register(target).concat(); + i = a.length; + while (--i > -1) { + if (a[i]._gc) { + a.splice(i, 1); + } + } + } + return a; + }; + + + +/* + * ---------------------------------------------------------------- + * TweenPlugin (could easily be split out as a separate file/class, but included for ease of use (so that people don't need to include another