aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/PropertyTrack.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/PropertyTrack.reel')
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js407
1 files changed, 256 insertions, 151 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index a12128ff..e5ff1e95 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -1,25 +1,24 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility LLC. 2Copyright (c) 2012, Motorola Mobility, Inc
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
4 5
5Redistribution and use in source and binary forms, with or without 6Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met: 7modification, are permitted provided that the following conditions are met:
7 8
8* Redistributions of source code must retain the above copyright notice, 9 - Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer. 10 this list of conditions and the following disclaimer.
10 11 - Redistributions in binary form must reproduce the above copyright
11* Redistributions in binary form must reproduce the above copyright notice, 12 notice, this list of conditions and the following disclaimer in the
12 this list of conditions and the following disclaimer in the documentation 13 documentation and/or other materials provided with the distribution.
13 and/or other materials provided with the distribution. 14 - Neither the name of Motorola Mobility nor the names of its contributors
14 15 may be used to endorse or promote products derived from this software
15* Neither the name of Motorola Mobility LLC nor the names of its 16 without specific prior written permission.
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
18 17
19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -34,44 +33,12 @@ var Component = require("montage/ui/component").Component;
34 33
35var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { 34var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
36 35
36
37 hasTemplate:{ 37 hasTemplate:{
38 value: true 38 value: true
39 }, 39 },
40 40
41 prepareForDraw:{ 41 /* Begin: Models */
42 value:function(){
43 this.element.addEventListener("click", this, false);
44 this.trackID = this.parentComponent.parentComponent.parentComponent.parentComponent.trackID;
45 this.animatedElement = this.parentComponent.parentComponent.parentComponent.parentComponent.animatedElement;
46 this.ninjaStylesContoller = this.application.ninja.stylesController;
47 }
48 },
49
50 draw:{
51 value:function(){
52
53 }
54 },
55
56 didDraw:{
57 value:function () {
58 if(this.currentKeyframeRule){
59 this.retrieveStoredStyleTweens();
60 }
61 }
62 },
63
64 trackEditorProperty:{
65 value:""
66 },
67
68 animatedElement:{
69 value:null
70 },
71
72 isSubproperty:{
73 value:true
74 },
75 42
76 _propTweenRepetition:{ 43 _propTweenRepetition:{
77 value:null 44 value:null
@@ -116,27 +83,6 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
116 } 83 }
117 } 84 }
118 }, 85 },
119
120 nextKeyframe:{
121 value:1
122 },
123
124 ninjaStylesContoller:{
125 value:null
126 },
127
128 animationName:{
129 value:null
130 },
131
132 currentKeyframeRule:{
133 value:null
134 },
135
136 trackDuration:{
137 value:0
138 },
139
140 _trackID:{ 86 _trackID:{
141 value:null 87 value:null
142 }, 88 },
@@ -185,6 +131,42 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
185 } 131 }
186 }, 132 },
187 133
134 trackEditorProperty:{
135 value:""
136 },
137
138 animatedElement:{
139 value:null
140 },
141
142 isSubproperty:{
143 value:true
144 },
145
146 nextKeyframe:{
147 value:1
148 },
149
150 ninjaStylesContoller:{
151 value:null
152 },
153
154 animationName:{
155 value:null
156 },
157
158 currentKeyframeRule:{
159 value:null
160 },
161
162 trackDuration:{
163 value:0
164 },
165
166 timelineTrack:{
167 value:null
168 },
169
188 setData:{ 170 setData:{
189 value:function () { 171 value:function () {
190 if (typeof(this.propTrackData) === "undefined") { 172 if (typeof(this.propTrackData) === "undefined") {
@@ -200,35 +182,72 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
200 } 182 }
201 }, 183 },
202 184
185 /* End: Models */
186
187 /* Begin: Draw Cycle */
188 prepareForDraw:{
189 value:function(){
190 this.element.addEventListener("click", this, false);
191 this.timelineTrack = this.parentComponent.parentComponent.parentComponent.parentComponent;
192 this.trackID = this.timelineTrack.trackID;
193 this.animatedElement = this.timelineTrack.animatedElement;
194 this.ninjaStylesContoller = this.application.ninja.stylesController;
195 this.eventManager.addEventListener("tlZoomSlider", this, false);
196
197 // Drag and Drop event handlers
198 this.element.addEventListener("dragstart", this.handleKeyframeDragstart.bind(this), false);
199 this.element.addEventListener("dragend", this.handleKeyframeDragstart.bind(this), false);
200 this.element.addEventListener("drop", this.handleKeyframeDragstart.bind(this), false);
201 }
202 },
203
204 didDraw:{
205 value:function () {
206 if(this.currentKeyframeRule){
207 this.retrieveStoredStyleTweens();
208 }
209 }
210 },
211
212 /* End: Draw Cycle */
213
214 /* Begin: Event Handlers */
215
216 handleKeyframeDragstart: {
217 value: function(event) {
218 event.stopPropagation();
219 return false;
220 }
221 },
222
203 handleClick:{ 223 handleClick:{
204 value:function (ev) { 224 value:function (ev) {
225
226 var selectIndex ,
227 currentSelectedStyleIndex;
228
205 if (ev.shiftKey) { 229 if (ev.shiftKey) {