diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 948 |
1 files changed, 737 insertions, 211 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 9bf51e60..b3f4318a 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -1,295 +1,821 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage; | 1 | var Montage = require("montage/core/core").Montage; |
8 | var Component = require("montage/ui/component").Component; | 2 | var Component = require("montage/ui/component").Component; |
9 | var TimelineController = require("js/panels/Timeline/TimelineController").TimelineController; | 3 | var Layer = require("js/panels/Timeline/Layer.reel").Layer; |
4 | var TimelineTrack = require("js/panels/Timeline/TimelineTrack.reel").TimelineTrack; | ||
5 | var nj = require("js/lib/NJUtils").NJUtils; | ||
10 | 6 | ||
11 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | 7 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { |
12 | 8 | ||
13 | tmpImg: { value: null}, | 9 | hasTemplate:{ |
10 | value:true | ||
11 | }, | ||
14 | 12 | ||
15 | templateDidLoad: { | 13 | /* === BEGIN: Models === */ |
16 | value: function() { | 14 | _arrLayers:{ |
17 | /* | 15 | value:[] |
18 | this.tmpImg = document.createElement("img"); | ||
19 | this.tmpImg.width = 1879; | ||
20 | this.tmpImg.height = 440; | ||
21 | this.tmpImg.src = "images/timeline/timeline.png"; | ||
22 | */ | ||
23 | } | ||
24 | }, | 16 | }, |
25 | 17 | ||
26 | prepareForDraw: { | 18 | arrLayers:{ |
27 | value: function() { | 19 | get:function () { |
28 | this.element.style.background = "url('images/timeline/timeline.png')"; | 20 | return this._arrLayers; |
29 | this.element.style.width = "100%"; | 21 | }, |
30 | this.element.style.height = "400px"; | 22 | set:function (newVal) { |
31 | this.element.style.backgroundPosition = "-5px -40px"; | 23 | this._arrLayers = newVal; |
32 | } | 24 | } |
33 | }, | 25 | }, |
34 | 26 | ||
35 | init : { | 27 | _layerRepetition:{ |
36 | value : function() | 28 | value:null |
37 | { | 29 | }, |
38 | this.buildTimelineView(); | ||
39 | 30 | ||
31 | layerRepetition:{ | ||
32 | get:function () { | ||
33 | return this._layerRepetition; | ||
34 | }, | ||
35 | set:function (newVal) { | ||
36 | this._layerRepetition = newVal; | ||
40 | } | 37 | } |
41 | }, | 38 | }, |
42 | 39 | ||
43 | breadCrumbContainer:{ | 40 | _currentLayerNumber:{ |
44 | value:null, | 41 | value:0 |
45 | writable:true, | ||
46 | enumerable:true | ||
47 | }, | 42 | }, |
48 | 43 | ||
49 | controlsContainer:{ | 44 | currentLayerNumber:{ |
50 | value:null, | 45 | get:function () { |
51 | writable:true, | 46 | return this._currentLayerNumber; |
52 | enumerable:true | 47 | }, |
48 | set:function (newVal) { | ||
49 | if (newVal !== this._currentLayerNumber) { | ||
50 | this._currentLayerNumber = newVal; | ||
51 | } | ||
52 | } | ||
53 | }, | 53 | }, |
54 | 54 | ||
55 | timelineGutter:{ | 55 | currentLayerSelected:{ |
56 | value:null, | 56 | value: null |
57 | writable:true, | ||
58 | enumerable:true | ||
59 | }, | 57 | }, |
60 | 58 | ||
61 | userLayerContainer:{ | 59 | currentTrackSelected:{ |
62 | value:null, | 60 | value: null |
63 | writable:true, | ||
64 | enumerable:true | ||
65 | }, | 61 | }, |
66 | 62 | ||
67 | currentLayerNumber:{ | 63 | millisecondsOffset:{ |
68 | value:1, | 64 | value:1000 |
69 | writable:true, | 65 | }, |
70 | enumerable:true | ||
71 | }, | ||
72 | |||
73 | newLayerButton:{ | ||
74 | value:null, | ||
75 | writable:true, | ||
76 | enumerable:true | ||
77 | }, | ||
78 | |||
79 | deleteLayerButton:{ | ||
80 | value:null, | ||
81 | writable:true, | ||
82 | enumerable:true | ||
83 | }, | ||
84 | |||
85 | newFolderButton:{ | ||
86 | value:null, | ||
87 | writable:true, | ||
88 | enumerable:true | ||
89 | }, | ||
90 | |||
91 | buildTimelineView : { | ||
92 | value:function(){ | ||
93 | var timeline = document.getElementById("timelinePanel"); | ||
94 | |||
95 | var mainTimelineContainer = document.createElement("div"); | ||
96 | mainTimelineContainer.style.backgroundColor = "#000000"; | ||
97 | mainTimelineContainer.style.width = "100%"; | ||
98 | mainTimelineContainer.style.height = "100%"; | ||
99 | mainTimelineContainer.style.overflow = "visible"; | ||
100 | |||
101 | timeline.appendChild(mainTimelineContainer); | ||
102 | |||
103 | this.breadCrumbContainer = document.createElement("div"); | ||
104 | this.breadCrumbContainer.style.width = "100%"; | ||
105 | this.breadCrumbContainer.style.height = "20px"; | ||
106 | this.breadCrumbContainer.style.backgroundColor = "#111111"; | ||
107 | 66 | ||
108 | var timeControllerContainer = document.createElement("div"); | 67 | _arrTracks:{ |
109 | timeControllerContainer.style.width = "auto"; | 68 | serializable:true, |
110 | timeControllerContainer.style.height = "20px"; | 69 | value:[] |
111 | timeControllerContainer.style.backgroundColor = "#000000"; | 70 | }, |
112 | 71 | ||
113 | this.controlsContainer = document.createElement("div"); | 72 | arrTracks:{ |
114 | this.controlsContainer.style.width = "200px"; | 73 | serializable:true, |
115 | this.controlsContainer.style.height = "20px"; | 74 | get:function () { |
116 | this.controlsContainer.style.backgroundColor = "#440000"; | 75 | return this._arrTracks; |
117 | this.controlsContainer.style.float = "left"; | 76 | }, |
118 | this.controlsContainer.innerText = "Timeline Controller"; | 77 | set:function (newVal) { |
78 | this._arrTracks = newVal; | ||
79 | } | ||
80 | }, | ||
119 | 81 | ||
120 | var timeContainer = document.createElement("div"); | 82 | _trackRepetition:{ |
121 | timeContainer.style.width = "inherit"; | 83 | serializable:true, |
122 | timeContainer.style.height = "20px"; | 84 | value:null |
123 | timeContainer.style.backgroundColor = "#880000"; | 85 | }, |
124 | timeContainer.style.float = "left"; | ||
125 | timeContainer.innerText = "Time markers"; | ||
126 | 86 | ||
127 | timeControllerContainer.appendChild(this.controlsContainer); | 87 | trackRepetition:{ |
128 | timeControllerContainer.appendChild(timeContainer); | 88 | serializable:true, |
89 | get:function () { | ||
90 | return this._trackRepetition; | ||
91 | }, | ||
92 | set:function (newVal) { | ||
93 | this._trackRepetition = newVal; | ||
94 | } | ||
95 | }, | ||
129 | 96 | ||
130 | var masterLayerContainer = document.createElement("div"); | 97 | _selectedKeyframes:{ |
131 | masterLayerContainer.style.width = "100%"; | 98 | value:[] |
132 | masterLayerContainer.style.height = "20px"; | 99 | }, |
133 | masterLayerContainer.style.backgroundColor = "#111111"; | ||
134 | masterLayerContainer.style.border = "solid"; | ||
135 | masterLayerContainer.style.borderWidth = "thin"; | ||
136 | masterLayerContainer.style.borderColor = "#333333"; | ||
137 | masterLayerContainer.innerText = "MASTER Layer"; | ||
138 | 100 | ||
139 | this.userLayerContainer = document.createElement("div"); | 101 | selectedKeyframes:{ |
140 | this.userLayerContainer.style.width = "100%"; | 102 | serializable:true, |