diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 359 |
1 files changed, 180 insertions, 179 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 3dc2e514..3616c7a5 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 |
@@ -142,11 +143,11 @@ 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") { |
@@ -155,7 +156,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
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 | ||
@@ -169,10 +170,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
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); |
@@ -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,15 +263,15 @@ 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 | }, |
@@ -342,7 +343,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
342 | this.cacheTimeline(); | 343 | this.cacheTimeline(); |
343 | } | 344 | } |
344 | }, | 345 | }, |
345 | 346 | ||
346 | _easingMenu: { | 347 | _easingMenu: { |
347 | value: null | 348 | value: null |
348 | }, | 349 | }, |
@@ -355,12 +356,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
355 | this._easingMenu = newVal; | 356 | this._easingMenu = newVal; |
356 | } | 357 | } |
357 | }, | 358 | }, |
358 | 359 | ||
359 | // The index of the last layer that was clicked on | 360 | // The index of the last layer that was clicked on |
360 | // (used for shift-click multiselect) | 361 | // (used for shift-click multiselect) |
361 | _lastLayerClicked : { | 362 | _lastLayerClicked : { |
362 | value: 0 | 363 | value: 0 |
363 | }, | 364 | }, |
364 | lastLayerClicked: { | 365 | lastLayerClicked: { |
365 | serializable: true, | 366 | serializable: true, |
366 | get: function() { | 367 | get: function() { |
@@ -476,7 +477,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
476 | timeMarkerHolder:{ | 477 | timeMarkerHolder:{ |
477 | value:null | 478 | value:null |
478 | }, | 479 | }, |
479 | 480 | ||
480 | // Drag and Drop properties | 481 | // Drag and Drop properties |
481 | _dragAndDropHelper : { | 482 | _dragAndDropHelper : { |
482 | value: false | 483 | value: false |
@@ -501,7 +502,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
501 | this._draggingType = newVal; | 502 | this._draggingType = newVal; |
502 | } | 503 | } |
503 | }, | 504 | }, |
504 | 505 | ||
505 | _elementsDragged: { | 506 | _elementsDragged: { |
506 | value: [] | 507 | value: [] |
507 | }, | 508 | }, |
@@ -535,33 +536,33 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
535 | set: function(newVal) { | 536 | set: function(newVal) { |
536 | if (newVal !== this._dropLayerID) { | 537 | if (newVal !== this._dropLayerID) { |
537 | this._dropLayerID = newVal; | 538 | this._dropLayerID = newVal; |
538 | 539 | ||
539 | var dropLayerIndex = this.getLayerIndexByID(newVal), | 540 | var dropLayerIndex = this.getLayerIndexByID(newVal), |
540 | i = 0, | 541 | i = 0, |
541 | dragLayerIndexesLength = this.currentLayersSelected.length, | 542 | dragLayerIndexesLength = this.currentLayersSelected.length, |
542 | dragAndDropDirection = 0, | 543 |