diff options
Diffstat (limited to 'node_modules/montage/ui/flow-path.js')
-rwxr-xr-x | node_modules/montage/ui/flow-path.js | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/node_modules/montage/ui/flow-path.js b/node_modules/montage/ui/flow-path.js index 85a6b5a4..ecb1d8fa 100755 --- a/node_modules/montage/ui/flow-path.js +++ b/node_modules/montage/ui/flow-path.js | |||
@@ -1,11 +1,5 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage").Montage; | 1 | var Montage = require("montage").Montage; |
8 | 2 | ||
9 | var FlowPath = exports.FlowPath = Montage.create(Montage, { | 3 | var FlowPath = exports.FlowPath = Montage.create(Montage, { |
10 | 4 | ||
11 | _translateX: { | 5 | _translateX: { |
@@ -21,7 +15,7 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
21 | this._updatePath(); | 15 | this._updatePath(); |
22 | } | 16 | } |
23 | }, | 17 | }, |
24 | 18 | ||
25 | _translateY: { | 19 | _translateY: { |
26 | enumerable: false, | 20 | enumerable: false, |
27 | value: null | 21 | value: null |
@@ -49,7 +43,7 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
49 | this._updatePath(); | 43 | this._updatePath(); |
50 | } | 44 | } |
51 | }, | 45 | }, |
52 | 46 | ||
53 | _rotateX: { | 47 | _rotateX: { |
54 | enumerable: false, | 48 | enumerable: false, |
55 | value: null | 49 | value: null |
@@ -63,7 +57,7 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
63 | this._updatePath(); | 57 | this._updatePath(); |
64 | } | 58 | } |
65 | }, | 59 | }, |
66 | 60 | ||
67 | _rotateY: { | 61 | _rotateY: { |
68 | enumerable: false, | 62 | enumerable: false, |
69 | value: null | 63 | value: null |
@@ -77,7 +71,7 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
77 | this._updatePath(); | 71 | this._updatePath(); |
78 | } | 72 | } |
79 | }, | 73 | }, |
80 | 74 | ||
81 | _rotateZ: { | 75 | _rotateZ: { |
82 | enumerable: false, | 76 | enumerable: false, |
83 | value: null | 77 | value: null |
@@ -105,7 +99,7 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
105 | this._updatePath(); | 99 | this._updatePath(); |
106 | } | 100 | } |
107 | }, | 101 | }, |
108 | 102 | ||
109 | _opacity: { | 103 | _opacity: { |
110 | enumerable: false, | 104 | enumerable: false, |
111 | value: null | 105 | value: null |
@@ -119,12 +113,12 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
119 | this._updatePath(); | 113 | this._updatePath(); |
120 | } | 114 | } |
121 | }, | 115 | }, |
122 | 116 | ||
123 | _updatePath: { | 117 | _updatePath: { |
124 | enumerable: false, | 118 | enumerable: false, |
125 | value: function () { | 119 | value: function () { |
126 | var path = []; | 120 | var path = []; |
127 | 121 | ||
128 | if (this._translateX) { | 122 | if (this._translateX) { |
129 | path.push("path.translateX="+this._translateX); | 123 | path.push("path.translateX="+this._translateX); |
130 | } | 124 | } |
@@ -152,21 +146,21 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
152 | this.evalPath=path; | 146 | this.evalPath=path; |
153 | } | 147 | } |
154 | }, | 148 | }, |
155 | 149 | ||
156 | // we should be cautious with this eval, but I wanted to try serializing paths directly | 150 | // we should be cautious with this eval, but I wanted to try serializing paths directly |
157 | 151 | ||
158 | _evalPath: { | 152 | _evalPath: { |
159 | enumerable: false, | 153 | enumerable: false, |
160 | value: null | 154 | value: null |
161 | }, | 155 | }, |
162 | 156 | ||
163 | evalPath: { | 157 | evalPath: { |
164 | get: function () { | 158 | get: function () { |
165 | return this._evalPath; | 159 | return this._evalPath; |
166 | }, | 160 | }, |
167 | set: function (value) { | 161 | set: function (value) { |
168 | var error=false; | 162 | var error=false; |
169 | 163 | ||
170 | if (typeof value === "string") { | 164 | if (typeof value === "string") { |
171 | try { | 165 | try { |
172 | eval("var func=function(slide){var path={};path.style={};"+value+";return path;}"); | 166 | eval("var func=function(slide){var path={};path.style={};"+value+";return path;}"); |
@@ -182,10 +176,10 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
182 | this._evalPath = value; | 176 | this._evalPath = value; |
183 | } | 177 | } |
184 | } else { | 178 | } else { |
185 | this._evalPath = value.join(";\r\n")+";"; | 179 | this._evalPath = value.join(";\r\n")+";"; |
186 | eval("var func=function(slide){var path={};path.style={};"+this._evalPath+"return path;}"); | 180 | eval("var func=function(slide){var path={};path.style={};"+this._evalPath+"return path;}"); |
187 | } | 181 | } |
188 | 182 | ||
189 | if (!error) { | 183 | if (!error) { |
190 | this.path = { | 184 | this.path = { |
191 | value: func | 185 | value: func |
@@ -193,7 +187,7 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
193 | } | 187 | } |
194 | } | 188 | } |
195 | }, | 189 | }, |
196 | 190 | ||
197 | _path: { | 191 | _path: { |
198 | enumerable: false, | 192 | enumerable: false, |
199 | value: { | 193 | value: { |
@@ -202,14 +196,14 @@ var FlowPath = exports.FlowPath = Montage.create(Montage, { | |||
202 | } | 196 | } |
203 | } | 197 | } |
204 | }, | 198 | }, |
205 | 199 | ||
206 | path: { | 200 | path: { |
207 | get: function () { | 201 | get: function () { |
208 | return this._path; | 202 | return this._path; |
209 | }, | 203 | }, |
210 | set: function (value) { | 204 | set: function (value) { |
211 | this._path = value; | 205 | this._path = value; |
212 | } | 206 | } |
213 | } | 207 | } |
214 | 208 | ||
215 | }); \ No newline at end of file | 209 | }); |