From 0e1a276f19ea70009c5a649e9667861d7c346a7e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 6 Jun 2012 00:25:27 -0700 Subject: first iteration of adding serializable to ninja plus other changes to run the latest montage Signed-off-by: Valerio Virgillito --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 122 ++++++++++++++++++--- 1 file changed, 107 insertions(+), 15 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 6e9513f2..7af88662 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -10,10 +10,98 @@ var nj = require("js/lib/NJUtils").NJUtils; var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { - hasTemplate:{ - value:true + user_layers: { + value: null, + serializable: true + }, + + track_container: { + value: null, + serializable: true + }, + + timeline_leftpane: { + value: null, + serializable: true + }, + + layer_tracks: { + value: null, + serializable: true + }, + + master_track: { + value: null, + serializable: true + }, + + time_markers: { + value: null, + serializable: true + }, + + playhead: { + value: null, + serializable: true + }, + + playheadmarker: { + value: null, + serializable: true + }, + + timetext: { + value: null, + serializable: true + }, + + timebar: { + value: null, + serializable: true + }, + + container_tracks: { + value: null, + serializable: true }, + end_hottext: { + value: null, + serializable: true + }, + + container_layers: { + value: null, + serializable: true + }, + + timeline_disabler: { + value: null, + serializable: true + }, + + checkable_relative: { + value: null, + serializable: true + }, + + checkable_absolute: { + value: null, + serializable: true + }, + + checkable_animated: { + value: null, + serializable: true + }, + + tl_configbutton: { + value: null, + serializable: true + }, + + + /* === BEGIN: Models === */ _currentDocument: { value : null @@ -90,7 +178,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { }, set:function (newVal) { this._layerRepetition = newVal; - } + }, + serializable: true }, // Set to false to skip array caching array sets in current document @@ -234,7 +323,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { }, set:function (newVal) { this._trackRepetition = newVal; - } + }, + serializable: true }, _selectedKeyframes:{ @@ -488,11 +578,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Store the timeline data in currentDocument... if (this._boolCacheArrays) { // ... but only if we're supposed to. - this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; - this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; - this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; - this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; - this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; + if(this.currentDocument) { + this.currentDocument.tlArrLayers = this.arrLayers; + this.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; + this.currentDocument.tllayerNumber = this.currentLayerNumber; + this.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; + this.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; + } } } }, @@ -500,12 +592,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { initTimelineCache: { value: function() { // Initialize the currentDocument for a new set of timeline data. - this.application.ninja.currentDocument.isTimelineInitialized = true; - this.application.ninja.currentDocument.tlArrLayers = []; - this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; - this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; - this.application.ninja.currentDocument.tlCurrentLayerSelected = false; - this.application.ninja.currentDocument.tlCurrentLayersSelected = false; + this.currentDocument.isTimelineInitialized = true; + this.currentDocument.tlArrLayers = []; + this.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; + this.currentDocument.tllayerNumber = this.currentLayerNumber; + this.currentDocument.tlCurrentLayerSelected = false; + this.currentDocument.tlCurrentLayersSelected = false; } }, -- cgit v1.2.3