diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 1427 |
1 files changed, 773 insertions, 654 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 033d0f79..33b99760 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -6,10 +6,7 @@ | |||
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage; | 7 | var Montage = require("montage/core/core").Montage; |
8 | var Component = require("montage/ui/component").Component; | 8 | var Component = require("montage/ui/component").Component; |
9 | var Layer = require("js/panels/Timeline/Layer.reel").Layer; | ||
10 | var TimelineTrack = require("js/panels/Timeline/TimelineTrack.reel").TimelineTrack; | ||
11 | var nj = require("js/lib/NJUtils").NJUtils; | 9 | var nj = require("js/lib/NJUtils").NJUtils; |
12 | var ElementMediator = require("js/mediators/element-mediator").ElementMediator; | ||
13 | 10 | ||
14 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | 11 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { |
15 | 12 | ||
@@ -19,19 +16,19 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
19 | 16 | ||
20 | /* === BEGIN: Models === */ | 17 | /* === BEGIN: Models === */ |
21 | _arrLayers:{ | 18 | _arrLayers:{ |
22 | serializable: true, | 19 | serializable:true, |
23 | value:[] | 20 | value:[] |
24 | }, | 21 | }, |
25 | 22 | ||
26 | arrLayers:{ | 23 | arrLayers:{ |
27 | serializable: true, | 24 | serializable:true, |
28 | get:function () { | 25 | get:function () { |
29 | return this._arrLayers; | 26 | return this._arrLayers; |
30 | }, | 27 | }, |
31 | set:function (newVal) { | 28 | set:function (newVal) { |
32 | this._arrLayers = newVal; | 29 | this._arrLayers = newVal; |
33 | this.needsDraw = true; | 30 | this.needsDraw = true; |
34 | this._cacheArrays(); | 31 | this.cacheTimeline(); |
35 | } | 32 | } |
36 | }, | 33 | }, |
37 | 34 | ||
@@ -50,12 +47,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
50 | 47 | ||
51 | 48 | ||
52 | _layerRepetition:{ | 49 | _layerRepetition:{ |
53 | serializable: true, | 50 | serializable:true, |
54 | value:null | 51 | value:null |
55 | }, | 52 | }, |
56 | 53 | ||
57 | layerRepetition:{ | 54 | layerRepetition:{ |
58 | serializable: true, | 55 | serializable:true, |
59 | get:function () { | 56 | get:function () { |
60 | return this._layerRepetition; | 57 | return this._layerRepetition; |
61 | }, | 58 | }, |
@@ -64,18 +61,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
64 | } | 61 | } |
65 | }, | 62 | }, |
66 | 63 | ||
67 | _cacheArrays : { | ||
68 | value: function() { | ||
69 | if (this._boolCacheArrays) { | ||
70 | this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; | ||
71 | |||
72 | } | ||
73 | } | ||
74 | }, | ||
75 | |||
76 | // Set to false to skip array caching array sets in current document | 64 | // Set to false to skip array caching array sets in current document |
77 | _boolCacheArrays : { | 65 | _boolCacheArrays:{ |
78 | value: true | 66 | value:true |
79 | }, | 67 | }, |
80 | 68 | ||
81 | _currentLayerNumber:{ | 69 | _currentLayerNumber:{ |
@@ -89,93 +77,84 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
89 | set:function (newVal) { | 77 | set:function (newVal) { |
90 | if (newVal !== this._currentLayerNumber) { | 78 | if (newVal !== this._currentLayerNumber) { |
91 | this._currentLayerNumber = newVal; | 79 | this._currentLayerNumber = newVal; |
92 | this._setCurrentLayerNumber(); | 80 | this.cacheTimeline(); |
93 | } | 81 | } |
94 | } | 82 | } |
95 | }, | 83 | }, |
96 | 84 | ||
97 | _setCurrentLayerNumber:{ | 85 | _currentLayerSelected:{ |
98 | value:function(){ | 86 | value:null |
99 | if (this._boolCacheArrays) { | ||
100 | this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; | ||
101 | } | ||
102 | } | ||
103 | }, | 87 | }, |
104 | 88 | currentLayerSelected:{ | |
105 | _hashKey:{ | 89 | get:function () { |
106 | value:0 | 90 | return this._currentLayerSelected; |
107 | }, | 91 | }, |
92 | set:function (newVal) { | ||
93 | this._currentLayerSelected = newVal; | ||
94 | this.cacheTimeline(); | ||
95 | } | ||
96 | }, | ||
108 | 97 | ||
109 | hashKey:{ | 98 | _selectedLayerID:{ |
99 | value:false | ||
100 | }, | ||
101 | selectedLayerID:{ | ||
110 | get:function () { | 102 | get:function () { |
111 | return this._hashKey; | 103 | return this._selectedLayerID; |
112 | }, | 104 | }, |
113 | set:function (newVal) { | 105 | set:function (newVal) { |
114 | if (newVal !== this._hashKey) { | 106 | if (newVal === false) { |
115 | this._hashKey = newVal; | 107 | // We are clearing the timeline, so just set the value and return. |
116 | this._setHashKey(); | 108 | this._selectedLayerID = newVal; |
109 | return; | ||
110 | } | ||
111 | if (newVal !== this._selectedLayerID) { | ||
112 | var selectIndex = this.getLayerIndexByID(newVal); | ||
113 | this._selectedLayerID = newVal; | ||
114 | this._captureSelection = true; | ||
115 | this.selectLayer(selectIndex); | ||
117 | } | 116 | } |
118 | } | 117 | } |
119 | }, | 118 | }, |
120 | 119 | ||
121 | _setHashKey:{ | 120 | _millisecondsOffset:{ |
122 | value:function(){ | 121 | value:1000 |
123 | if (this._boolCacheArrays) { | ||
124 | this.application.ninja.currentDocument.hashKey = this.hashKey; | ||
125 | } | ||
126 | } | ||
127 | }, | 122 | }, |
128 | 123 | ||
129 | _currentLayerSelected:{ | 124 | millisecondsOffset:{ |
130 | value: null | 125 | get:function () { |
126 | return this._millisecondsOffset; | ||
131 | }, | 127 | }, |
132 | currentLayerSelected : { | 128 | set:function (newVal) { |
133 | get: function() { | 129 | if (newVal !== this._millisecondsOffset) { |
134 | return this._currentLayerSelected; | 130 | this._millisecondsOffset= newVal; |
135 | }, | 131 | this.drawTimeMarkers(); |
136 | set: function(newVal) { | 132 | NJevent('tlZoomSlider',this); |
137 | this._currentLayerSelected = newVal; | 133 | } |
138 | this.application.ninja.currentDocument.tlCurrentLayerSelected = newVal; | 134 | } |
139 | } | ||
140 | }, | 135 | }, |
141 | 136 | ||
142 | _selectedLayerID:{ | 137 | tweenarray:{ |
143 | value: false | 138 | value:[], |
144 | }, | 139 | writable:true |
145 | selectedLayerID : { | ||
146 | get: function() { | ||
147 | return this._selectedLayerID; | ||
148 | }, | ||
149 | set: function(newVal) { | ||
150 | if (newVal === false) { | ||
151 | // We are clearing the timeline, so just set the value and return. | ||
152 | this._selectedLayerID = newVal; | ||
153 | return; | ||
154 | } | ||
155 | if (newVal !== this._selectedLayerID) { | ||
156 | var selectIndex = this.getLayerIndexByID(newVal); | ||
157 | this._selectedLayerID = newVal; | ||
158 | this._captureSelection = true; | ||
159 | this.selectLayer(selectIndex, true); | ||
160 | } | ||
161 | } | ||
162 | }, | 140 | }, |
163 | 141 | ||
164 | millisecondsOffset:{ | 142 | tempArray:{ |
165 | value:1000 | 143 | value:[], |
144 | writable:true | ||
166 | }, | 145 | }, |
167 | 146 | ||
168 | _masterDuration:{ | 147 | _masterDuration:{ |
169 | serializable: true, |