diff options
Diffstat (limited to 'node_modules/montage-user/ui/flow-path-cubic.js')
-rw-r--r-- | node_modules/montage-user/ui/flow-path-cubic.js | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/node_modules/montage-user/ui/flow-path-cubic.js b/node_modules/montage-user/ui/flow-path-cubic.js new file mode 100644 index 00000000..a4be0dbe --- /dev/null +++ b/node_modules/montage-user/ui/flow-path-cubic.js | |||
@@ -0,0 +1,109 @@ | |||
1 | var Montage = require("montage").Montage; | ||
2 | |||
3 | var FlowPathCubic = exports.FlowPathCubic = Montage.create(Montage, { | ||
4 | |||
5 | _variable: { | ||
6 | enumerable: false, | ||
7 | value: "time" | ||
8 | }, | ||
9 | |||
10 | variable: { | ||
11 | get: function () { | ||
12 | return this._variable; | ||
13 | }, | ||
14 | set: function (value) { | ||
15 | switch (value) { | ||
16 | case "speed": | ||
17 | case "index": | ||
18 | this._variable = value; | ||
19 | break; | ||
20 | default: | ||
21 | this._variable = "time"; | ||
22 | } | ||
23 | this._updatePath(); | ||
24 | } | ||
25 | }, | ||
26 | |||
27 | _a: { | ||
28 | enumerable: false, | ||
29 | value: 0 | ||
30 | }, | ||
31 | |||
32 | a: { | ||
33 | get: function () { | ||
34 | return this._a; | ||
35 | }, | ||
36 | set: function (value) { | ||
37 | this._a = value; | ||
38 | this._updatePath(); | ||
39 | } | ||
40 | }, | ||
41 | |||
42 | _b: { | ||
43 | enumerable: false, | ||
44 | value: 0 | ||
45 | }, | ||
46 | |||
47 | b: { | ||
48 | get: function () { | ||
49 | return this._b; | ||
50 | }, | ||
51 | set: function (value) { | ||
52 | this._b = value; | ||
53 | this._updatePath(); | ||
54 | } | ||
55 | }, | ||
56 | |||
57 | _c: { | ||
58 | enumerable: false, | ||
59 | value: 0 | ||
60 | }, | ||
61 | |||
62 | c: { | ||
63 | get: function () { | ||
64 | return this._c; | ||
65 | }, | ||
66 | set: function (value) { | ||
67 | this._c = value; | ||
68 | this._updatePath(); | ||
69 | } | ||
70 | }, | ||
71 | |||
72 | _d: { | ||
73 | enumerable: false, | ||
74 | value: 0 | ||
75 | }, | ||
76 | |||
77 | d: { | ||
78 | get: function () { | ||
79 | return this._d; | ||
80 | }, | ||
81 | set: function (value) { | ||
82 | this._d = value; | ||
83 | this._updatePath(); | ||
84 | } | ||
85 | }, | ||
86 | |||
87 | _path: { | ||
88 | enumerable: false, | ||
89 | value: "0" | ||
90 | }, | ||
91 | |||
92 | path: { | ||
93 | get: function () { | ||
94 | return this._path; | ||
95 | }, | ||
96 | set: function (value) { | ||
97 | this._path = value; | ||
98 | } | ||
99 | }, | ||
100 | |||
101 | _updatePath: { | ||
102 | enumerable: false, | ||
103 | value: function () { | ||
104 | var s = "slide."+this._variable; | ||
105 | |||
106 | this.path = "("+this._a+")*"+s+"*"+s+"*"+s+"+("+this._b+")*"+s+"*"+s+"+("+this._c+")*"+s+"+("+this._d+")"; | ||
107 | } | ||
108 | } | ||
109 | }); | ||