diff options
author | Ananya Sen | 2012-02-10 16:05:27 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-10 16:05:27 -0800 |
commit | f3dc624fa464a79fd8e8cec1ddd16ed2109bda23 (patch) | |
tree | f716757dab75d7626297893c7f4aca3596d606de /js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |
parent | c48eeb01bd726895dc577d8b843b2a75883eee07 (diff) | |
download | ninja-f3dc624fa464a79fd8e8cec1ddd16ed2109bda23.tar.gz |
Revert "Merge from /joseeight/ninja-internal/tree/FileIO"
This reverts commit c48eeb01bd726895dc577d8b843b2a75883eee07.
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rwxr-xr-x | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 1027 |
1 files changed, 215 insertions, 812 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 44129743..9bf51e60 100755 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -1,892 +1,295 @@ | |||
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 | |||
1 | var Montage = require("montage/core/core").Montage; | 7 | var Montage = require("montage/core/core").Montage; |
2 | var Component = require("montage/ui/component").Component; | 8 | var Component = require("montage/ui/component").Component; |
3 | var Layer = require("js/panels/Timeline/Layer.reel").Layer; | 9 | var TimelineController = require("js/panels/Timeline/TimelineController").TimelineController; |
4 | var TimelineTrack = require("js/panels/Timeline/TimelineTrack.reel").TimelineTrack; | ||
5 | var nj = require("js/lib/NJUtils").NJUtils; | ||
6 | var ElementMediator = require("js/mediators/element-mediator").ElementMediator; | ||
7 | 10 | ||
8 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | 11 | var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { |
9 | 12 | ||
10 | hasTemplate:{ | 13 | tmpImg: { value: null}, |
11 | value:true | ||
12 | }, | ||
13 | |||
14 | /* === BEGIN: Models === */ | ||
15 | _arrLayers:{ | ||
16 | value:[] | ||
17 | }, | ||
18 | |||
19 | arrLayers:{ | ||
20 | get:function () { | ||
21 | return this._arrLayers; | ||
22 | }, | ||
23 | set:function (newVal) { | ||
24 | this._arrLayers = newVal; | ||
25 | } | ||
26 | }, | ||
27 | |||
28 | _layerRepetition:{ | ||
29 | value:null | ||
30 | }, | ||
31 | 14 | ||
32 | layerRepetition:{ | 15 | templateDidLoad: { |
33 | get:function () { | 16 | value: function() { |
34 | return this._layerRepetition; | 17 | /* |
35 | }, | 18 | this.tmpImg = document.createElement("img"); |
36 | set:function (newVal) { | 19 | this.tmpImg.width = 1879; |
37 | this._layerRepetition = newVal; | 20 | this.tmpImg.height = 440; |
21 | this.tmpImg.src = "images/timeline/timeline.png"; | ||
22 | */ | ||
38 | } | 23 | } |
39 | }, | 24 | }, |
40 | 25 | ||
41 | _currentLayerNumber:{ | 26 | prepareForDraw: { |
42 | value:0 | 27 | value: function() { |
43 | }, | 28 | this.element.style.background = "url('images/timeline/timeline.png')"; |
44 | 29 | this.element.style.width = "100%"; | |
45 | currentLayerNumber:{ | 30 | this.element.style.height = "400px"; |
46 | get:function () { | 31 | this.element.style.backgroundPosition = "-5px -40px"; |
47 | return this._currentLayerNumber; | ||
48 | }, | ||
49 | set:function (newVal) { | ||
50 | if (newVal !== this._currentLayerNumber) { | ||
51 | this._currentLayerNumber = newVal; | ||
52 | } | ||
53 | } | 32 | } |
54 | }, | 33 | }, |
55 | 34 | ||
56 | currentLayerSelected:{ | 35 | init : { |
57 | value: null | 36 | value : function() |
58 | }, | 37 | { |
59 | 38 | this.buildTimelineView(); | |
60 | currentTrackSelected:{ | ||
61 | value: null | ||
62 | }, | ||
63 | |||
64 | millisecondsOffset:{ | ||
65 | value:1000 | ||
66 | }, | ||
67 | |||
68 | _arrTracks:{ | ||
69 | serializable:true, | ||
70 | value:[] | ||
71 | }, | ||
72 | 39 | ||
73 | arrTracks:{ | ||
74 | serializable:true, | ||
75 | get:function () { | ||
76 | return this._arrTracks; | ||
77 | }, | ||
78 | set:function (newVal) { | ||
79 | this._arrTracks = newVal; | ||
80 | } | 40 | } |
81 | }, | 41 | }, |
82 | 42 | ||
83 | _trackRepetition:{ | 43 | breadCrumbContainer:{ |
84 | serializable:true, | 44 | value:null, |
85 | value:null | 45 | writable:true, |
46 | enumerable:true | ||
86 | }, | 47 | }, |
87 | 48 | ||
88 | trackRepetition:{ | 49 | controlsContainer:{ |
89 | serializable:true, | 50 | value:null, |
90 | get:function () { | 51 | writable:true, |
91 | return this._trackRepetition; | 52 | enumerable:true |
92 | }, | ||
93 | set:function (newVal) { | ||
94 | this._trackRepetition = newVal; | ||
95 | } | ||
96 | }, | 53 | }, |
97 | 54 | ||
98 | _selectedKeyframes:{ | 55 | timelineGutter:{ |
99 | value:[] | 56 | value:null, |
57 | writable:true, | ||
58 | enumerable:true | ||
100 | }, | 59 | }, |
101 | 60 | ||
102 | selectedKeyframes:{ | 61 | userLayerContainer:{ |
103 | serializable:true, | 62 | value:null, |
104 | get:function () { | 63 | writable:true, |
105 | return this._selectedKeyframes; | 64 | enumerable:true |
106 | }, | ||
107 | set:function (newVal) { | ||
108 | this._selectedKeyframes = newVal; | ||
109 | } | ||
110 | }, | 65 | }, |
111 | 66 | ||
112 | _isLayer:{ | 67 | currentLayerNumber:{ |
113 | value:false | 68 | value:1, |
114 | }, | 69 | writable:true, |
115 | 70 | enumerable:true | |
116 | _firstTimeLoaded:{ | ||
117 | value:true, | ||
118 | writable:true | ||
119 | }, | 71 | }, |
120 | 72 | ||
121 | _arrLayersNonEmpty:{ | 73 | newLayerButton:{ |
122 | value:true, | 74 | value:null, |
123 | writable:true | 75 | writable:true, |
76 | enumerable:true | ||
124 | }, | 77 | }, |
125 | 78 | ||
126 | _captureSelection:{ | 79 | deleteLayerButton:{ |
127 | value:false, | 80 | value:null, |
128 | writable:true | 81 | writable:true, |
129 | }, | 82 | enumerable:true |
130 | /* === END: Models === */ | ||
131 | |||
132 | /* === BEGIN: Draw cycle === */ | ||
133 | prepareForDraw:{ | ||
134 | value:function () { | ||
135 | |||
136 | this.eventManager.addEventListener("deleteLayerClick", this, false); | ||
137 | this.eventManager.addEventListener("newLayer", this, false); | ||
138 | this.eventManager.addEventListener("deleteLayer", this, false); | ||
139 | this.eventManager.addEventListener("layerBinding", this, false); | ||
140 | this.eventManager.addEventListener("elementAdded", this, false); | ||
141 | this.eventManager.addEventListener("elementDeleted", this, false); | ||
142 | this.eventManager.addEventListener("deleteSelection", this, false); | ||
143 | this.eventManager.addEventListener("selectionChange", this, true); | ||
144 | this.hashInstance = this.createLayerHashTable(); | ||
145 | this.hashTrackInstance = this.createTrackHashTable(); | ||
146 | this.hashLayerNumber = this.createLayerNumberHash(); | ||
147 | this.hashElementMapToLayer = this.createElementMapToLayer(); | ||
148 | this.initTimelineView(); | ||
149 | } | ||
150 | }, | 83 | }, |
151 | 84 | ||
152 | willDraw:{ | 85 | newFolderButton:{ |
153 | value:function () { | 86 | value:null, |
154 | if (this._isLayer) { | 87 | writable:true, |
155 | this.insertLayer(); | 88 | enumerable:true |
156 | this._isLayer = false; | ||
157 | } | ||
158 | } | ||
159 | }, | ||
160 |