aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Track.reel
diff options
context:
space:
mode:
authorKruti Shah2012-07-03 15:10:45 -0700
committerKruti Shah2012-07-03 15:10:45 -0700
commit14f30bb927f2cb4a27c81fd6ee4e8d9af46b4404 (patch)
tree4c8ad3e68c3b71639f2718d7100a75f11bdefbdd /js/panels/Timeline/Track.reel
parentf9c592ac8284cace4daed6f2ac87fe15dfad873c (diff)
downloadninja-14f30bb927f2cb4a27c81fd6ee4e8d9af46b4404.tar.gz
Refactor Code + Bug Fix for the Colorchip disappear between breadcrumb navigation
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/panels/Timeline/Track.reel')
-rw-r--r--js/panels/Timeline/Track.reel/Track.html63
-rw-r--r--js/panels/Timeline/Track.reel/Track.js187
-rw-r--r--js/panels/Timeline/Track.reel/css/Track.css32
-rw-r--r--js/panels/Timeline/Track.reel/images/gridline.jpgbin724 -> 0 bytes
4 files changed, 0 insertions, 282 deletions
diff --git a/js/panels/Timeline/Track.reel/Track.html b/js/panels/Timeline/Track.reel/Track.html
deleted file mode 100644
index 0f0c7c9c..00000000
--- a/js/panels/Timeline/Track.reel/Track.html
+++ /dev/null
@@ -1,63 +0,0 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html lang="en">
8 <head>
9 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" type="text/css" href="css/Track.css">
11 <script type="text/montage-serialization">
12 {
13 "owner": {
14 "prototype": "js/panels/Timeline/Track.reel",
15 "properties": {
16 "element": {"#": "track"},
17 "spanRepetition" : {"@" : "spanRepetition"},
18 "track_lane": {"#": "track_lane"}
19 }
20 },
21
22 "trackslot": {
23 "prototype": "montage/ui/slot.reel",
24 "properties": {
25 "element": {"#": "track_lane"}
26 },
27 "bindings" : {
28 "content" : {
29 "boundObject" : {"@": "spanRepetition"},
30 "boundObjectPropertyPath" : "objectAtCurrentIteration",
31 "oneway" : false
32 }
33 }
34 },
35
36 "spanRepetition": {
37 "prototype": "montage/ui/repetition.reel",
38 "properties": {
39 "element": {"#": "track_lanes"},
40 "isSelectionEnabled" : true
41 },
42 "bindings": {
43 "objects": {
44 "boundObject": {"@": "owner"},
45 "boundObjectPropertyPath": "spans",
46 "oneway": false
47 }
48 }
49 }
50
51 }
52 </script>
53 </head>
54 <body>
55
56 <div data-montage-id="track">
57 <div data-montage-id="track_lanes">
58 <div data-montage-id="track_lane" class="tracklane"></div>
59 </div>
60 </div>
61
62 </body>
63</html> \ No newline at end of file
diff --git a/js/panels/Timeline/Track.reel/Track.js b/js/panels/Timeline/Track.reel/Track.js
deleted file mode 100644
index 2ef760b7..00000000
--- a/js/panels/Timeline/Track.reel/Track.js
+++ /dev/null
@@ -1,187 +0,0 @@
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
7var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component;
9var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager;
10
11var Track = exports.Track = Montage.create(Component, {
12
13 track_lane: {
14 value: null,
15 serializable: true
16 },
17
18 _trackID:{
19 value:null
20 },
21
22 trackID:{
23 get:function(){
24 return this._trackID;
25 },
26 set:function(value){
27 this._trackID = value;
28 }
29 },
30
31 _spans:{
32 value:[]
33 },
34
35 spans:{
36 serializable:true,
37 get:function () {
38 return this._spans;
39 },
40 set:function (newVal) {
41 this._spans = newVal;
42 }
43 },
44
45 _spanRepetition:{
46 value:null
47 },
48
49 spanRepetition:{
50 get:function () {
51 return this._spanRepetition;
52 },
53 set:function (newVal) {
54 this._spanRepetition = newVal;
55 }
56 },
57
58 trackDuration:{
59 value:0
60 },
61
62 currentKeyframe:{
63 value:0
64 },
65
66 currentMillisecClicked:{
67 value: 0
68 },
69
70 isAnimated:{
71 value:false
72 },
73
74 animatedElement:{
75 value:null
76 },
77
78 ninjaStylesContoller:{
79 value: null
80 },
81
82 //TEMP
83 keyFrames:{
84 serializable: true,
85 value:[]
86 },
87
88 prepareForDraw: {
89 value: function() {
90 this.keyFrames = new Array();
91 this.spans = new Array();
92 this.track_lane.addEventListener("click", this, false);
93 this.addNewEndPoint(0);
94
95 this.ninjaStylesContoller = this.application.ninja.stylesController;
96 }
97 },
98
99 handleNewTween:{
100 value: function(event){
101 var newTween = Tween.create();
102 }
103 },
104
105 handleClick:{
106 value:function (ev) {
107 var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
108 this.currentMillisecClicked = currentMillisecPerPixel * (ev.offsetX + parseInt(ev.target.style.left));
109
110 // TEMP - if the SHIFT key is down, add a new keyframe or split an existing span
111 // This needs to move to a keyboard shortcut that is TBD
112 if (ev.shiftKey) {
113 var prevFrame = this.keyFrames[this.keyFrames.length - 1][0];
114 if (ev.offsetX > prevFrame) {
115 this.addNewEndPoint(ev.offsetX);
116 this.currentMillisecClicked = currentMillisecPerPixel * ev.offsetX;
117 } else {
118 this.currentMillisecClicked = currentMillisecPerPixel * (ev.offsetX + parseInt(ev.target.style.left));
119 this.splitSpan(ev);
120 }
121 }
122
123 console.log("currentMillisecClicked = " + this.currentMillisecClicked);
124 }
125 },
126
127 addNewEndPoint : {
128 value: function(xpos){
129 var newKeyFrame = document.createElement("div");
130 newKeyFrame.className = "keyframe";
131 newKeyFrame.style.left = (xpos - 2) + "px";
132 this.track_lane.appendChild(newKeyFrame);
133
134 if(xpos > 0){
135 var prevFrame = this.keyFrames[this.keyFrames.length - 1][0];
136
137 var newDefaultSpan = document.createElement("div");
138 newDefaultSpan.className = "defaultSpan";
139 newDefaultSpan.style.left = prevFrame + "px";
140 newDefaultSpan.style.width = (xpos - prevFrame) + "px";
141 this.track_lane.appendChild(newDefaultSpan);
142
143 this.spans.push(newDefaultSpan);
144 }
145
146 var keyframePercent = this.currentMillisecClicked / this.application.ninja.timeline.totalDuration;
147 var keyframeProperties;
148
149 //console.log(keyframePercent);
150
151 this.keyFrames.push([xpos, keyframePercent, keyframeProperties]);
152 //console.log(this.keyFrames)
153 }
154 },
155
156 splitSpan: {
157 value: function(ev){
158 console.log("splitting span at span offsetX: " + ev.offsetX);
159
160