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