aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/components/editable.reel/editable.js8
-rw-r--r--js/components/hintable.reel/hintable.js20
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js2
-rw-r--r--js/panels/Timeline/DragDrop.js136
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.html54
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js237
-rw-r--r--js/panels/Timeline/Layer.reel/css/Layer.css76
-rw-r--r--js/panels/Timeline/Layer.reel/scss/Layer.scss34
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html42
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js1204
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css11
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html2
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js201
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js9
-rwxr-xr-xjs/tools/SelectionTool.js2
15 files changed, 1229 insertions, 809 deletions
diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js
index 9c8946c4..7a31e7fd 100644
--- a/js/components/editable.reel/editable.js
+++ b/js/components/editable.reel/editable.js
@@ -120,7 +120,7 @@ exports.Editable = Montage.create(Component, {
120 } 120 }
121 121
122 if(this.stopOnBlur) { 122 if(this.stopOnBlur) {
123 console.log('adding mousedown event listener'); 123 //console.log('adding mousedown event listener');
124 ///// Simulate blur on editable node by listening to the doc 124 ///// Simulate blur on editable node by listening to the doc
125 document.addEventListener('mouseup', this, false); 125 document.addEventListener('mouseup', this, false);
126 } 126 }
@@ -189,7 +189,7 @@ exports.Editable = Montage.create(Component, {
189 handleKeydown : { 189 handleKeydown : {
190 value : function(e) { 190 value : function(e) {
191 var k = e.keyCode; 191 var k = e.keyCode;
192 console.log('keyCode: ' + k); 192 //console.log('keyCode: ' + k);
193 } 193 }
194 }, 194 },
195 ///// Text input has changed values 195 ///// Text input has changed values
@@ -204,7 +204,7 @@ exports.Editable = Montage.create(Component, {
204 }, 204 },
205 handleMouseup : { 205 handleMouseup : {
206 value : function(e) { 206 value : function(e) {
207 console.log('handle mouse down'); 207 //console.log('handle mouse down');
208 ///// Listen for simulated blur event 208 ///// Listen for simulated blur event
209 if(this.stopOnBlur && e._event.target !== this._element) { 209 if(this.stopOnBlur && e._event.target !== this._element) {
210 this.blur(); 210 this.blur();
@@ -213,7 +213,7 @@ exports.Editable = Montage.create(Component, {
213 }, 213 },
214 handleEvent : { 214 handleEvent : {
215 value : function(e) { 215 value : function(e) {
216 console.log("event type : " + e._event.type); 216 //console.log("event type : " + e._event.type);
217 ///// If configured, start on specified event 217 ///// If configured, start on specified event
218 if(e._event.type === this.startOnEvent) { 218 if(e._event.type === this.startOnEvent) {
219 this.start(); 219 this.start();
diff --git a/js/components/hintable.reel/hintable.js b/js/components/hintable.reel/hintable.js
index 5ed46b3c..6e3b2aaf 100644
--- a/js/components/hintable.reel/hintable.js
+++ b/js/components/hintable.reel/hintable.js
@@ -90,10 +90,10 @@ exports.Hintable = Montage.create(Editable, {
90 hintNext : { 90 hintNext : {
91 value : function(e) { 91 value : function(e) {
92 if(e) { e.preventDefault(); } 92 if(e) { e.preventDefault(); }
93 console.log('next1'); 93 //console.log('next1');
94 94
95 if(this._matchIndex < this.matches.length - 1) { 95 if(this._matchIndex < this.matches.length - 1) {
96 console.log('next'); 96 //console.log('next');
97 ++this._matchIndex; 97 ++this._matchIndex;
98 this.hint = this._getHintDifference(); 98 this.hint = this._getHintDifference();
99 } 99 }
@@ -102,9 +102,9 @@ exports.Hintable = Montage.create(Editable, {
102 hintPrev : { 102 hintPrev : {
103 value : function(e) { 103 value : function(e) {
104 if(e) { e.preventDefault(); } 104 if(e) { e.preventDefault(); }
105 console.log('prev1'); 105 //console.log('prev1');
106 if(this._matchIndex !== 0) { 106 if(this._matchIndex !== 0) {
107 console.log('prev'); 107 //console.log('prev');
108 --this._matchIndex; 108 --this._matchIndex;
109 this.hint = this._getHintDifference(); 109 this.hint = this._getHintDifference();
110 } 110 }
@@ -135,7 +135,7 @@ exports.Hintable = Montage.create(Editable, {
135 /// revert to old value 135 /// revert to old value
136 this.value = (this._preEditValue); 136 this.value = (this._preEditValue);
137 this._sendEvent('revert'); 137 this._sendEvent('revert');
138 console.log('reverting'); 138 //console.log('reverting');
139 139
140 } 140 }
141 } 141 }
@@ -157,6 +157,14 @@ exports.Hintable = Montage.create(Editable, {
157 157
158 this._super(arguments); 158 this._super(arguments);
159 159
160 /// Remove the phantom "<BR>" element that is generated when
161 /// content editable element is empty
162 this._children(this._element, function(item) {
163 return item.nodeName === 'BR';
164 }).forEach(function(item) {
165 this._element.removeChild(item);
166 }, this);
167
160 if(k === 39) { 168 if(k === 39) {
161 selection = window.getSelection(); 169 selection = window.getSelection();
162 text = selection.baseNode.textContent; 170 text = selection.baseNode.textContent;
@@ -180,7 +188,7 @@ exports.Hintable = Montage.create(Editable, {
180 188
181 var val = this.value, 189 var val = this.value,
182 matches, hint; 190 matches, hint;
183 console.log('val = "' + val + '"'); 191 //console.log('val = "' + val + '"');
184 //// Handle auto-suggest if configured 192 //// Handle auto-suggest if configured
185 if(this.hints instanceof Array) { 193 if(this.hints instanceof Array) {
186 194
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index f35972b6..4776265a 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -23,6 +23,7 @@ exports.Breadcrumb = Montage.create(Component, {
23 value: function(){ 23 value: function(){
24 if(!this.application.ninja.documentController.activeDocument) { 24 if(!this.application.ninja.documentController.activeDocument) {
25 this.disabled = true; 25 this.disabled = true;
26 this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot;
26 } 27 }
27 } 28 }
28 }, 29 },
@@ -79,6 +80,7 @@ exports.Breadcrumb = Montage.create(Component, {
79 handleAction: { 80 handleAction: {
80 value: function(evt) { 81 value: function(evt) {
81 82
83 this.application.ninja.breadCrumbClick=true;
82 if(evt.target.value === this.container.uuid) { 84 if(evt.target.value === this.container.uuid) {
83 return; 85 return;
84 } 86 }
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>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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 Composer = require("montage/ui/composer/composer").Composer;
9
10exports.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: {