diff options
-rw-r--r-- | js/components/focus-manager.reel/focus-manager.js | 49 | ||||
-rwxr-xr-x | js/controllers/elements/element-controller.js | 17 | ||||
-rwxr-xr-x | js/ninja.reel/ninja.css | 4 | ||||
-rwxr-xr-x | js/ninja.reel/ninja.html | 11 | ||||
-rwxr-xr-x | js/panels/Splitter.js | 6 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 20 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 86 | ||||
-rw-r--r-- | js/panels/Timeline/Tween.reel/Tween.js | 5 | ||||
-rwxr-xr-x | js/panels/properties.reel/properties.html | 72 | ||||
-rwxr-xr-x | js/panels/properties.reel/properties.js | 64 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.html | 7 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.js | 11 |
12 files changed, 192 insertions, 160 deletions
diff --git a/js/components/focus-manager.reel/focus-manager.js b/js/components/focus-manager.reel/focus-manager.js new file mode 100644 index 00000000..65a84bc1 --- /dev/null +++ b/js/components/focus-manager.reel/focus-manager.js | |||
@@ -0,0 +1,49 @@ | |||
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 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | exports.FocusManager = Montage.create(Component, { | ||
11 | |||
12 | hasTemplate: { | ||
13 | value: false | ||
14 | }, | ||
15 | |||
16 | element: { | ||
17 | serializable: true, | ||
18 | enumerable: true, | ||
19 | get: function() { | ||
20 | return this._element; | ||
21 | }, | ||
22 | set: function(value) { | ||
23 | // call super set | ||
24 | Object.getPropertyDescriptor(Component, "element").set.call(this, value); | ||
25 | } | ||
26 | }, | ||
27 | |||
28 | hiddenInput: { | ||
29 | value: null | ||
30 | }, | ||
31 | |||
32 | prepareForDraw: { | ||
33 | value: function() { | ||
34 | this.hiddenInput = document.createElement("input"); | ||
35 | this.hiddenInput.type = "text"; | ||
36 | |||
37 | this.element.appendChild(this.hiddenInput); | ||
38 | |||
39 | } | ||
40 | }, | ||
41 | |||
42 | setFocus: { | ||
43 | value: function() { | ||
44 | this.hiddenInput.focus(); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | }); | ||
49 | |||
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 9f00604f..70aba54e 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -51,23 +51,6 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, | |||
51 | 51 | ||
52 | setAttribute: { | 52 | setAttribute: { |
53 | value: function(el, att, value) { | 53 | value: function(el, att, value) { |
54 | if(att === "id") { | ||
55 | if(value === "") { | ||
56 | el.setAttribute(att, value); | ||
57 | return; | ||
58 | } | ||
59 | |||
60 | // Then check if this is a valid id by the following spec: http://www.w3.org/TR/REC-html40/types.html#h-6.2 | ||
61 | var regexID = /^([a-zA-Z])+([a-zA-Z0-9_\.\:\-])+/; | ||
62 | if(!regexID.test(value)) { | ||
63 | alert("Invalid ID"); | ||
64 | return; | ||
65 | } else if (this.application.ninja.currentDocument._document.getElementById(value) !== null) { | ||
66 | alert("The following ID: " + value + " is already in Use"); | ||
67 | } | ||
68 | |||
69 | } | ||
70 | |||
71 | el.setAttribute(att, value); | 54 | el.setAttribute(att, value); |
72 | } | 55 | } |
73 | }, | 56 | }, |
diff --git a/js/ninja.reel/ninja.css b/js/ninja.reel/ninja.css index 83c0e569..61251eff 100755 --- a/js/ninja.reel/ninja.css +++ b/js/ninja.reel/ninja.css | |||
@@ -7,3 +7,7 @@ | |||
7 | .main { | 7 | .main { |
8 | padding: 100px; | 8 | padding: 100px; |
9 | } | 9 | } |
10 | |||
11 | .hidden { | ||
12 | display: none; | ||
13 | } | ||
diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 3dc45498..f9e1efdd 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html | |||
@@ -287,6 +287,13 @@ | |||
287 | "name": "MainMenuController" | 287 | "name": "MainMenuController" |
288 | }, | 288 | }, |
289 | 289 | ||
290 | "focusManager": { | ||
291 | "object": "js/components/focus-manager.reel", | ||
292 | "properties": { | ||
293 | "element": {"#": "focus-container" } | ||
294 | } | ||
295 | }, | ||
296 | |||
290 | "owner": { | 297 | "owner": { |
291 | "module": "js/ninja.reel", | 298 | "module": "js/ninja.reel", |
292 | "name": "Ninja", | 299 | "name": "Ninja", |
@@ -396,7 +403,9 @@ | |||
396 | 403 | ||
397 | <section data-montage-id="bottomSplitter" class="bottomSplitter splitter"></section> | 404 | <section data-montage-id="bottomSplitter" class="bottomSplitter splitter"></section> |
398 | </section> | 405 | </section> |
399 | 406 | ||
407 | <div data-montage-id="focus-container" class="hidden"></div> | ||
408 | |||
400 | <section id="popupWindows"></section> | 409 | <section id="popupWindows"></section> |
401 | 410 | ||
402 | </div> | 411 | </div> |
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index a396ea28..e92cb2dd 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js | |||
@@ -91,12 +91,6 @@ exports.Splitter = Montage.create(Component, { | |||
91 | } | 91 | } |
92 | }, | 92 | }, |
93 | 93 | ||
94 | didDraw: { | ||
95 | value: function() { | ||
96 | this.application.ninja.stage.resizeCanvases = true; | ||
97 | } | ||
98 | }, | ||
99 | |||
100 | handleClick : { | 94 | handleClick : { |
101 | value: function() { | 95 | value: function() { |
102 | if (!this.disabled) { | 96 | if (!this.disabled) { |
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index b41680be..5206ae16 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -255,12 +255,12 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
255 | if (value !== this._isSelected) { | 255 | if (value !== this._isSelected) { |
256 | // Only concerned about different values | 256 | // Only concerned about different values |
257 | if (value === false) { | 257 | if (value === false) { |
258 | // If changing from false to true, we need to deselect any associated styles | 258 | // If changing from true to false, we need to deselect any associated styles |
259 | this.selectStyle(false); | 259 | this.selectStyle(false); |
260 | } | 260 | } |
261 | this._isSelected = value; | 261 | this._isSelected = value; |
262 | this.layerData.isSelected = value; | 262 | this.layerData.isSelected = value; |
263 | //this.needsDraw = true; | 263 | this.needsDraw = true; |
264 | } | 264 | } |
265 | 265 | ||
266 | } | 266 | } |
@@ -381,7 +381,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
381 | return this._bypassAnimation; | 381 | return this._bypassAnimation; |
382 | }, | 382 | }, |
383 | set: function(newVal) { | 383 | set: function(newVal) { |
384 | //console.log("layer.js _bypassAnimation setter " + newVal) | ||
385 | this._bypassAnimation = newVal; | 384 | this._bypassAnimation = newVal; |
386 | } | 385 | } |
387 | }, | 386 | }, |
@@ -406,7 +405,6 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
406 | 405 | ||
407 | setData:{ | 406 | setData:{ |
408 | value:function(){ | 407 | value:function(){ |
409 | this.log('layer: setData called') | ||
410 | this.layerName = this.layerData.layerName; | 408 | this.layerName = this.layerData.layerName; |
411 | this.layerID = this.layerData.layerID; | 409 | this.layerID = this.layerData.layerID; |
412 | this.arrLayerStyles = this.layerData.arrLayerStyles; | 410 | this.arrLayerStyles = this.layerData.arrLayerStyles; |
@@ -424,9 +422,13 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
424 | this.dtextScaleX = this.layerData.dtextScaleX; | 422 | this.dtextScaleX = this.layerData.dtextScaleX; |
425 | this.dtextScaleY = this.layerData.dtextScaleY; | 423 | this.dtextScaleY = this.layerData.dtextScaleY; |
426 | this.dtextRotate = this.layerData.dtextRotate; | 424 | this.dtextRotate = this.layerData.dtextRotate; |
425 | this._isFirstDraw = this.layerData._isFirstDraw; | ||
427 | this.needsDraw = true; | 426 | this.needsDraw = true; |
428 | } | 427 | } |
429 | }, | 428 | }, |
429 | _isFirstDraw : { | ||
430 | value: true | ||
431 | }, | ||
430 | 432 | ||
431 | /* END: Models */ | 433 | /* END: Models */ |
432 | 434 | ||
@@ -483,6 +485,16 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
483 | } | 485 | } |
484 | } | 486 | } |
485 | }, | 487 | }, |
488 | didDraw: { | ||
489 | value: function() { | ||
490 | if ((this.isSelected === true) && (this._isFirstDraw === true)) { | ||
491 | // Once we're done drawing the first time we need to tell the TimelinePanel if | ||
492 | // this layer is supposed to be selected. | ||
493 | this.parentComponent.parentComponent.selectedLayerID = this.layerID; | ||
494 | this._isFirstDraw = false; | ||
495 | } | ||
496 | } | ||
497 | }, | ||
486 | /* End: Draw cycle */ | 498 | /* End: Draw cycle */ |
487 | 499 | ||
488 | /* Begin: Controllers */ | 500 | /* Begin: Controllers */ |