aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js221
1 files changed, 100 insertions, 121 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 190f818c..dfc40c0a 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -277,7 +277,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
277 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 277 this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
278 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false); 278 this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
279 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false); 279 this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false);
280
281 } 280 }
282 }, 281 },
283 282
@@ -285,15 +284,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
285 value:function () { 284 value:function () {
286 var myIndex; 285 var myIndex;
287 this.drawTimeMarkers(); 286 this.drawTimeMarkers();
288
289 // Document switching 287 // Document switching
290 // Check to see if we have saved timeline information in the currentDocument. 288 // Check to see if we have saved timeline information in the currentDocument.
291 if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") { 289 if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") {
292 // No, we have no information stored. Create it. 290 // No, we have no information stored. Create it.
293 this.log('newfile ' + this.application.ninja.currentDocument.name)
294 this.application.ninja.currentDocument.isTimelineInitialized = true; 291 this.application.ninja.currentDocument.isTimelineInitialized = true;
295 this.application.ninja.currentDocument.tlArrLayers = []; 292 this.application.ninja.currentDocument.tlArrLayers = [];
296 this.application.ninja.currentDocument.tlArrTracks = [];
297 this.application.ninja.currentDocument.tllayerNumber = 0; 293 this.application.ninja.currentDocument.tllayerNumber = 0;
298 this.application.ninja.currentDocument.tlLayerHashTable=[]; 294 this.application.ninja.currentDocument.tlLayerHashTable=[];
299 this.hashKey = this.application.ninja.currentSelectedContainer.uuid; 295 this.hashKey = this.application.ninja.currentSelectedContainer.uuid;
@@ -325,29 +321,17 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
325 this.application.ninja.currentDocument.tlLayerHashTable = this.hashInstance; 321 this.application.ninja.currentDocument.tlLayerHashTable = this.hashInstance;
326 this.application.ninja.currentDocument.tlElementHashTable = this.hashElementMapToLayer; 322 this.application.ninja.currentDocument.tlElementHashTable = this.hashElementMapToLayer;
327 this.application.ninja.currentDocument.hashKey=this.hashKey; 323 this.application.ninja.currentDocument.hashKey=this.hashKey;
328
329
330
331 } else { 324 } else {
332 // we do have information stored. Use it. 325 // we do have information stored. Use it.
333 this._boolCacheArrays = false; 326 this._boolCacheArrays = false;
334 //this.arrLayers = [];
335 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers; 327 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers;
336 this.arrTracks = this.application.ninja.currentDocument.tlArrTracks;
337 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 328 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
338 this.hashInstance = this.application.ninja.currentDocument.tlLayerHashTable; 329 this.hashInstance = this.application.ninja.currentDocument.tlLayerHashTable;
339 this.hashElementMapToLayer = this.application.ninja.currentDocument.tlElementHashTable; 330 this.hashElementMapToLayer = this.application.ninja.currentDocument.tlElementHashTable;
340 this.hashKey = this.application.ninja.currentDocument.hashKey; 331 this.hashKey = this.application.ninja.currentDocument.hashKey;
341 this.selectLayer(0); 332 this.selectLayer(0);
342 this._boolCacheArrays = true; 333 this._boolCacheArrays = true;
343
344
345 } 334 }
346
347 // Redraw all the things
348 //this.layerRepetition.needsDraw = true;
349 //this.trackRepetition.needsDraw = true;
350 //this.needsDraw = true;
351 } 335 }
352 }, 336 },
353 337
@@ -367,7 +351,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
367 351
368 // Clear variables--including repetitions. 352 // Clear variables--including repetitions.
369 this.hashInstance = null; 353 this.hashInstance = null;
370 this.hashLayerNumber = null;
371 this.hashElementMapToLayer = null; 354 this.hashElementMapToLayer = null;
372 this.arrLayers = []; 355 this.arrLayers = [];
373 356
@@ -391,7 +374,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
391 this._bindDocumentEvents(); 374 this._bindDocumentEvents();
392 375
393 this.hashInstance = this.createLayerHashTable(); 376 this.hashInstance = this.createLayerHashTable();
394 this.hashLayerNumber = this.createLayerNumberHash();
395 this.hashElementMapToLayer = this.createElementMapToLayer(); 377 this.hashElementMapToLayer = this.createElementMapToLayer();
396 this.initTimelineForDocument(); 378 this.initTimelineForDocument();
397 } 379 }
@@ -501,7 +483,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
501 this._firstTimeLoaded = false; 483 this._firstTimeLoaded = false;
502 } else { 484 } else {
503 this.arrLayers.length = 0; 485 this.arrLayers.length = 0;
504 this.arrTracks.length = 0;
505 this.hashKey = node.uuid; 486 this.hashKey = node.uuid;
506 487
507 if (this.returnedObject = this.hashInstance.getItem(this.hashKey)) { 488 if (this.returnedObject = this.hashInstance.getItem(this.hashKey)) {
@@ -533,8 +514,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
533 if (object._el.parentElementUUID !== this.application.ninja.currentSelectedContainer.uuid) { 514 if (object._el.parentElementUUID !== this.application.ninja.currentSelectedContainer.uuid) {
534 dLayer = this.hashInstance.getItem(object._el.parentElementUUID); 515 dLayer = this.hashInstance.getItem(object._el.parentElementUUID);
535 while (dLayer[hashVariable]) { 516 while (dLayer[hashVariable]) {
536 if (dLayer[hashVariable]._layerID === object._el._layerID) { 517 if (dLayer[hashVariable].layerData._layerID === object._el._layerID) {
537 dLayer[hashVariable].deleted = false; 518 dLayer[hashVariable].layerData.deleted = false;
538 parentNode = dLayer[hashVariable].parentElement; 519 parentNode = dLayer[hashVariable].parentElement;
539 break; 520 break;
540 } 521 }
@@ -544,9 +525,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
544 this.LayerBinding(parentNode); 525 this.LayerBinding(parentNode);
545 } else { 526 } else {
546 dLayer = this.hashInstance.getItem(object._el.parentElementUUID); 527 dLayer = this.hashInstance.getItem(object._el.parentElementUUID);
547 while (dLayer[hashVariable]) { 528 while (dLayer[hashVariable].layerData) {
548 if (dLayer[hashVariable]._layerID === object._el._layerID) { 529 if (dLayer[hashVariable].layerData._layerID === object._el._layerID) {
549 dLayer[hashVariable].deleted = false; 530 dLayer[hashVariable].layerData.deleted = false;
550 531
551 this.arrLayers.splice(object._layerPosition, 0, object._el); 532 this.arrLayers.splice(object._layerPosition, 0, object._el);
552 this.selectLayer(object._layerPosition); 533 this.selectLayer(object._layerPosition);
@@ -561,58 +542,58 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
561 var newLayerName = "", 542 var newLayerName = "",
562 thingToPush = {}, 543 thingToPush = {},
563 myIndex = 0; 544 myIndex = 0;
545 thingToPush.layerData = {};
564 546
565// this.currentLayerNumber = this.hashLayerNumber.getItem(this._hashKey);
566// if (this.currentLayerNumber === undefined) {
567// this.currentLayerNumber = 0;
568// }
569 547
570 this.currentLayerNumber = this.currentLayerNumber + 1; 548 this.currentLayerNumber = this.currentLayerNumber + 1;
571 newLayerName = "Layer " + this.currentLayerNumber; 549 newLayerName = "Layer " + this.currentLayerNumber;
572 thingToPush.layerName = newLayerName; 550 thingToPush.layerData.layerName = newLayerName;
573 thingToPush.layerID = this.currentLayerNumber; 551 thingToPush.layerData.layerID = this.currentLayerNumber;
574 thingToPush.isMainCollapsed = true; 552 thingToPush.layerData.isMainCollapsed = true;
575 thingToPush.isPositionCollapsed = true; 553 thingToPush.layerData.isPositionCollapsed = true;
576 thingToPush.isTransformCollapsed = true; 554 thingToPush.layerData.isTransformCollapsed = true;
577 thingToPush.isStyleCollapsed = true; 555 thingToPush.layerData.isStyleCollapsed = true;
578 thingToPush.arrLayerStyles = []; 556 thingToPush.layerData.arrLayerStyles = [];
579 thingToPush.elementsList = []; 557 thingToPush.layerData.elementsList = [];
580 thingToPush.deleted = false; 558 thingToPush.layerData.deleted = false;
581 thingToPush.isSelected = false; 559 thingToPush.layerData.isSelected = false;
582 thingToPush.created=false; 560
583 thingToPush.isTrackAnimated = false; 561 thingToPush.layerData.isActive = false;
584 thingToPush.currentKeyframeRule = null; 562
585 thingToPush.trackPosition = 0; 563 thingToPush.layerData.created=false;
586 thingToPush.arrStyleTracks = []; 564 thingToPush.layerData.isTrackAnimated = false;
587 thingToPush.tweens = []; 565 thingToPush.layerData.currentKeyframeRule = null;
566 thingToPush.layerData.trackPosition = 0;
567 thingToPush.layerData.arrStyleTracks = [];
568 thingToPush.layerData.tweens = [];
588 569
589 thingToPush.parentElementUUID = this.hashKey; 570 thingToPush.parentElementUUID = this.hashKey;
590 thingToPush.parentElement = this.application.ninja.currentSelectedContainer; 571 thingToPush.parentElement = this.application.ninja.currentSelectedContainer;
591 572
592 if (!!this.layerRepetition.selectedIndexes) { 573 if (!!this.layerRepetition.selectedIndexes) {
593 myIndex = this.layerRepetition.selectedIndexes[0]; 574 myIndex = this.layerRepetition.selectedIndexes[0];
594 thingToPush.layerPosition = myIndex; 575 thingToPush.layerData.layerPosition = myIndex;
595 thingToPush.isSelected = true; 576 thingToPush.layerData.isSelected = true;
596 thingToPush.trackPosition = myIndex; 577 thingToPush.layerData.trackPosition = myIndex;
597 this.arrLayers.splice(myIndex, 0, thingToPush); 578 this.arrLayers.splice(myIndex, 0, thingToPush);
598 this._LayerUndoPosition = myIndex; 579 this._LayerUndoPosition = myIndex;
599 this.selectLayer(myIndex); 580 this.selectLayer(myIndex);
600 this.hashLayerNumber.setItem(this.hashKey, thingToPush); 581 <