diff options
author | Valerio Virgillito | 2012-04-27 14:19:36 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-27 14:19:36 -0700 |
commit | 314709dd189807bfc762aa150bb1b29d2ccdf25b (patch) | |
tree | 94a2b7a9c3e89173d3fb39246485bae46cf0f23a /js/panels/Timeline | |
parent | 917668dbd753d69b346cb9fd2e665fbe257f5311 (diff) | |
parent | 69dba9ace7a1b77f57ee418abfc2e0fd0e0a9896 (diff) | |
download | ninja-314709dd189807bfc762aa150bb1b29d2ccdf25b.tar.gz |
Merge pull request #181 from imix23ways/TimelineUber
Timeline uber
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r-- | js/panels/Timeline/DragDrop.js | 136 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.html | 70 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 338 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/css/Layer.css | 99 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/scss/Layer.scss | 50 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | 61 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 1590 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css | 424 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/images/icon-checkmark.png | bin | 0 -> 1083 bytes | |||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/images/icon-gear.png | bin | 0 -> 1397 bytes | |||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/scss/TimelinePanel.scss | 373 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/scss/config.rb | 10 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html | 2 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 236 | ||||
-rw-r--r-- | js/panels/Timeline/Tween.reel/Tween.js | 78 |
15 files changed, 2296 insertions, 1171 deletions
diff --git a/js/panels/Timeline/DragDrop.js b/js/panels/Timeline/DragDrop.js new file mode 100644 index 00000000..55ee3ab4 --- /dev/null +++ b/js/panels/Timeline/DragDrop.js | |||
@@ -0,0 +1,136 @@ | |||
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 | |||
7 | var Montage = require("montage/core/core").Montage; | ||
8 | var Composer = require("montage/ui/composer/composer").Composer; | ||
9 | |||
10 | exports.DragDropComposer = Montage.create(Composer, { | ||
11 | |||
12 | draggable: { | ||
13 | value: true | ||
14 | }, | ||
15 | |||
16 | droppable: { | ||
17 | value: true | ||
18 | }, | ||
19 | |||
20 | identifier: { | ||
21 | value: "generic" | ||
22 | }, | ||
23 | |||
24 | _dragover: { | ||
25 | value: false | ||
26 | }, | ||
27 | |||
28 | load: { | ||
29 | value: function() { | ||
30 | //TODO: to make this work even better check to see if this is a component or not | ||
31 | //right now it does not support data-montage id's | ||
32 | this.element.addEventListener("mouseover", this, true); | ||
33 | this.element.addEventListener("mouseout", this, true); | ||
34 | this.component.element.addEventListener("dragenter", this, true); | ||
35 | this.component.element.addEventListener("dragleave", this, true); | ||
36 | this.component.element.addEventListener("dragend", this, true); | ||
37 | this.component.element.addEventListener("drop", this, true); | ||
38 | this.component.element.addEventListener("dragover", this, true); | ||
39 | this.component.element.addEventListener("dragstart", this, true); | ||
40 | } | ||
41 | }, | ||
42 | |||
43 | unload: { | ||
44 | value: function() { | ||
45 | this.element.removeEventListener("mouseover", this, true); | ||
46 | this.element.removeEventListener("mouseout", this, true); | ||
47 | this.component.element.removeEventListener("dragenter", this, true); | ||
48 | this.component.element.removeEventListener("dragleave", this, true); | ||
49 | this.component.element.removeEventListener("dragend", this, true); | ||
50 | this.component.element.removeEventListener("drop", this, true); | ||
51 | this.component.element.removeEventListener("dragover", this, true); | ||
52 | this.component.element.removeEventListener("dragstart", this, true); | ||
53 | } | ||
54 | }, | ||
55 | |||
56 | captureMouseover: { | ||
57 | value: function(e) { | ||
58 | if(this.draggable) { | ||
59 | this.component.element.draggable = true; | ||
60 | } | ||
61 | } | ||
62 | }, | ||
63 | |||
64 | captureMouseout: { | ||
65 | value: function(e) { | ||
66 | this.component.element.draggable = false; | ||
67 | } | ||
68 | }, | ||
69 | |||
70 | /* ------ Drag Drop Events ------- */ | ||
71 | |||
72 | // This Function will determine what is being moved | ||
73 | captureDragstart: { | ||
74 | value:function(e) { | ||
75 | e.dataTransfer.effectAllowed = 'move'; | ||
76 | e.dataTransfer.setData('Text', this.identifier); | ||
77 | this.component.element.classList.add("dragging"); | ||
78 | this.component.application.ninja.componentBeingDragged = this.component; | ||
79 | } | ||
80 | }, | ||
81 | |||
82 | captureDragenter: { | ||
83 | value: function(e) { | ||
84 | |||
85 | } | ||
86 | }, | ||
87 | |||
88 | captureDragover: { | ||
89 | value:function(e) { | ||
90 | e.preventDefault(); | ||
91 | e.stopImmediatePropagation(); | ||
92 | if (!this._dragover) { | ||
93 | this._dragover = true; | ||
94 | this.component.element.classList.add("dragOver"); | ||
95 | } | ||
96 | } | ||
97 | }, | ||
98 | |||
99 | captureDragleave: { | ||
100 | value: function(e) { | ||
101 | if (this._dragover) { | ||
102 | this._dragover = false; | ||
103 | this.component.element.classList.remove("dragOver"); | ||
104 | } | ||
105 | } | ||
106 | }, | ||
107 | |||
108 | captureDrop: { | ||
109 | value:function(e) { | ||
110 | e.stopPropagation(); // Stops some browsers from redirecting. | ||
111 | e.preventDefault(); | ||
112 | if (this._dragover) { | ||
113 | this._dragover = false; | ||
114 | this.component.element.classList.remove("dragOver"); | ||
115 | if (this.identifier === e.dataTransfer.getData("Text")) { | ||
116 | if(this.component.application.ninja.componentBeingDragged !== this.component) { | ||
117 | dropEvent = document.createEvent("CustomEvent"); | ||
118 | dropEvent.initCustomEvent("dropped", true, false, null); | ||
119 | dropEvent.draggedComponent = this.component.application.ninja.componentBeingDragged; | ||
120 | dropEvent.droppedComponent = this.component; | ||
121 | this.component.dispatchEvent(dropEvent); | ||
122 | } | ||
123 | } | ||
124 | this.component.application.ninja.componentBeingDragged = null; | ||
125 | } | ||
126 | |||
127 | } | ||
128 | }, | ||
129 | |||
130 | captureDragend: { | ||
131 | value:function(e) { | ||
132 | this.component.element.classList.remove("dragging"); | ||
133 | } | ||
134 | } | ||
135 | |||
136 | }); \ No newline at end of file | ||
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index 79b522ee..915e8b89 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html | |||
@@ -17,12 +17,15 @@ | |||
17 | "element": {"#": "layer"}, | 17 | "element": {"#": "layer"}, |
18 | "styleRepetition" : {"@":"repetition1"}, | 18 | "styleRepetition" : {"@":"repetition1"}, |
19 | "dynamicLayerName" : {"@":"dtext1"}, | 19 | "dynamicLayerName" : {"@":"dtext1"}, |
20 | "dynamicLayerTag" : {"@": "dtext2"}, | ||
20 | "slotStyle" : {"@":"slot1"}, | 21 | "slotStyle" : {"@":"slot1"}, |
21 | "mainCollapser" : {"@" : "mainCollapser"}, | 22 | "mainCollapser" : {"@" : "mainCollapser"}, |
22 | "positionCollapser" : {"@" : "positionCollapser"}, | 23 | "positionCollapser" : {"@" : "positionCollapser"}, |
23 | "transformCollapser" : {"@" : "transformCollapser"}, | 24 | "transformCollapser" : {"@" : "transformCollapser"}, |
24 | "styleCollapser" : {"@" : "styleCollapser"}, | 25 | "styleCollapser" : {"@" : "styleCollapser"}, |
25 | "clickerMain" : {"#" : "clicker-main"} | 26 | "clickerMain" : {"#" : "clicker-main"}, |
27 | "myLabel" : {"#" : "myLabel"}, | ||
28 | "dragDrop" : {"@" : "DragDrop"} | ||
26 | } | 29 | } |
27 | }, | 30 | }, |
28 | "dtext1" : { | 31 | "dtext1" : { |
@@ -39,6 +42,20 @@ | |||
39 | } | 42 | } |
40 | } | 43 | } |
41 | }, | 44 | }, |
45 | "dtext2" : { | ||
46 | "module" : "montage/ui/dynamic-text.reel", | ||
47 | "name" : "DynamicText", | ||
48 | "properties" : { | ||
49 | "element" : {"#" : "layer-tag"} | ||
50 | }, | ||
51 | "bindings" : { | ||
52 | "value" : { | ||
53 | "boundObject" : {"@": "owner"}, | ||
54 | "boundObjectPropertyPath" : "layerTag", | ||
55 | "oneway" : false | ||
56 | } | ||
57 | } | ||
58 | }, | ||
42 | "repetition1": { | 59 | "repetition1": { |
43 | "module": "montage/ui/repetition.reel", | 60 | "module": "montage/ui/repetition.reel", |
44 | "name": "Repetition", | 61 | "name": "Repetition", |
@@ -301,7 +318,7 @@ | |||
301 | "properties" : { | 318 | "properties" : { |
302 | "element" : {"#" : "content-style"}, | 319 | "element" : {"#" : "content-style"}, |
303 | "myContent" : {"#":"content-style"}, | 320 | "myContent" : {"#":"content-style"}, |
304 | "contentHeight" : 60, | 321 | "contentHeight" : 0, |
305 | "isLabelClickable" : true, | 322 | "isLabelClickable" : true, |
306 | "clicker" : {"#" : "clicker-style"}, | 323 | "clicker" : {"#" : "clicker-style"}, |
307 | "isCollapsed" : true, | 324 | "isCollapsed" : true, |
@@ -323,7 +340,8 @@ | |||
323 | <body> | 340 | <body> |
324 | 341 | ||
325 |