greensock-rails 1.11.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +2 -0
  3. data/README.md +47 -0
  4. data/lib/greensock/rails.rb +9 -0
  5. data/lib/greensock/rails/version.rb +5 -0
  6. data/vendor/assets/javascripts/greensock/TimelineLite.js +622 -0
  7. data/vendor/assets/javascripts/greensock/TimelineMax.js +1060 -0
  8. data/vendor/assets/javascripts/greensock/TweenLite.js +1654 -0
  9. data/vendor/assets/javascripts/greensock/TweenMax.js +6662 -0
  10. data/vendor/assets/javascripts/greensock/easing/EasePack.js +343 -0
  11. data/vendor/assets/javascripts/greensock/jquery.gsap.js +167 -0
  12. data/vendor/assets/javascripts/greensock/plugins/AttrPlugin.js +51 -0
  13. data/vendor/assets/javascripts/greensock/plugins/BezierPlugin.js +574 -0
  14. data/vendor/assets/javascripts/greensock/plugins/CSSPlugin.js +2260 -0
  15. data/vendor/assets/javascripts/greensock/plugins/CSSRulePlugin.js +100 -0
  16. data/vendor/assets/javascripts/greensock/plugins/ColorPropsPlugin.js +122 -0
  17. data/vendor/assets/javascripts/greensock/plugins/DirectionalRotationPlugin.js +80 -0
  18. data/vendor/assets/javascripts/greensock/plugins/EaselPlugin.js +298 -0
  19. data/vendor/assets/javascripts/greensock/plugins/KineticPlugin.js +298 -0
  20. data/vendor/assets/javascripts/greensock/plugins/RaphaelPlugin.js +367 -0
  21. data/vendor/assets/javascripts/greensock/plugins/RoundPropsPlugin.js +73 -0
  22. data/vendor/assets/javascripts/greensock/plugins/ScrollToPlugin.js +115 -0
  23. data/vendor/assets/javascripts/greensock/plugins/TEMPLATE_Plugin.js +74 -0
  24. data/vendor/assets/javascripts/greensock/plugins/TextPlugin.js +108 -0
  25. data/vendor/assets/javascripts/greensock/utils/Draggable.js +1438 -0
  26. metadata +97 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 740e36e613fc20787d3f0a4228b478a4c9a35a78
4
+ data.tar.gz: 71646bd75cabbe7d7ffeff8a0d18418c9ccc66da
5
+ SHA512:
6
+ metadata.gz: 7e82bcabcd9227f622b8acf815ba3ded0f9aaa80507b8b9f209570d02838a3b40d6d5a68938f5633fffcd78d1268b12538f9a9b47a7e852fb2cca44f0921f42e
7
+ data.tar.gz: 62d56d0f875250f50e2f945a07f65e7b3812d1468dfaa98fe946926832d1216febd59abf70993d489ed40d7b7ffc0398e826a78ab5faf8963c7ad83d5d017924
data/LICENSE.txt ADDED
@@ -0,0 +1,2 @@
1
+ Greensock JS: Copyright (c) 2014, GreenSock. All rights reserved.
2
+ Greensock Rails Ruby gem: Copyright (c) 2014, Robert Pataki.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Greensock JS for Rails
2
+
3
+ This is a Ruby gem for adding the great [Greensock JavaScript tweening engine](http://www.greensock.com/gsap-js/) to Rails, so that you can animate the hell out of your RESTful app :)
4
+
5
+ ## greensock-rails RubyGems URL
6
+
7
+ [https://rubygems.org/gems/greensock-rails](https://rubygems.org/gems/greensock-rails)
8
+
9
+ ## Installation
10
+
11
+ **Using the command line:**
12
+
13
+ $ gem install 'greensock-rails'
14
+
15
+ **In the Gemfile:**
16
+
17
+ gem 'greensock-rails'
18
+
19
+ ## Usage
20
+
21
+ The gem is using the uncompressed GSAP files, so that you can debug your code in development mode and let the [Rails assets pipeline](http://guides.rubyonrails.org/) to handle the minification, compression etc.
22
+
23
+ **To include the required GSAP files in your application, simply require them in `application.js`:**
24
+
25
+ //= require 'greensock/TweenMax'
26
+ //= require 'greensock/easing/EasePack'
27
+
28
+ **To include the GSAP jQuery plugin in your application, use:**
29
+
30
+ //= require 'greensock/jquery.gsap.js'
31
+
32
+ ## Versioning
33
+
34
+ The versioning of the gem follows the original versioning of GSAP, so:
35
+
36
+ `greensock-rails-1.11.4 = gsap-js-1.11.4`
37
+
38
+ ## Contributing
39
+
40
+ Feel free to open an issue if you find anything that can be improved around the Ruby gem's code.
41
+
42
+ Please do not open an issue if there is a bug in GSAP itself. Any bugs of the Greensock code should be reported directly to the [Greensock team](https://github.com/greensock/GreenSock-JS/issues).
43
+
44
+ ## Copyright
45
+
46
+ Greensock JS: Copyright (c) 2014, GreenSock. All rights reserved.
47
+ Greensock Rails Ruby gem: Copyright (c) 2014, Robert Pataki.
@@ -0,0 +1,9 @@
1
+ require "greensock/rails/version"
2
+
3
+ module Greensock
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ # Get rails to add app, lib, vendor to load path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module Greensock
2
+ module Rails
3
+ VERSION = "1.11.4.1"
4
+ end
5
+ end
@@ -0,0 +1,622 @@
1
+ /*!
2
+ * VERSION: 1.11.4
3
+ * DATE: 2014-01-18
4
+ * UPDATES AND DOCS AT: http://www.greensock.com
5
+ *
6
+ * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8
+ * Club GreenSock members, the software agreement that was issued with your membership.
9
+ *
10
+ * @author: Jack Doyle, jack@greensock.com
11
+ */
12
+
13
+ (window._gsQueue || (window._gsQueue = [])).push( function() {
14
+
15
+ "use strict";
16
+
17
+ window._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) {
18
+
19
+ var TimelineLite = function(vars) {
20
+ SimpleTimeline.call(this, vars);
21
+ this._labels = {};
22
+ this.autoRemoveChildren = (this.vars.autoRemoveChildren === true);
23
+ this.smoothChildTiming = (this.vars.smoothChildTiming === true);
24
+ this._sortChildren = true;
25
+ this._onUpdate = this.vars.onUpdate;
26
+ var v = this.vars,
27
+ val, p;
28
+ for (p in v) {
29
+ val = v[p];
30
+ if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) {
31
+ v[p] = this._swapSelfInParams(val);
32
+ }
33
+ }
34
+ if (_isArray(v.tweens)) {
35
+ this.add(v.tweens, 0, v.align, v.stagger);
36
+ }
37
+ },
38
+ _tinyNum = 0.0000000001,
39
+ _isSelector = TweenLite._internals.isSelector,
40
+ _isArray = TweenLite._internals.isArray,
41
+ _blankArray = [],
42
+ _copy = function(vars) {
43
+ var copy = {}, p;
44
+ for (p in vars) {
45
+ copy[p] = vars[p];
46
+ }
47
+ return copy;
48
+ },
49
+ _pauseCallback = function(tween, callback, params, scope) {
50
+ tween._timeline.pause(tween._startTime);
51
+ if (callback) {
52
+ callback.apply(scope || tween._timeline, params || _blankArray);
53
+ }
54
+ },
55
+ _slice = _blankArray.slice,
56
+ p = TimelineLite.prototype = new SimpleTimeline();
57
+
58
+ TimelineLite.version = "1.11.4";
59
+ p.constructor = TimelineLite;
60
+ p.kill()._gc = false;
61
+
62
+ p.to = function(target, duration, vars, position) {
63
+ return duration ? this.add( new TweenLite(target, duration, vars), position) : this.set(target, vars, position);
64
+ };
65
+
66
+ p.from = function(target, duration, vars, position) {
67
+ return this.add( TweenLite.from(target, duration, vars), position);
68
+ };
69
+
70
+ p.fromTo = function(target, duration, fromVars, toVars, position) {
71
+ return duration ? this.add( TweenLite.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position);
72
+ };
73
+
74
+ p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
75
+ var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, onCompleteScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}),
76
+ i;
77
+ if (typeof(targets) === "string") {
78
+ targets = TweenLite.selector(targets) || targets;
79
+ }
80
+ if (_isSelector(targets)) { //senses if the targets object is a selector. If it is, we should translate it into an array.
81
+ targets = _slice.call(targets, 0);
82
+ }
83
+ stagger = stagger || 0;
84
+ for (i = 0; i < targets.length; i++) {
85
+ if (vars.startAt) {
86
+ vars.startAt = _copy(vars.startAt);
87
+ }
88
+ tl.to(targets[i], duration, _copy(vars), i * stagger);
89
+ }
90
+ return this.add(tl, position);
91
+ };
92
+
93
+ p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
94
+ vars.immediateRender = (vars.immediateRender != false);
95
+ vars.runBackwards = true;
96
+ return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
97
+ };
98
+
99
+ p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
100
+ toVars.startAt = fromVars;
101
+ toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);
102
+ return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
103
+ };
104
+
105
+ p.call = function(callback, params, scope, position) {
106
+ return this.add( TweenLite.delayedCall(0, callback, params, scope), position);
107
+ };
108
+
109
+ p.set = function(target, vars, position) {
110
+ position = this._parseTimeOrLabel(position, 0, true);
111
+ if (vars.immediateRender == null) {
112
+ vars.immediateRender = (position === this._time && !this._paused);
113
+ }
114
+ return this.add( new TweenLite(target, 0, vars), position);
115
+ };
116
+
117
+ TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) {
118
+ vars = vars || {};
119
+ if (vars.smoothChildTiming == null) {
120
+ vars.smoothChildTiming = true;
121
+ }
122
+ var tl = new TimelineLite(vars),
123
+ root = tl._timeline,
124
+ tween, next;
125
+ if (ignoreDelayedCalls == null) {
126
+ ignoreDelayedCalls = true;
127
+ }
128
+ root._remove(tl, true);
129
+ tl._startTime = 0;
130
+ tl._rawPrevTime = tl._time = tl._totalTime = root._time;
131
+ tween = root._first;
132
+ while (tween) {
133
+ next = tween._next;
134
+ if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) {
135
+ tl.add(tween, tween._startTime - tween._delay);
136
+ }
137
+ tween = next;
138
+ }
139
+ root.add(tl, 0);
140
+ return tl;
141
+ };
142
+
143
+ p.add = function(value, position, align, stagger) {
144
+ var curTime, l, i, child, tl, beforeRawTime;
145
+ if (typeof(position) !== "number") {
146
+ position = this._parseTimeOrLabel(position, 0, true, value);
147
+ }
148
+ if (!(value instanceof Animation)) {
149
+ if ((value instanceof Array) || (value && value.push && _isArray(value))) {
150
+ align = align || "normal";
151
+ stagger = stagger || 0;
152
+ curTime = position;
153
+ l = value.length;
154
+ for (i = 0; i < l; i++) {
155
+ if (_isArray(child = value[i])) {
156
+ child = new TimelineLite({tweens:child});
157
+ }
158
+ this.add(child, curTime);
159
+ if (typeof(child) !== "string" && typeof(child) !== "function") {
160
+ if (align === "sequence") {
161
+ curTime = child._startTime + (child.totalDuration() / child._timeScale);
162
+ } else if (align === "start") {
163
+ child._startTime -= child.delay();
164
+ }
165
+ }
166
+ curTime += stagger;
167
+ }
168
+ return this._uncache(true);
169
+ } else if (typeof(value) === "string") {
170
+ return this.addLabel(value, position);
171
+ } else if (typeof(value) === "function") {
172
+ value = TweenLite.delayedCall(0, value);
173
+ } else {
174
+ throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string.");
175
+ }
176
+ }
177
+
178
+ SimpleTimeline.prototype.add.call(this, value, position);
179
+
180
+ //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.
181
+ if (this._gc) if (!this._paused) if (this._duration < this.duration()) {
182
+ //in case any of the anscestors had completed but should now be enabled...
183
+ tl = this;
184
+ beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect.
185
+ while (tl._gc && tl._timeline) {
186
+ if (tl._timeline.smoothChildTiming && beforeRawTime) {
187
+ tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it.
188
+ } else {
189
+ tl._enabled(true, false);
190
+ }
191
+ tl = tl._timeline;
192
+ }
193
+ }
194
+
195
+ return this;
196
+ };
197
+
198
+ p.remove = function(value) {
199
+ if (value instanceof Animation) {
200
+ return this._remove(value, false);
201
+ } else if (value instanceof Array || (value && value.push && _isArray(value))) {
202
+ var i = value.length;
203
+ while (--i > -1) {
204
+ this.remove(value[i]);
205
+ }
206
+ return this;
207
+ } else if (typeof(value) === "string") {
208
+ return this.removeLabel(value);
209
+ }
210
+ return this.kill(null, value);
211
+ };
212
+
213
+ p._remove = function(tween, skipDisable) {
214
+ SimpleTimeline.prototype._remove.call(this, tween, skipDisable);
215
+ var last = this._last;
216
+ if (!last) {
217
+ this._time = this._totalTime = 0;
218
+ } else if (this._time > last._startTime + last._totalDuration / last._timeScale) {
219
+ this._time = this.duration();
220
+ this._totalTime = this._totalDuration;
221
+ }
222
+ return this;
223
+ };
224
+
225
+ p.append = function(value, offsetOrLabel) {
226
+ return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value));
227
+ };
228
+
229
+ p.insert = p.insertMultiple = function(value, position, align, stagger) {
230
+ return this.add(value, position || 0, align, stagger);
231
+ };
232
+
233
+ p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) {
234
+ return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger);
235
+ };
236
+
237
+ p.addLabel = function(label, position) {
238
+ this._labels[label] = this._parseTimeOrLabel(position);
239
+ return this;
240
+ };
241
+
242
+ p.addPause = function(position, callback, params, scope) {
243
+ return this.call(_pauseCallback, ["{self}", callback, params, scope], this, position);
244
+ };
245
+
246
+ p.removeLabel = function(label) {
247
+ delete this._labels[label];
248
+ return this;
249
+ };
250
+
251
+ p.getLabelTime = function(label) {
252
+ return (this._labels[label] != null) ? this._labels[label] : -1;
253
+ };
254
+
255
+ p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) {
256
+ var i;
257
+ //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration().
258
+ if (ignore instanceof Animation && ignore.timeline === this) {
259
+ this.remove(ignore);
260
+ } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) {
261
+ i = ignore.length;
262
+ while (--i > -1) {
263
+ if (ignore[i] instanceof Animation && ignore[i].timeline === this) {
264
+ this.remove(ignore[i]);
265
+ }
266
+ }
267
+ }
268
+ if (typeof(offsetOrLabel) === "string") {
269
+ return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent);
270
+ }
271
+ offsetOrLabel = offsetOrLabel || 0;
272
+ if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).
273
+ i = timeOrLabel.indexOf("=");
274
+ if (i === -1) {
275
+ if (this._labels[timeOrLabel] == null) {
276
+ return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel;
277
+ }
278
+ return this._labels[timeOrLabel] + offsetOrLabel;
279
+ }
280
+ offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1));
281
+ timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration();
282
+ } else if (timeOrLabel == null) {
283
+ timeOrLabel = this.duration();
284
+ }
285
+ return Number(timeOrLabel) + offsetOrLabel;
286
+ };
287
+
288
+ p.seek = function(position, suppressEvents) {
289
+ return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false));
290
+ };
291
+
292
+ p.stop = function() {
293
+ return this.paused(true);
294
+ };
295
+
296
+ p.gotoAndPlay = function(position, suppressEvents) {
297
+ return this.play(position, suppressEvents);
298
+ };
299
+
300
+ p.gotoAndStop = function(position, suppressEvents) {
301
+ return this.pause(position, suppressEvents);
302
+ };
303
+
304
+ p.render = function(time, suppressEvents, force) {
305
+ if (this._gc) {
306
+ this._enabled(true, false);
307
+ }
308
+ var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
309
+ prevTime = this._time,
310
+ prevStart = this._startTime,
311
+ prevTimeScale = this._timeScale,
312
+ prevPaused = this._paused,
313
+ tween, isComplete, next, callback, internalForce;
314
+ if (time >= totalDur) {
315
+ this._totalTime = this._time = totalDur;
316
+ if (!this._reversed) if (!this._hasPausedChild()) {
317
+ isComplete = true;
318
+ callback = "onComplete";
319
+ if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0 || this._rawPrevTime === _tinyNum) if (this._rawPrevTime !== time && this._first) {
320
+ internalForce = true;
321
+ if (this._rawPrevTime > _tinyNum) {
322
+ callback = "onReverseComplete";
323
+ }
324
+ }
325
+ }
326
+ this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === 0) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
327
+ time = totalDur + 0.0001; //to avoid occasional 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). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7.
328
+
329
+ } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.
330
+ this._totalTime = this._time = 0;
331
+ if (prevTime !== 0 || (this._duration === 0 && (this._rawPrevTime > _tinyNum || (time < 0 && this._rawPrevTime >= 0)))) {
332
+ callback = "onReverseComplete";
333
+ isComplete = this._reversed;
334
+ }
335
+ if (time < 0) {
336
+ this._active = false;
337
+ if (this._duration === 0) if (this._rawPrevTime >= 0 && this._first) { //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.
338
+ internalForce = true;
339
+ }
340
+ this._rawPrevTime = time;
341
+ } else {
342
+ this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === 0) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
343
+
344
+ time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline)
345
+ if (!this._initted) {
346
+ internalForce = true;
347
+ }
348
+ }
349
+
350
+ } else {
351
+ this._totalTime = this._time = this._rawPrevTime = time;
352
+ }
353
+ if ((this._time === prevTime || !this._first) && !force && !internalForce) {
354
+ return;
355
+ } else if (!this._initted) {
356
+ this._initted = true;
357
+ }
358
+
359
+ if (!this._active) if (!this._paused && this._time !== prevTime && time > 0) {
360
+ this._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example.
361
+ }
362
+
363
+ if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0) if (!suppressEvents) {
364
+ this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
365
+ }
366
+
367
+ if (this._time >= prevTime) {
368
+ tween = this._first;
369
+ while (tween) {
370
+ next = tween._next; //record it here because the value could change after rendering...
371
+ if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
372
+ break;
373
+ } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
374
+
375
+ if (!tween._reversed) {
376
+ tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
377
+ } else {
378
+ tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
379
+ }
380
+
381
+ }
382
+ tween = next;
383
+ }
384
+ } else {
385
+ tween = this._last;
386
+ while (tween) {
387
+ next = tween._prev; //record it here because the value could change after rendering...
388
+ if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
389
+ break;
390
+ } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
391
+
392
+ if (!tween._reversed) {
393
+ tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
394
+ } else {
395
+ tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
396
+ }
397
+
398
+ }
399
+ tween = next;
400
+ }
401
+ }
402
+
403
+ if (this._onUpdate) if (!suppressEvents) {
404
+ this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
405
+ }
406
+
407
+ 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
408
+ if (isComplete) {
409
+ if (this._timeline.autoRemoveChildren) {
410
+ this._enabled(false, false);
411
+ }
412
+ this._active = false;
413
+ }
414
+ if (!suppressEvents && this.vars[callback]) {
415
+ this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray);
416
+ }
417
+ }
418
+ };
419
+
420
+ p._hasPausedChild = function() {
421
+ var tween = this._first;
422
+ while (tween) {
423
+ if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) {
424
+ return true;
425
+ }
426
+ tween = tween._next;
427
+ }
428
+ return false;
429
+ };
430
+
431
+ p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) {
432
+ ignoreBeforeTime = ignoreBeforeTime || -9999999999;
433
+ var a = [],
434
+ tween = this._first,
435
+ cnt = 0;
436
+ while (tween) {
437
+ if (tween._startTime < ignoreBeforeTime) {
438
+ //do nothing
439
+ } else if (tween instanceof TweenLite) {
440
+ if (tweens !== false) {
441
+ a[cnt++] = tween;
442
+ }
443
+ } else {
444
+ if (timelines !== false) {
445
+ a[cnt++] = tween;
446
+ }
447
+ if (nested !== false) {
448
+ a = a.concat(tween.getChildren(true, tweens, timelines));
449
+ cnt = a.length;
450
+ }
451
+ }
452
+ tween = tween._next;
453
+ }
454
+ return a;
455
+ };
456
+
457
+ p.getTweensOf = function(target, nested) {
458
+ var tweens = TweenLite.getTweensOf(target),
459
+ i = tweens.length,
460
+ a = [],
461
+ cnt = 0;
462
+ while (--i > -1) {
463
+ if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) {
464
+ a[cnt++] = tweens[i];
465
+ }
466
+ }
467
+ return a;
468
+ };
469
+
470
+ p._contains = function(tween) {
471
+ var tl = tween.timeline;
472
+ while (tl) {
473
+ if (tl === this) {
474
+ return true;
475
+ }
476
+ tl = tl.timeline;
477
+ }
478
+ return false;
479
+ };
480
+
481
+ p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) {
482
+ ignoreBeforeTime = ignoreBeforeTime || 0;
483
+ var tween = this._first,
484
+ labels = this._labels,
485
+ p;
486
+ while (tween) {
487
+ if (tween._startTime >= ignoreBeforeTime) {
488
+ tween._startTime += amount;
489
+ }
490
+ tween = tween._next;
491
+ }
492
+ if (adjustLabels) {
493
+ for (p in labels) {
494
+ if (labels[p] >= ignoreBeforeTime) {
495
+ labels[p] += amount;
496
+ }
497
+ }
498
+ }
499
+ return this._uncache(true);
500
+ };
501
+
502
+ p._kill = function(vars, target) {
503
+ if (!vars && !target) {
504
+ return this._enabled(false, false);
505
+ }
506
+ var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target),
507
+ i = tweens.length,
508
+ changed = false;
509
+ while (--i > -1) {
510
+ if (tweens[i]._kill(vars, target)) {
511
+ changed = true;
512
+ }
513
+ }
514
+ return changed;
515
+ };
516
+
517
+ p.clear = function(labels) {
518
+ var tweens = this.getChildren(false, true, true),
519
+ i = tweens.length;
520
+ this._time = this._totalTime = 0;
521
+ while (--i > -1) {
522
+ tweens[i]._enabled(false, false);
523
+ }
524
+ if (labels !== false) {
525
+ this._labels = {};
526
+ }
527
+ return this._uncache(true);
528
+ };
529
+
530
+ p.invalidate = function() {
531
+ var tween = this._first;
532
+ while (tween) {
533
+ tween.invalidate();
534
+ tween = tween._next;
535
+ }
536
+ return this;
537
+ };
538
+
539
+ p._enabled = function(enabled, ignoreTimeline) {
540
+ if (enabled === this._gc) {
541
+ var tween = this._first;
542
+ while (tween) {
543
+ tween._enabled(enabled, true);
544
+ tween = tween._next;
545
+ }
546
+ }
547
+ return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline);
548
+ };
549
+
550
+ p.duration = function(value) {
551
+ if (!arguments.length) {
552
+ if (this._dirty) {
553
+ this.totalDuration(); //just triggers recalculation
554
+ }
555
+ return this._duration;
556
+ }
557
+ if (this.duration() !== 0 && value !== 0) {
558
+ this.timeScale(this._duration / value);
559
+ }
560
+ return this;
561
+ };
562
+
563
+ p.totalDuration = function(value) {
564
+ if (!arguments.length) {
565
+ if (this._dirty) {
566
+ var max = 0,
567
+ tween = this._last,
568
+ prevStart = 999999999999,
569
+ prev, end;
570
+ while (tween) {
571
+ prev = tween._prev; //record it here in case the tween changes position in the sequence...
572
+ if (tween._dirty) {
573
+ tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it.
574
+ }
575
+ if (tween._startTime > prevStart && this._sortChildren && !tween._paused) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence
576
+ this.add(tween, tween._startTime - tween._delay);
577
+ } else {
578
+ prevStart = tween._startTime;
579
+ }
580
+ if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.
581
+ max -= tween._startTime;
582
+ if (this._timeline.smoothChildTiming) {
583
+ this._startTime += tween._startTime / this._timeScale;
584
+ }
585
+ this.shiftChildren(-tween._startTime, false, -9999999999);
586
+ prevStart = 0;
587
+ }
588
+ end = tween._startTime + (tween._totalDuration / tween._timeScale);
589
+ if (end > max) {
590
+ max = end;
591
+ }
592
+ tween = prev;
593
+ }
594
+ this._duration = this._totalDuration = max;
595
+ this._dirty = false;
596
+ }
597
+ return this._totalDuration;
598
+ }
599
+ if (this.totalDuration() !== 0) if (value !== 0) {
600
+ this.timeScale(this._totalDuration / value);
601
+ }
602
+ return this;
603
+ };
604
+
605
+ p.usesFrames = function() {
606
+ var tl = this._timeline;
607
+ while (tl._timeline) {
608
+ tl = tl._timeline;
609
+ }
610
+ return (tl === Animation._rootFramesTimeline);
611
+ };
612
+
613
+ p.rawTime = function() {
614
+ return this._paused ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale;
615
+ };
616
+
617
+ return TimelineLite;
618
+
619
+ }, true);
620
+
621
+
622
+ }); if (window._gsDefine) { window._gsQueue.pop()(); }