aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Guzman2012-04-04 11:36:22 -0700
committerEric Guzman2012-04-04 11:36:22 -0700
commitaf52148777d554dc6e55a736574b82e4916f1fea (patch)
tree39705d138b489d2e90722238c850320fd6b6a8e9
parentb7ca1821ad43403a2a54361ffc6a0cdf9cba0e59 (diff)
parenta11ef2eed7049835c8bdfa50a2b893632c46eaa0 (diff)
downloadninja-af52148777d554dc6e55a736574b82e4916f1fea.tar.gz
Merge branch 'refs/heads/master' into PresetsPI
Conflicts: js/controllers/presets-controller.js
-rwxr-xr-xjs/components/SliderBase.js1
-rwxr-xr-xjs/controllers/elements/element-controller.js15
-rwxr-xr-xjs/controllers/elements/shapes-controller.js5
-rwxr-xr-xjs/controllers/selection-controller.js147
-rwxr-xr-xjs/data/menu-data.js40
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js79
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js16
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.js9
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js11
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js4
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js13
-rwxr-xr-xjs/lib/drawing/world.js13
-rwxr-xr-xjs/lib/nj-base.js13
-rwxr-xr-xjs/mediators/drag-drop-mediator.js8
-rwxr-xr-xjs/mediators/element-mediator.js218
-rwxr-xr-xjs/mediators/keyboard-mediator.js37
-rwxr-xr-xjs/mediators/mouse-mediator.js4
-rwxr-xr-xjs/ninja.reel/ninja.js4
-rwxr-xr-xjs/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js10
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js37
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js2
-rw-r--r--js/panels/presets/animations-presets.reel/animations-presets.js4
-rw-r--r--js/panels/presets/style-presets.reel/style-presets.js4
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.js4
-rwxr-xr-xjs/panels/properties.reel/properties.js16
-rwxr-xr-xjs/panels/properties.reel/sections/three-d-view.reel/three-d-view.js2
-rwxr-xr-xjs/stage/layout.js18
-rwxr-xr-xjs/stage/stage.reel/stage.js5
-rw-r--r--js/tools/BrushTool.js2
-rwxr-xr-xjs/tools/LineTool.js111
-rwxr-xr-xjs/tools/PenTool.js12
-rwxr-xr-xjs/tools/Rotate3DToolBase.js4
-rwxr-xr-xjs/tools/SelectionTool.js34
-rwxr-xr-xjs/tools/ShapeTool.js37
-rwxr-xr-xjs/tools/TagTool.js6
-rwxr-xr-xjs/tools/TextTool.js4
-rwxr-xr-xjs/tools/Translate3DToolBase.js2
-rwxr-xr-xjs/tools/modifier-tool-base.js2
39 files changed, 394 insertions, 561 deletions
diff --git a/js/components/SliderBase.js b/js/components/SliderBase.js
index 9f007456..8df868a2 100755
--- a/js/components/SliderBase.js
+++ b/js/components/SliderBase.js
@@ -268,7 +268,6 @@ var SliderBase = exports.SliderBase = Montage.create(Component, {
268 268
269 _dispatchActionEvent: { 269 _dispatchActionEvent: {
270 value: function() { 270 value: function() {
271// console.log("dispatching event", this._element.id, this._eventType, this._wasSetByCode);
272 var actionEvent = document.createEvent("CustomEvent"); 271 var actionEvent = document.createEvent("CustomEvent");
273 actionEvent.initEvent(this._eventType, true, true); 272 actionEvent.initEvent(this._eventType, true, true);
274 actionEvent.type = this._eventType; 273 actionEvent.type = this._eventType;
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index b35251ad..efb33292 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -5,22 +5,27 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
5</copyright> */ 5</copyright> */
6 6
7var Montage = require("montage/core/core").Montage, 7var Montage = require("montage/core/core").Montage,
8 NJComponent = require("js/lib/nj-base").NJComponent; 8 Component = require("montage/ui/component").Component;
9 9
10var ElementController = exports.ElementController = Montage.create(NJComponent, { 10exports.ElementController = Montage.create(Component, {
11 11
12 addElement: { 12 addElement: {
13 value: function(el, styles) { 13 value: function(el, styles) {
14 this.application.ninja.currentDocument.documentRoot.appendChild(el); 14 this.application.ninja.currentDocument.documentRoot.appendChild(el);
15 // Nested elements - 15 // Nested elements - TODO make sure the CSS is correct before nesting elements
16 // TODO make sure the CSS is correct before nesting elements
17 // this.application.ninja.currentSelectedContainer.appendChild(el); 16 // this.application.ninja.currentSelectedContainer.appendChild(el);
18 this.application.ninja.stylesController.setElementStyles(el, styles); 17 if(styles) {
18 this.application.ninja.stylesController.setElementStyles(el, styles);
19 }
19 } 20 }
20 }, 21 },
21 22
23 // Remove the element from the DOM and clear the GLWord.
22 removeElement: { 24 removeElement: {
23 value: function(el) { 25 value: function(el) {
26 if(el.elementModel && el.elementModel.shapeModel && el.elementModel.shapeModel.GLWorld) {
27 el.elementModel.shapeModel.GLWorld.clearTree();
28 }
24 el.parentNode.removeChild(el); 29 el.parentNode.removeChild(el);
25 } 30 }
26 }, 31 },
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index ef453bea..c9164e3e 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -72,8 +72,9 @@ exports.ShapesController = Montage.create(CanvasController, {
72 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom()); 72 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom());
73 canvas.width = el.width; 73 canvas.width = el.width;
74 canvas.height = el.height; 74 canvas.height = el.height;
75 this.application.ninja.elementMediator.replaceElement(el, canvas); 75 canvas.elementModel = el.elementModel;
76 NJevent("elementDeleted", el); 76 this.application.ninja.currentDocument.documentRoot.replaceChild(canvas, el);
77 NJevent("elementsRemoved", el);
77 el = canvas; 78 el = canvas;
78 this.toggleWebGlMode(el, value); 79 this.toggleWebGlMode(el, value);
79 el.elementModel.shapeModel.GLWorld.render(); 80 el.elementModel.shapeModel.GLWorld.render();
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 53cca029..dbb3f30d 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -6,8 +6,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
6 6
7 7
8var Montage = require("montage/core/core").Montage, 8var Montage = require("montage/core/core").Montage,
9 Component = require("montage/ui/component").Component, 9 Component = require("montage/ui/component").Component;
10 NJUtils = require("js/lib/NJUtils").NJUtils;
11 10
12exports.SelectionController = Montage.create(Component, { 11exports.SelectionController = Montage.create(Component, {
13 12
@@ -45,13 +44,10 @@ exports.SelectionController = Montage.create(Component, {
45 value: function() { 44 value: function() {
46 this.eventManager.addEventListener("openDocument", this, false); 45 this.eventManager.addEventListener("openDocument", this, false);
47 this.eventManager.addEventListener("elementAdded", this, false); 46 this.eventManager.addEventListener("elementAdded", this, false);
48 this.eventManager.addEventListener("elementDeleted", this, false); 47 this.eventManager.addEventListener("elementsRemoved", this, false);
49 this.eventManager.addEventListener("selectAll", this, false); 48 this.eventManager.addEventListener("selectAll", this, false);
50 this.eventManager.addEventListener("deleteSelection", this, false);
51 this.eventManager.addEventListener("switchDocument", this, false); 49 this.eventManager.addEventListener("switchDocument", this, false);
52 this.eventManager.addEventListener("closeDocument", this, false); 50 this.eventManager.addEventListener("closeDocument", this, false);
53// defaultEventManager.addEventListener( "undo", this, false);
54// defaultEventManager.addEventListener( "redo", this, false);
55 } 51 }
56 }, 52 },
57 53
@@ -67,35 +63,25 @@ exports.SelectionController = Montage.create(Component, {
67 63
68 initWithDocument: { 64 initWithDocument: {
69 value: function(currentSelectionArray) { 65 value: function(currentSelectionArray) {
70 this._selectedItems = [];
71 this._isDocument = true; 66 this._isDocument = true;
72 67
73 if(currentSelectionArray) { 68 if(currentSelectionArray) {
74 if(currentSelectionArray.length >= 1) { 69 if(currentSelectionArray.length >= 1) {
75 this._selectedItems = currentSelectionArray;
76 this._isDocument = false; 70 this._isDocument = false;
77 71
78
79
80 this.application.ninja.selectedElements = currentSelectionArray; 72 this.application.ninja.selectedElements = currentSelectionArray;
81 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); 73 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument});
82
83
84
85 } 74 }
86 } 75 }
87 76
88 //
89 this._selectionContainer = this.application.ninja.currentSelectedContainer; 77 this._selectionContainer = this.application.ninja.currentSelectedContainer;
90
91 } 78 }
92 }, 79 },
93 80
94 handleSwitchDocument: { 81 handleSwitchDocument: {
95 value: function() { 82 value: function() {
96 if(this.application.ninja.documentController.activeDocument.currentView === "design"){ 83 if(this.application.ninja.documentController.activeDocument.currentView === "design"){
97 this._selectedItems = this.application.ninja.selectedElements.slice(0); 84 this._isDocument = this.application.ninja.selectedElements.length === 0;
98 this._isDocument = this._selectedItems.length === 0;
99 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 85 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
100 } 86 }
101 } 87 }
@@ -107,21 +93,12 @@ exports.SelectionController = Montage.create(Component, {
107 }