diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 2165 |
1 files changed, 1083 insertions, 1082 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 3dc2e514..a1e03b35 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -1,24 +1,25 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | Copyright (c) 2012, Motorola Mobility, Inc | 2 | Copyright (c) 2012, Motorola Mobility LLC. |
3 | All Rights Reserved. | 3 | All Rights Reserved. |
4 | BSD License. | ||
5 | 4 | ||
6 | Redistribution and use in source and binary forms, with or without | 5 | Redistribution and use in source and binary forms, with or without |
7 | modification, are permitted provided that the following conditions are met: | 6 | modification, are permitted provided that the following conditions are met: |
8 | 7 | ||
9 | - Redistributions of source code must retain the above copyright notice, | 8 | * Redistributions of source code must retain the above copyright notice, |
10 | this list of conditions and the following disclaimer. | 9 | this list of conditions and the following disclaimer. |
11 | - Redistributions in binary form must reproduce the above copyright | 10 | |
12 | notice, this list of conditions and the following disclaimer in the | 11 | * Redistributions in binary form must reproduce the above copyright notice, |
13 | documentation and/or other materials provided with the distribution. | 12 | this list of conditions and the following disclaimer in the documentation |
14 | - Neither the name of Motorola Mobility nor the names of its contributors | 13 | and/or other materials provided with the distribution. |
15 | may be used to endorse or promote products derived from this software | 14 | |
16 | without specific prior written permission. | 15 | * Neither the name of Motorola Mobility LLC nor the names of its |
16 | contributors may be used to endorse or promote products derived from this | ||
17 | software without specific prior written permission. | ||
17 | 18 | ||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
@@ -29,9 +30,9 @@ POSSIBILITY OF SUCH DAMAGE. | |||
29 | </copyright> */ | 30 | </copyright> */ |
30 | 31 | ||
31 | var Montage = require("montage/core/core").Montage, | 32 | var Montage = require("montage/core/core").Montage, |
32 | Component = require("montage/ui/component").Component, | 33 | Component = require("montage/ui/component").Component, |
33 | nj = require("js/lib/NJUtils").NJUtils, | 34 | nj = require("js/lib/NJUtils").NJUtils, |
34 | EasingMenuPopup = require("js/panels/Timeline/EasingMenu.reel").EasingMenu; | 35 | EasingMenuPopup = require("js/panels/Timeline/EasingMenu.reel").EasingMenu; |
35 | 36 | ||
36 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | 37 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { |
37 | 38 | ||
@@ -142,22 +143,22 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
142 | return; | 143 | return; |
143 | } | 144 | } |
144 | this._currentDocument = value; | 145 | this._currentDocument = value; |
145 | 146 | ||
146 | var boolDoc = false, | 147 | var boolDoc = false, |
147 | boolView = false; | 148 | boolView = false; |
148 | 149 | ||
149 | // Should we enable the panel? | 150 | // Should we enable the panel? |
150 | // Only if we have both a document and we're in design view. | 151 | // Only if we have both a document and we're in design view. |
151 | if (typeof(value) !== "undefined") { | 152 | if (typeof(value) !== "undefined") { |
152 | if (value.currentView === "design") { | 153 | if (value.currentView === "design") { |
153 | // We are in design view. | 154 | // We are in design view. |
154 | boolView = true; | 155 | boolView = true; |
155 | } | 156 | } |
156 | } | 157 | } |
157 | if (typeof(this._currentDocument) !== "undefined") { | 158 | if (typeof(this._currentDocument) !== "undefined") { |
158 | // We have a document, or at least we have initialized the panel. | 159 | // We have a document, or at least we have initialized the panel. |
159 | boolDoc = true; | 160 | boolDoc = true; |
160 | } | 161 | } |
161 | 162 | ||
162 | if(boolDoc === false) { | 163 | if(boolDoc === false) { |
163 | this._boolCacheArrays = false; | 164 | this._boolCacheArrays = false; |
@@ -165,18 +166,18 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
165 | this._boolCacheArrays = true; | 166 | this._boolCacheArrays = true; |
166 | this.enablePanel(false); | 167 | this.enablePanel(false); |
167 | } else { | 168 | } else { |
168 | if(boolView === true) { | 169 | if(boolView === true) { |
169 | this._boolCacheArrays = false; | 170 | this._boolCacheArrays = false; |
170 | this.clearTimelinePanel(); | 171 | this.clearTimelinePanel(); |
171 | this._boolCacheArrays = true; | 172 | this._boolCacheArrays = true; |
172 | 173 | ||
173 | // Rebind the document events for the new document context | 174 | // Rebind the document events for the new document context |
174 | this._bindDocumentEvents(); | 175 | this._bindDocumentEvents(); |
175 | 176 | ||
176 | // Initialize the timeline for the document. | 177 | // Initialize the timeline for the document. |
177 | this.initTimelineForDocument(); | 178 | this.initTimelineForDocument(); |
178 | this.enablePanel(true); | 179 | this.enablePanel(true); |
179 | } | 180 | } |
180 | } | 181 | } |
181 | } | 182 | } |
182 | }, | 183 | }, |
@@ -188,7 +189,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
188 | } | 189 | } |
189 | } | 190 | } |
190 | }, | 191 | }, |
191 | 192 | ||
192 | _currentSelectedContainer: { | 193 | _currentSelectedContainer: { |
193 | value: null | 194 | value: null |
194 | }, | 195 | }, |
@@ -204,15 +205,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
204 | return; | 205 | return; |
205 | } | 206 | } |
206 | this.application.ninja.currentDocument.setLevel = true; | 207 | this.application.ninja.currentDocument.setLevel = true; |
207 | 208 | ||
208 | if(this._currentDocument.currentView === "design") { | 209 | if(this._currentDocument.currentView === "design") { |
209 | this._boolCacheArrays = false; | 210 | this._boolCacheArrays = false; |
210 | this.clearTimelinePanel(); | 211 | this.clearTimelinePanel(); |
211 | this._boolCacheArrays = true; | 212 | this._boolCacheArrays = true; |
212 | 213 | ||
213 | // Rebind the document events for the new document context | 214 | // Rebind the document events for the new document context |
214 | this._bindDocumentEvents(); | 215 | this._bindDocumentEvents(); |
215 | 216 | ||
216 | // Initialize the timeline for the document. | 217 | // Initialize the timeline for the document. |
217 | this.initTimelineForDocument(); | 218 | this.initTimelineForDocument(); |
218 | } | 219 | } |
@@ -262,25 +263,25 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
262 | this._layerRepetition = newVal; | 263 | this._layerRepetition = newVal; |
263 | } | 264 | } |
264 | }, | 265 | }, |
265 | 266 | ||
266 | _areTracksScrolling: { | 267 | _areTracksScrolling: { |
267 | value: false | 268 | value: false |
268 | }, | 269 | }, |
269 | 270 | ||
270 | _areTracksCollapsing: { | 271 | _areTracksCollapsing: { |
271 | value: false | 272 | value: false |
272 | }, | 273 | }, |
273 | 274 | ||
274 | _currentOpenSpanMenu: { | 275 | _currentOpenSpanMenu: { |
275 | value: false | 276 | value: false |
276 | }, | 277 | }, |
277 | currentOpenSpanMenu: { | 278 | currentOpenSpanMenu: { |
278 | get: function() { | 279 | get: function() { |
279 | return this._currentOpenSpanMenu; | 280 | return this._currentOpenSpanMenu; |
280 | }, | 281 | }, |
281 | set: function(newVal) { | 282 | set: function(newVal) { |
282 | this._currentOpenSpanMenu = newVal; | 283 | this._currentOpenSpanMenu = newVal; |
283 | } | 284 | } |
284 | }, | 285 | }, |
285 | 286 | ||
286 | // Set to false to skip array caching array sets in currentDocument | 287 | // Set to false to skip array caching array sets in currentDocument |
@@ -288,7 +289,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
288 | value:true | 289 | value:true |
289 | }, | 290 | }, |
290 | 291 | ||
291 | // Current layer number: iterated and used to assign layer IDs. | 292 | // Current layer number: iterated and used to assign layer IDs. |
292 | _currentLayerNumber:{ | 293 | _currentLayerNumber:{ |
293 | value:0 | 294 | value:0 |
294 | }, | 295 | }, |
@@ -318,16 +319,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
318 | } | 319 | } |
319 | }, |