aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorArmen Kesablyan2012-02-22 16:26:41 -0800
committerArmen Kesablyan2012-02-22 16:26:41 -0800
commit0bd1cefea2ab350fad1a891bdc926053b799aafc (patch)
tree962f559fcc02a3dfeb297d59907e40fa153453f3 /js/tools
parent695bc5082f48dddf66ce31480a4faefc067b38bd (diff)
parent2d2b1af8b5c0d506fe6a1cf65614101fec145970 (diff)
downloadninja-0bd1cefea2ab350fad1a891bdc926053b799aafc.tar.gz
Merge branch 'refs/heads/master' into new-tool-icons
Diffstat (limited to 'js/tools')
-rwxr-xr-x[-rw-r--r--]js/tools/BrushTool.js2
-rwxr-xr-x[-rw-r--r--]js/tools/EraserTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/EyedropperTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/FillTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/InkBottleTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/LineTool.js2
-rwxr-xr-x[-rw-r--r--]js/tools/OvalTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/PanTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/PenTool.js2
-rwxr-xr-x[-rw-r--r--]js/tools/PencilTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/RectTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/Rotate3DToolBase.js0
-rwxr-xr-x[-rw-r--r--]js/tools/RotateObject3DTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/RotateStage3DTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/SelectionTool.js36
-rwxr-xr-x[-rw-r--r--]js/tools/ShapeTool.js2
-rwxr-xr-x[-rw-r--r--]js/tools/SubSelectTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/TagTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/TextTool.js1
-rwxr-xr-x[-rw-r--r--]js/tools/ToolBase.js0
-rwxr-xr-x[-rw-r--r--]js/tools/Translate3DToolBase.js0
-rwxr-xr-x[-rw-r--r--]js/tools/TranslateObject3DTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/ZoomTool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/drawing-tool-base.js0
-rwxr-xr-x[-rw-r--r--]js/tools/drawing-tool.js0
-rwxr-xr-x[-rw-r--r--]js/tools/modifier-tool-base.js3
26 files changed, 20 insertions, 28 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index ce8ffbb9..4d44326f 100644..100755
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -201,7 +201,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
201 var top = Math.round(midPt[1] - 0.5 * h); 201 var top = Math.round(midPt[1] - 0.5 * h);
202 202
203 if (!canvas) { 203 if (!canvas) {
204 var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", null, true); 204 var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
205 var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas); 205 var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas);
206 ElementMediator.addElement(newCanvas, elementModel.data, true); 206 ElementMediator.addElement(newCanvas, elementModel.data, true);
207 207
diff --git a/js/tools/EraserTool.js b/js/tools/EraserTool.js
index c12a14b1..c12a14b1 100644..100755
--- a/js/tools/EraserTool.js
+++ b/js/tools/EraserTool.js
diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js
index 795753d2..795753d2 100644..100755
--- a/js/tools/EyedropperTool.js
+++ b/js/tools/EyedropperTool.js
diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js
index fabcec69..fabcec69 100644..100755
--- a/js/tools/FillTool.js
+++ b/js/tools/FillTool.js
diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js
index cc20d94c..cc20d94c 100644..100755
--- a/js/tools/InkBottleTool.js
+++ b/js/tools/InkBottleTool.js
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 99c374a7..233316a5 100644..100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -82,7 +82,7 @@ exports.LineTool = Montage.create(ShapeTool, {
82 h += ~~(yAdj*2); 82 h += ~~(yAdj*2);
83 } 83 }
84 84
85 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", null, true); 85 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
86 var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas); 86 var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas);
87 87
88 ElementMediator.addElement(canvas, elementModel.data, true); 88 ElementMediator.addElement(canvas, elementModel.data, true);
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index 14655312..14655312 100644..100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js
index 71301d46..71301d46 100644..100755
--- a/js/tools/PanTool.js
+++ b/js/tools/PanTool.js
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js
index 9a69b53d..7749d525 100644..100755
--- a/js/tools/PenTool.js
+++ b/js/tools/PenTool.js
@@ -570,7 +570,7 @@ exports.PenTool = Montage.create(ShapeTool, {
570 570
571 if (!canvas) { 571 if (!canvas) {
572 var newCanvas = null; 572 var newCanvas = null;
573 newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", null, true); 573 newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
574 var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas); 574 var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas);
575 ElementMediator.addElement(newCanvas, elementModel.data, true); 575 ElementMediator.addElement(newCanvas, elementModel.data, true);
576 576
diff --git a/js/tools/PencilTool.js b/js/tools/PencilTool.js
index 349eb1e8..349eb1e8 100644..100755
--- a/js/tools/PencilTool.js
+++ b/js/tools/PencilTool.js
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js
index 31ac7faa..31ac7faa 100644..100755
--- a/js/tools/RectTool.js
+++ b/js/tools/RectTool.js
diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js
index aa91b2f4..aa91b2f4 100644..100755
--- a/js/tools/Rotate3DToolBase.js
+++ b/js/tools/Rotate3DToolBase.js
diff --git a/js/tools/RotateObject3DTool.js b/js/tools/RotateObject3DTool.js
index 72af6eff..72af6eff 100644..100755
--- a/js/tools/RotateObject3DTool.js
+++ b/js/tools/RotateObject3DTool.js
diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js
index ca2a8bf3..ca2a8bf3 100644..100755
--- a/js/tools/RotateStage3DTool.js
+++ b/js/tools/RotateStage3DTool.js
diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js
index 48548271..37029e8c 100644..100755
--- a/js/tools/SelectionTool.js
+++ b/js/tools/SelectionTool.js
@@ -115,8 +115,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
115 HandleLeftButtonUp: { 115 HandleLeftButtonUp: {
116 value: function(event) { 116 value: function(event) {
117 var selectedItems, 117 var selectedItems,
118 point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, 118 point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY));
119 new WebKitPoint(event.pageX, event.pageY));
120 119
121 this.isDrawing = false; 120 this.isDrawing = false;
122 this.application.ninja.stage.showSelectionBounds = true; 121 this.application.ninja.stage.showSelectionBounds = true;
@@ -184,28 +183,21 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
184 } 183 }
185 }, 184 },
186 185
186 /**
187 * Double click handler
188 *
189 * Sets the currentSelectionContainer to the current selected element. If no elements are selected set the
190 * currentSelectionContainer to the userDocument div.
191 */
187 HandleDoubleClick: { 192 HandleDoubleClick: {
188 value: function(event) { 193 value: function(event) {
189 /* 194 if(this.application.ninja.selectedElements.length > 0) {
190 var selectedObject = stageManagerModule.stageManager.GetObjectFromPoint(event.layerX, event.layerY, this._canOperateOnStage); 195 this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element;
191 196 } else {
192 if(selectedObject) { 197 this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot;
193 if(selectionManagerModule.selectionManager.findSelectedElement(selectedObject) === -1) {
194 selectionManagerModule.selectionManager.setSingleSelection(selectedObject);
195 }
196 }
197 */
198
199 // Temporary Code for Breadcrumb
200 if(this.application.ninja.selectedElements.length > 0) {
201 this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element;
202 } else {
203 console.log(this.application.ninja.currentDocument.documentRoot.uuid);
204 this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot;
205 }
206
207 } 198 }
208 }, 199 }
200 },
209 201
210 HandleKeyPress: { 202 HandleKeyPress: {
211 value: function(event){ 203 value: function(event){
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js
index 4ccb7a8d..29e9b99f 100644..100755
--- a/js/tools/ShapeTool.js
+++ b/js/tools/ShapeTool.js
@@ -66,7 +66,7 @@ exports.ShapeTool = Montage.create(DrawingTool, {
66 var canvas; 66 var canvas;
67 if(!this._useExistingCanvas()) 67 if(!this._useExistingCanvas())
68 { 68 {
69 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", null, true); 69 canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true);
70 var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height, 70 var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height,
71 drawData.planeMat, drawData.midPt, canvas); 71 drawData.planeMat, drawData.midPt, canvas);
72 72
diff --git a/js/tools/SubSelectTool.js b/js/tools/SubSelectTool.js
index 12f0e5c0..12f0e5c0 100644..100755
--- a/js/tools/SubSelectTool.js
+++ b/js/tools/SubSelectTool.js
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js
index e3f49bbe..e3f49bbe 100644..100755
--- a/js/tools/TagTool.js
+++ b/js/tools/TagTool.js
diff --git a/js/tools/TextTool.js b/js/tools/TextTool.js
index 760af55b..4c464173 100644..100755
--- a/js/tools/TextTool.js
+++ b/js/tools/TextTool.js
@@ -21,6 +21,7 @@ exports.TextTool = Montage.create(DrawingTool, {
21 this.selectedElement.innerHTML = this.application.ninja.stage.textTool.value; 21 this.selectedElement.innerHTML = this.application.ninja.stage.textTool.value;
22 this.application.ninja.stage.textTool.value = ""; 22 this.application.ninja.stage.textTool.value = "";
23 this.application.ninja.stage.textTool.element.style.display = "none"; 23 this.application.ninja.stage.textTool.element.style.display = "none";
24 this.applyElementStyles(this.application.ninja.stage.textTool.element.firstChild, this.selectedElement, ["color"]);
24 } 25 }
25 //Set Selected Element 26 //Set Selected Element
26 this._selectedElement = val; 27 this._selectedElement = val;
diff --git a/js/tools/ToolBase.js b/js/tools/ToolBase.js
index 678d03ac..678d03ac 100644..100755
--- a/js/tools/ToolBase.js
+++ b/js/tools/ToolBase.js
diff --git a/js/tools/Translate3DToolBase.js b/js/tools/Translate3DToolBase.js
index cbf76830..cbf76830 100644..100755
--- a/js/tools/Translate3DToolBase.js
+++ b/js/tools/Translate3DToolBase.js
diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js
index bbbbc871..bbbbc871 100644..100755
--- a/js/tools/TranslateObject3DTool.js
+++ b/js/tools/TranslateObject3DTool.js
diff --git a/js/tools/ZoomTool.js b/js/tools/ZoomTool.js
index 4b6705c1..4b6705c1 100644..100755
--- a/js/tools/ZoomTool.js
+++ b/js/tools/ZoomTool.js
diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js
index cd895102..cd895102 100644..100755
--- a/js/tools/drawing-tool-base.js
+++ b/js/tools/drawing-tool-base.js
diff --git a/js/tools/drawing-tool.js b/js/tools/drawing-tool.js
index 603f63a3..603f63a3 100644..100755
--- a/js/tools/drawing-tool.js
+++ b/js/tools/drawing-tool.js
diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js
index 67b217c4..54bc06be 100644..100755
--- a/js/tools/modifier-tool-base.js
+++ b/js/tools/modifier-tool-base.js
@@ -791,8 +791,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, {
791 HandleLeftButtonDown: { 791 HandleLeftButtonDown: {
792 value: function(event) { 792 value: function(event) {
793 793
794 var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, 794 var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY));
795 new WebKitPoint(event.pageX, event.pageY));
796 this.downPoint.x = point.x; 795 this.downPoint.x = point.x;
797 this.downPoint.y = point.y; 796 this.downPoint.y = point.y;
798 797