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.js1441
1 files changed, 783 insertions, 658 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 033d0f79..8c3b64eb 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -6,10 +6,7 @@
6 6
7var Montage = require("montage/core/core").Montage; 7var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9var Layer = require("js/panels/Timeline/Layer.reel").Layer;
10var TimelineTrack = require("js/panels/Timeline/TimelineTrack.reel").TimelineTrack;
11var nj = require("js/lib/NJUtils").NJUtils; 9var nj = require("js/lib/NJUtils").NJUtils;
12var ElementMediator = require("js/mediators/element-mediator").ElementMediator;
13 10
14var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { 11var 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,74 @@ 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:{
106 value:0
107 },
108
109 hashKey:{
110 get:function () { 89 get:function () {
111 return this._hashKey; 90 return this._currentLayerSelected;
112 }, 91 },
113 set:function (newVal) { 92 set:function (newVal) {
114 if (newVal !== this._hashKey) { 93 this._currentLayerSelected = newVal;
115 this._hashKey = newVal; 94 this.cacheTimeline();
116 this._setHashKey();
117 }
118 } 95 }
119 }, 96 },
120 97
121 _setHashKey:{ 98 _selectedLayerID:{
122 value:function(){ 99 value:false
123 if (this._boolCacheArrays) { 100 },
124 this.application.ninja.currentDocument.hashKey = this.hashKey; 101 selectedLayerID:{
102 get:function () {
103 return this._selectedLayerID;
104 },
105 set:function (newVal) {
106 if (newVal === false) {
107 // We are clearing the timeline, so just set the value and return.
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, true);
125 } 116 }
126 } 117 }
127 }, 118 },
128 119
129 _currentLayerSelected:{ 120 _millisecondsOffset:{
130 value: null 121 value:1000
131 },
132 currentLayerSelected : {
133 get: function() {
134 return this._currentLayerSelected;
135 },
136 set: function(newVal) {
137 this._currentLayerSelected = newVal;
138 this.application.ninja.currentDocument.tlCurrentLayerSelected = newVal;
139 }
140 },
141
142 _selectedLayerID:{
143 value: false
144 },
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 }, 122 },
163 123
164 millisecondsOffset:{ 124 millisecondsOffset:{
165 value:1000 125 get:function () {
126 return this._millisecondsOffset;
127 },
128 set:function (newVal) {
129 if (newVal !== this._millisecondsOffset) {
130 this._millisecondsOffset= newVal;
131 this.drawTimeMarkers();
132 NJevent('tlZoomSlider',this);
133 }
134 }
166 }, 135 },
167 136
168 _masterDuration:{ 137 _masterDuration:{
169 serializable: true, 138 serializable:true,
170 value:0 139 value:0
171 }, 140 },