greensock-rails 1.19.1.2 → 1.20.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: beta 1.5.0
3
- * DATE: 2017-01-17
2
+ * VERSION: beta 1.5.2
3
+ * DATE: 2017-06-19
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
@@ -118,8 +118,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
118
118
  _formatColors = function(s, toHSL) {
119
119
  var colors = (s + "").match(_colorExp) || [],
120
120
  charIndex = 0,
121
- parsed = colors.length ? "" : s,
121
+ parsed = "",
122
122
  i, color, temp;
123
+ if (!colors.length) {
124
+ return s;
125
+ }
123
126
  for (i = 0; i < colors.length; i++) {
124
127
  color = colors[i];
125
128
  temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex);
@@ -132,12 +135,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
132
135
  }
133
136
  return parsed + s.substr(charIndex);
134
137
  }, p, _colorStringFilter,
135
- TweenLite = _gsScope.TweenLite,
138
+ TweenLite = (_gsScope.GreenSockGlobals || _gsScope).TweenLite,
136
139
  _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b", //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.
137
140
 
138
141
  ColorPropsPlugin = _gsScope._gsDefine.plugin({
139
142
  propName: "colorProps",
140
- version: "1.5.0",
143
+ version: "1.5.2",
141
144
  priority: -1,
142
145
  API: 2,
143
146
  global: true,
@@ -189,7 +192,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
189
192
  }
190
193
  _colorExp = new RegExp(_colorExp+")", "gi");
191
194
  ColorPropsPlugin.colorStringFilter = _colorStringFilter = function(a) {
192
- var combined = a[0] + a[1],
195
+ var combined = a[0] + " " + a[1],
193
196
  toHSL;
194
197
  _colorExp.lastIndex = 0;
195
198
  if (_colorExp.test(combined)) {
@@ -233,10 +236,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
233
236
  var getGlobal = function() {
234
237
  return (_gsScope.GreenSockGlobals || _gsScope)[name];
235
238
  };
236
- if (typeof(define) === "function" && define.amd) { //AMD
237
- define(["TweenLite"], getGlobal);
238
- } else if (typeof(module) !== "undefined" && module.exports) { //node
239
+ if (typeof(module) !== "undefined" && module.exports) { //node
239
240
  require("../TweenLite.js");
240
241
  module.exports = getGlobal();
242
+ } else if (typeof(define) === "function" && define.amd) { //AMD
243
+ define(["TweenLite"], getGlobal);
241
244
  }
242
245
  }("ColorPropsPlugin"));
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 0.3.0
3
- * DATE: 2017-01-17
2
+ * VERSION: 0.3.1
3
+ * DATE: 2017-06-19
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
@@ -16,7 +16,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
16
16
 
17
17
  _gsScope._gsDefine.plugin({
18
18
  propName: "directionalRotation",
19
- version: "0.3.0",
19
+ version: "0.3.1",
20
20
  API: 2,
21
21
 
22
22
  //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
@@ -90,10 +90,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
90
90
  var getGlobal = function() {
91
91
  return (_gsScope.GreenSockGlobals || _gsScope)[name];
92
92
  };
93
- if (typeof(define) === "function" && define.amd) { //AMD
94
- define(["TweenLite"], getGlobal);
95
- } else if (typeof(module) !== "undefined" && module.exports) { //node
93
+ if (typeof(module) !== "undefined" && module.exports) { //node
96
94
  require("../TweenLite.js");
97
95
  module.exports = getGlobal();
96
+ } else if (typeof(define) === "function" && define.amd) { //AMD
97
+ define(["TweenLite"], getGlobal);
98
98
  }
99
99
  }("DirectionalRotationPlugin"));
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 0.2.1
3
- * DATE: 2017-01-17
2
+ * VERSION: 0.2.2
3
+ * DATE: 2017-06-19
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
@@ -229,7 +229,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
229
229
  _gsScope._gsDefine.plugin({
230
230
  propName: "easel",
231
231
  priority: -1,
232
- version: "0.2.1",
232
+ version: "0.2.2",
233
233
  API: 2,
234
234
 
235
235
  //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
@@ -315,10 +315,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
315
315
  var getGlobal = function() {
316
316
  return (_gsScope.GreenSockGlobals || _gsScope)[name];
317
317
  };
318
- if (typeof(define) === "function" && define.amd) { //AMD
319
- define(["TweenLite"], getGlobal);
320
- } else if (typeof(module) !== "undefined" && module.exports) { //node
318
+ if (typeof(module) !== "undefined" && module.exports) { //node
321
319
  require("../TweenLite.js");
322
320
  module.exports = getGlobal();
321
+ } else if (typeof(define) === "function" && define.amd) { //AMD
322
+ define(["TweenLite"], getGlobal);
323
323
  }
324
324
  }("EaselPlugin"));
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 0.0.2
3
- * DATE: 2017-01-17
2
+ * VERSION: 0.0.3
3
+ * DATE: 2017-06-19
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
@@ -92,7 +92,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
92
92
 
93
93
  ModifiersPlugin = _gsScope._gsDefine.plugin({
94
94
  propName: "modifiers",
95
- version: "0.0.2",
95
+ version: "0.0.3",
96
96
  API: 2,
97
97
 
98
98
  //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
@@ -163,10 +163,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
163
163
  var getGlobal = function() {
164
164
  return (_gsScope.GreenSockGlobals || _gsScope)[name];
165
165
  };
166
- if (typeof(define) === "function" && define.amd) { //AMD
167
- define(["TweenLite"], getGlobal);
168
- } else if (typeof(module) !== "undefined" && module.exports) { //node
166
+ if (typeof(module) !== "undefined" && module.exports) { //node
169
167
  require("../TweenLite.js");
170
168
  module.exports = getGlobal();
169
+ } else if (typeof(define) === "function" && define.amd) { //AMD
170
+ define(["TweenLite"], getGlobal);
171
171
  }
172
172
  }("ModifiersPlugin"));
@@ -0,0 +1,442 @@
1
+ /*!
2
+ * VERSION: 0.1.0
3
+ * DATE: 2017-06-28
4
+ * UPDATES AND DOCS AT: http://greensock.com
5
+ *
6
+ * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
7
+ * PixiPlugin is subject to the terms at http://greensock.com/standard-license or for
8
+ * Club GreenSock members, the software agreement that was issued with your membership.
9
+ *
10
+ * @author: Jack Doyle, jack@greensock.com
11
+ */
12
+ var _gsScope = (typeof module !== "undefined" && module.exports && typeof global !== "undefined") ? global : this || window;
13
+ (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push(function () {
14
+ "use strict";
15
+
16
+ var _numExp = /(\d|\.)+/g,
17
+ _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
18
+ _colorLookup = {aqua:[0,255,255],
19
+ lime:[0,255,0],
20
+ silver:[192,192,192],
21
+ black:[0,0,0],
22
+ maroon:[128,0,0],
23
+ teal:[0,128,128],
24
+ blue:[0,0,255],
25
+ navy:[0,0,128],
26
+ white:[255,255,255],
27
+ fuchsia:[255,0,255],
28
+ olive:[128,128,0],
29
+ yellow:[255,255,0],
30
+ orange:[255,165,0],
31
+ gray:[128,128,128],
32
+ purple:[128,0,128],
33
+ green:[0,128,0],
34
+ red:[255,0,0],
35
+ pink:[255,192,203],
36
+ cyan:[0,255,255],
37
+ transparent:[255,255,255,0]},
38
+ _hue = function(h, m1, m2) {
39
+ h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h;
40
+ return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0;
41
+ },
42
+ /**
43
+ * @private Parses a color (like #9F0, #FF9900, rgb(255,51,153) or hsl(108, 50%, 10%)) into an array with 3 elements for red, green, and blue or if "format" parameter is "hsl", it will populate the array with hue, saturation, and lightness values. Or if "format" is "number", it'll return a number like 0xFF0000 instead of an array. If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases it will be populated with numbers).
44
+ * @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc.
45
+ * @param {(string)} format If "hsl", an hsl() or hsla() value will be returned instead of rgb() or rgba(). Or if "number", then a numeric value will be returned, like 0xFF0000. Default is rgb.
46
+ * @return {(array|number)} An array containing red, green, and blue (and optionally alpha) in that order, or if the format parameter was "hsl", the array will contain hue, saturation and lightness (and optionally alpha) in that order. Or if "format" is defined as "number", it'll return a number like 0xFF0000. Always numbers unless there's a relative prefix found in an hsl() or hsla() string and "format" is "hsl".
47
+ */
48
+ _parseColor = function(v, format) {
49
+ var toHSL = (format === "hsl"),
50
+ a, r, g, b, h, s, l, max, min, d, wasHSL;
51
+ if (!v) {
52
+ a = _colorLookup.black;
53
+ } else if (typeof(v) === "number") {
54
+ a = [v >> 16, (v >> 8) & 255, v & 255];
55
+ } else {
56
+ if (v.charAt(v.length - 1) === ",") { //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.
57
+ v = v.substr(0, v.length - 1);
58
+ }
59
+ if (_colorLookup[v]) {
60
+ a = _colorLookup[v];
61
+ } else if (v.charAt(0) === "#") {
62
+ if (v.length === 4) { //for shorthand like #9F0
63
+ r = v.charAt(1);
64
+ g = v.charAt(2);
65
+ b = v.charAt(3);
66
+ v = "#" + r + r + g + g + b + b;
67
+ }
68
+ v = parseInt(v.substr(1), 16);
69
+ a = [v >> 16, (v >> 8) & 255, v & 255];
70
+ } else if (v.substr(0, 3) === "hsl") {
71
+ a = wasHSL = v.match(_numExp);
72
+ if (!toHSL) {
73
+ h = (Number(a[0]) % 360) / 360;
74
+ s = Number(a[1]) / 100;
75
+ l = Number(a[2]) / 100;
76
+ g = (l <= 0.5) ? l * (s + 1) : l + s - l * s;
77
+ r = l * 2 - g;
78
+ if (a.length > 3) {
79
+ a[3] = Number(v[3]);
80
+ }
81
+ a[0] = _hue(h + 1 / 3, r, g);
82
+ a[1] = _hue(h, r, g);
83
+ a[2] = _hue(h - 1 / 3, r, g);
84
+ } else if (v.indexOf("=") !== -1) { //if relative values are found, just return the raw strings with the relative prefixes in place.
85
+ return v.match(_relNumExp);
86
+ }
87
+ } else {
88
+ a = v.match(_numExp) || _colorLookup.transparent;
89
+ }
90
+ a[0] = Number(a[0]);
91
+ a[1] = Number(a[1]);
92
+ a[2] = Number(a[2]);
93
+ if (a.length > 3) {
94
+ a[3] = Number(a[3]);
95
+ }
96
+ }
97
+ if (toHSL && !wasHSL) {
98
+ r = a[0] / 255;
99
+ g = a[1] / 255;
100
+ b = a[2] / 255;
101
+ max = Math.max(r, g, b);
102
+ min = Math.min(r, g, b);
103
+ l = (max + min) / 2;
104
+ if (max === min) {
105
+ h = s = 0;
106
+ } else {
107
+ d = max - min;
108
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
109
+ h = (max === r) ? (g - b) / d + (g < b ? 6 : 0) : (max === g) ? (b - r) / d + 2 : (r - g) / d + 4;
110
+ h *= 60;
111
+ }
112
+ a[0] = (h + 0.5) | 0;
113
+ a[1] = (s * 100 + 0.5) | 0;
114
+ a[2] = (l * 100 + 0.5) | 0;
115
+ }
116
+ return (format === "number") ? (a[0] << 16 | a[1] << 8 | a[2]) : a;
117
+ },
118
+ _formatColors = function(s, toHSL) {
119
+ var colors = (s + "").match(_colorExp) || [],
120
+ charIndex = 0,
121
+ parsed = "",
122
+ i, color, temp;
123
+ if (!colors.length) {
124
+ return s;
125
+ }
126
+ for (i = 0; i < colors.length; i++) {
127
+ color = colors[i];
128
+ temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex);
129
+ charIndex += temp.length + color.length;
130
+ color = _parseColor(color, (toHSL ? "hsl" : "rgb"));
131
+ if (color.length === 3) {
132
+ color.push(1);
133
+ }
134
+ parsed += temp + (toHSL ? "hsla(" + color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : "rgba(" + color.join(",")) + ")";
135
+ }
136
+ return parsed + s.substr(charIndex);
137
+ }, _colorStringFilter,
138
+ TweenLite = (_gsScope.GreenSockGlobals || _gsScope).TweenLite,
139
+ _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b", //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.
140
+
141
+ _idMatrix = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],
142
+ _lumR = 0.212671,
143
+ _lumG = 0.715160,
144
+ _lumB = 0.072169,
145
+
146
+ _applyMatrix = function(m, m2) {
147
+ if (!(m instanceof Array) || !(m2 instanceof Array)) {
148
+ return m2;
149
+ }
150
+ var temp = [],
151
+ i = 0,
152
+ z = 0,
153
+ y, x;
154
+ for (y = 0; y < 4; y++) {
155
+ for (x = 0; x < 5; x++) {
156
+ z = (x === 4) ? m[i + 4] : 0;
157
+ temp[i + x] = m[i] * m2[x] + m[i+1] * m2[x + 5] + m[i+2] * m2[x + 10] + m[i+3] * m2[x + 15] + z;
158
+ }
159
+ i += 5;
160
+ }
161
+ return temp;
162
+ },
163
+
164
+ _setSaturation = function(m, n) {
165
+ if (isNaN(n)) {
166
+ return m;
167
+ }
168
+ var inv = 1 - n,
169
+ r = inv * _lumR,
170
+ g = inv * _lumG,
171
+ b = inv * _lumB;
172
+ return _applyMatrix([r + n, g, b, 0, 0, r, g + n, b, 0, 0, r, g, b + n, 0, 0, 0, 0, 0, 1, 0], m);
173
+ },
174
+
175
+ _colorize = function(m, color, amount) {
176
+ if (isNaN(amount)) {
177
+ amount = 1;
178
+ }
179
+ var c = _parseColor(color),
180
+ r = c[0] / 255,
181
+ g = c[1] / 255,
182
+ b = c[2] / 255,
183
+ inv = 1 - amount;
184
+ return _applyMatrix([inv + amount * r * _lumR, amount * r * _lumG, amount * r * _lumB, 0, 0, amount * g * _lumR, inv + amount * g * _lumG, amount * g * _lumB, 0, 0, amount * b * _lumR, amount * b * _lumG, inv + amount * b * _lumB, 0, 0, 0, 0, 0, 1, 0], m);
185
+ },
186
+
187
+ _setHue = function(m, n) {
188
+ if (isNaN(n)) {
189
+ return m;
190
+ }
191
+ n *= Math.PI / 180;
192
+ var c = Math.cos(n),
193
+ s = Math.sin(n);
194
+ return _applyMatrix([(_lumR + (c * (1 - _lumR))) + (s * (-_lumR)), (_lumG + (c * (-_lumG))) + (s * (-_lumG)), (_lumB + (c * (-_lumB))) + (s * (1 - _lumB)), 0, 0, (_lumR + (c * (-_lumR))) + (s * 0.143), (_lumG + (c * (1 - _lumG))) + (s * 0.14), (_lumB + (c * (-_lumB))) + (s * -0.283), 0, 0, (_lumR + (c * (-_lumR))) + (s * (-(1 - _lumR))), (_lumG + (c * (-_lumG))) + (s * _lumG), (_lumB + (c * (1 - _lumB))) + (s * _lumB), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], m);
195
+ },
196
+
197
+ _setContrast = function(m, n) {
198
+ if (isNaN(n)) {
199
+ return m;
200
+ }
201
+ return _applyMatrix([n,0,0,0,0.5 * (1 - n), 0,n,0,0,0.5 * (1 - n), 0,0,n,0,0.5 * (1 - n), 0,0,0,1,0], m);
202
+ },
203
+
204
+ _getFilter = function(t, type) {
205
+ var filterClass = _gsScope.PIXI.filters[type],
206
+ filters = t.filters || [],
207
+ i = filters.length,
208
+ filter;
209
+ if (!filterClass) {
210
+ throw("PixiPlugin error: " + type + " isn't present.");
211
+ }
212
+ while (--i > -1) {
213
+ if (filters[i] instanceof filterClass) {
214
+ return filters[i];
215
+ }
216
+ }
217
+ filter = new filterClass();
218
+ if (type === "BlurFilter") {
219
+ filter.blur = 0;
220
+ }
221
+ filters.push(filter);
222
+ t.filters = filters;
223
+ return filter;
224
+ },
225
+
226
+ _addColorMatrixFilterCacheTween = function(p, pg, cache, vars) { //we cache the ColorMatrixFilter components in a _gsColorMatrixFilter object attached to the target object so that it's easy to grab the current value at any time.
227
+ pg._addTween(cache, p, cache[p], vars[p], p);
228
+ pg._overwriteProps.push(p);
229
+ },
230
+
231
+ _applyBrightnessToMatrix = function(brightness, matrix) {
232
+ var temp = new _gsScope.PIXI.filters.ColorMatrixFilter();
233
+ temp.matrix = matrix;
234
+ temp.brightness(brightness, true);
235
+ return temp.matrix;
236
+ },
237
+
238
+ _parseColorMatrixFilter = function(t, v, pg) {
239
+ var filter = _getFilter(t, "ColorMatrixFilter"),
240
+ cache = t._gsColorMatrixFilter = t._gsColorMatrixFilter || {contrast:1, saturation:1, colorizeAmount:0, colorize:"rgb(255,255,255)", hue:0, brightness:1},
241
+ clear = v.clearCMF || (("colorMatrixFilter" in v) && !v.colorMatrixFilter), //users should be able to clear/normalize a ColorMatrixFilter by setting pixi:{colorMatrixFilter:null}
242
+ i, matrix, startMatrix;
243
+ startMatrix = filter.matrix;
244
+ if (v.matrix && v.matrix.length === startMatrix.length) {
245
+ matrix = v.matrix;
246
+ } else {
247
+ matrix = _idMatrix.slice();
248
+ if (v.contrast != null) {
249
+ matrix = _setContrast(matrix, Number(v.contrast));
250
+ _addColorMatrixFilterCacheTween("contrast", pg, cache, v);
251
+ } else if (!clear && cache.contrast !== 1) {
252
+ matrix = _setContrast(matrix, cache.contrast);
253
+ }
254
+ if (v.hue != null) {
255
+ matrix = _setHue(matrix, Number(v.hue));
256
+ _addColorMatrixFilterCacheTween("hue", pg, cache, v);
257
+ } else if (!clear && cache.hue) {
258
+ matrix = _setHue(matrix, cache.hue);
259
+ }
260
+ if (v.brightness != null) {
261
+ matrix = _applyBrightnessToMatrix(Number(v.brightness), matrix);
262
+ _addColorMatrixFilterCacheTween("brightness", pg, cache, v);
263
+ } else if (!clear && cache.brightness !== 1) {
264
+ matrix = _applyBrightnessToMatrix(cache.brightness, matrix);
265
+ }
266
+ if (v.colorize != null) {
267
+ matrix = _colorize(matrix, v.colorize, Number(v.colorizeAmount));
268
+ _addColorMatrixFilterCacheTween("colorize", pg, cache, v);
269
+ _addColorMatrixFilterCacheTween("colorizeAmount", pg, cache, v);
270
+ } else if (!clear && cache.colorizeAmount) {
271
+ matrix = _colorize(matrix, cache.colorize, cache.colorizeAmount);
272
+ }
273
+ if (v.saturation != null) {
274
+ matrix = _setSaturation(matrix, Number(v.saturation));
275
+ _addColorMatrixFilterCacheTween("saturation", pg, cache, v);
276
+ } else if (!clear && cache.saturation !== 1) {
277
+ matrix = _setSaturation(matrix, cache.saturation);
278
+ }
279
+ }
280
+ i = matrix.length;
281
+ while (--i > -1) {
282
+ if (matrix[i] !== startMatrix[i]) {
283
+ pg._addTween(startMatrix, i, startMatrix[i], matrix[i], "colorMatrixFilter");
284
+ }
285
+ }
286
+ pg._overwriteProps.push("colorMatrixFilter");
287
+ },
288
+
289
+ _addColorTween = function(target, p, value, colorSetter, plugin) {
290
+ var pt = colorSetter._firstPT = {_next:colorSetter._firstPT, t:target, p:p, proxy:{}, f:(typeof(target[p]) === "function")};
291
+ pt.proxy[p] = "rgb(" + _parseColor(!pt.f ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]()).join(",") + ")";
292
+ plugin._addTween(pt.proxy, p, "get", ((typeof(value) === "number") ? "rgb(" + _parseColor(value, false).join(",") + ")" : value), p, null, null, _colorStringFilter);
293
+ },
294
+
295
+ //to improve performance, when a color is sensed, we hijack the setRatio() method of the plugin instance with a new function that this method spits back. This is a special method that handles parsing color values on-the-fly and turns them into numeric values which PixiJS requires. In other words, instead of "rgb(255, 0, 0)", PixiJS wants 0xFF0000. This also works with hsl() values.
296
+ _buildColorSetter = function(tween, plugin) {
297
+ var setRatio = plugin.setRatio, //save the original (super) setRatio() function
298
+ func = function(v) {
299
+ var pt = func._firstPT,
300
+ val;
301
+ setRatio.call(plugin, v);
302
+ while (pt) {
303
+ val = _parseColor(pt.proxy[pt.p], "number");
304
+ if (pt.f) {
305
+ pt.t[pt.p](val);
306
+ } else {
307
+ pt.t[pt.p] = val;
308
+ }
309
+ pt = pt._next;
310
+ }
311
+ if (func.graphics) { //in order for PixiJS to actually redraw GraphicsData, we've gotta increment the "dirty" and "clearDirty" values. If we don't do this, the values will be tween properly, but not rendered.
312
+ func.graphics.dirty++;
313
+ func.graphics.clearDirty++;
314
+ }
315
+ };
316
+ plugin.setRatio = func;
317
+ return func;
318
+ },
319
+
320
+
321
+ _colorProps = {tint:1, lineColor:1, fillColor:1},
322
+ _xyContexts = "position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),
323
+ _contexts = {x:"position", y:"position", tileX:"tilePosition", tileY:"tilePosition"},
324
+ _colorMatrixFilterProps = {colorMatrixFilter:1, saturation:1, contrast:1, hue:1, colorize:1, colorizeAmount:1, brightness:1, clearCMF:1},
325
+ _DEG2RAD = Math.PI / 180,
326
+ _degreesToRadians = function(value) {
327
+ return (typeof(value) === "string" && value.charAt(1) === "=") ? value.substr(0, 2) + (parseFloat(value.substr(2)) * _DEG2RAD) : value * _DEG2RAD;
328
+ }, i, p;
329
+
330
+ //context setup...
331
+ for (i = 0; i < _xyContexts.length; i++) {
332
+ p = _xyContexts[i];
333
+ _contexts[p + "X"] = p;
334
+ _contexts[p + "Y"] = p;
335
+ }
336
+
337
+ //color parsing setup...
338
+ for (p in _colorLookup) {
339
+ _colorExp += "|" + p + "\\b";
340
+ }
341
+ _colorExp = new RegExp(_colorExp+")", "gi");
342
+ _colorStringFilter = function(a) {
343
+ var combined = a[0] + " " + a[1],
344
+ toHSL;
345
+ _colorExp.lastIndex = 0;
346
+ if (_colorExp.test(combined)) {
347
+ toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1);
348
+ a[0] = _formatColors(a[0], toHSL);
349
+ a[1] = _formatColors(a[1], toHSL);
350
+ }
351
+ };
352
+
353
+ if (!TweenLite.defaultStringFilter) {
354
+ TweenLite.defaultStringFilter = _colorStringFilter;
355
+ }
356
+
357
+ var PixiPlugin = _gsScope._gsDefine.plugin({
358
+ propName: "pixi",
359
+ priority: 0,
360
+ API: 2,
361
+ global: true,
362
+ version: "0.1.0",
363
+
364
+ init: function (target, values, tween, index) {
365
+ if (!target instanceof _gsScope.PIXI.DisplayObject) {
366
+ return false;
367
+ }
368
+ var context, axis, value, colorMatrix, filter, p, padding, colorSetter, i, data;
369
+ for (p in values) {
370
+ context = _contexts[p];
371
+ value = values[p];
372
+ if (typeof(value) === "function") {
373
+ value = value(index || 0, target);
374
+ }
375
+ if (context) {
376
+ axis = (p.charAt(p.length-1).toLowerCase().indexOf("x") !== -1) ? "x" : "y";
377
+ this._addTween(target[context], axis, target[context][axis], (context === "skew") ? _degreesToRadians(value) : value, p);
378
+ } else if (p === "scale" || p === "anchor" || p === "pivot" || p === "tileScale") {
379
+ this._addTween(target[p], "x", target[p].x, value, p + "X");
380
+ this._addTween(target[p], "y", target[p].y, value, p + "Y");
381
+ } else if (p === "rotation") { //PIXI expects rotation in radians, but as a convenience we let folks define it in degrees and we do the conversion.
382
+ this._addTween(target, p, target.rotation, _degreesToRadians(value), p);
383
+
384
+ } else if (_colorMatrixFilterProps[p]) {
385
+ if (!colorMatrix) {
386
+ _parseColorMatrixFilter(target, values.colorMatrixFilter || values, this);
387
+ colorMatrix = true;
388
+ }
389
+ } else if (p === "blur" || p === "blurX" || p === "blurY" || p === "blurPadding") {
390
+ filter = _getFilter(target, "BlurFilter");
391
+ this._addTween(filter, p, filter[p], value, p);
392
+ if (values.blurPadding !== 0) {
393
+ padding = values.blurPadding || Math.max(filter[p], value) * 2;
394
+ i = target.filters.length;
395
+ while (--i > -1) {
396
+ target.filters[i].padding = Math.max(target.filters[i].padding, padding); //if we don't expand the padding on all the filters, it can look clipped.
397
+ }
398
+ }
399
+ } else if (_colorProps[p]) {
400
+ if (!colorSetter) {
401
+ colorSetter = _buildColorSetter(tween, this);
402
+ }
403
+ if ((p === "lineColor" || p === "fillColor") && target instanceof _gsScope.PIXI.Graphics) {
404
+ data = target.graphicsData;
405
+ i = data.length;
406
+ while (--i > -1) {
407
+ _addColorTween(data[i], p, value, colorSetter, this);
408
+ }
409
+ colorSetter.graphics = target;
410
+ } else {
411
+ _addColorTween(target, p, value, colorSetter, this);
412
+ }
413
+ } else {
414
+ this._addTween(target, p, target[p], value, p);
415
+ }
416
+ this._overwriteProps.push(p);
417
+ }
418
+ return true;
419
+ }
420
+ });
421
+
422
+ PixiPlugin.colorProps = _colorProps;
423
+ PixiPlugin.parseColor = _parseColor;
424
+ PixiPlugin.formatColors = _formatColors;
425
+ PixiPlugin.colorStringFilter = _colorStringFilter;
426
+
427
+
428
+ }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
429
+
430
+ //export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date)
431
+ (function(name) {
432
+ "use strict";
433
+ var getGlobal = function() {
434
+ return (_gsScope.GreenSockGlobals || _gsScope)[name];
435
+ };
436
+ if (typeof(module) !== "undefined" && module.exports) { //node
437
+ require("../TweenLite.js");
438
+ module.exports = getGlobal();
439
+ } else if (typeof(define) === "function" && define.amd) { //AMD
440
+ define(["TweenLite"], getGlobal);
441
+ }
442
+ }("PixiPlugin"));