diff options
author | Kruti Shah | 2012-07-09 11:30:37 -0700 |
---|---|---|
committer | Kruti Shah | 2012-07-09 11:30:37 -0700 |
commit | 35a31845720beb1296dc42a79fa068601dfc52cb (patch) | |
tree | 252ba58a3f2bb9600262c48571cc3dabaee36449 /js/panels/Timeline/Keyframe.reel | |
parent | b35edd96135bd8c2b500ffee08474bacd17c25ac (diff) | |
parent | 39aa69624e1e3b8598b0242ee6ec436862b67280 (diff) | |
download | ninja-35a31845720beb1296dc42a79fa068601dfc52cb.tar.gz |
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel')
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/Keyframe.html | 34 | ||||
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/Keyframe.js | 103 | ||||
-rw-r--r-- | js/panels/Timeline/Keyframe.reel/css/Keyframe.css | 34 |
3 files changed, 124 insertions, 47 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.html b/js/panels/Timeline/Keyframe.reel/Keyframe.html index 4b029874..9f8baf86 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.html +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.html | |||
@@ -1,9 +1,33 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <!-- <copyright> | 2 | <!-- <copyright> |
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 3 | Copyright (c) 2012, Motorola Mobility, Inc |
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 4 | All Rights Reserved. |
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 5 | BSD License. |
6 | </copyright> --> | 6 | |
7 | Redistribution and use in source and binary forms, with or without | ||
8 | modification, are permitted provided that the following conditions are met: | ||
9 | |||
10 | - Redistributions of source code must retain the above copyright notice, | ||
11 | this list of conditions and the following disclaimer. | ||
12 | - Redistributions in binary form must reproduce the above copyright | ||
13 | notice, this list of conditions and the following disclaimer in the | ||
14 | documentation and/or other materials provided with the distribution. | ||
15 | - Neither the name of Motorola Mobility nor the names of its contributors | ||
16 | may be used to endorse or promote products derived from this software | ||
17 | without specific prior written permission. | ||
18 | |||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | POSSIBILITY OF SUCH DAMAGE. | ||
30 | </copyright> --> | ||
7 | <html lang="en"> | 31 | <html lang="en"> |
8 | <head> | 32 | <head> |
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | 33 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
@@ -26,4 +50,4 @@ | |||
26 | </div> | 50 | </div> |
27 | 51 | ||
28 | </body> | 52 | </body> |
29 | </html> \ No newline at end of file | 53 | </html> |
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index f7c936f7..a52150af 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js | |||
@@ -1,14 +1,39 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 2 | Copyright (c) 2012, Motorola Mobility, Inc |
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 3 | All Rights Reserved. |
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | BSD License. |
5 | </copyright> */ | 5 | |
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | - Redistributions of source code must retain the above copyright notice, | ||
10 | this list of conditions and the following disclaimer. | ||
11 | - Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | - Neither the name of Motorola Mobility nor the names of its contributors | ||
15 | may be used to endorse or promote products derived from this software | ||
16 | without specific prior written permission. | ||
17 | |||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
28 | POSSIBILITY OF SUCH DAMAGE. | ||
29 | </copyright> */ | ||
6 | 30 | ||
7 | var Montage = require("montage/core/core").Montage; | 31 | var Montage = require("montage/core/core").Montage; |
8 | var Component = require("montage/ui/component").Component; | 32 | var Component = require("montage/ui/component").Component; |
9 | 33 | ||
10 | var Keyframe = exports.Keyframe = Montage.create(Component, { | 34 | var Keyframe = exports.Keyframe = Montage.create(Component, { |
11 | 35 | ||
36 | // ==== Begin models | ||
12 | hasTemplate:{ | 37 | hasTemplate:{ |
13 | value: true | 38 | value: true |
14 | }, | 39 | }, |
@@ -42,7 +67,9 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
42 | this.needsDraw = true; | 67 | this.needsDraw = true; |
43 | } | 68 | } |
44 | }, | 69 | }, |
70 | // ==== End Models | ||
45 | 71 | ||
72 | // ==== Begin Draw cycle methods | ||
46 | prepareForDraw:{ | 73 | prepareForDraw:{ |
47 | value:function(){ | 74 | value:function(){ |
48 | this.element.addEventListener("click", this, false); | 75 | this.element.addEventListener("click", this, false); |
@@ -66,57 +93,31 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
66 | this.element.style.left = (this.position - 5) + "px"; | 93 | this.element.style.left = (this.position - 5) + "px"; |
67 | } | 94 | } |
68 | }, | 95 | }, |
96 | // ==== End Draw cycle methods | ||
69 | 97 | ||
70 | deselectKeyframe:{ | 98 | // ==== Begin Event handlers |
71 | value:function(){ | ||
72 | this.isSelected=false; | ||
73 | this.element.style.left = (this.position - 5) + "px"; | ||
74 | } | ||
75 | }, | ||
76 | |||
77 | selectKeyframe:{ | ||
78 | value:function(){ | ||
79 | if(this.isSelected){ | ||
80 | return; | ||
81 | } | ||
82 | |||
83 | if(this.parentComponent.parentComponent.parentComponent.trackType == "position"){ | ||
84 | var tweenID = this.parentComponent.tweenID; | ||
85 | var mainTrack = this.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent.parentComponent; | ||
86 | mainTrack.childComponents[0].childComponents[tweenID].childComponents[0].selectKeyframe(); | ||
87 | return; | ||
88 | } | ||
89 | |||
90 | this.isSelected=true; | ||
91 | this.element.style.left = (this.position - 6) + "px"; | ||
92 | this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; | ||
93 | this.parentComponent.selectTween(); | ||
94 | } | ||
95 | }, | ||
96 | |||
97 | handleClick:{ | 99 | handleClick:{ |
98 | value:function(ev){ | 100 | value:function(ev){ |
99 | this.selectKeyframe(); | 101 | this.selectKeyframe(); |
100 | ev.stopPropagation(); | 102 | ev.stopPropagation(); |
101 | } | 103 | } |
102 | }, | 104 | }, |
103 | 105 | ||
104 | handleMouseover: { | 106 | handleMouseover: { |
105 | value: function(event) { | 107 | value: function(event) { |
106 | this.element.draggable = true; | 108 | this.element.draggable = true; |
107 | } | 109 | } |
108 | }, | 110 | }, |
111 | |||
109 | handleMouseout: { | 112 | handleMouseout: { |
110 | value: function(event) { | 113 | value: function(event) { |
111 | this.element.draggable = false; | 114 | this.element.draggable = false; |
112 | } | 115 | } |
113 | }, | 116 | }, |
117 | |||
114 | handleDragstart: { | 118 | handleDragstart: { |
115 | value: function(event) { | 119 | value: function(event) { |
116 | //this.parentComponent.parentComponent.dragLayerID = this.layerID; | ||
117 | event.dataTransfer.setData('Text', 'Keyframe'); | 120 | event.dataTransfer.setData('Text', 'Keyframe'); |
118 | |||
119 | // Get my index in my track's tween array | ||
120 | var i = 0, | 121 | var i = 0, |
121 | tweenRepetitionLength = this.parentComponent.parentComponent.parentComponent.tweenRepetition.childComponents.length, | 122 | tweenRepetitionLength = this.parentComponent.parentComponent.parentComponent.tweenRepetition.childComponents.length, |
122 | myIndex = null; | 123 | myIndex = null; |
@@ -129,10 +130,38 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { | |||
129 | this.selectKeyframe(); | 130 | this.selectKeyframe(); |
130 | } | 131 | } |
131 | }, | 132 | }, |
133 | |||
132 | handleDragend: { | 134 | handleDragend: { |
133 | value: function(event) { | 135 | value: function(event) { |
134 | this.parentComponent.isDragging = false; | 136 | this.parentComponent.isDragging = false; |
135 | } | 137 | } |
136 | } | 138 | }, |
137 | 139 | // ==== End Event handlers | |
140 | |||
141 | // === Begin Controllers | ||
142 | selectKeyframe:{ | ||
143 | value:function(){ | ||
144 | if(this.isSelected){ | ||
145 | return; | ||
146 | } | ||
147 | if(this.parentComponent.parentComponent.parentComponent.trackType == "position"){ | ||
148 | var tweenID = this.parentComponent.tweenID; | ||