greensock-rails 1.15.0.0 → 1.15.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/greensock/rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/greensock/TimelineLite.js +8 -7
  5. data/vendor/assets/javascripts/greensock/TimelineMax.js +14 -9
  6. data/vendor/assets/javascripts/greensock/TweenLite.js +6 -6
  7. data/vendor/assets/javascripts/greensock/TweenMax.js +135 -99
  8. data/vendor/assets/javascripts/greensock/easing/EasePack.js +3 -3
  9. data/vendor/assets/javascripts/greensock/jquery.gsap.js +3 -3
  10. data/vendor/assets/javascripts/greensock/plugins/AttrPlugin.js +2 -2
  11. data/vendor/assets/javascripts/greensock/plugins/BezierPlugin.js +2 -2
  12. data/vendor/assets/javascripts/greensock/plugins/CSSPlugin.js +123 -92
  13. data/vendor/assets/javascripts/greensock/plugins/CSSRulePlugin.js +9 -6
  14. data/vendor/assets/javascripts/greensock/plugins/ColorPropsPlugin.js +2 -2
  15. data/vendor/assets/javascripts/greensock/plugins/DirectionalRotationPlugin.js +2 -2
  16. data/vendor/assets/javascripts/greensock/plugins/EaselPlugin.js +2 -2
  17. data/vendor/assets/javascripts/greensock/plugins/EndArrayPlugin.js +2 -2
  18. data/vendor/assets/javascripts/greensock/plugins/KineticPlugin.js +2 -2
  19. data/vendor/assets/javascripts/greensock/plugins/RaphaelPlugin.js +2 -2
  20. data/vendor/assets/javascripts/greensock/plugins/RoundPropsPlugin.js +2 -2
  21. data/vendor/assets/javascripts/greensock/plugins/ScrollToPlugin.js +2 -2
  22. data/vendor/assets/javascripts/greensock/plugins/TEMPLATE_Plugin.js +4 -4
  23. data/vendor/assets/javascripts/greensock/plugins/TextPlugin.js +2 -2
  24. data/vendor/assets/javascripts/greensock/utils/Draggable.js +18 -10
  25. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f730f1a572256766ec5d4e39edde2bd60ad127b
4
- data.tar.gz: 2c89a9e90964f1ca93feb92c0e1cbb41c3ad23e2
3
+ metadata.gz: d12a8246dd48a721b95b0893a04bd608094cd38d
4
+ data.tar.gz: caf5e03c20e59f8ea2978e62005aab5e27212743
5
5
  SHA512:
6
- metadata.gz: aeee17feeba70f7bf78d13d9eb9f1fad9c6c8055bf62cee8abbcbc0740d83d7c32093d4483d26306452f667049ba6fb50c0ad9764787c4ce4b66cb9416c4a9b8
7
- data.tar.gz: c227f044815706dc4dd1f0787a816c792b32a09d32c3cd8de20767849effd166999f8013f504dad23930c197284c04ca3c1a32f7ff08e992aaf7b553eb448d3d
6
+ metadata.gz: 82af37432729b8a17037fae29a2a99b2ffea263c9c089ae8dbc92e0ddf3424f942fb8ee619e9dcbf7788c723e83ffae109b58eab605d265e61db3eb7792d6d26
7
+ data.tar.gz: c5227fc9bc6a8376388376259a02d59a7fc77745983f9d1577cd9e92f0ef97322b98a1bc91e2fcba216ec1ac27b7b43ef4c389a053681f8db4a0662b8c05f161
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
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
4
 
5
- [![Gem Version](https://badge.fury.io/rb/greensock-rails.png)](http://badge.fury.io/rb/greensock-rails)
5
+ [![Gem Version](https://badge.fury.io/rb/greensock-rails.png)](http://badge.fury.io/rb/greensock-rails) [![npm version](https://badge.fury.io/js/generator-sizzle.svg)](http://badge.fury.io/js/generator-sizzle)
6
6
 
7
7
  ## greensock-rails RubyGems URL
8
8
 
@@ -1,5 +1,5 @@
1
1
  module Greensock
2
2
  module Rails
3
- VERSION = "1.15.0.0"
3
+ VERSION = "1.15.1.0"
4
4
  end
5
5
  end
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * VERSION: 1.15.0
3
- * DATE: 2014-12-03
4
- * UPDATES AND DOCS AT: http://www.greensock.com
2
+ * VERSION: 1.15.1
3
+ * DATE: 2015-01-08
4
+ * UPDATES AND DOCS AT: http://greensock.com
5
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
6
+ * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://greensock.com/standard-license or for
8
8
  * Club GreenSock members, the software agreement that was issued with your membership.
9
9
  *
10
10
  * @author: Jack Doyle, jack@greensock.com
@@ -37,6 +37,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
37
37
  },
38
38
  _tinyNum = 0.0000000001,
39
39
  TweenLiteInternals = TweenLite._internals,
40
+ _internals = TimelineLite._internals = {},
40
41
  _isSelector = TweenLiteInternals.isSelector,
41
42
  _isArray = TweenLiteInternals.isArray,
42
43
  _lazyTweens = TweenLiteInternals.lazyTweens,
@@ -50,7 +51,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
50
51
  }
51
52
  return copy;
52
53
  },
53
- _pauseCallback = function(tween, callback, params, scope) {
54
+ _pauseCallback = _internals.pauseCallback = function(tween, callback, params, scope) {
54
55
  var tl = tween._timeline,
55
56
  time = tl._totalTime;
56
57
  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.
@@ -72,7 +73,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
72
73
  },
73
74
  p = TimelineLite.prototype = new SimpleTimeline();
74
75
 
75
- TimelineLite.version = "1.15.0";
76
+ TimelineLite.version = "1.15.1";
76
77
  p.constructor = TimelineLite;
77
78
  p.kill()._gc = p._forcingPlayhead = false;
78
79
 
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * VERSION: 1.15.0
3
- * DATE: 2014-12-03
4
- * UPDATES AND DOCS AT: http://www.greensock.com
2
+ * VERSION: 1.15.1
3
+ * DATE: 2015-01-08
4
+ * UPDATES AND DOCS AT: http://greensock.com
5
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
6
+ * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://greensock.com/standard-license or for
8
8
  * Club GreenSock members, the software agreement that was issued with your membership.
9
9
  *
10
10
  * @author: Jack Doyle, jack@greensock.com
@@ -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.15.0";
37
+ TimelineMax.version = "1.15.1";
38
38
 
39
39
  p.invalidate = function() {
40
40
  this._yoyo = (this.vars.yoyo === true);
@@ -65,10 +65,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
65
65
  }
66
66
  return this;
67
67
  };
68
+
69
+ p.removePause = function(position) {
70
+ return this.removeCallback(TimelineLite._internals.pauseCallback, position);
71
+ };
68
72
 
69
73
  p.tweenTo = function(position, vars) {
70
74
  vars = vars || {};
71
- var copy = {ease:_easeNone, overwrite:(vars.delay ? 2 : 1), useFrames:this.usesFrames(), immediateRender:false},//note: set overwrite to 1 (true/all) by default unless there's a delay so that we avoid a racing situation that could happen if, for example, an onmousemove creates the same tweenTo() over and over again.
75
+ var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false},
72
76
  duration, p, t;
73
77
  for (p in vars) {
74
78
  copy[p] = vars[p];
@@ -484,6 +488,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
484
488
  },
485
489
  _tinyNum = 0.0000000001,
486
490
  TweenLiteInternals = TweenLite._internals,
491
+ _internals = TimelineLite._internals = {},
487
492
  _isSelector = TweenLiteInternals.isSelector,
488
493
  _isArray = TweenLiteInternals.isArray,
489
494
  _lazyTweens = TweenLiteInternals.lazyTweens,
@@ -497,7 +502,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
497
502
  }
498
503
  return copy;
499
504
  },
500
- _pauseCallback = function(tween, callback, params, scope) {
505
+ _pauseCallback = _internals.pauseCallback = function(tween, callback, params, scope) {
501
506
  var tl = tween._timeline,
502
507
  time = tl._totalTime;
503
508
  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.
@@ -519,7 +524,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
519
524
  },
520
525
  p = TimelineLite.prototype = new SimpleTimeline();
521
526
 
522
- TimelineLite.version = "1.15.0";
527
+ TimelineLite.version = "1.15.1";
523
528
  p.constructor = TimelineLite;
524
529
  p.kill()._gc = p._forcingPlayhead = false;
525
530
 
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * VERSION: 1.15.0
3
- * DATE: 2014-12-03
4
- * UPDATES AND DOCS AT: http://www.greensock.com
2
+ * VERSION: 1.15.1
3
+ * DATE: 2015-01-08
4
+ * UPDATES AND DOCS AT: http://greensock.com
5
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
6
+ * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://greensock.com/standard-license or for
8
8
  * Club GreenSock members, the software agreement that was issued with your membership.
9
9
  *
10
10
  * @author: Jack Doyle, jack@greensock.com
@@ -911,7 +911,7 @@
911
911
  p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
912
912
  p._notifyPluginsOfEnabled = p._lazy = false;
913
913
 
914
- TweenLite.version = "1.15.0";
914
+ TweenLite.version = "1.15.1";
915
915
  TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
916
916
  TweenLite.defaultOverwrite = "auto";
917
917
  TweenLite.ticker = _ticker;
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VERSION: 1.15.0
3
- * DATE: 2014-12-03
4
- * UPDATES AND DOCS AT: http://www.greensock.com
2
+ * VERSION: 1.15.1
3
+ * DATE: 2015-01-20
4
+ * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
7
7
  *
8
- * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
9
- * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8
+ * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
9
+ * This work is subject to the terms at http://greensock.com/standard-license or for
10
10
  * Club GreenSock members, the software agreement that was issued with your membership.
11
11
  *
12
12
  * @author: Jack Doyle, jack@greensock.com
@@ -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.15.0";
44
+ TweenMax.version = "1.15.1";
45
45
  p.constructor = TweenMax;
46
46
  p.kill()._gc = false;
47
47
  TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf;
@@ -628,6 +628,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
628
628
  },
629
629
  _tinyNum = 0.0000000001,
630
630
  TweenLiteInternals = TweenLite._internals,
631
+ _internals = TimelineLite._internals = {},
631
632
  _isSelector = TweenLiteInternals.isSelector,
632
633
  _isArray = TweenLiteInternals.isArray,
633
634
  _lazyTweens = TweenLiteInternals.lazyTweens,
@@ -641,7 +642,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
641
642
  }
642
643
  return copy;
643
644
  },
644
- _pauseCallback = function(tween, callback, params, scope) {
645
+ _pauseCallback = _internals.pauseCallback = function(tween, callback, params, scope) {
645
646
  var tl = tween._timeline,
646
647
  time = tl._totalTime;
647
648
  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.
@@ -663,7 +664,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
663
664
  },
664
665
  p = TimelineLite.prototype = new SimpleTimeline();
665
666
 
666
- TimelineLite.version = "1.15.0";
667
+ TimelineLite.version = "1.15.1";
667
668
  p.constructor = TimelineLite;
668
669
  p.kill()._gc = p._forcingPlayhead = false;
669
670
 
@@ -1316,7 +1317,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1316
1317
 
1317
1318
  p.constructor = TimelineMax;
1318
1319
  p.kill()._gc = false;
1319
- TimelineMax.version = "1.15.0";
1320
+ TimelineMax.version = "1.15.1";
1320
1321
 
1321
1322
  p.invalidate = function() {
1322
1323
  this._yoyo = (this.vars.yoyo === true);
@@ -1348,9 +1349,13 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1348
1349
  return this;
1349
1350
  };
1350
1351
 
1352
+ p.removePause = function(position) {
1353
+ return this.removeCallback(TimelineLite._internals.pauseCallback, position);
1354
+ };
1355
+
1351
1356
  p.tweenTo = function(position, vars) {
1352
1357
  vars = vars || {};
1353
- var copy = {ease:_easeNone, overwrite:(vars.delay ? 2 : 1), useFrames:this.usesFrames(), immediateRender:false},//note: set overwrite to 1 (true/all) by default unless there's a delay so that we avoid a racing situation that could happen if, for example, an onmousemove creates the same tweenTo() over and over again.
1358
+ var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false},
1354
1359
  duration, p, t;
1355
1360
  for (p in vars) {
1356
1361
  copy[p] = vars[p];
@@ -2351,7 +2356,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2351
2356
  p = CSSPlugin.prototype = new TweenPlugin("css");
2352
2357
 
2353
2358
  p.constructor = CSSPlugin;
2354
- CSSPlugin.version = "1.15.0";
2359
+ CSSPlugin.version = "1.15.1";
2355
2360
  CSSPlugin.API = 2;
2356
2361
  CSSPlugin.defaultTransformPerspective = 0;
2357
2362
  CSSPlugin.defaultSkewType = "compensated";
@@ -2530,12 +2535,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2530
2535
  var s = {},
2531
2536
  i, tr;
2532
2537
  if ((cs = cs || _getComputedStyle(t, null))) {
2533
- if ((i = cs.length)) {
2534
- while (--i > -1) {
2535
- s[cs[i].replace(_camelExp, _camelFunc)] = cs.getPropertyValue(cs[i]);
2536
- }
2537
- } else { //Opera behaves differently - cs.length is always 0, so we must do a for...in loop.
2538
- for (i in cs) {
2538
+ for (i in cs) {
2539
+ if (i.indexOf("Transform") === -1 || _transformProp === i) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here.
2539
2540
  s[i] = cs[i];
2540
2541
  }
2541
2542
  }
@@ -2621,7 +2622,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2621
2622
  x = (v.indexOf("left") !== -1) ? "0%" : (v.indexOf("right") !== -1) ? "100%" : a[0],
2622
2623
  y = (v.indexOf("top") !== -1) ? "0%" : (v.indexOf("bottom") !== -1) ? "100%" : a[1];
2623
2624
  if (y == null) {
2624
- y = "0";
2625
+ y = (x === "center") ? "50%" : "0";
2625
2626
  } else if (y === "center") {
2626
2627
  y = "50%";
2627
2628
  }
@@ -2669,7 +2670,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2669
2670
  */
2670
2671
  _parseAngle = function(v, d, p, directionalEnd) {
2671
2672
  var min = 0.000001,
2672
- cap, split, dif, result;
2673
+ cap, split, dif, result, isRelative;
2673
2674
  if (v == null) {
2674
2675
  result = d;
2675
2676
  } else if (typeof(v) === "number") {
@@ -2677,7 +2678,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2677
2678
  } else {
2678
2679
  cap = 360;
2679
2680
  split = v.split("_");
2680
- dif = Number(split[0].replace(_NaNExp, "")) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - ((v.charAt(1) === "=") ? 0 : d);
2681
+ isRelative = (v.charAt(1) === "=");
2682
+ dif = (isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(split[0].substr(2)) : parseFloat(split[0])) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - (isRelative ? 0 : d);
2681
2683
  if (split.length) {
2682
2684
  if (directionalEnd) {
2683
2685
  directionalEnd[p] = d + dif;
@@ -3405,7 +3407,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3405
3407
  width = rect.getBoundingClientRect().width;
3406
3408
  rect.style[_transformOriginProp] = "50% 50%";
3407
3409
  rect.style[_transformProp] = "scaleX(0.5)";
3408
- force = (width === rect.getBoundingClientRect().width);
3410
+ force = (width === rect.getBoundingClientRect().width && !(_isFirefox && _supports3D)); //note: Firefox fails the test even though it does support CSS transforms in 3D. Since we can't push 3D stuff into the transform attribute, we force Firefox to pass the test here (as long as it does truly support 3D).
3409
3411
  _docElement.removeChild(svg);
3410
3412
  }
3411
3413
  return force;
@@ -3433,8 +3435,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3433
3435
  invX = (tm.scaleX < 0), //in order to interpret things properly, we need to know if the user applied a negative scaleX previously so that we can adjust the rotation and skewX accordingly. Otherwise, if we always interpret a flipped matrix as affecting scaleY and the user only wants to tween the scaleX on multiple sequential tweens, it would keep the negative scaleY without that being the user's intent.
3434
3436
  min = 0.00002,
3435
3437
  rnd = 100000,
3436
- minAngle = 179.99,
3437
- minPI = minAngle * _DEG2RAD,
3438
3438
  zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0,
3439
3439
  defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0,
3440
3440
  isDefault, s, m, i, n, dec, scaleX, scaleY, rotation, skewX;
@@ -3465,10 +3465,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3465
3465
  m[i] = (dec = n - (n |= 0)) ? ((dec * rnd + (dec < 0 ? -0.5 : 0.5)) | 0) / rnd + n : n; //convert strings to Numbers and round to 5 decimal places to avoid issues with tiny numbers. Roughly 20x faster than Number.toFixed(). We also must make sure to round before dividing so that values like 0.9999999999 become 1 to avoid glitches in browser rendering and interpretation of flipped/rotated 3D matrices. And don't just multiply the number by rnd, floor it, and then divide by rnd because the bitwise operations max out at a 32-bit signed integer, thus it could get clipped at a relatively low value (like 22,000.00000 for example).
3466
3466
  }
3467
3467
  if (m.length === 16) {
3468
-
3469
3468
  //we'll only look at these position-related 6 variables first because if x/y/z all match, it's relatively safe to assume we don't need to re-parse everything which risks losing important rotational information (like rotationX:180 plus rotationY:180 would look the same as rotation:180 - there's no way to know for sure which direction was taken based solely on the matrix3d() values)
3470
- var a13 = m[8], a23 = m[9], a33 = m[10],
3471
- a14 = m[12], a24 = m[13], a34 = m[14];
3469
+ var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3],
3470
+ a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7],
3471
+ a13 = m[8], a23 = m[9], a33 = m[10],
3472
+ a14 = m[12], a24 = m[13], a34 = m[14],
3473
+ a43 = m[11],
3474
+ angle = Math.atan2(a32, a33),
3475
+ t1, t2, t3, t4, cos, sin;
3472
3476
 
3473
3477
  //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari
3474
3478
  if (tm.zOrigin) {
@@ -3477,26 +3481,24 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3477
3481
  a24 = a23*a34-m[13];
3478
3482
  a34 = a33*a34+tm.zOrigin-m[14];
3479
3483
  }
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;
3484
+ tm.rotationX = angle * _RAD2DEG;
3485
+ //rotationX
3488
3486
  if (angle) {
3489
3487
  cos = Math.cos(-angle);
3490
3488
  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;
3489
+ t1 = a12*cos+a13*sin;
3490
+ t2 = a22*cos+a23*sin;
3491
+ t3 = a32*cos+a33*sin;
3492
+ a13 = a12*-sin+a13*cos;
3493
+ a23 = a22*-sin+a23*cos;
3494
+ a33 = a32*-sin+a33*cos;
3495
+ a43 = a42*-sin+a43*cos;
3496
+ a12 = t1;
3497
+ a22 = t2;
3498
+ a32 = t3;
3496
3499
  }
3497
-
3498
3500
  //rotationY
3499
- angle = Math.atan2(a13, a11);
3501
+ angle = Math.atan2(a13, a33);
3500
3502
  tm.rotationY = angle * _RAD2DEG;
3501
3503
  if (angle) {
3502
3504
  cos = Math.cos(-angle);
@@ -3511,23 +3513,22 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3511
3513
  a21 = t2;
3512
3514
  a31 = t3;
3513
3515
  }
3514
-
3515
- //rotationX
3516
- angle = Math.atan2(a32, a33);
3517
- tm.rotationX = angle * _RAD2DEG;
3516
+ //rotationZ
3517
+ angle = Math.atan2(a21, a11);
3518
+ tm.rotation = angle * _RAD2DEG;
3518
3519
  if (angle) {
3519
3520
  cos = Math.cos(-angle);
3520
3521
  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;
3522
+ a11 = a11*cos+a12*sin;
3523
+ t2 = a21*cos+a22*sin;
3524
+ a22 = a21*-sin+a22*cos;
3525
+ a32 = a31*-sin+a32*cos;
3526
+ a21 = t2;
3527
+ }
3528
+
3529
+ if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here.
3530
+ tm.rotationX = tm.rotation = 0;
3531
+ tm.rotationY += 180;
3531
3532
  }
3532
3533
 
3533
3534
  tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd;
@@ -3579,7 +3580,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3579
3580
  }
3580
3581
  }
3581
3582
  }
3582
- //DEBUG: _log("parsed rotation: "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective);
3583
+ //DEBUG: _log("parsed rotation of " + t.getAttribute("id")+": "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective);
3583
3584
  if (rec) {
3584
3585
  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)
3585
3586
  }
@@ -3665,6 +3666,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3665
3666
  }
3666
3667
  },
3667
3668
 
3669
+ /* translates a super small decimal to a string WITHOUT scientific notation
3670
+ _safeDecimal = function(n) {
3671
+ var s = (n < 0 ? -n : n) + "",
3672
+ a = s.split("e-");
3673
+ return (n < 0 ? "-0." : "0.") + new Array(parseInt(a[1], 10) || 0).join("0") + a[0].split(".").join("");
3674
+ },
3675
+ */
3676
+
3668
3677
  _set3DTransformRatio = _internals.set3DTransformRatio = function(v) {
3669
3678
  var t = this.data, //refers to the element's _gsTransform object
3670
3679
  style = this.t.style,
@@ -3676,18 +3685,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3676
3685
  y = t.y,
3677
3686
  z = t.z,
3678
3687
  perspective = t.perspective,
3679
- a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43,
3680
- zOrigin, rnd, cos, sin, t1, t2, t3, t4, transform, comma;
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
3688
+ a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43,
3689
+ zOrigin, min, cos, sin, t1, t2, transform, comma, zero;
3690
+ if (v === 1 || v === 0 || !t.force3D) if (t.force3D !== true) 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
3682
3691
  _set2DTransformRatio.call(this, v);
3683
3692
  return;
3684
3693
  }
3685
3694
  if (_isFirefox) {
3686
- var n = 0.0001;
3687
- if (sx < n && sx > -n) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue.
3695
+ min = 0.0001;
3696
+ if (sx < min && sx > -min) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue.
3688
3697
  sx = sz = 0.00002;
3689
3698
  }
3690
- if (sy < n && sy > -n) {
3699
+ if (sy < min && sy > -min) {
3691
3700
  sy = sz = 0.00002;
3692
3701
  }
3693
3702
  if (perspective && !t.z && !t.rotationX && !t.rotationY) { //Firefox has a bug that causes elements to have an odd super-thin, broken/dotted black border on elements that have a perspective set but aren't utilizing 3D space (no rotationX, rotationY, or z).
@@ -3695,10 +3704,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3695
3704
  }
3696
3705
  }
3697
3706
  if (angle || t.skewX) {
3698
- cos = Math.cos(angle);
3699
- sin = Math.sin(angle);
3700
- a11 = cos;
3701
- a21 = sin;
3707
+ cos = a11 = Math.cos(angle);
3708
+ sin = a21 = Math.sin(angle);
3702
3709
  if (t.skewX) {
3703
3710
  angle -= t.skewX * _DEG2RAD;
3704
3711
  cos = Math.cos(angle);
@@ -3720,21 +3727,42 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3720
3727
  a11 = a22 = 1;
3721
3728
  a12 = a21 = 0;
3722
3729
  }
3730
+ // KEY INDEX AFFECTS
3731
+ // a11 0 rotation, rotationY, scaleX
3732
+ // a21 1 rotation, rotationY, scaleX
3733
+ // a31 2 rotationY, scaleX
3734
+ // a41 3 rotationY, scaleX
3735
+ // a12 4 rotation, skewX, rotationX, scaleY
3736
+ // a22 5 rotation, skewX, rotationX, scaleY
3737
+ // a32 6 rotationX, scaleY
3738
+ // a42 7 rotationX, scaleY
3739
+ // a13 8 rotationY, rotationX, scaleZ
3740
+ // a23 9 rotationY, rotationX, scaleZ
3741
+ // a33 10 rotationY, rotationX, scaleZ
3742
+ // a43 11 rotationY, rotationX, perspective, scaleZ
3743
+ // a14 12 x, zOrigin, svgOrigin
3744
+ // a24 13 y, zOrigin, svgOrigin
3745
+ // a34 14 z, zOrigin
3746
+ // a44 15
3747
+ // rotation: Math.atan2(a21, a11)
3748
+ // rotationY: Math.atan2(a13, a33) (or Math.atan2(a13, a11))
3749
+ // rotationX: Math.atan2(a32, a33)
3723
3750
  a33 = 1;
3724
- a13 = a14 = a23 = a24 = a31 = a32 = a34 = a41 = a42 = 0;
3751
+ a13 = a23 = a31 = a32 = a41 = a42 = 0;
3725
3752
  a43 = (perspective) ? -1 / perspective : 0;
3726
3753
  zOrigin = t.zOrigin;
3727
- rnd = 100000;
3754
+ min = 0.000001; //threshold below which browsers use scientific notation which won't work.
3728
3755
  comma = ",";
3756
+ zero = "0";
3729
3757
  angle = t.rotationY * _DEG2RAD;
3730
3758
  if (angle) {
3731
3759
  cos = Math.cos(angle);
3732
3760
  sin = Math.sin(angle);
3733
- a31 = a33*-sin;
3761
+ a31 = -sin;
3734
3762
  a41 = a43*-sin;
3735
3763
  a13 = a11*sin;
3736
3764
  a23 = a21*sin;
3737
- a33 *= cos;
3765
+ a33 = cos;
3738
3766
  a43 *= cos;
3739
3767
  a11 *= cos;
3740
3768
  a21 *= cos;
@@ -3745,16 +3773,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3745
3773
  sin = Math.sin(angle);
3746
3774
  t1 = a12*cos+a13*sin;
3747
3775
  t2 = a22*cos+a23*sin;
3748
- t3 = a32*cos+a33*sin;
3749
- t4 = a42*cos+a43*sin;
3776
+ a32 = a33*sin;
3777
+ a42 = a43*sin;
3750
3778
  a13 = a12*-sin+a13*cos;
3751
3779
  a23 = a22*-sin+a23*cos;
3752
- a33 = a32*-sin+a33*cos;
3753
- a43 = a42*-sin+a43*cos;
3780
+ a33 = a33*cos;
3781
+ a43 = a43*cos;
3754
3782
  a12 = t1;
3755
3783
  a22 = t2;
3756
- a32 = t3;
3757
- a42 = t4;
3758
3784
  }
3759
3785
  if (sz !== 1) {
3760
3786
  a13*=sz;
@@ -3774,31 +3800,41 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3774
3800
  a31*=sx;
3775
3801
  a41*=sx;
3776
3802
  }
3777
- if (zOrigin) {
3778
- a34 -= zOrigin;
3779
- a14 = a13*a34;
3780
- a24 = a23*a34;
3781
- a34 = a33*a34+zOrigin;
3782
- }
3783
- if (t.svg) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually
3784
- a14 += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12);
3785
- a24 += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22);
3803
+
3804
+ if (zOrigin || t.svg) {
3805
+ if (zOrigin) {
3806
+ x += a13*-zOrigin;
3807
+ y += a23*-zOrigin;
3808
+ z += a33*-zOrigin+zOrigin;
3809
+ }
3810
+ if (t.svg) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually
3811
+ x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12);
3812
+ y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22);
3813
+ }
3814
+ if (x < min && x > -min) {
3815
+ x = zero;
3816
+ }
3817
+ if (y < min && y > -min) {
3818
+ y = zero;
3819
+ }
3820
+ if (z < min && z > -min) {
3821
+ z = 0; //don't use string because we calculate perspective later and need the number.
3822
+ }
3786
3823
  }
3787
- //we round the x, y, and z slightly differently to allow even larger values.
3788
- a14 = (t1 = (a14 += x) - (a14 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a14 : a14;
3789
- a24 = (t1 = (a24 += y) - (a24 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a24 : a24;
3790
- a34 = (t1 = (a34 += z) - (a34 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a34 : a34;
3791
3824
 
3792
3825
  //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
3826
  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;
3827
+ transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31);
3828
+ transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22);
3829
+ if (t.rotationX || t.rotationY) { //performance optimization (often there's no rotationX or rotationY, so we can skip these calculations)
3830
+ transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13);
3831
+ transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma;
3832
+ } else {
3833
+ transform += ",0,0,0,0,1,0,";
3834
+ }
3835
+ transform += x + comma + y + comma + z + comma + (perspective ? (1 + (-z / perspective)) : 1) + ")";
3800
3836
 
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(",") + ")";
3837
+ style[_transformProp] = transform;
3802
3838
  },
3803
3839
 
3804
3840
  _set2DTransformRatio = _internals.set2DTransformRatio = function(v) {
@@ -3940,7 +3976,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3940
3976
 
3941
3977
  orig = v.transformOrigin;
3942
3978
  if (orig && m1.svg) {
3943
- _parseSVGOrigin(t, orig, m2);
3979
+ _parseSVGOrigin(t, _parsePosition(orig), m2);
3944
3980
  pt = new CSSPropTween(m1, "xOrigin", m1.xOrigin, m2.xOrigin - m1.xOrigin, pt, -1, "transformOrigin");
3945
3981
  pt.b = m1.xOrigin;
3946
3982
  pt.e = pt.xs0 = m2.xOrigin;
@@ -4430,7 +4466,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4430
4466
  esfx = es.replace(_suffixExp, "");
4431
4467
  } else {
4432
4468
  en = parseFloat(es);
4433
- esfx = isStr ? es.substr((en + "").length) || "" : "";
4469
+ esfx = isStr ? es.replace(_suffixExp, "") : "";
4434
4470
  }
4435
4471
 
4436
4472
  if (esfx === "") {
@@ -6188,7 +6224,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6188
6224
  p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
6189
6225
  p._notifyPluginsOfEnabled = p._lazy = false;
6190
6226
 
6191
- TweenLite.version = "1.15.0";
6227
+ TweenLite.version = "1.15.1";
6192
6228
  TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
6193
6229
  TweenLite.defaultOverwrite = "auto";
6194
6230
  TweenLite.ticker = _ticker;