greensock-rails 1.17.0.0 → 1.18.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * VERSION: beta 1.4.1
3
- * DATE: 2014-07-17
4
- * UPDATES AND DOCS AT: http://www.greensock.com
2
+ * VERSION: 1.5
3
+ * DATE: 2015-08-28
4
+ * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
7
7
  * This work is subject to the terms at http://greensock.com/standard-license or for
@@ -16,7 +16,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
16
16
 
17
17
  var RoundPropsPlugin = _gsScope._gsDefine.plugin({
18
18
  propName: "roundProps",
19
- version: "1.4.1",
19
+ version: "1.5",
20
20
  priority: -1,
21
21
  API: 2,
22
22
 
@@ -27,11 +27,19 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
27
27
  }
28
28
 
29
29
  }),
30
+ _roundLinkedList = function(node) {
31
+ while (node) {
32
+ if (!node.f && !node.blob) {
33
+ node.r = 1;
34
+ }
35
+ node = node._next;
36
+ }
37
+ },
30
38
  p = RoundPropsPlugin.prototype;
31
39
 
32
40
  p._onInitAllProps = function() {
33
41
  var tween = this._tween,
34
- rp = (tween.vars.roundProps instanceof Array) ? tween.vars.roundProps : tween.vars.roundProps.split(","),
42
+ rp = (tween.vars.roundProps.join) ? tween.vars.roundProps : tween.vars.roundProps.split(","),
35
43
  i = rp.length,
36
44
  lookup = {},
37
45
  rpt = tween._propLookup.roundProps,
@@ -48,18 +56,22 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
48
56
  if (pt.pg) {
49
57
  pt.t._roundProps(lookup, true);
50
58
  } else if (pt.n === prop) {
51
- this._add(pt.t, prop, pt.s, pt.c);
52
- //remove from linked list
53
- if (next) {
54
- next._prev = pt._prev;
55
- }
56
- if (pt._prev) {
57
- pt._prev._next = next;
58
- } else if (tween._firstPT === pt) {
59
- tween._firstPT = next;
59
+ if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values)
60
+ _roundLinkedList(pt.t._firstPT);
61
+ } else {
62
+ this._add(pt.t, prop, pt.s, pt.c);
63
+ //remove from linked list
64
+ if (next) {
65
+ next._prev = pt._prev;
66
+ }
67
+ if (pt._prev) {
68
+ pt._prev._next = next;
69
+ } else if (tween._firstPT === pt) {
70
+ tween._firstPT = next;
71
+ }
72
+ pt._next = pt._prev = null;
73
+ tween._propLookup[prop] = rpt;
60
74
  }
61
- pt._next = pt._prev = null;
62
- tween._propLookup[prop] = rpt;
63
75
  }
64
76
  pt = next;
65
77
  }
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 0.14.0
3
- * DATE: 2015-05-26
2
+ * VERSION: 0.14.1
3
+ * DATE: 2015-09-05
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * Requires TweenLite and CSSPlugin version 1.17.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://greensock.com/club/).
@@ -497,9 +497,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
497
497
  cache.computedStyle = cs;
498
498
  if (isSVGRoot) {
499
499
  if (!(cache.offsetParent = e.offsetParent)) { //some browsers don't report offsetParent for SVG elements.
500
- e.parentNode.insertBefore(_tempDiv, e);
501
- cache.offsetParent = _tempDiv.offsetParent;
502
- e.parentNode.removeChild(_tempDiv);
500
+ curSVG = e.parentNode || _docElement;
501
+ curSVG.insertBefore(_tempDiv, e);
502
+ cache.offsetParent = _tempDiv.offsetParent || _docElement; //in some cases, Firefox still reports offsetParent as null.
503
+ curSVG.removeChild(_tempDiv);
503
504
  }
504
505
  } else if (isSVG) {
505
506
  curSVG = e.parentNode;
@@ -737,7 +738,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
737
738
 
738
739
 
739
740
  _isArrayLike = function(e) {
740
- return (e.length && e[0] && ((e[0].nodeType && e[0].style && !e.nodeType) || (e[0].length && e[0][0]))) ? true : false; //could be an array of jQuery objects too, so accommodate that.
741
+ return (e && e.length && e[0] && ((e[0].nodeType && e[0].style && !e.nodeType) || (e[0].length && e[0][0]))) ? true : false; //could be an array of jQuery objects too, so accommodate that.
741
742
  },
742
743
 
743
744
  _flattenArray = function(a) {
@@ -751,7 +752,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
751
752
  for (j = 0; j < e.length; j++) {
752
753
  result.push(e[j]);
753
754
  }
754
- } else {
755
+ } else if (e && e.length !== 0) {
755
756
  result.push(e);
756
757
  }
757
758
  }
@@ -1125,7 +1126,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1125
1126
  dragEndTime = 0,
1126
1127
  checkAutoScrollBounds = false,
1127
1128
  isClickable = vars.clickableTest || _isClickable,
1128
- enabled, scrollProxy, startPointerX, startPointerY, startElementX, startElementY, hasBounds, hasDragCallback, maxX, minX, maxY, minY, tempVars, cssVars, touch, touchID, rotationOrigin, dirty, old, snapX, snapY, isClicking, touchEventTarget, matrix, interrupted, clickTime, startScrollTop, startScrollLeft, applyObj, allowNativeTouchScrolling, touchDragAxis,
1129
+ enabled, scrollProxy, startPointerX, startPointerY, startElementX, startElementY, hasBounds, hasDragCallback, maxX, minX, maxY, minY, tempVars, cssVars, touch, touchID, rotationOrigin, dirty, old, snapX, snapY, isClicking, touchEventTarget, matrix, interrupted, clickTime, startScrollTop, startScrollLeft, applyObj, allowNativeTouchScrolling, touchDragAxis, isDispatching,
1129
1130
 
1130
1131
  //this method gets called on every tick of TweenLite.ticker which allows us to synchronize the renders to the core engine (which is typically synchronized with the display refresh via requestAnimationFrame). This is an optimization - it's better than applying the values inside the "mousemove" or "touchmove" event handler which may get called many times inbetween refreshes.
1131
1132
  render = function(suppressEvents) {
@@ -1214,8 +1215,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1214
1215
  }
1215
1216
  }
1216
1217
  }
1217
- if (hasDragCallback && !suppressEvents) {
1218
+ if (hasDragCallback && !suppressEvents && !isDispatching) {
1219
+ isDispatching = true; //in case onDrag has an update() call (avoid endless loop)
1218
1220
  _dispatchEvent(self, "drag", "onDrag");
1221
+ isDispatching = false;
1219
1222
  }
1220
1223
  }
1221
1224
  dirty = false;
@@ -1223,7 +1226,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1223
1226
 
1224
1227
  //copies the x/y from the element (whether that be transforms, top/left, or ScrollProxy's top/left) to the Draggable's x and y (and rotation if necessary) properties so that they reflect reality and it also (optionally) applies any snapping necessary. This is used by the ThrowPropsPlugin tween in an onUpdate to ensure things are synced and snapped.
1225
1228
  syncXY = function(skipOnUpdate, skipSnap) {
1226
- var snappedValue;
1229
+ var x = self.x,
1230
+ y = self.y,
1231
+ snappedValue;
1227
1232
  if (!target._gsTransform && (xyMode || rotationMode)) { //just in case the _gsTransform got wiped, like if the user called clearProps on the transform or something (very rare), doing an x tween forces a re-parsing of the transforms and population of the _gsTransform.
1228
1233
  TweenLite.set(target, {x:"+=0", overwrite:false});
1229
1234
  }
@@ -1247,19 +1252,17 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1247
1252
  if (rotationMode) {
1248
1253
  self.rotation = snappedValue;
1249
1254
  }
1250
- dirty = true;
1251
1255
  }
1252
1256
  }
1253
1257
  if (snapY) {
1254
1258
  snappedValue = snapY(self.y);
1255
1259
  if (snappedValue !== self.y) {
1256
1260
  self.y = snappedValue;
1257
- dirty = true;
1258
1261
  }
1259
1262
  }
1260
- if (dirty) {
1261
- render(true);
1262
- }
1263
+ }
1264
+ if (x !== self.x || y !== self.y) {
1265
+ render(true);
1263
1266
  }
1264
1267
  if (!skipOnUpdate) {
1265
1268
  _dispatchEvent(self, "throwupdate", "onThrowUpdate");
@@ -1473,7 +1476,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1473
1476
  interrupted = isTweening();
1474
1477
  self.pointerEvent = e;
1475
1478
  if (_touchEventLookup[e.type]) { //note: on iOS, BOTH touchmove and mousemove are dispatched, but the mousemove has pageY and pageX of 0 which would mess up the calculations and needlessly hurt performance.
1476
- touchEventTarget = (e.type.indexOf("touch") !== -1) ? e.currentTarget : _doc; //pointer-based touches (for Microsoft browsers) don't remain locked to the original target like other browsers, so we must use the document instead. The event type would be "MSPointerDown" or "pointerdown".
1479
+ touchEventTarget = (e.type.indexOf("touch") !== -1) ? (e.currentTarget || e.target) : _doc; //pointer-based touches (for Microsoft browsers) don't remain locked to the original target like other browsers, so we must use the document instead. The event type would be "MSPointerDown" or "pointerdown".
1477
1480
  _addListener(touchEventTarget, "touchend", onRelease);
1478
1481
  _addListener(touchEventTarget, "touchmove", onMove);
1479
1482
  _addListener(touchEventTarget, "touchcancel", onRelease);
@@ -1924,14 +1927,14 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1924
1927
  return self;
1925
1928
  };
1926
1929
 
1927
- this.update = function(applyBounds) {
1930
+ this.update = function(applyBounds, ignoreExternalChanges) {
1928
1931
  var x = self.x,
1929
1932
  y = self.y;
1930
1933
  updateMatrix();
1931
1934
  if (applyBounds) {
1932
1935
  self.applyBounds();
1933
1936
  } else {
1934
- if (dirty) {
1937
+ if (dirty && ignoreExternalChanges) {
1935
1938
  render();
1936
1939
  }
1937
1940
  syncXY(true);
@@ -1979,12 +1982,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1979
1982
  tween:{},
1980
1983
  setRatio:(_isOldIE ? function() { TweenLite.set(target, tempVars); } : CSSPlugin._internals.setTransformRatio || CSSPlugin._internals.set3DTransformRatio)
1981
1984
  };
1982
- this.update(true);
1985
+ self.update(true);
1983
1986
  return self;
1984
1987
  };
1985
1988
 
1986
1989
  this.disable = function(type) {
1987
- var dragging = this.isDragging,
1990
+ var dragging = self.isDragging,
1988
1991
  i, trigger;
1989
1992
  if (!rotationMode) {
1990
1993
  i = triggers.length;
@@ -2020,15 +2023,15 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2020
2023
  scrollProxy.disable();
2021
2024
  }
2022
2025
  _removeFromRenderQueue(render);
2023
- this.isDragging = this.isPressed = isClicking = false;
2026
+ self.isDragging = self.isPressed = isClicking = false;
2024
2027
  if (dragging) {
2025
- _dispatchEvent(this, "dragend", "onDragEnd");
2028
+ _dispatchEvent(self, "dragend", "onDragEnd");
2026
2029
  }
2027
2030
  return self;
2028
2031
  };
2029
2032
 
2030
2033
  this.enabled = function(value, type) {
2031
- return arguments.length ? (value ? this.enable(type) : this.disable(type)) : enabled;
2034
+ return arguments.length ? (value ? self.enable(type) : self.disable(type)) : enabled;
2032
2035
  };
2033
2036
 
2034
2037
  this.kill = function() {
@@ -2080,7 +2083,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2080
2083
  p.constructor = Draggable;
2081
2084
  p.pointerX = p.pointerY = 0;
2082
2085
  p.isDragging = p.isPressed = false;
2083
- Draggable.version = "0.14.0";
2086
+ Draggable.version = "0.14.1";
2084
2087
  Draggable.zIndex = 1000;
2085
2088
 
2086
2089
  _addListener(_doc, "touchcancel", function() {
@@ -2099,7 +2102,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2099
2102
  if (typeof(targets) === "string") {
2100
2103
  targets = TweenLite.selector(targets);
2101
2104
  }
2102
- var a = _isArrayLike(targets) ? _flattenArray(targets) : [targets],
2105
+ var a = (!targets || targets.length === 0) ? [] : _isArrayLike(targets) ? _flattenArray(targets) : [targets],
2103
2106
  i = a.length;
2104
2107
  while (--i > -1) {
2105
2108
  a[i] = new Draggable(a[i], vars);
@@ -2116,6 +2119,19 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2116
2119
  };
2117
2120
 
2118
2121
  var _tempRect = {}, //reuse to reduce garbage collection tasks
2122
+ _oldIERect = function(e) { //IE8 doesn't support getBoundingClientRect(), so we use this as a backup.
2123
+ var top = 0,
2124
+ left = 0,
2125
+ width = e.offsetWidth,
2126
+ height = e.offsetHeight;
2127
+ e = _unwrapElement(e);
2128
+ while(e) {
2129
+ top += e.offsetTop;
2130
+ left += e.offsetLeft;
2131
+ e = e.offsetParent;
2132
+ }
2133
+ return {top: top, left: left, width: width, height: height};
2134
+ },
2119
2135
  _parseRect = function(e, undefined) { //accepts a DOM element, a mouse event, or a rectangle object and returns the corresponding rectangle with left, right, width, height, top, and bottom properties
2120
2136
  if (e === window) {
2121
2137
  _tempRect.left = _tempRect.top = 0;
@@ -2123,7 +2139,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2123
2139
  _tempRect.height = _tempRect.bottom = ((e.innerHeight || 0) - 20 < _docElement.clientHeight) ? _docElement.clientHeight : e.innerHeight || _doc.body.clientHeight || 0;
2124
2140
  return _tempRect;
2125
2141
  }
2126
- var r = (e.pageX !== undefined) ? {left:e.pageX, top:e.pageY, right:e.pageX + 1, bottom:e.pageY + 1} : (!e.nodeType && e.left !== undefined && e.top !== undefined) ? e : _unwrapElement(e).getBoundingClientRect();
2142
+ var r = (e.pageX !== undefined) ? {left:e.pageX - _getDocScrollLeft(), top:e.pageY - _getDocScrollTop(), right:e.pageX - _getDocScrollLeft() + 1, bottom:e.pageY - _getDocScrollTop() + 1} : (!e.nodeType && e.left !== undefined && e.top !== undefined) ? e : _isOldIE ? _oldIERect(e) : _unwrapElement(e).getBoundingClientRect();
2127
2143
  if (r.right === undefined && r.width !== undefined) {
2128
2144
  r.right = r.left + r.width;
2129
2145
  r.bottom = r.top + r.height;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greensock-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0.0
4
+ version: 1.18.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Pataki, Greensock Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-01 00:00:00.000000000 Z
11
+ date: 2015-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.4.5
94
+ rubygems_version: 2.4.5.1
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Use GSAP with Rails 3.1 or later