greensock-rails 1.11.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +2 -0
  3. data/README.md +47 -0
  4. data/lib/greensock/rails.rb +9 -0
  5. data/lib/greensock/rails/version.rb +5 -0
  6. data/vendor/assets/javascripts/greensock/TimelineLite.js +622 -0
  7. data/vendor/assets/javascripts/greensock/TimelineMax.js +1060 -0
  8. data/vendor/assets/javascripts/greensock/TweenLite.js +1654 -0
  9. data/vendor/assets/javascripts/greensock/TweenMax.js +6662 -0
  10. data/vendor/assets/javascripts/greensock/easing/EasePack.js +343 -0
  11. data/vendor/assets/javascripts/greensock/jquery.gsap.js +167 -0
  12. data/vendor/assets/javascripts/greensock/plugins/AttrPlugin.js +51 -0
  13. data/vendor/assets/javascripts/greensock/plugins/BezierPlugin.js +574 -0
  14. data/vendor/assets/javascripts/greensock/plugins/CSSPlugin.js +2260 -0
  15. data/vendor/assets/javascripts/greensock/plugins/CSSRulePlugin.js +100 -0
  16. data/vendor/assets/javascripts/greensock/plugins/ColorPropsPlugin.js +122 -0
  17. data/vendor/assets/javascripts/greensock/plugins/DirectionalRotationPlugin.js +80 -0
  18. data/vendor/assets/javascripts/greensock/plugins/EaselPlugin.js +298 -0
  19. data/vendor/assets/javascripts/greensock/plugins/KineticPlugin.js +298 -0
  20. data/vendor/assets/javascripts/greensock/plugins/RaphaelPlugin.js +367 -0
  21. data/vendor/assets/javascripts/greensock/plugins/RoundPropsPlugin.js +73 -0
  22. data/vendor/assets/javascripts/greensock/plugins/ScrollToPlugin.js +115 -0
  23. data/vendor/assets/javascripts/greensock/plugins/TEMPLATE_Plugin.js +74 -0
  24. data/vendor/assets/javascripts/greensock/plugins/TextPlugin.js +108 -0
  25. data/vendor/assets/javascripts/greensock/utils/Draggable.js +1438 -0
  26. metadata +97 -0
@@ -0,0 +1,100 @@
1
+ /*!
2
+ * VERSION: beta 0.6.0
3
+ * DATE: 2013-07-03
4
+ * UPDATES AND DOCS AT: http://www.greensock.com
5
+ *
6
+ * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8
+ * Club GreenSock members, the software agreement that was issued with your membership.
9
+ *
10
+ * @author: Jack Doyle, jack@greensock.com
11
+ */
12
+ (window._gsQueue || (window._gsQueue = [])).push( function() {
13
+
14
+ "use strict";
15
+
16
+ window._gsDefine("plugins.CSSRulePlugin", ["plugins.TweenPlugin","TweenLite","plugins.CSSPlugin"], function(TweenPlugin, TweenLite, CSSPlugin) {
17
+
18
+ /** @constructor **/
19
+ var CSSRulePlugin = function() {
20
+ TweenPlugin.call(this, "cssRule");
21
+ this._overwriteProps.length = 0;
22
+ },
23
+ _doc = window.document,
24
+ _superSetRatio = CSSPlugin.prototype.setRatio,
25
+ p = CSSRulePlugin.prototype = new CSSPlugin();
26
+
27
+ p._propName = "cssRule";
28
+ p.constructor = CSSRulePlugin;
29
+ CSSRulePlugin.API = 2;
30
+
31
+ /**
32
+ * Searches the style sheets in the document for a particular selector like ".myClass" or "a" or "a:hover" or ":after" and
33
+ * returns a reference to that style sheet (or an array of them in the case of a pseudo selector like ":after"). Then you
34
+ * can animate the individual properties of the style sheet.
35
+ *
36
+ * @param {!string} selector a string describing the selector, like ".myClass" or "a" or "a:hover" or ":after"
37
+ * @return a reference to the style sheet (or an array of them in the case of a pseudo selector). If none was found, null is returned (or an empty array for a pseudo selector)
38
+ */
39
+ CSSRulePlugin.getRule = function(selector) {
40
+ var ruleProp = _doc.all ? 'rules' : 'cssRules',
41
+ ss = _doc.styleSheets,
42
+ i = ss.length,
43
+ pseudo = (selector.charAt(0) === ":"),
44
+ j, curSS, cs, a;
45
+ selector = (pseudo ? "" : ",") + selector.toLowerCase() + ","; //note: old versions of IE report tag name selectors as upper case, so we just change everything to lowercase.
46
+ if (pseudo) {
47
+ a = [];
48
+ }
49
+ while (--i > -1) {
50
+ //Firefox may throw insecure operation errors when css is loaded from other domains, so try/catch.
51
+ try {
52
+ curSS = ss[i][ruleProp];
53
+ } catch (e) {
54
+ console.log(e);
55
+ continue;
56
+ }
57
+ j = curSS.length;
58
+ while (--j > -1) {
59
+ cs = curSS[j];
60
+ if (cs.selectorText && ("," + cs.selectorText.split("::").join(":").toLowerCase() + ",").indexOf(selector) !== -1) { //note: IE adds an extra ":" to pseudo selectors, so .myClass:after becomes .myClass::after, so we need to strip the extra one out.
61
+ if (pseudo) {
62
+ a.push(cs.style);
63
+ } else {
64
+ return cs.style;
65
+ }
66
+ }
67
+ }
68
+ }
69
+ return a;
70
+ };
71
+
72
+
73
+ //@private gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc.
74
+ p._onInitTween = function(target, value, tween) {
75
+ if (target.cssText === undefined) {
76
+ return false;
77
+ }
78
+ var div = _doc.createElement("div");
79
+ this._ss = target;
80
+ this._proxy = div.style;
81
+ div.style.cssText = target.cssText;
82
+ CSSPlugin.prototype._onInitTween.call(this, div, value, tween); //we just offload all the work to the regular CSSPlugin and then copy the cssText back over to the rule in the setRatio() method. This allows us to have all of the updates to CSSPlugin automatically flow through to CSSRulePlugin instead of having to maintain both
83
+ return true;
84
+ };
85
+
86
+
87
+
88
+ //@private gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1.
89
+ p.setRatio = function(v) {
90
+ _superSetRatio.call(this, v);
91
+ this._ss.cssText = this._proxy.cssText;
92
+ };
93
+
94
+
95
+ TweenPlugin.activate([CSSRulePlugin]);
96
+ return CSSRulePlugin;
97
+
98
+ }, true);
99
+
100
+ }); if (window._gsDefine) { window._gsQueue.pop()(); }
@@ -0,0 +1,122 @@
1
+ /*!
2
+ * VERSION: beta 1.2.0
3
+ * DATE: 2013-03-01
4
+ * UPDATES AND DOCS AT: http://www.greensock.com
5
+ *
6
+ * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8
+ * Club GreenSock members, the software agreement that was issued with your membership.
9
+ *
10
+ * @author: Jack Doyle, jack@greensock.com
11
+ **/
12
+
13
+ (window._gsQueue || (window._gsQueue = [])).push( function() {
14
+
15
+ "use strict";
16
+
17
+ var _numExp = /(\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
+ _parseColor = function(color) {
43
+ if (color === "" || color == null || color === "none") {
44
+ return _colorLookup.transparent;
45
+ }
46
+ if (_colorLookup[color]) {
47
+ return _colorLookup[color];
48
+ }
49
+ if (typeof(color) === "number") {
50
+ return [color >> 16, (color >> 8) & 255, color & 255];
51
+ }
52
+ if (color.charAt(0) === "#") {
53
+ if (color.length === 4) { //for shorthand like #9F0
54
+ color = "#" + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2) + color.charAt(3) + color.charAt(3);
55
+ }
56
+ color = parseInt(color.substr(1), 16);
57
+ return [color >> 16, (color >> 8) & 255, color & 255];
58
+ }
59
+ if (color.substr(0, 3) === "hsl") {
60
+ color = color.match(_numExp);
61
+ var h = (Number(color[0]) % 360) / 360,
62
+ s = Number(color[1]) / 100,
63
+ l = Number(color[2]) / 100,
64
+ m2 = (l <= 0.5) ? l * (s + 1) : l + s - l * s,
65
+ m1 = l * 2 - m2;
66
+ if (color.length > 3) {
67
+ color[3] = Number(color[3]);
68
+ }
69
+ color[0] = _hue(h + 1 / 3, m1, m2);
70
+ color[1] = _hue(h, m1, m2);
71
+ color[2] = _hue(h - 1 / 3, m1, m2);
72
+ return color;
73
+ }
74
+ return color.match(_numExp) || _colorLookup.transparent;
75
+ };
76
+
77
+ window._gsDefine.plugin({
78
+ propName: "colorProps",
79
+ priority: -1,
80
+ API: 2,
81
+
82
+ //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
83
+ init: function(target, value, tween) {
84
+ this._target = target;
85
+ var p, s, c, pt;
86
+ for (p in value) {
87
+ c = _parseColor(value[p]);
88
+ this._firstPT = pt = {_next:this._firstPT, p:p, f:(typeof(target[p]) === "function"), n:p, r:false};
89
+ s = _parseColor( (!pt.f) ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() );
90
+ pt.s = Number(s[0]);
91
+ pt.c = Number(c[0]) - pt.s;
92
+ pt.gs = Number(s[1]);
93
+ pt.gc = Number(c[1]) - pt.gs;
94
+ pt.bs = Number(s[2]);
95
+ pt.bc = Number(c[2]) - pt.bs;
96
+ if ((pt.rgba = (s.length > 3 || c.length > 3))) { //detect an rgba() value
97
+ pt.as = (s.length < 4) ? 1 : Number(s[3]);
98
+ pt.ac = ((c.length < 4) ? 1 : Number(c[3])) - pt.as;
99
+ }
100
+ if (pt._next) {
101
+ pt._next._prev = pt;
102
+ }
103
+ }
104
+ return true;
105
+ },
106
+
107
+ //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
108
+ set: function(v) {
109
+ var pt = this._firstPT, val;
110
+ while (pt) {
111
+ val = (pt.rgba ? "rgba(" : "rgb(") + ((pt.s + (v * pt.c)) >> 0) + ", " + ((pt.gs + (v * pt.gc)) >> 0) + ", " + ((pt.bs + (v * pt.bc)) >> 0) + (pt.rgba ? ", " + (pt.as + (v * pt.ac)) : "") + ")";
112
+ if (pt.f) {
113
+ this._target[pt.p](val);
114
+ } else {
115
+ this._target[pt.p] = val;
116
+ }
117
+ pt = pt._next;
118
+ }
119
+ }
120
+ });
121
+
122
+ }); if (window._gsDefine) { window._gsQueue.pop()(); }
@@ -0,0 +1,80 @@
1
+ /*!
2
+ * VERSION: beta 0.2.0
3
+ * DATE: 2013-05-07
4
+ * UPDATES AND DOCS AT: http://www.greensock.com
5
+ *
6
+ * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8
+ * Club GreenSock members, the software agreement that was issued with your membership.
9
+ *
10
+ * @author: Jack Doyle, jack@greensock.com
11
+ **/
12
+ (window._gsQueue || (window._gsQueue = [])).push( function() {
13
+
14
+ "use strict";
15
+
16
+ window._gsDefine.plugin({
17
+ propName: "directionalRotation",
18
+ API: 2,
19
+ version: "0.2.0",
20
+
21
+ //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
22
+ init: function(target, value, tween) {
23
+ if (typeof(value) !== "object") {
24
+ value = {rotation:value};
25
+ }
26
+ this.finals = {};
27
+ var cap = (value.useRadians === true) ? Math.PI * 2 : 360,
28
+ min = 0.000001,
29
+ p, v, start, end, dif, split;
30
+ for (p in value) {
31
+ if (p !== "useRadians") {
32
+ split = (value[p] + "").split("_");
33
+ v = split[0];
34
+ start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() );
35
+ end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0;
36
+ dif = end - start;
37
+ if (split.length) {
38
+ v = split.join("_");
39
+ if (v.indexOf("short") !== -1) {
40
+ dif = dif % cap;
41
+ if (dif !== dif % (cap / 2)) {
42
+ dif = (dif < 0) ? dif + cap : dif - cap;
43
+ }
44
+ }
45
+ if (v.indexOf("_cw") !== -1 && dif < 0) {
46
+ dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
47
+ } else if (v.indexOf("ccw") !== -1 && dif > 0) {
48
+ dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
49
+ }
50
+ }
51
+ if (dif > min || dif < -min) {
52
+ this._addTween(target, p, start, start + dif, p);
53
+ this._overwriteProps.push(p);
54
+ }
55
+ }
56
+ }
57
+ return true;
58
+ },
59
+
60
+ //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
61
+ set: function(ratio) {
62
+ var pt;
63
+ if (ratio !== 1) {
64
+ this._super.setRatio.call(this, ratio);
65
+ } else {
66
+ pt = this._firstPT;
67
+ while (pt) {
68
+ if (pt.f) {
69
+ pt.t[pt.p](this.finals[pt.p]);
70
+ } else {
71
+ pt.t[pt.p] = this.finals[pt.p];
72
+ }
73
+ pt = pt._next;
74
+ }
75
+ }
76
+ }
77
+
78
+ })._autoCSS = true;
79
+
80
+ }); if (window._gsDefine) { window._gsQueue.pop()(); }
@@ -0,0 +1,298 @@
1
+ /*!
2
+ * VERSION: beta 0.1.5
3
+ * DATE: 2013-08-29
4
+ * UPDATES AND DOCS AT: http://www.greensock.com
5
+ *
6
+ * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7
+ * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8
+ * Club GreenSock members, the software agreement that was issued with your membership.
9
+ *
10
+ * @author: Jack Doyle, jack@greensock.com
11
+ **/
12
+ (window._gsQueue || (window._gsQueue = [])).push( function() {
13
+
14
+ "use strict";
15
+
16
+ var _numExp = /(\d|\.)+/g,
17
+ _ColorFilter, _ColorMatrixFilter,
18
+ _colorProps = ["redMultiplier","greenMultiplier","blueMultiplier","alphaMultiplier","redOffset","greenOffset","blueOffset","alphaOffset"],
19
+ _colorLookup = {aqua:[0,255,255],
20
+ lime:[0,255,0],
21
+ silver:[192,192,192],
22
+ black:[0,0,0],
23
+ maroon:[128,0,0],
24
+ teal:[0,128,128],
25
+ blue:[0,0,255],
26
+ navy:[0,0,128],
27
+ white:[255,255,255],
28
+ fuchsia:[255,0,255],
29
+ olive:[128,128,0],
30
+ yellow:[255,255,0],
31
+ orange:[255,165,0],
32
+ gray:[128,128,128],
33
+ purple:[128,0,128],
34
+ green:[0,128,0],
35
+ red:[255,0,0],
36
+ pink:[255,192,203],
37
+ cyan:[0,255,255],
38
+ transparent:[255,255,255,0]},
39
+ _parseColor = function(color) {
40
+ if (color === "" || color == null || color === "none") {
41
+ return _colorLookup.transparent;
42
+ } else if (_colorLookup[color]) {
43
+ return _colorLookup[color];
44
+ } else if (typeof(color) === "number") {
45
+ return [color >> 16, (color >> 8) & 255, color & 255];
46
+ } else if (color.charAt(0) === "#") {
47
+ if (color.length === 4) { //for shorthand like #9F0
48
+ color = "#" + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2) + color.charAt(3) + color.charAt(3);
49
+ }
50
+ color = parseInt(color.substr(1), 16);
51
+ return [color >> 16, (color >> 8) & 255, color & 255];
52
+ }
53
+ return color.match(_numExp) || _colorLookup.transparent;
54
+ },
55
+ _parseColorFilter = function(t, v, pg) {
56
+ if (!_ColorFilter) {
57
+ _ColorFilter = (window.ColorFilter || window.createjs.ColorFilter);
58
+ if (!_ColorFilter) {
59
+ throw("EaselPlugin error: The EaselJS ColorFilter JavaScript file wasn't loaded.");
60
+ }
61
+ }
62
+ var filters = t.filters || [],
63
+ i = filters.length,
64
+ c, s, e, a, p;
65
+ while (--i > -1) {
66
+ if (filters[i] instanceof _ColorFilter) {
67
+ s = filters[i];
68
+ break;
69
+ }
70
+ }
71
+ if (!s) {
72
+ s = new _ColorFilter();
73
+ filters.push(s);
74
+ t.filters = filters;
75
+ }
76
+ e = s.clone();
77
+ if (v.tint != null) {
78
+ c = _parseColor(v.tint);
79
+ a = (v.tintAmount != null) ? Number(v.tintAmount) : 1;
80
+ e.redOffset = Number(c[0]) * a;
81
+ e.greenOffset = Number(c[1]) * a;
82
+ e.blueOffset = Number(c[2]) * a;
83
+ e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - a;
84
+ } else {
85
+ for (p in v) {
86
+ if (p !== "exposure") if (p !== "brightness") {
87
+ e[p] = Number(v[p]);
88
+ }
89
+ }
90
+ }
91
+ if (v.exposure != null) {
92
+ e.redOffset = e.greenOffset = e.blueOffset = 255 * (Number(v.exposure) - 1);
93
+ e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1;
94
+ } else if (v.brightness != null) {
95
+ a = Number(v.brightness) - 1;
96
+ e.redOffset = e.greenOffset = e.blueOffset = (a > 0) ? a * 255 : 0;
97
+ e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - Math.abs(a);
98
+ }
99
+ i = 8;
100
+ while (--i > -1) {
101
+ p = _colorProps[i];
102
+ if (s[p] !== e[p]) {
103
+ pg._addTween(s, p, s[p], e[p], "easel_colorFilter");
104
+ }
105
+ }
106
+ pg._overwriteProps.push("easel_colorFilter");
107
+ if (!t.cacheID) {
108
+ throw("EaselPlugin warning: for filters to display in EaselJS, you must call the object's cache() method first. " + t);
109
+ }
110
+ },
111
+
112
+ _idMatrix = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],
113
+ _lumR = 0.212671,
114
+ _lumG = 0.715160,
115
+ _lumB = 0.072169,
116
+
117
+ _applyMatrix = function(m, m2) {
118
+ if (!(m instanceof Array) || !(m2 instanceof Array)) {
119
+ return m2;
120
+ }
121
+ var temp = [],
122
+ i = 0,
123
+ z = 0,
124
+ y, x;
125
+ for (y = 0; y < 4; y++) {
126
+ for (x = 0; x < 5; x++) {
127
+ z = (x === 4) ? m[i + 4] : 0;
128
+ 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;
129
+ }
130
+ i += 5;
131
+ }
132
+ return temp;
133
+ },
134
+
135
+ _setSaturation = function(m, n) {
136
+ if (isNaN(n)) {
137
+ return m;
138
+ }
139
+ var inv = 1 - n,
140
+ r = inv * _lumR,
141
+ g = inv * _lumG,
142
+ b = inv * _lumB;
143
+ 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);
144
+ },
145
+
146
+ _colorize = function(m, color, amount) {
147
+ if (isNaN(amount)) {
148
+ amount = 1;
149
+ }
150
+ var c = _parseColor(color),
151
+ r = c[0] / 255,
152
+ g = c[1] / 255,
153
+ b = c[2] / 255,
154
+ inv = 1 - amount;
155
+ 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);
156
+ },
157
+
158
+ _setHue = function(m, n) {
159
+ if (isNaN(n)) {
160
+ return m;
161
+ }
162
+ n *= Math.PI / 180;
163
+ var c = Math.cos(n),
164
+ s = Math.sin(n);
165
+ 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);
166
+ },
167
+
168
+ _setContrast = function(m, n) {
169
+ if (isNaN(n)) {
170
+ return m;
171
+ }
172
+ n += 0.01;
173
+ return _applyMatrix([n,0,0,0,128 * (1 - n), 0,n,0,0,128 * (1 - n), 0,0,n,0,128 * (1 - n), 0,0,0,1,0], m);
174
+ },
175
+
176
+ _parseColorMatrixFilter = function(t, v, pg) {
177
+ if (!_ColorMatrixFilter) {
178
+ _ColorMatrixFilter = (window.ColorMatrixFilter || window.createjs.ColorMatrixFilter);
179
+ if (!_ColorMatrixFilter) {
180
+ throw("EaselPlugin error: The EaselJS ColorMatrixFilter JavaScript file wasn't loaded.");
181
+ }
182
+ }
183
+ var filters = t.filters || [],
184
+ i = filters.length,
185
+ matrix, startMatrix, s;
186
+ while (--i > -1) {
187
+ if (filters[i] instanceof _ColorMatrixFilter) {
188
+ s = filters[i];
189
+ break;
190
+ }
191
+ }
192
+ if (!s) {
193
+ s = new _ColorMatrixFilter(_idMatrix.slice());
194
+ filters.push(s);
195
+ t.filters = filters;
196
+ }
197
+ startMatrix = s.matrix;
198
+ matrix = _idMatrix.slice();
199
+ if (v.colorize != null) {
200
+ matrix = _colorize(matrix, v.colorize, Number(v.colorizeAmount));
201
+ }
202
+ if (v.contrast != null) {
203
+ matrix = _setContrast(matrix, Number(v.contrast));
204
+ }
205
+ if (v.hue != null) {
206
+ matrix = _setHue(matrix, Number(v.hue));
207
+ }
208
+ if (v.saturation != null) {
209
+ matrix = _setSaturation(matrix, Number(v.saturation));
210
+ }
211
+
212
+ i = matrix.length;
213
+ while (--i > -1) {
214
+ if (matrix[i] !== startMatrix[i]) {
215
+ pg._addTween(startMatrix, i, startMatrix[i], matrix[i], "easel_colorMatrixFilter");
216
+ }
217
+ }
218
+
219
+ pg._overwriteProps.push("easel_colorMatrixFilter");
220
+ if (!t.cacheID) {
221
+ throw("EaselPlugin warning: for filters to display in EaselJS, you must call the object's cache() method first. " + t);
222
+ }
223
+
224
+ pg._matrix = startMatrix;
225
+ };
226
+
227
+
228
+ window._gsDefine.plugin({
229
+ propName: "easel",
230
+ priority: -1,
231
+ API: 2,
232
+
233
+ //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
234
+ init: function(target, value, tween) {
235
+ this._target = target;
236
+ var p, pt, tint, colorMatrix;
237
+ for (p in value) {
238
+
239
+ if (p === "colorFilter" || p === "tint" || p === "tintAmount" || p === "exposure" || p === "brightness") {
240
+ if (!tint) {
241
+ _parseColorFilter(target, value.colorFilter || value, this);
242
+ tint = true;
243
+ }
244
+
245
+ } else if (p === "saturation" || p === "contrast" || p === "hue" || p === "colorize" || p === "colorizeAmount") {
246
+ if (!colorMatrix) {
247
+ _parseColorMatrixFilter(target, value.colorMatrixFilter || value, this);
248
+ colorMatrix = true;
249
+ }
250
+
251
+ } else if (p === "frame") {
252
+ this._firstPT = pt = {_next:this._firstPT, t:target, p:"gotoAndStop", s:target.currentFrame, f:true, n:"frame", pr:0, type:0, r:true};
253
+ pt.c = (typeof(value[p]) === "number") ? value[p] - pt.s : (typeof(value[p]) === "string") ? parseFloat(value[p].split("=").join("")) : 0;
254
+ if (pt._next) {
255
+ pt._next._prev = pt;
256
+ }
257
+
258
+ } else if (target[p] != null) {
259
+ this._firstPT = pt = {_next:this._firstPT, t:target, p:p, f:(typeof(target[p]) === "function"), n:p, pr:0, type:0};
260
+ pt.s = (!pt.f) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]();
261
+ pt.c = (typeof(value[p]) === "number") ? value[p] - pt.s : (typeof(value[p]) === "string") ? parseFloat(value[p].split("=").join("")) : 0;
262
+
263
+ if (pt._next) {
264
+ pt._next._prev = pt;
265
+ }
266
+ }
267
+
268
+ }
269
+ return true;
270
+ },
271
+
272
+ //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
273
+ set: function(v) {
274
+ var pt = this._firstPT,
275
+ min = 0.000001,
276
+ val;
277
+ while (pt) {
278
+ val = pt.c * v + pt.s;
279
+ if (pt.r) {
280
+ val = (val + ((val > 0) ? 0.5 : -0.5)) >> 0; //about 4x faster than Math.round()
281
+ } else if (val < min && val > -min) {
282
+ val = 0;
283
+ }
284
+ if (pt.f) {
285
+ pt.t[pt.p](val);
286
+ } else {
287
+ pt.t[pt.p] = val;
288
+ }
289
+ pt = pt._next;
290
+ }
291
+ if (this._target.cacheID) {
292
+ this._target.updateCache();
293
+ }
294
+ }
295
+
296
+ });
297
+
298
+ }); if (window._gsDefine) { window._gsQueue.pop()(); }