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 From 844d59d85a1881525c79a1f44a35a9ea59e70e4a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 00:02:22 -0700 Subject: removing the serializable from the timeline repetition and fixing the panels currentDocument binding Signed-off-by: Valerio Virgillito --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 658ac043..36b868d0 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -221,8 +221,7 @@ 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 @@ -346,8 +345,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { }, set:function (newVal) { this._trackRepetition = newVal; - }, - serializable: true + } }, _selectedKeyframes:{ @@ -603,11 +601,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.currentDocument.model.domContainer; - 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.application.ninja.currentDocument.tlArrLayers = this.arrLayers; + this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer; + this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; + this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; + this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; + } } } }, -- cgit v1.2.3 From 5e010900b91d8634ba6caed0c97ccc1ccdec1ff7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 00:13:28 -0700 Subject: adding more missing properties to the timeline Signed-off-by: Valerio Virgillito --- js/panels/Timeline/Layer.reel/Layer.js | 38 ++++++++++++++++++++-- js/panels/Timeline/Style.reel/Style.js | 30 ++++++++++++++--- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 4 +-- js/panels/Timeline/Track.reel/Track.js | 5 +-- js/panels/Timeline/Tween.reel/Tween.js | 10 ++++-- 5 files changed, 74 insertions(+), 13 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 16fb0303..474190b9 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -15,8 +15,39 @@ var nj = require("js/lib/NJUtils").NJUtils; var Layer = exports.Layer = Montage.create(Component, { - hasTemplate:{ - value: true + dynamicLayerName: { + value: null, + serializable: true + }, + + dynamicLayerTag: { + value: null, + serializable: true + }, + + positionCollapser: { + value: null, + serializable: true + }, + + transformCollapser: { + value: null, + serializable: true + }, + + styleCollapser: { + value: null, + serializable: true + }, + + clickerMain: { + value: null, + serializable: true + }, + + myLabel: { + value: null, + serializable: true }, /* Begin: Models */ @@ -31,7 +62,8 @@ var Layer = exports.Layer = Montage.create(Component, { }, set: function(newVal) { this._mainCollapser = newVal; - } + }, + serializable: true }, /* Style models: the array of styles, and the repetition that uses them */ diff --git a/js/panels/Timeline/Style.reel/Style.js b/js/panels/Timeline/Style.reel/Style.js index c39f3a56..eed58a65 100644 --- a/js/panels/Timeline/Style.reel/Style.js +++ b/js/panels/Timeline/Style.reel/Style.js @@ -20,10 +20,31 @@ var Component = require("montage/ui/component").Component; var LayerStyle = exports.LayerStyle = Montage.create(Component, { - hasTemplate:{ - value: true + styleContainer: { + value: null, + serializable: true }, - + + styleHintable: { + value: null, + serializable: true + }, + + styleProperty: { + value: null, + serializable: true + }, + + valueEditorHottext: { + value: null, + serializable: true + }, + + dtextProperty: { + value: null, + serializable: true + }, + /* === BEGIN: Models === */ // isSelected: whether or not the style is selected _isSelected: { @@ -112,7 +133,8 @@ var LayerStyle = exports.LayerStyle = Montage.create(Component, { }, set: function(newVal) { this._myHintable = newVal; - } + }, + serializable: true }, _myHintableValue : { value: null diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 126e6a61..7cfe07a6 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -11,8 +11,8 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { - hasTemplate:{ - value:true + tween: { + value: null }, _trackID:{ diff --git a/js/panels/Timeline/Track.reel/Track.js b/js/panels/Timeline/Track.reel/Track.js index 8c52199a..2ef760b7 100644 --- a/js/panels/Timeline/Track.reel/Track.js +++ b/js/panels/Timeline/Track.reel/Track.js @@ -10,8 +10,9 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve var Track = exports.Track = Montage.create(Component, { - hasTemplate:{ - value: true + track_lane: { + value: null, + serializable: true }, _trackID:{ diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 8b6826ed..dda06028 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -9,8 +9,14 @@ var Component = require("montage/ui/component").Component; var Tween = exports.Tween = Montage.create(Component, { - hasTemplate:{ - value: true + keyframe: { + value: null, + serializable: true + }, + + tweenspan: { + value: null, + serializable: true }, _tweenData:{ -- cgit v1.2.3 From 8e5536bddb9f9f991e1d5ed363d253879a159a28 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 00:20:47 -0700 Subject: fixing a timeline issue Signed-off-by: Valerio Virgillito --- js/panels/Timeline/Layer.reel/Layer.js | 5 ----- 1 file changed, 5 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 474190b9..ed0200ae 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -15,11 +15,6 @@ var nj = require("js/lib/NJUtils").NJUtils; var Layer = exports.Layer = Montage.create(Component, { - dynamicLayerName: { - value: null, - serializable: true - }, - dynamicLayerTag: { value: null, serializable: true -- cgit v1.2.3 From 0a5ce26ee62b74261e1b00877b7e43af0e681856 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 12 Jun 2012 10:10:11 -0700 Subject: Timeline: Fix document switching under Montage v.10 --- js/panels/Timeline/Layer.reel/Layer.js | 1 + .../Timeline/TimelinePanel.reel/TimelinePanel.js | 3 +++ .../Timeline/TimelineTrack.reel/TimelineTrack.js | 28 +++++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index ed0200ae..6b64261e 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -456,6 +456,7 @@ var Layer = exports.Layer = Montage.create(Component, { }, layerData:{ + serializable: true, get:function(){ return this._layerData; }, diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 36b868d0..65476d6b 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -783,6 +783,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { var i = 0, tlArrLayersLength = this.application.ninja.currentDocument.tlArrLayers.length; + + this._ignoreNextContainerChange = true; + // We're reading from the cache, not writing to it. this._boolCacheArrays = false; for (i = 0; i < tlArrLayersLength; i++) { diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 7cfe07a6..75997466 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -155,7 +155,11 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { }, set: function(newVal) { this._arrPositionTracks = newVal; - this.trackData.arrPositionTracks = newVal; + if (typeof(this.trackData) === "undefined") { + //this.createTrackData(); + } + this.trackData.arrPositionTracks = newVal; + } }, _positionTracksRepetition: { @@ -348,6 +352,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { }, trackData:{ + serializable: true, get:function(){ return this._trackData; }, @@ -386,6 +391,27 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.needsDraw = true; } }, + createTrackData: { + value: function() { + tempData = {}; + tempData.bypassAnimation = this.bypassAnimation; + tempData.trackID = this.layerID; + tempData.tweens = this.tweens; + tempData.animatedElement = this.animatedElement; + tempData.arrStyleTracks = this.arrStyleTracks; + tempData.isTrackAnimated = this.isTrackAnimated; + tempData.trackDuration = this.trackDuration; + tempData.animationName = this.animationName; + tempData.currentKeyframeRule = this.currentKeyframeRule; + tempData.isMainCollapsed = this.isMainCollapsed; + tempData.isPositionCollapsed = this.isPositionCollapsed; + tempData.isTransformCollapsed = this.isTransformCollapsed; + tempData.isStyleCollapsed = this.isStyleCollapsed; + tempData.trackPosition = this.trackPosition; + tempData.isVisible = this.isVisible; + this.trackData = tempData; + } + }, // Data binding observation point and trigger method _bindingPoint : { -- cgit v1.2.3 From a61713e5187e10cebf7984ced7a8443949c412b0 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 10:56:47 -0700 Subject: fix a typo Signed-off-by: Valerio Virgillito --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 65476d6b..cb8185e5 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -221,7 +221,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { }, set:function (newVal) { this._layerRepetition = newVal; - }, + } }, // Set to false to skip array caching array sets in current document -- cgit v1.2.3 From 55e392b4ac5e45e8bf468399b3c0ddde669a15fd Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 12 Jun 2012 11:10:38 -0700 Subject: montage v10 serialization updates for timeline Signed-off-by: Jonathan Duran --- js/panels/Timeline/Collapser.js | 34 ++++++++++++- js/panels/Timeline/Layer.reel/Layer.js | 13 +++++ .../Timeline/TimelineTrack.reel/TimelineTrack.html | 8 ++-- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 55 ++++++++++++++++++++-- 4 files changed, 101 insertions(+), 9 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/Collapser.js b/js/panels/Timeline/Collapser.js index 88314c8b..e5c04279 100644 --- a/js/panels/Timeline/Collapser.js +++ b/js/panels/Timeline/Collapser.js @@ -41,6 +41,7 @@ var Montage = require("montage/core/core").Montage, value: 0 }, contentHeight: { + serializable: true, get: function() { return this._contentHeight; }, @@ -59,6 +60,7 @@ var Montage = require("montage/core/core").Montage, value: false }, isAnimated: { + serializable: true, get: function() { return this._isAnimated; }, @@ -71,6 +73,7 @@ var Montage = require("montage/core/core").Montage, value: true }, bypassAnimation: { + serializable: true, get: function() { return this._bypassAnimation; }, @@ -102,6 +105,7 @@ var Montage = require("montage/core/core").Montage, value: "" }, isCollapsed : { + serializable: true, get: function() { return this._isCollapsed; }, @@ -110,7 +114,6 @@ var Montage = require("montage/core/core").Montage, this._isCollapsed = newVal; //this.needsDraw = true; } - } }, @@ -141,6 +144,7 @@ var Montage = require("montage/core/core").Montage, value: true }, isLabelClickable : { + serializable: true, get: function() { return this._isLabelClickable; }, @@ -149,6 +153,34 @@ var Montage = require("montage/core/core").Montage, } }, + _myContent:{ + value:null + }, + + myContent:{ + serializable:true, + get:function () { + return this._myContent; + }, + set:function (newVal) { + this._myContent = newVal; + } + }, + + _clicker:{ + value:null + }, + + clicker:{ + serializable:true, + get:function () { + return this._clicker; + }, + set:function (newVal) { + this._clicker = newVal; + } + }, + // isToggling: Bindable property. Set this (to anything) to trigger a toggle. _isToggling: { serializable: true, diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 6b64261e..a2d6444d 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -372,6 +372,19 @@ var Layer = exports.Layer = Montage.create(Component, { _layerEditable : { value: false }, + + _dynamicLayerName:{ + value:true + }, + dynamicLayerName:{ + serializable:true, + get:function () { + return this._dynamicLayerName; + }, + set:function (newVal) { + this._dynamicLayerName = newVal; + } + }, // Are the various collapsers collapsed or not _isMainCollapsed : { diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html index 5c5a8b76..091470f3 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html @@ -16,10 +16,10 @@ "element": {"#": "track"}, "tweenRepetition" : {"@" : "tweenRepetition"}, "tween": {"@" : "tween"}, - "_mainCollapser" : {"@" : "mainCollapser"}, - "_positionCollapser" : {"@" : "positionCollapser"}, - "_transformCollapser" : {"@" : "transformCollapser"}, - "_styleCollapser" : {"@" : "styleCollapser"} + "mainCollapser" : {"@" : "mainCollapser"}, + "positionCollapser" : {"@" : "positionCollapser"}, + "transformCollapser" : {"@" : "transformCollapser"}, + "styleCollapser" : {"@" : "styleCollapser"} } }, diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 75997466..87a5e156 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -11,10 +11,6 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { - tween: { - value: null - }, - _trackID:{ value:null }, @@ -31,6 +27,21 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { } } }, + + _tween:{ + value:[] + }, + + tween:{ + serializable:true, + get:function () { + return this._tween; + }, + set:function (newVal) { + this._tween = newVal; + } + }, + _isVisible:{ value: true }, @@ -337,15 +348,51 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { _positionCollapser:{ value:null }, + positionCollapser:{ + serializable:true, + get:function(){ + return this._positionCollapser; + }, + set:function(val){ + this._positionCollapser = val; + } + }, _mainCollapser:{ value:null }, + mainCollapser:{ + serializable:true, + get:function () { + return this._mainCollapser; + }, + set:function (val) { + this._mainCollapser = val; + } + }, _transformCollapser:{ value:null }, + transformCollapser:{ + serializable:true, + get:function () { + return this._transformCollapser; + }, + set:function (val) { + this._transformCollapser = val; + } + }, _styleCollapser:{ value:null }, + styleCollapser:{ + serializable:true, + get:function () { + return this._styleCollapser; + }, + set:function (val) { + this._styleCollapser = val; + } + }, _trackData:{ value: false -- cgit v1.2.3