greensock-rails 1.14.2.0 → 1.15.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5213f4d2af34fc56af21a52d0ce731f774fc8900
4
- data.tar.gz: 28a0dfa4c62ffc97d88d3dab2256e3fef8c29e8d
3
+ metadata.gz: 2f730f1a572256766ec5d4e39edde2bd60ad127b
4
+ data.tar.gz: 2c89a9e90964f1ca93feb92c0e1cbb41c3ad23e2
5
5
  SHA512:
6
- metadata.gz: 8bb581dd6a912fb4d71e7c090b4972ba4b7c493e71c8bc36da9a0541eb811739e1fed9bc2f7f4c5a2028653a9e459fc42717874e3964526c0cb9a7718e513e05
7
- data.tar.gz: 6b6a252eab281a8f15ffd49110f80a714f2861c2de21c16c3466a04c8b2752621ab8862903c1f1a3403db54ee70526475125feea3139f7aae94dbae88afb45c8
6
+ metadata.gz: aeee17feeba70f7bf78d13d9eb9f1fad9c6c8055bf62cee8abbcbc0740d83d7c32093d4483d26306452f667049ba6fb50c0ad9764787c4ce4b66cb9416c4a9b8
7
+ data.tar.gz: c227f044815706dc4dd1f0787a816c792b32a09d32c3cd8de20767849effd166999f8013f504dad23930c197284c04ca3c1a32f7ff08e992aaf7b553eb448d3d
@@ -1,5 +1,5 @@
1
1
  module Greensock
2
2
  module Rails
3
- VERSION = "1.14.2.0"
3
+ VERSION = "1.15.0.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.14.2
3
- * DATE: 2014-10-18
2
+ * VERSION: 1.15.0
3
+ * DATE: 2014-12-03
4
4
  * UPDATES AND DOCS AT: http://www.greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
@@ -51,14 +51,15 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
51
51
  return copy;
52
52
  },
53
53
  _pauseCallback = function(tween, callback, params, scope) {
54
- var time = tween._timeline._totalTime;
55
- if (callback || !this._forcingPlayhead) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
56
- tween._timeline.pause(tween._startTime);
54
+ var tl = tween._timeline,
55
+ time = tl._totalTime;
56
+ if ((callback || !this._forcingPlayhead) && tl._rawPrevTime !== tween._startTime) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
57
+ tl.pause(tween._startTime);
57
58
  if (callback) {
58
- callback.apply(scope || tween._timeline, params || _blankArray);
59
+ callback.apply(scope || tl, params || _blankArray);
59
60
  }
60
61
  if (this._forcingPlayhead) {
61
- tween._timeline.seek(time);
62
+ tl.seek(time);
62
63
  }
63
64
  }
64
65
  },
@@ -71,7 +72,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
71
72
  },
72
73
  p = TimelineLite.prototype = new SimpleTimeline();
73
74
 
74
- TimelineLite.version = "1.14.2";
75
+ TimelineLite.version = "1.15.0";
75
76
  p.constructor = TimelineLite;
76
77
  p.kill()._gc = p._forcingPlayhead = false;
77
78
 
@@ -286,7 +287,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
286
287
  };
287
288
 
288
289
  p.addPause = function(position, callback, params, scope) {
289
- return this.call(_pauseCallback, ["{self}", callback, params, scope], this, position);
290
+ var t = TweenLite.delayedCall(0, _pauseCallback, ["{self}", callback, params, scope], this);
291
+ t.data = "isPause"; // we use this flag in TweenLite's render() method to identify it as a special case that shouldn't be triggered when the virtual playhead is LEAVING the exact position where the pause is, otherwise timeline.addPause(1).play(1) would end up paused on the very next tick.
292
+ return this.add(t, position);
290
293
  };
291
294
 
292
295
  p.removeLabel = function(label) {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.14.2
3
- * DATE: 2014-10-18
2
+ * VERSION: 1.15.0
3
+ * DATE: 2014-12-03
4
4
  * UPDATES AND DOCS AT: http://www.greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
@@ -34,7 +34,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
34
34
 
35
35
  p.constructor = TimelineMax;
36
36
  p.kill()._gc = false;
37
- TimelineMax.version = "1.14.2";
37
+ TimelineMax.version = "1.15.0";
38
38
 
39
39
  p.invalidate = function() {
40
40
  this._yoyo = (this.vars.yoyo === true);
@@ -498,14 +498,15 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
498
498
  return copy;
499
499
  },
500
500
  _pauseCallback = function(tween, callback, params, scope) {
501
- var time = tween._timeline._totalTime;
502
- if (callback || !this._forcingPlayhead) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
503
- tween._timeline.pause(tween._startTime);
501
+ var tl = tween._timeline,
502
+ time = tl._totalTime;
503
+ if ((callback || !this._forcingPlayhead) && tl._rawPrevTime !== tween._startTime) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
504
+ tl.pause(tween._startTime);
504
505
  if (callback) {
505
- callback.apply(scope || tween._timeline, params || _blankArray);
506
+ callback.apply(scope || tl, params || _blankArray);
506
507
  }
507
508
  if (this._forcingPlayhead) {
508
- tween._timeline.seek(time);
509
+ tl.seek(time);
509
510
  }
510
511
  }
511
512
  },
@@ -518,7 +519,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
518
519
  },
519
520
  p = TimelineLite.prototype = new SimpleTimeline();
520
521
 
521
- TimelineLite.version = "1.14.2";
522
+ TimelineLite.version = "1.15.0";
522
523
  p.constructor = TimelineLite;
523
524
  p.kill()._gc = p._forcingPlayhead = false;
524
525
 
@@ -564,6 +565,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
564
565
  if (typeof(targets) === "string") {
565
566
  targets = TweenLite.selector(targets) || targets;
566
567
  }
568
+ targets = targets || [];
567
569
  if (_isSelector(targets)) { //senses if the targets object is a selector. If it is, we should translate it into an array.
568
570
  targets = _slice(targets);
569
571
  }
@@ -732,7 +734,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
732
734
  };
733
735
 
734
736
  p.addPause = function(position, callback, params, scope) {
735
- return this.call(_pauseCallback, ["{self}", callback, params, scope], this, position);
737
+ var t = TweenLite.delayedCall(0, _pauseCallback, ["{self}", callback, params, scope], this);
738
+ t.data = "isPause"; // we use this flag in TweenLite's render() method to identify it as a special case that shouldn't be triggered when the virtual playhead is LEAVING the exact position where the pause is, otherwise timeline.addPause(1).play(1) would end up paused on the very next tick.
739
+ return this.add(t, position);
736
740
  };
737
741
 
738
742
  p.removeLabel = function(label) {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.14.2
3
- * DATE: 2014-10-28
2
+ * VERSION: 1.15.0
3
+ * DATE: 2014-12-03
4
4
  * UPDATES AND DOCS AT: http://www.greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
@@ -289,6 +289,7 @@
289
289
  _useRAF = (useRAF !== false && _reqAnimFrame),
290
290
  _lagThreshold = 500,
291
291
  _adjustedLag = 33,
292
+ _tickWord = "tick", //helps reduce gc burden
292
293
  _fps, _req, _id, _gap, _nextTime,
293
294
  _tick = function(manual) {
294
295
  var elapsed = _getTime() - _lastUpdate,
@@ -308,7 +309,7 @@
308
309
  _id = _req(_tick);
309
310
  }
310
311
  if (dispatch) {
311
- _self.dispatchEvent("tick");
312
+ _self.dispatchEvent(_tickWord);
312
313
  }
313
314
  };
314
315
 
@@ -910,7 +911,7 @@
910
911
  p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
911
912
  p._notifyPluginsOfEnabled = p._lazy = false;
912
913
 
913
- TweenLite.version = "1.14.2";
914
+ TweenLite.version = "1.15.0";
914
915
  TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
915
916
  TweenLite.defaultOverwrite = "auto";
916
917
  TweenLite.ticker = _ticker;
@@ -1277,7 +1278,7 @@
1277
1278
  if (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate.
1278
1279
  time = 0;
1279
1280
  }
1280
- if (time === 0 || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time) {
1281
+ if (time === 0 || prevRawPrevTime < 0 || (prevRawPrevTime === _tinyNum && this.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause.
1281
1282
  force = true;
1282
1283
  if (prevRawPrevTime > _tinyNum) {
1283
1284
  callback = "onReverseComplete";
@@ -1296,7 +1297,7 @@
1296
1297
  if (time < 0) {
1297
1298
  this._active = false;
1298
1299
  if (duration === 0) if (this._initted || !this.vars.lazy || force) { //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.
1299
- if (prevRawPrevTime >= 0) {
1300
+ if (prevRawPrevTime >= 0 && !(prevRawPrevTime === _tinyNum && this.data === "isPause")) {
1300
1301
  force = true;
1301
1302
  }
1302
1303
  this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration 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.
@@ -1397,7 +1398,6 @@
1397
1398
  this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
1398
1399
  }
1399
1400
  }
1400
-
1401
1401
  if (callback) if (!this._gc || force) { //check _gc because there's a chance that kill() could be called in an onUpdate
1402
1402
  if (time < 0 && this._startAt && !this._onUpdate && time !== -0.0001) { //-0.0001 is a special value that we use when looping back to the beginning of a repeated TimelineMax, in which case we shouldn't render the _startAt values.
1403
1403
  this._startAt.render(time, suppressEvents, force);
@@ -1557,7 +1557,7 @@
1557
1557
  };
1558
1558
 
1559
1559
  TweenLite.delayedCall = function(delay, callback, params, scope, useFrames) {
1560
- 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});
1560
+ return new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, onCompleteScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, onReverseCompleteScope:scope, immediateRender:false, lazy:false, useFrames:useFrames, overwrite:0});
1561
1561
  };
1562
1562
 
1563
1563
  TweenLite.set = function(target, vars) {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.14.2
3
- * DATE: 2014-10-29
2
+ * VERSION: 1.15.0
3
+ * DATE: 2014-12-03
4
4
  * UPDATES AND DOCS AT: http://www.greensock.com
5
5
  *
6
6
  * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
@@ -41,7 +41,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
41
41
  p = TweenMax.prototype = TweenLite.to({}, 0.1, {}),
42
42
  _blankArray = [];
43
43
 
44
- TweenMax.version = "1.14.2";
44
+ TweenMax.version = "1.15.0";
45
45
  p.constructor = TweenMax;
46
46
  p.kill()._gc = false;
47
47
  TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf;
@@ -77,6 +77,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
77
77
  if (this._initted || immediate) {
78
78
  if (resetDuration) {
79
79
  this._initted = false;
80
+ if (immediate) {
81
+ this.render(0, true, true);
82
+ }
80
83
  } else {
81
84
  if (this._gc) {
82
85
  this._enabled(true, false);
@@ -639,14 +642,15 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
639
642
  return copy;
640
643
  },
641
644
  _pauseCallback = function(tween, callback, params, scope) {
642
- var time = tween._timeline._totalTime;
643
- if (callback || !this._forcingPlayhead) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
644
- tween._timeline.pause(tween._startTime);
645
+ var tl = tween._timeline,
646
+ time = tl._totalTime;
647
+ if ((callback || !this._forcingPlayhead) && tl._rawPrevTime !== tween._startTime) { //if the user calls a method that moves the playhead (like progress() or time()), it should honor that and skip any pauses (although if there's a callback positioned at that pause, it must jump there and make the call to ensure the time is EXACTLY what it is supposed to be, and then proceed to where the playhead is being forced). Otherwise, imagine placing a pause in the middle of a timeline and then doing timeline.progress(0.9) - it would get stuck where the pause is.
648
+ tl.pause(tween._startTime);
645
649
  if (callback) {
646
- callback.apply(scope || tween._timeline, params || _blankArray);
650
+ callback.apply(scope || tl, params || _blankArray);
647
651
  }
648
652
  if (this._forcingPlayhead) {
649
- tween._timeline.seek(time);
653
+ tl.seek(time);
650
654
  }
651
655
  }
652
656
  },
@@ -659,7 +663,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
659
663
  },
660
664
  p = TimelineLite.prototype = new SimpleTimeline();
661
665
 
662
- TimelineLite.version = "1.14.2";
666
+ TimelineLite.version = "1.15.0";
663
667
  p.constructor = TimelineLite;
664
668
  p.kill()._gc = p._forcingPlayhead = false;
665
669
 
@@ -874,7 +878,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
874
878
  };
875
879
 
876
880
  p.addPause = function(position, callback, params, scope) {
877
- return this.call(_pauseCallback, ["{self}", callback, params, scope], this, position);
881
+ var t = TweenLite.delayedCall(0, _pauseCallback, ["{self}", callback, params, scope], this);
882
+ t.data = "isPause"; // we use this flag in TweenLite's render() method to identify it as a special case that shouldn't be triggered when the virtual playhead is LEAVING the exact position where the pause is, otherwise timeline.addPause(1).play(1) would end up paused on the very next tick.
883
+ return this.add(t, position);
878
884
  };
879
885
 
880
886
  p.removeLabel = function(label) {
@@ -1310,7 +1316,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1310
1316
 
1311
1317
  p.constructor = TimelineMax;
1312
1318
  p.kill()._gc = false;
1313
- TimelineMax.version = "1.14.2";
1319
+ TimelineMax.version = "1.15.0";
1314
1320
 
1315
1321
  p.invalidate = function() {
1316
1322
  this._yoyo = (this.vars.yoyo === true);
@@ -1748,6 +1754,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1748
1754
  _r2 = [],
1749
1755
  _r3 = [],
1750
1756
  _corProps = {},
1757
+ _globals = _gsScope._gsDefine.globals,
1751
1758
  Segment = function(a, b, c, d) {
1752
1759
  this.a = a;
1753
1760
  this.b = b;
@@ -2036,7 +2043,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2036
2043
  BezierPlugin = _gsScope._gsDefine.plugin({
2037
2044
  propName: "bezier",
2038
2045
  priority: -1,
2039
- version: "1.3.3",
2046
+ version: "1.3.4",
2040
2047
  API: 2,
2041
2048
  global:true,
2042
2049
 
@@ -2228,7 +2235,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2228
2235
  };
2229
2236
 
2230
2237
  BezierPlugin._cssRegister = function() {
2231
- var CSSPlugin = _gsScope._gsDefine.globals.CSSPlugin;
2238
+ var CSSPlugin = _globals.CSSPlugin;
2232
2239
  if (!CSSPlugin) {
2233
2240
  return;
2234
2241
  }
@@ -2335,6 +2342,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2335
2342
  this._overwriteProps.length = 0;
2336
2343
  this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method)
2337
2344
  },
2345
+ _globals = _gsScope._gsDefine.globals,
2338
2346
  _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called.
2339
2347
  _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance
2340
2348
  _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter
@@ -2343,7 +2351,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2343
2351
  p = CSSPlugin.prototype = new TweenPlugin("css");
2344
2352
 
2345
2353
  p.constructor = CSSPlugin;
2346
- CSSPlugin.version = "1.14.2";
2354
+ CSSPlugin.version = "1.15.0";
2347
2355
  CSSPlugin.API = 2;
2348
2356
  CSSPlugin.defaultTransformPerspective = 0;
2349
2357
  CSSPlugin.defaultSkewType = "compensated";
@@ -2354,7 +2362,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2354
2362
  var _numExp = /(?:\d|\-\d|\.\d|\-\.\d)+/g,
2355
2363
  _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
2356
2364
  _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)"
2357
- _NaNExp = /(?![+-]?\d*\.?\d+|e[+-]\d+)[^0-9]/g, //also allows scientific notation
2365
+ _NaNExp = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, //also allows scientific notation and doesn't kill the leading -/+ in -= and +=
2358
2366
  _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g,
2359
2367
  _opacityExp = /opacity *= *([^)]*)/i,
2360
2368
  _opacityValExp = /opacity:([^;]*)/i,
@@ -2372,8 +2380,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2372
2380
  _RAD2DEG = 180 / Math.PI,
2373
2381
  _forcePT = {},
2374
2382
  _doc = document,
2375
- _tempDiv = _doc.createElement("div"),
2376
- _tempImg = _doc.createElement("img"),
2383
+ _createElement = function(type) {
2384
+ return _doc.createElementNS ? _doc.createElementNS("http://www.w3.org/1999/xhtml", type) : _doc.createElement(type);
2385
+ },
2386
+ _tempDiv = _createElement("div"),
2387
+ _tempImg = _createElement("img"),
2377
2388
  _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins
2378
2389
  _agent = navigator.userAgent,
2379
2390
  _autoRound,
@@ -2385,17 +2396,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2385
2396
  _ieVers,
2386
2397
  _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version.
2387
2398
  var i = _agent.indexOf("Android"),
2388
- d = _doc.createElement("div"), a;
2389
-
2399
+ a = _createElement("a");
2390
2400
  _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || Number(_agent.substr(i+8, 1)) > 3));
2391
2401
  _isSafariLT6 = (_isSafari && (Number(_agent.substr(_agent.indexOf("Version/")+8, 1)) < 6));
2392
2402
  _isFirefox = (_agent.indexOf("Firefox") !== -1);
2393
2403
  if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent) || (/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) {
2394
2404
  _ieVers = parseFloat( RegExp.$1 );
2395
2405
  }
2396
- d.innerHTML = "<a style='top:1px;opacity:.55;'>a</a>";
2397
- a = d.getElementsByTagName("a")[0];
2398
- return a ? /^0.55/.test(a.style.opacity) : false;
2406
+ if (!a) {
2407
+ return false;
2408
+ }
2409
+ a.style.cssText = "top:1px;opacity:.55;";
2410
+ return /^0.55/.test(a.style.opacity);
2399
2411
  }()),
2400
2412
  _getIEOpacity = function(v) {
2401
2413
  return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1);
@@ -3245,7 +3257,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3245
3257
  if (!_specialProps[p]) {
3246
3258
  var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin";
3247
3259
  _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) {
3248
- var pluginClass = (_gsScope.GreenSockGlobals || _gsScope).com.greensock.plugins[pluginName];
3260
+ var pluginClass = _globals.com.greensock.plugins[pluginName];
3249
3261
  if (!pluginClass) {
3250
3262
  _log("Error: " + pluginName + " js file not loaded.");
3251
3263
  return pt;
@@ -3365,7 +3377,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3365
3377
  _transformOriginProp = _checkPropPrefix("transformOrigin"),
3366
3378
  _supports3D = (_checkPropPrefix("perspective") !== null),
3367
3379
  Transform = _internals.Transform = function() {
3368
- this.skewY = 0;
3380
+ this.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0;
3381
+ this.force3D = (CSSPlugin.defaultForce3D === false || !_supports3D) ? false : CSSPlugin.defaultForce3D || "auto";
3369
3382
  },
3370
3383
  _SVGElement = window.SVGElement,
3371
3384
  _useSVGTransformAttr,
@@ -3385,14 +3398,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3385
3398
  _forceSVGTransformAttr = (function() {
3386
3399
  //IE and Android stock don't support CSS transforms on SVG elements, so we must write them to the "transform" attribute. We populate this variable in the _parseTransform() method, and only if/when we come across an SVG element
3387
3400
  var force = _ieVers || (/Android/i.test(_agent) && !window.chrome),
3388
- svg, rect, left;
3401
+ svg, rect, width;
3389
3402
  if (_doc.createElementNS && !force) { //IE8 and earlier doesn't support SVG anyway
3390
3403
  svg = _createSVG("svg", _docElement);
3391
3404
  rect = _createSVG("rect", svg, {width:100, height:50, x:100});
3392
- left = rect.getBoundingClientRect().left;
3405
+ width = rect.getBoundingClientRect().width;
3393
3406
  rect.style[_transformOriginProp] = "50% 50%";
3394
- rect.style[_transformProp] = "scale(0.5,0.5)";
3395
- force = (left === rect.getBoundingClientRect().left);
3407
+ rect.style[_transformProp] = "scaleX(0.5)";
3408
+ force = (width === rect.getBoundingClientRect().width);
3396
3409
  _docElement.removeChild(svg);
3397
3410
  }
3398
3411
  return force;
@@ -3424,7 +3437,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3424
3437
  minPI = minAngle * _DEG2RAD,
3425
3438
  zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0,
3426
3439
  defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0,
3427
- s, m, i, n, dec, scaleX, scaleY, rotation, skewX, difX, difY, difR, difS;
3440
+ isDefault, s, m, i, n, dec, scaleX, scaleY, rotation, skewX;
3428
3441
  if (_transformProp) {
3429
3442
  s = _getStyle(t, _transformPropCSS, cs, true);
3430
3443
  } else if (t.currentStyle) {
@@ -3432,9 +3445,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3432
3445
  s = t.currentStyle.filter.match(_ieGetMatrixExp);
3433
3446
  s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : "";
3434
3447
  }
3435
- if (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)") { //if no transforms are applied, just use the defaults to optimize performance (no need to parse).
3436
- tm = {x:0, y:0, z:0, scaleX:1, scaleY:1, scaleZ:1, skewX:0, skewY:0, perspective:defaultTransformPerspective, rotation:0, rotationX:0, rotationY:0, zOrigin:0};
3437
- } else {
3448
+ isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)");
3449
+ tm.svg = !!(_SVGElement && typeof(t.getBBox) === "function" && t.getCTM && (!t.parentNode || (t.parentNode.getBBox && t.parentNode.getCTM))); //don't just rely on "instanceof _SVGElement" because if the SVG is embedded via an object tag, it won't work (SVGElement is mapped to a different object)
3450
+ if (tm.svg) {
3451
+ _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, _cs, false, "50% 50%") + "", tm);
3452
+ _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr;
3453
+ m = t.getAttribute("transform");
3454
+ if (isDefault && m && m.indexOf("matrix") !== -1) { //just in case there's a "transfom" value specified as an attribute instead of CSS style. Only accept a matrix, though.
3455
+ s = m;
3456
+ isDefault = 0;
3457
+ }
3458
+ }
3459
+ if (!isDefault) {
3438
3460
  //split the matrix values out into an array (m for matrix)
3439
3461
  m = (s || "").match(/(?:\-|\b)[\d\-\.e]+\b/gi) || [];
3440
3462
  i = m.length;
@@ -3455,80 +3477,68 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3455
3477
  a24 = a23*a34-m[13];
3456
3478
  a34 = a33*a34+tm.zOrigin-m[14];
3457
3479
  }
3480
+ var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3],
3481
+ a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7],
3482
+ a43 = m[11],
3483
+ angle = Math.atan2(a21, a22),
3484
+ t1, t2, t3, cos, sin;
3485
+
3486
+ //rotation
3487
+ tm.rotation = angle * _RAD2DEG;
3488
+ if (angle) {
3489
+ cos = Math.cos(-angle);
3490
+ sin = Math.sin(-angle);
3491
+ a11 = a11*cos+a12*sin;
3492
+ t2 = a21*cos+a22*sin;
3493
+ a22 = a21*-sin+a22*cos;
3494
+ a32 = a31*-sin+a32*cos;
3495
+ a21 = t2;
3496
+ }
3458
3497
 
3459
- //only parse from the matrix if we MUST because not only is it usually unnecessary due to the fact that we store the values in the _gsTransform object, but also because it's impossible to accurately interpret rotationX, rotationY, rotationZ, scaleX, and scaleY if all are applied, so it's much better to rely on what we store. However, we must parse the first time that an object is tweened. We also assume that if the position has changed, the user must have done some styling changes outside of CSSPlugin, thus we force a parse in that scenario.
3460
- if (!rec || parse || tm.rotationX == null) {
3461
- var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3],
3462
- a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7],
3463
- a43 = m[11],
3464
- angle = Math.atan2(a32, a33),
3465
- xFlip = (angle < -minPI || angle > minPI),
3466
- t1, t2, t3, cos, sin, yFlip, zFlip;
3467
- tm.rotationX = angle * _RAD2DEG;
3468
- //rotationX
3469
- if (angle) {
3470
- cos = Math.cos(-angle);
3471
- sin = Math.sin(-angle);
3472
- t1 = a12*cos+a13*sin;
3473
- t2 = a22*cos+a23*sin;
3474
- t3 = a32*cos+a33*sin;
3475
- a13 = a12*-sin+a13*cos;
3476
- a23 = a22*-sin+a23*cos;
3477
- a33 = a32*-sin+a33*cos;
3478
- a43 = a42*-sin+a43*cos;
3479
- a12 = t1;
3480
- a22 = t2;
3481
- a32 = t3;
3482
- }
3483
- //rotationY
3484
- angle = Math.atan2(a13, a11);
3485
- tm.rotationY = angle * _RAD2DEG;
3486
- if (angle) {
3487
- yFlip = (angle < -minPI || angle > minPI);
3488
- cos = Math.cos(-angle);
3489
- sin = Math.sin(-angle);
3490
- t1 = a11*cos-a13*sin;
3491
- t2 = a21*cos-a23*sin;
3492
- t3 = a31*cos-a33*sin;
3493
- a23 = a21*sin+a23*cos;
3494
- a33 = a31*sin+a33*cos;
3495
- a43 = a41*sin+a43*cos;
3496
- a11 = t1;
3497
- a21 = t2;
3498
- a31 = t3;
3499
- }
3500
- //rotationZ
3501
- angle = Math.atan2(a21, a22);
3502
- tm.rotation = angle * _RAD2DEG;
3503
- if (angle) {
3504
- zFlip = (angle < -minPI || angle > minPI);
3505
- cos = Math.cos(-angle);
3506
- sin = Math.sin(-angle);
3507
- a11 = a11*cos+a12*sin;
3508
- t2 = a21*cos+a22*sin;
3509
- a22 = a21*-sin+a22*cos;
3510
- a32 = a31*-sin+a32*cos;
3511
- a21 = t2;
3512
- }
3513
-
3514
- if (zFlip && xFlip) {
3515
- tm.rotation = tm.rotationX = 0;
3516
- } else if (zFlip && yFlip) {
3517
- tm.rotation = tm.rotationY = 0;
3518
- } else if (yFlip && xFlip) {
3519
- tm.rotationY = tm.rotationX = 0;
3520
- }
3498
+ //rotationY
3499
+ angle = Math.atan2(a13, a11);
3500
+ tm.rotationY = angle * _RAD2DEG;
3501
+ if (angle) {
3502
+ cos = Math.cos(-angle);
3503
+ sin = Math.sin(-angle);
3504
+ t1 = a11*cos-a13*sin;
3505
+ t2 = a21*cos-a23*sin;
3506
+ t3 = a31*cos-a33*sin;
3507
+ a23 = a21*sin+a23*cos;
3508
+ a33 = a31*sin+a33*cos;
3509
+ a43 = a41*sin+a43*cos;
3510
+ a11 = t1;
3511
+ a21 = t2;
3512
+ a31 = t3;
3513
+ }
3521
3514
 
3522
- tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd;
3523
- tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd;
3524
- tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd;
3525
- tm.skewX = 0;
3526
- tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0;
3527
- tm.x = a14;
3528
- tm.y = a24;
3529
- tm.z = a34;
3515
+ //rotationX
3516
+ angle = Math.atan2(a32, a33);
3517
+ tm.rotationX = angle * _RAD2DEG;
3518
+ if (angle) {
3519
+ cos = Math.cos(-angle);
3520
+ sin = Math.sin(-angle);
3521
+ t1 = a12*cos+a13*sin;
3522
+ t2 = a22*cos+a23*sin;
3523
+ t3 = a32*cos+a33*sin;
3524
+ a13 = a12*-sin+a13*cos;
3525
+ a23 = a22*-sin+a23*cos;
3526
+ a33 = a32*-sin+a33*cos;
3527
+ a43 = a42*-sin+a43*cos;
3528
+ a12 = t1;
3529
+ a22 = t2;
3530
+ a32 = t3;
3530
3531
  }
3531
3532
 
3533
+ tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd;
3534
+ tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd;
3535
+ tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd;
3536
+ tm.skewX = 0;
3537
+ tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0;
3538
+ tm.x = a14;
3539
+ tm.y = a24;
3540
+ tm.z = a34;
3541
+
3532
3542
  } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY)) && !(tm.x !== undefined && _getStyle(t, "display", cs) === "none")) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those.
3533
3543
  var k = (m.length >= 6),
3534
3544
  a = k ? m[0] : 1,
@@ -3541,8 +3551,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3541
3551
  scaleY = Math.sqrt(d * d + c * c);
3542
3552
  rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).
3543
3553
  skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0;
3544
- difX = scaleX - Math.abs(tm.scaleX || 0);
3545
- difY = scaleY - Math.abs(tm.scaleY || 0);
3546
3554
  if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
3547
3555
  if (invX) {
3548
3556
  scaleX *= -1;
@@ -3553,15 +3561,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3553
3561
  skewX += (skewX <= 0) ? 180 : -180;
3554
3562
  }
3555
3563
  }
3556
- difR = (rotation - tm.rotation) % 180; //note: matching ranges would be very small (+/-0.0001) or very close to 180.
3557
- difS = (skewX - tm.skewX) % 180;
3558
- //if there's already a recorded _gsTransform in place for the target, we should leave those values in place unless we know things changed for sure (beyond a super small amount). This gets around ambiguous interpretations, like if scaleX and scaleY are both -1, the matrix would be the same as if the rotation was 180 with normal scaleX/scaleY. If the user tweened to particular values, those must be prioritized to ensure animation is consistent.
3559
- if (tm.skewX === undefined || difX > min || difX < -min || difY > min || difY < -min || (difR > -minAngle && difR < minAngle && (difR * rnd) | 0 !== 0) || (difS > -minAngle && difS < minAngle && (difS * rnd) | 0 !== 0)) {
3560
- tm.scaleX = scaleX;
3561
- tm.scaleY = scaleY;
3562
- tm.rotation = rotation;
3563
- tm.skewX = skewX;
3564
- }
3564
+ tm.scaleX = scaleX;
3565
+ tm.scaleY = scaleY;
3566
+ tm.rotation = rotation;
3567
+ tm.skewX = skewX;
3565
3568
  if (_supports3D) {
3566
3569
  tm.rotationX = tm.rotationY = tm.z = 0;
3567
3570
  tm.perspective = defaultTransformPerspective;
@@ -3569,7 +3572,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3569
3572
  }
3570
3573
  }
3571
3574
  tm.zOrigin = zOrigin;
3572
-
3573
3575
  //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate.
3574
3576
  for (i in tm) {
3575
3577
  if (tm[i] < min) if (tm[i] > -min) {
@@ -3581,12 +3583,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3581
3583
  if (rec) {
3582
3584
  t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method)
3583
3585
  }
3584
- tm.svg = (_SVGElement && (t instanceof _SVGElement) && (t.parentNode instanceof _SVGElement));
3585
- if (tm.svg) {
3586
- _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, _cs, false, "50% 50%") + "", tm);
3587
- _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr;
3588
- }
3589
- tm.xPercent = tm.yPercent = 0;
3590
3586
  return tm;
3591
3587
  },
3592
3588
 
@@ -3681,7 +3677,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3681
3677
  z = t.z,
3682
3678
  perspective = t.perspective,
3683
3679
  a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43,
3684
- zOrigin, rnd, cos, sin, t1, t2, t3, t4;
3680
+ zOrigin, rnd, cos, sin, t1, t2, t3, t4, transform, comma;
3685
3681
  if (v === 1 || v === 0) if (t.force3D === "auto") if (!t.rotationY && !t.rotationX && sz === 1 && !perspective && !z) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices
3686
3682
  _set2DTransformRatio.call(this, v);
3687
3683
  return;
@@ -3729,6 +3725,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3729
3725
  a43 = (perspective) ? -1 / perspective : 0;
3730
3726
  zOrigin = t.zOrigin;
3731
3727
  rnd = 100000;
3728
+ comma = ",";
3732
3729
  angle = t.rotationY * _DEG2RAD;
3733
3730
  if (angle) {
3734
3731
  cos = Math.cos(angle);
@@ -3791,7 +3788,17 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3791
3788
  a14 = (t1 = (a14 += x) - (a14 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a14 : a14;
3792
3789
  a24 = (t1 = (a24 += y) - (a24 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a24 : a24;
3793
3790
  a34 = (t1 = (a34 += z) - (a34 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a34 : a34;
3794
- style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d(") + [ (((a11 * rnd) | 0) / rnd), (((a21 * rnd) | 0) / rnd), (((a31 * rnd) | 0) / rnd), (((a41 * rnd) | 0) / rnd), (((a12 * rnd) | 0) / rnd), (((a22 * rnd) | 0) / rnd), (((a32 * rnd) | 0) / rnd), (((a42 * rnd) | 0) / rnd), (((a13 * rnd) | 0) / rnd), (((a23 * rnd) | 0) / rnd), (((a33 * rnd) | 0) / rnd), (((a43 * rnd) | 0) / rnd), a14, a24, a34, (perspective ? (1 + (-a34 / perspective)) : 1) ].join(",") + ")";
3791
+
3792
+ //optimized way of concatenating all the values into a string. If we do it all in one shot, it's slower because of the way browsers have to create temp strings and the way it affects memory. If we do it piece-by-piece with +=, it's a bit slower too. We found that doing it in these sized chunks works best overall:
3793
+ transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d(");
3794
+ transform += ((a11 * rnd) | 0) / rnd + comma + ((a21 * rnd) | 0) / rnd + comma + ((a31 * rnd) | 0) / rnd;
3795
+ transform += comma + ((a41 * rnd) | 0) / rnd + comma + ((a12 * rnd) | 0) / rnd + comma + ((a22 * rnd) | 0) / rnd;
3796
+ transform += comma + ((a32 * rnd) | 0) / rnd + comma + ((a42 * rnd) | 0) / rnd + comma + ((a13 * rnd) | 0) / rnd;
3797
+ transform += comma + ((a23 * rnd) | 0) / rnd + comma + ((a33 * rnd) | 0) / rnd + comma + ((a43 * rnd) | 0) / rnd;
3798
+ transform += comma + a14 + comma + a24 + comma + a34 + comma + (perspective ? (1 + (-a34 / perspective)) : 1) + ")";
3799
+ style[_transformProp] = transform;
3800
+
3801
+ //OLD (slower on most devices): style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d(") + [ (((a11 * rnd) | 0) / rnd), (((a21 * rnd) | 0) / rnd), (((a31 * rnd) | 0) / rnd), (((a41 * rnd) | 0) / rnd), (((a12 * rnd) | 0) / rnd), (((a22 * rnd) | 0) / rnd), (((a32 * rnd) | 0) / rnd), (((a42 * rnd) | 0) / rnd), (((a13 * rnd) | 0) / rnd), (((a23 * rnd) | 0) / rnd), (((a33 * rnd) | 0) / rnd), (((a43 * rnd) | 0) / rnd), a14, a24, a34, (perspective ? (1 + (-a34 / perspective)) : 1) ].join(",") + ")";
3795
3802
  },
3796
3803
 
3797
3804
  _set2DTransformRatio = _internals.set2DTransformRatio = function(v) {
@@ -3839,8 +3846,13 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3839
3846
  }
3840
3847
  };
3841
3848
 
3849
+ p = Transform.prototype;
3850
+ p.x = p.y = p.z = p.skewX = p.skewY = p.rotation = p.rotationX = p.rotationY = p.zOrigin = p.xPercent = p.yPercent = 0;
3851
+ p.scaleX = p.scaleY = p.scaleZ = 1;
3852
+
3842
3853
  _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent", {parser:function(t, e, p, cssp, pt, plugin, vars) {
3843
- if (cssp._transform) { return pt; } //only need to parse the transform once, and only if the browser supports it.
3854
+ if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it.
3855
+ cssp._lastParsedTransform = vars;
3844
3856
  var m1 = cssp._transform = _getTransform(t, _cs, true, vars.parseTransform),
3845
3857
  style = t.style,
3846
3858
  min = 0.000001,
@@ -4274,7 +4286,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4274
4286
 
4275
4287
 
4276
4288
  p = CSSPlugin.prototype;
4277
- p._firstPT = null;
4289
+ p._firstPT = p._lastParsedTransform = p._transform = null;
4278
4290
 
4279
4291
  //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc.
4280
4292
  p._onInitTween = function(target, vars, tween) {
@@ -5554,6 +5566,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
5554
5566
  _useRAF = (useRAF !== false && _reqAnimFrame),
5555
5567
  _lagThreshold = 500,
5556
5568
  _adjustedLag = 33,
5569
+ _tickWord = "tick", //helps reduce gc burden
5557
5570
  _fps, _req, _id, _gap, _nextTime,
5558
5571
  _tick = function(manual) {
5559
5572
  var elapsed = _getTime() - _lastUpdate,
@@ -5573,7 +5586,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
5573
5586
  _id = _req(_tick);
5574
5587
  }
5575
5588
  if (dispatch) {
5576
- _self.dispatchEvent("tick");
5589
+ _self.dispatchEvent(_tickWord);
5577
5590
  }
5578
5591
  };
5579
5592
 
@@ -6175,7 +6188,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6175
6188
  p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
6176
6189
  p._notifyPluginsOfEnabled = p._lazy = false;
6177
6190
 
6178
- TweenLite.version = "1.14.2";
6191
+ TweenLite.version = "1.15.0";
6179
6192
  TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
6180
6193
  TweenLite.defaultOverwrite = "auto";
6181
6194
  TweenLite.ticker = _ticker;
@@ -6542,7 +6555,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6542
6555
  if (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate.
6543
6556
  time = 0;
6544
6557
  }
6545
- if (time === 0 || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time) {
6558
+ if (time === 0 || prevRawPrevTime < 0 || (prevRawPrevTime === _tinyNum && this.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause.
6546
6559
  force = true;
6547
6560
  if (prevRawPrevTime > _tinyNum) {
6548
6561
  callback = "onReverseComplete";
@@ -6561,7 +6574,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6561
6574
  if (time < 0) {
6562
6575
  this._active = false;
6563
6576
  if (duration === 0) if (this._initted || !this.vars.lazy || force) { //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.
6564
- if (prevRawPrevTime >= 0) {
6577
+ if (prevRawPrevTime >= 0 && !(prevRawPrevTime === _tinyNum && this.data === "isPause")) {
6565
6578
  force = true;
6566
6579
  }
6567
6580
  this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration 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.
@@ -6662,7 +6675,6 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6662
6675
  this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
6663
6676
  }
6664
6677
  }
6665
-
6666
6678
  if (callback) if (!this._gc || force) { //check _gc because there's a chance that kill() could be called in an onUpdate
6667
6679
  if (time < 0 && this._startAt && !this._onUpdate && time !== -0.0001) { //-0.0001 is a special value that we use when looping back to the beginning of a repeated TimelineMax, in which case we shouldn't render the _startAt values.
6668
6680
  this._startAt.render(time, suppressEvents, force);
@@ -6822,7 +6834,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6822
6834
  };
6823
6835
 
6824
6836
  TweenLite.delayedCall = function(delay, callback, params, scope, useFrames) {
6825
- 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});
6837
+ return new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, onCompleteScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, onReverseCompleteScope:scope, immediateRender:false, lazy:false, useFrames:useFrames, overwrite:0});
6826
6838
  };
6827
6839
 
6828
6840
  TweenLite.set = function(target, vars) {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: beta 1.3.3
3
- * DATE: 2014-07-17
2
+ * VERSION: beta 1.3.4
3
+ * DATE: 2014-11-15
4
4
  * UPDATES AND DOCS AT: http://www.greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
@@ -19,6 +19,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
19
19
  _r2 = [],
20
20
  _r3 = [],
21
21
  _corProps = {},
22
+ _globals = _gsScope._gsDefine.globals,
22
23
  Segment = function(a, b, c, d) {
23
24
  this.a = a;
24
25
  this.b = b;
@@ -307,7 +308,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
307
308
  BezierPlugin = _gsScope._gsDefine.plugin({
308
309
  propName: "bezier",
309
310
  priority: -1,
310
- version: "1.3.3",
311
+ version: "1.3.4",
311
312
  API: 2,
312
313
  global:true,
313
314
 
@@ -499,7 +500,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
499
500
  };
500
501
 
501
502
  BezierPlugin._cssRegister = function() {
502
- var CSSPlugin = _gsScope._gsDefine.globals.CSSPlugin;
503
+ var CSSPlugin = _globals.CSSPlugin;
503
504
  if (!CSSPlugin) {
504
505
  return;
505
506
  }
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.14.2
3
- * DATE: 2014-10-28
2
+ * VERSION: 1.15.0
3
+ * DATE: 2014-12-03
4
4
  * UPDATES AND DOCS AT: http://www.greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
@@ -22,6 +22,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
22
22
  this._overwriteProps.length = 0;
23
23
  this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method)
24
24
  },
25
+ _globals = _gsScope._gsDefine.globals,
25
26
  _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called.
26
27
  _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance
27
28
  _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter
@@ -30,7 +31,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
30
31
  p = CSSPlugin.prototype = new TweenPlugin("css");
31
32
 
32
33
  p.constructor = CSSPlugin;
33
- CSSPlugin.version = "1.14.2";
34
+ CSSPlugin.version = "1.15.0";
34
35
  CSSPlugin.API = 2;
35
36
  CSSPlugin.defaultTransformPerspective = 0;
36
37
  CSSPlugin.defaultSkewType = "compensated";
@@ -41,7 +42,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
41
42
  var _numExp = /(?:\d|\-\d|\.\d|\-\.\d)+/g,
42
43
  _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
43
44
  _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)"
44
- _NaNExp = /(?![+-]?\d*\.?\d+|e[+-]\d+)[^0-9]/g, //also allows scientific notation
45
+ _NaNExp = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, //also allows scientific notation and doesn't kill the leading -/+ in -= and +=
45
46
  _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g,
46
47
  _opacityExp = /opacity *= *([^)]*)/i,
47
48
  _opacityValExp = /opacity:([^;]*)/i,
@@ -59,8 +60,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
59
60
  _RAD2DEG = 180 / Math.PI,
60
61
  _forcePT = {},
61
62
  _doc = document,
62
- _tempDiv = _doc.createElement("div"),
63
- _tempImg = _doc.createElement("img"),
63
+ _createElement = function(type) {
64
+ return _doc.createElementNS ? _doc.createElementNS("http://www.w3.org/1999/xhtml", type) : _doc.createElement(type);
65
+ },
66
+ _tempDiv = _createElement("div"),
67
+ _tempImg = _createElement("img"),
64
68
  _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins
65
69
  _agent = navigator.userAgent,
66
70
  _autoRound,
@@ -72,17 +76,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
72
76
  _ieVers,
73
77
  _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version.
74
78
  var i = _agent.indexOf("Android"),
75
- d = _doc.createElement("div"), a;
76
-
79
+ a = _createElement("a");
77
80
  _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || Number(_agent.substr(i+8, 1)) > 3));
78
81
  _isSafariLT6 = (_isSafari && (Number(_agent.substr(_agent.indexOf("Version/")+8, 1)) < 6));
79
82
  _isFirefox = (_agent.indexOf("Firefox") !== -1);
80
83
  if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent) || (/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) {
81
84
  _ieVers = parseFloat( RegExp.$1 );
82
85
  }
83
- d.innerHTML = "<a style='top:1px;opacity:.55;'>a</a>";
84
- a = d.getElementsByTagName("a")[0];
85
- return a ? /^0.55/.test(a.style.opacity) : false;
86
+ if (!a) {
87
+ return false;
88
+ }
89
+ a.style.cssText = "top:1px;opacity:.55;";
90
+ return /^0.55/.test(a.style.opacity);
86
91
  }()),
87
92
  _getIEOpacity = function(v) {
88
93
  return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1);
@@ -932,7 +937,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
932
937
  if (!_specialProps[p]) {
933
938
  var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin";
934
939
  _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) {
935
- var pluginClass = (_gsScope.GreenSockGlobals || _gsScope).com.greensock.plugins[pluginName];
940
+ var pluginClass = _globals.com.greensock.plugins[pluginName];
936
941
  if (!pluginClass) {
937
942
  _log("Error: " + pluginName + " js file not loaded.");
938
943
  return pt;
@@ -1052,7 +1057,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1052
1057
  _transformOriginProp = _checkPropPrefix("transformOrigin"),
1053
1058
  _supports3D = (_checkPropPrefix("perspective") !== null),
1054
1059
  Transform = _internals.Transform = function() {
1055
- this.skewY = 0;
1060
+ this.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0;
1061
+ this.force3D = (CSSPlugin.defaultForce3D === false || !_supports3D) ? false : CSSPlugin.defaultForce3D || "auto";
1056
1062
  },
1057
1063
  _SVGElement = window.SVGElement,
1058
1064
  _useSVGTransformAttr,
@@ -1072,14 +1078,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1072
1078
  _forceSVGTransformAttr = (function() {
1073
1079
  //IE and Android stock don't support CSS transforms on SVG elements, so we must write them to the "transform" attribute. We populate this variable in the _parseTransform() method, and only if/when we come across an SVG element
1074
1080
  var force = _ieVers || (/Android/i.test(_agent) && !window.chrome),
1075
- svg, rect, left;
1081
+ svg, rect, width;
1076
1082
  if (_doc.createElementNS && !force) { //IE8 and earlier doesn't support SVG anyway
1077
1083
  svg = _createSVG("svg", _docElement);
1078
1084
  rect = _createSVG("rect", svg, {width:100, height:50, x:100});
1079
- left = rect.getBoundingClientRect().left;
1085
+ width = rect.getBoundingClientRect().width;
1080
1086
  rect.style[_transformOriginProp] = "50% 50%";
1081
- rect.style[_transformProp] = "scale(0.5,0.5)";
1082
- force = (left === rect.getBoundingClientRect().left);
1087
+ rect.style[_transformProp] = "scaleX(0.5)";
1088
+ force = (width === rect.getBoundingClientRect().width);
1083
1089
  _docElement.removeChild(svg);
1084
1090
  }
1085
1091
  return force;
@@ -1111,7 +1117,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1111
1117
  minPI = minAngle * _DEG2RAD,
1112
1118
  zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0,
1113
1119
  defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0,
1114
- s, m, i, n, dec, scaleX, scaleY, rotation, skewX, difX, difY, difR, difS;
1120
+ isDefault, s, m, i, n, dec, scaleX, scaleY, rotation, skewX;
1115
1121
  if (_transformProp) {
1116
1122
  s = _getStyle(t, _transformPropCSS, cs, true);
1117
1123
  } else if (t.currentStyle) {
@@ -1119,9 +1125,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1119
1125
  s = t.currentStyle.filter.match(_ieGetMatrixExp);
1120
1126
  s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : "";
1121
1127
  }
1122
- if (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)") { //if no transforms are applied, just use the defaults to optimize performance (no need to parse).
1123
- tm = {x:0, y:0, z:0, scaleX:1, scaleY:1, scaleZ:1, skewX:0, skewY:0, perspective:defaultTransformPerspective, rotation:0, rotationX:0, rotationY:0, zOrigin:0};
1124
- } else {
1128
+ isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)");
1129
+ tm.svg = !!(_SVGElement && typeof(t.getBBox) === "function" && t.getCTM && (!t.parentNode || (t.parentNode.getBBox && t.parentNode.getCTM))); //don't just rely on "instanceof _SVGElement" because if the SVG is embedded via an object tag, it won't work (SVGElement is mapped to a different object)
1130
+ if (tm.svg) {
1131
+ _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, _cs, false, "50% 50%") + "", tm);
1132
+ _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr;
1133
+ m = t.getAttribute("transform");
1134
+ if (isDefault && m && m.indexOf("matrix") !== -1) { //just in case there's a "transfom" value specified as an attribute instead of CSS style. Only accept a matrix, though.
1135
+ s = m;
1136
+ isDefault = 0;
1137
+ }
1138
+ }
1139
+ if (!isDefault) {
1125
1140
  //split the matrix values out into an array (m for matrix)
1126
1141
  m = (s || "").match(/(?:\-|\b)[\d\-\.e]+\b/gi) || [];
1127
1142
  i = m.length;
@@ -1142,80 +1157,68 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1142
1157
  a24 = a23*a34-m[13];
1143
1158
  a34 = a33*a34+tm.zOrigin-m[14];
1144
1159
  }
1160
+ var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3],
1161
+ a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7],
1162
+ a43 = m[11],
1163
+ angle = Math.atan2(a21, a22),
1164
+ t1, t2, t3, cos, sin;
1165
+
1166
+ //rotation
1167
+ tm.rotation = angle * _RAD2DEG;
1168
+ if (angle) {
1169
+ cos = Math.cos(-angle);
1170
+ sin = Math.sin(-angle);
1171
+ a11 = a11*cos+a12*sin;
1172
+ t2 = a21*cos+a22*sin;
1173
+ a22 = a21*-sin+a22*cos;
1174
+ a32 = a31*-sin+a32*cos;
1175
+ a21 = t2;
1176
+ }
1145
1177
 
1146
- //only parse from the matrix if we MUST because not only is it usually unnecessary due to the fact that we store the values in the _gsTransform object, but also because it's impossible to accurately interpret rotationX, rotationY, rotationZ, scaleX, and scaleY if all are applied, so it's much better to rely on what we store. However, we must parse the first time that an object is tweened. We also assume that if the position has changed, the user must have done some styling changes outside of CSSPlugin, thus we force a parse in that scenario.
1147
- if (!rec || parse || tm.rotationX == null) {
1148
- var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3],
1149
- a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7],
1150
- a43 = m[11],
1151
- angle = Math.atan2(a32, a33),
1152
- xFlip = (angle < -minPI || angle > minPI),
1153
- t1, t2, t3, cos, sin, yFlip, zFlip;
1154
- tm.rotationX = angle * _RAD2DEG;
1155
- //rotationX
1156
- if (angle) {
1157
- cos = Math.cos(-angle);
1158
- sin = Math.sin(-angle);
1159
- t1 = a12*cos+a13*sin;
1160
- t2 = a22*cos+a23*sin;
1161
- t3 = a32*cos+a33*sin;
1162
- a13 = a12*-sin+a13*cos;
1163
- a23 = a22*-sin+a23*cos;
1164
- a33 = a32*-sin+a33*cos;
1165
- a43 = a42*-sin+a43*cos;
1166
- a12 = t1;
1167
- a22 = t2;
1168
- a32 = t3;
1169
- }
1170
- //rotationY
1171
- angle = Math.atan2(a13, a11);
1172
- tm.rotationY = angle * _RAD2DEG;
1173
- if (angle) {
1174
- yFlip = (angle < -minPI || angle > minPI);
1175
- cos = Math.cos(-angle);
1176
- sin = Math.sin(-angle);
1177
- t1 = a11*cos-a13*sin;
1178
- t2 = a21*cos-a23*sin;
1179
- t3 = a31*cos-a33*sin;
1180
- a23 = a21*sin+a23*cos;
1181
- a33 = a31*sin+a33*cos;
1182
- a43 = a41*sin+a43*cos;
1183
- a11 = t1;
1184
- a21 = t2;
1185
- a31 = t3;
1186
- }
1187
- //rotationZ
1188
- angle = Math.atan2(a21, a22);
1189
- tm.rotation = angle * _RAD2DEG;
1190
- if (angle) {
1191
- zFlip = (angle < -minPI || angle > minPI);
1192
- cos = Math.cos(-angle);
1193
- sin = Math.sin(-angle);
1194
- a11 = a11*cos+a12*sin;
1195
- t2 = a21*cos+a22*sin;
1196
- a22 = a21*-sin+a22*cos;
1197
- a32 = a31*-sin+a32*cos;
1198
- a21 = t2;
1199
- }
1200
-
1201
- if (zFlip && xFlip) {
1202
- tm.rotation = tm.rotationX = 0;
1203
- } else if (zFlip && yFlip) {
1204
- tm.rotation = tm.rotationY = 0;
1205
- } else if (yFlip && xFlip) {
1206
- tm.rotationY = tm.rotationX = 0;
1207
- }
1178
+ //rotationY
1179
+ angle = Math.atan2(a13, a11);
1180
+ tm.rotationY = angle * _RAD2DEG;
1181
+ if (angle) {
1182
+ cos = Math.cos(-angle);
1183
+ sin = Math.sin(-angle);
1184
+ t1 = a11*cos-a13*sin;
1185
+ t2 = a21*cos-a23*sin;
1186
+ t3 = a31*cos-a33*sin;
1187
+ a23 = a21*sin+a23*cos;
1188
+ a33 = a31*sin+a33*cos;
1189
+ a43 = a41*sin+a43*cos;
1190
+ a11 = t1;
1191
+ a21 = t2;
1192
+ a31 = t3;
1193
+ }
1208
1194
 
1209
- tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd;
1210
- tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd;
1211
- tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd;
1212
- tm.skewX = 0;
1213
- tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0;
1214
- tm.x = a14;
1215
- tm.y = a24;
1216
- tm.z = a34;
1195
+ //rotationX
1196
+ angle = Math.atan2(a32, a33);
1197
+ tm.rotationX = angle * _RAD2DEG;
1198
+ if (angle) {
1199
+ cos = Math.cos(-angle);
1200
+ sin = Math.sin(-angle);
1201
+ t1 = a12*cos+a13*sin;
1202
+ t2 = a22*cos+a23*sin;
1203
+ t3 = a32*cos+a33*sin;
1204
+ a13 = a12*-sin+a13*cos;
1205
+ a23 = a22*-sin+a23*cos;
1206
+ a33 = a32*-sin+a33*cos;
1207
+ a43 = a42*-sin+a43*cos;
1208
+ a12 = t1;
1209
+ a22 = t2;
1210
+ a32 = t3;
1217
1211
  }
1218
1212
 
1213
+ tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd;
1214
+ tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd;
1215
+ tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd;
1216
+ tm.skewX = 0;
1217
+ tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0;
1218
+ tm.x = a14;
1219
+ tm.y = a24;
1220
+ tm.z = a34;
1221
+
1219
1222
  } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY)) && !(tm.x !== undefined && _getStyle(t, "display", cs) === "none")) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those.
1220
1223
  var k = (m.length >= 6),
1221
1224
  a = k ? m[0] : 1,
@@ -1228,8 +1231,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1228
1231
  scaleY = Math.sqrt(d * d + c * c);
1229
1232
  rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).
1230
1233
  skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0;
1231
- difX = scaleX - Math.abs(tm.scaleX || 0);
1232
- difY = scaleY - Math.abs(tm.scaleY || 0);
1233
1234
  if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
1234
1235
  if (invX) {
1235
1236
  scaleX *= -1;
@@ -1240,15 +1241,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1240
1241
  skewX += (skewX <= 0) ? 180 : -180;
1241
1242
  }
1242
1243
  }
1243
- difR = (rotation - tm.rotation) % 180; //note: matching ranges would be very small (+/-0.0001) or very close to 180.
1244
- difS = (skewX - tm.skewX) % 180;
1245
- //if there's already a recorded _gsTransform in place for the target, we should leave those values in place unless we know things changed for sure (beyond a super small amount). This gets around ambiguous interpretations, like if scaleX and scaleY are both -1, the matrix would be the same as if the rotation was 180 with normal scaleX/scaleY. If the user tweened to particular values, those must be prioritized to ensure animation is consistent.
1246
- if (tm.skewX === undefined || difX > min || difX < -min || difY > min || difY < -min || (difR > -minAngle && difR < minAngle && (difR * rnd) | 0 !== 0) || (difS > -minAngle && difS < minAngle && (difS * rnd) | 0 !== 0)) {
1247
- tm.scaleX = scaleX;
1248
- tm.scaleY = scaleY;
1249
- tm.rotation = rotation;
1250
- tm.skewX = skewX;
1251
- }
1244
+ tm.scaleX = scaleX;
1245
+ tm.scaleY = scaleY;
1246
+ tm.rotation = rotation;
1247
+ tm.skewX = skewX;
1252
1248
  if (_supports3D) {
1253
1249
  tm.rotationX = tm.rotationY = tm.z = 0;
1254
1250
  tm.perspective = defaultTransformPerspective;
@@ -1256,7 +1252,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1256
1252
  }
1257
1253
  }
1258
1254
  tm.zOrigin = zOrigin;
1259
-
1260
1255
  //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate.
1261
1256
  for (i in tm) {
1262
1257
  if (tm[i] < min) if (tm[i] > -min) {
@@ -1268,12 +1263,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1268
1263
  if (rec) {
1269
1264
  t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method)
1270
1265
  }
1271
- tm.svg = (_SVGElement && (t instanceof _SVGElement) && (t.parentNode instanceof _SVGElement));
1272
- if (tm.svg) {
1273
- _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, _cs, false, "50% 50%") + "", tm);
1274
- _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr;
1275
- }
1276
- tm.xPercent = tm.yPercent = 0;
1277
1266
  return tm;
1278
1267
  },
1279
1268
 
@@ -1368,7 +1357,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1368
1357
  z = t.z,
1369
1358
  perspective = t.perspective,
1370
1359
  a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43,
1371
- zOrigin, rnd, cos, sin, t1, t2, t3, t4;
1360
+ zOrigin, rnd, cos, sin, t1, t2, t3, t4, transform, comma;
1372
1361
  if (v === 1 || v === 0) if (t.force3D === "auto") if (!t.rotationY && !t.rotationX && sz === 1 && !perspective && !z) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices
1373
1362
  _set2DTransformRatio.call(this, v);
1374
1363
  return;
@@ -1416,6 +1405,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1416
1405
  a43 = (perspective) ? -1 / perspective : 0;
1417
1406
  zOrigin = t.zOrigin;
1418
1407
  rnd = 100000;
1408
+ comma = ",";
1419
1409
  angle = t.rotationY * _DEG2RAD;
1420
1410
  if (angle) {
1421
1411
  cos = Math.cos(angle);
@@ -1478,7 +1468,17 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1478
1468
  a14 = (t1 = (a14 += x) - (a14 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a14 : a14;
1479
1469
  a24 = (t1 = (a24 += y) - (a24 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a24 : a24;
1480
1470
  a34 = (t1 = (a34 += z) - (a34 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a34 : a34;
1481
- style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d(") + [ (((a11 * rnd) | 0) / rnd), (((a21 * rnd) | 0) / rnd), (((a31 * rnd) | 0) / rnd), (((a41 * rnd) | 0) / rnd), (((a12 * rnd) | 0) / rnd), (((a22 * rnd) | 0) / rnd), (((a32 * rnd) | 0) / rnd), (((a42 * rnd) | 0) / rnd), (((a13 * rnd) | 0) / rnd), (((a23 * rnd) | 0) / rnd), (((a33 * rnd) | 0) / rnd), (((a43 * rnd) | 0) / rnd), a14, a24, a34, (perspective ? (1 + (-a34 / perspective)) : 1) ].join(",") + ")";
1471
+
1472
+ //optimized way of concatenating all the values into a string. If we do it all in one shot, it's slower because of the way browsers have to create temp strings and the way it affects memory. If we do it piece-by-piece with +=, it's a bit slower too. We found that doing it in these sized chunks works best overall:
1473
+ transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d(");
1474
+ transform += ((a11 * rnd) | 0) / rnd + comma + ((a21 * rnd) | 0) / rnd + comma + ((a31 * rnd) | 0) / rnd;
1475
+ transform += comma + ((a41 * rnd) | 0) / rnd + comma + ((a12 * rnd) | 0) / rnd + comma + ((a22 * rnd) | 0) / rnd;
1476
+ transform += comma + ((a32 * rnd) | 0) / rnd + comma + ((a42 * rnd) | 0) / rnd + comma + ((a13 * rnd) | 0) / rnd;
1477
+ transform += comma + ((a23 * rnd) | 0) / rnd + comma + ((a33 * rnd) | 0) / rnd + comma + ((a43 * rnd) | 0) / rnd;
1478
+ transform += comma + a14 + comma + a24 + comma + a34 + comma + (perspective ? (1 + (-a34 / perspective)) : 1) + ")";
1479
+ style[_transformProp] = transform;
1480
+
1481
+ //OLD (slower on most devices): style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d(") + [ (((a11 * rnd) | 0) / rnd), (((a21 * rnd) | 0) / rnd), (((a31 * rnd) | 0) / rnd), (((a41 * rnd) | 0) / rnd), (((a12 * rnd) | 0) / rnd), (((a22 * rnd) | 0) / rnd), (((a32 * rnd) | 0) / rnd), (((a42 * rnd) | 0) / rnd), (((a13 * rnd) | 0) / rnd), (((a23 * rnd) | 0) / rnd), (((a33 * rnd) | 0) / rnd), (((a43 * rnd) | 0) / rnd), a14, a24, a34, (perspective ? (1 + (-a34 / perspective)) : 1) ].join(",") + ")";
1482
1482
  },
1483
1483
 
1484
1484
  _set2DTransformRatio = _internals.set2DTransformRatio = function(v) {
@@ -1526,8 +1526,13 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1526
1526
  }
1527
1527
  };
1528
1528
 
1529
+ p = Transform.prototype;
1530
+ p.x = p.y = p.z = p.skewX = p.skewY = p.rotation = p.rotationX = p.rotationY = p.zOrigin = p.xPercent = p.yPercent = 0;
1531
+ p.scaleX = p.scaleY = p.scaleZ = 1;
1532
+
1529
1533
  _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent", {parser:function(t, e, p, cssp, pt, plugin, vars) {
1530
- if (cssp._transform) { return pt; } //only need to parse the transform once, and only if the browser supports it.
1534
+ if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it.
1535
+ cssp._lastParsedTransform = vars;
1531
1536
  var m1 = cssp._transform = _getTransform(t, _cs, true, vars.parseTransform),
1532
1537
  style = t.style,
1533
1538
  min = 0.000001,
@@ -1961,7 +1966,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1961
1966
 
1962
1967
 
1963
1968
  p = CSSPlugin.prototype;
1964
- p._firstPT = null;
1969
+ p._firstPT = p._lastParsedTransform = p._transform = null;
1965
1970
 
1966
1971
  //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc.
1967
1972
  p._onInitTween = function(target, vars, tween) {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 0.10.7
3
- * DATE: 2014-10-14
2
+ * VERSION: 0.10.8
3
+ * DATE: 2014-11-14
4
4
  * UPDATES AND DOCS AT: http://www.greensock.com
5
5
  *
6
6
  * Requires TweenLite and CSSPlugin version 1.11.0 or later (TweenMax contains both TweenLite and CSSPlugin). ThrowPropsPlugin is required for momentum-based continuation of movement after the mouse/touch is released (ThrowPropsPlugin is a membership benefit of Club GreenSock - http://www.greensock.com/club/).
@@ -22,6 +22,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
22
22
  _tempVarsX = {css:{}},
23
23
  _tempVarsY = {css:{}},
24
24
  _tempVarsRotation = {css:{}},
25
+ _globals = _gsScope._gsDefine.globals,
25
26
  _tempEvent = {}, //for populating with pageX/pageY in old versions of IE
26
27
  _doc = document,
27
28
  _docElement = _doc.documentElement || {},
@@ -792,7 +793,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
792
793
  EventDispatcher.call(this, target);
793
794
  target = _unwrapElement(target); //in case the target is a selector object or selector text
794
795
  if (!ThrowPropsPlugin) {
795
- ThrowPropsPlugin = (_gsScope.GreenSockGlobals || _gsScope).com.greensock.plugins.ThrowPropsPlugin;
796
+ ThrowPropsPlugin = _globals.com.greensock.plugins.ThrowPropsPlugin;
796
797
  }
797
798
  this.vars = vars = vars || {};
798
799
  this.target = target;
@@ -988,7 +989,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
988
989
  }
989
990
  }
990
991
  }
991
- self.tween = tween = ThrowPropsPlugin.to(scrollProxy || target, {throwProps:throwProps, ease:(vars.ease || Power3.easeOut), onComplete:vars.onThrowComplete, onCompleteParams:vars.onThrowCompleteParams, onCompleteScope:(vars.onThrowCompleteScope || self), onUpdate:(vars.fastMode ? vars.onThrowUpdate : syncXY), onUpdateParams:(vars.fastMode ? vars.onThrowUpdateParams : null), onUpdateScope:(vars.onThrowUpdateScope || self)}, (isNaN(vars.maxDuration) ? 2 : vars.maxDuration), (isNaN(vars.minDuration) ? 0.5 : vars.minDuration), (isNaN(vars.overshootTolerance) ? (1 - self.edgeResistance) + 0.2 : vars.overshootTolerance));
992
+ self.tween = tween = ThrowPropsPlugin.to(scrollProxy || target, {throwProps:throwProps, ease:(vars.ease || _globals.Power3.easeOut), onComplete:vars.onThrowComplete, onCompleteParams:vars.onThrowCompleteParams, onCompleteScope:(vars.onThrowCompleteScope || self), onUpdate:(vars.fastMode ? vars.onThrowUpdate : syncXY), onUpdateParams:(vars.fastMode ? vars.onThrowUpdateParams : null), onUpdateScope:(vars.onThrowUpdateScope || self)}, (isNaN(vars.maxDuration) ? 2 : vars.maxDuration), (isNaN(vars.minDuration) ? 0.5 : vars.minDuration), (isNaN(vars.overshootTolerance) ? (1 - self.edgeResistance) + 0.2 : vars.overshootTolerance));
992
993
  if (!vars.fastMode) {
993
994
  //to populate the end values, we just scrub the tween to the end, record the values, and then jump back to the beginning.
994
995
  if (scrollProxy) {
@@ -1579,7 +1580,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1579
1580
  p.constructor = Draggable;
1580
1581
  p.pointerX = p.pointerY = 0;
1581
1582
  p.isDragging = p.isPressed = false;
1582
- Draggable.version = "0.10.7";
1583
+ Draggable.version = "0.10.8";
1583
1584
  Draggable.zIndex = 1000;
1584
1585
 
1585
1586
  _addListener(_doc, "touchcancel", function() {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greensock-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.2.0
4
+ version: 1.15.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Pataki, Greensock Team