From 3a754133dbc138390503341fd2e9beba3e43aa4b Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 27 Jan 2012 12:05:17 -0800 Subject: Merged old FileIO --- js/tools/BrushTool.js | 0 js/tools/EraserTool.js | 0 js/tools/EyedropperTool.js | 0 js/tools/FillTool.js | 0 js/tools/InkBottleTool.js | 0 js/tools/LineTool.js | 0 js/tools/OvalTool.js | 0 js/tools/PanTool.js | 0 js/tools/PenTool.js | 0 js/tools/PencilTool.js | 0 js/tools/RectTool.js | 0 js/tools/Rotate3DToolBase.js | 0 js/tools/RotateObject3DTool.js | 0 js/tools/RotateStage3DTool.js | 0 js/tools/SelectionTool.js | 0 js/tools/ShapeTool.js | 0 js/tools/SubSelectTool.js | 0 js/tools/TagTool.js | 0 js/tools/TextTool.js | 0 js/tools/ToolBase.js | 0 js/tools/Translate3DToolBase.js | 0 js/tools/TranslateObject3DTool.js | 0 js/tools/ZoomTool.js | 0 js/tools/drawing-tool-base.js | 0 js/tools/drawing-tool.js | 0 js/tools/modifier-tool-base.js | 0 26 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 js/tools/BrushTool.js mode change 100644 => 100755 js/tools/EraserTool.js mode change 100644 => 100755 js/tools/EyedropperTool.js mode change 100644 => 100755 js/tools/FillTool.js mode change 100644 => 100755 js/tools/InkBottleTool.js mode change 100644 => 100755 js/tools/LineTool.js mode change 100644 => 100755 js/tools/OvalTool.js mode change 100644 => 100755 js/tools/PanTool.js mode change 100644 => 100755 js/tools/PenTool.js mode change 100644 => 100755 js/tools/PencilTool.js mode change 100644 => 100755 js/tools/RectTool.js mode change 100644 => 100755 js/tools/Rotate3DToolBase.js mode change 100644 => 100755 js/tools/RotateObject3DTool.js mode change 100644 => 100755 js/tools/RotateStage3DTool.js mode change 100644 => 100755 js/tools/SelectionTool.js mode change 100644 => 100755 js/tools/ShapeTool.js mode change 100644 => 100755 js/tools/SubSelectTool.js mode change 100644 => 100755 js/tools/TagTool.js mode change 100644 => 100755 js/tools/TextTool.js mode change 100644 => 100755 js/tools/ToolBase.js mode change 100644 => 100755 js/tools/Translate3DToolBase.js mode change 100644 => 100755 js/tools/TranslateObject3DTool.js mode change 100644 => 100755 js/tools/ZoomTool.js mode change 100644 => 100755 js/tools/drawing-tool-base.js mode change 100644 => 100755 js/tools/drawing-tool.js mode change 100644 => 100755 js/tools/modifier-tool-base.js (limited to 'js/tools') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js old mode 100644 new mode 100755 diff --git a/js/tools/EraserTool.js b/js/tools/EraserTool.js old mode 100644 new mode 100755 diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js old mode 100644 new mode 100755 diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js old mode 100644 new mode 100755 diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js old mode 100644 new mode 100755 diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js old mode 100644 new mode 100755 diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js old mode 100644 new mode 100755 diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js old mode 100644 new mode 100755 diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js old mode 100644 new mode 100755 diff --git a/js/tools/PencilTool.js b/js/tools/PencilTool.js old mode 100644 new mode 100755 diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js old mode 100644 new mode 100755 diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js old mode 100644 new mode 100755 diff --git a/js/tools/RotateObject3DTool.js b/js/tools/RotateObject3DTool.js old mode 100644 new mode 100755 diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js old mode 100644 new mode 100755 diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js old mode 100644 new mode 100755 diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js old mode 100644 new mode 100755 diff --git a/js/tools/SubSelectTool.js b/js/tools/SubSelectTool.js old mode 100644 new mode 100755 diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js old mode 100644 new mode 100755 diff --git a/js/tools/TextTool.js b/js/tools/TextTool.js old mode 100644 new mode 100755 diff --git a/js/tools/ToolBase.js b/js/tools/ToolBase.js old mode 100644 new mode 100755 diff --git a/js/tools/Translate3DToolBase.js b/js/tools/Translate3DToolBase.js old mode 100644 new mode 100755 diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js old mode 100644 new mode 100755 diff --git a/js/tools/ZoomTool.js b/js/tools/ZoomTool.js old mode 100644 new mode 100755 diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js old mode 100644 new mode 100755 diff --git a/js/tools/drawing-tool.js b/js/tools/drawing-tool.js old mode 100644 new mode 100755 diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js old mode 100644 new mode 100755 -- cgit v1.2.3 From 0bb13001ce07e5256a6e395325a898ab4ac93e1c Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 13 Feb 2012 02:05:07 -0800 Subject: Fixed Color on text edit. Also Fixed Indent & Outdent button. toggle bullet and numbered now bound to text tool --- js/tools/TextTool.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tools') diff --git a/js/tools/TextTool.js b/js/tools/TextTool.js index 760af55b..4c464173 100644 --- a/js/tools/TextTool.js +++ b/js/tools/TextTool.js @@ -21,6 +21,7 @@ exports.TextTool = Montage.create(DrawingTool, { this.selectedElement.innerHTML = this.application.ninja.stage.textTool.value; this.application.ninja.stage.textTool.value = ""; this.application.ninja.stage.textTool.element.style.display = "none"; + this.applyElementStyles(this.application.ninja.stage.textTool.element.firstChild, this.selectedElement, ["color"]); } //Set Selected Element this._selectedElement = val; -- cgit v1.2.3 From e0bead5a36ae987c558607b77745c4018caf59f8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 16 Feb 2012 21:42:56 -0800 Subject: Adding a data-RDGE-id attribute to each canvas to save/load canvas data Signed-off-by: Valerio Virgillito --- js/tools/BrushTool.js | 2 +- js/tools/LineTool.js | 2 +- js/tools/PenTool.js | 2 +- js/tools/ShapeTool.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'js/tools') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index ce8ffbb9..4d44326f 100755 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -201,7 +201,7 @@ exports.BrushTool = Montage.create(ShapeTool, { var top = Math.round(midPt[1] - 0.5 * h); if (!canvas) { - var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", null, true); + var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas); ElementMediator.addElement(newCanvas, elementModel.data, true); diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 99c374a7..233316a5 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js @@ -82,7 +82,7 @@ exports.LineTool = Montage.create(ShapeTool, { h += ~~(yAdj*2); } - canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", null, true); + canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas); ElementMediator.addElement(canvas, elementModel.data, true); diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 9a69b53d..7749d525 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -570,7 +570,7 @@ exports.PenTool = Montage.create(ShapeTool, { if (!canvas) { var newCanvas = null; - newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", null, true); + newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas); ElementMediator.addElement(newCanvas, elementModel.data, true); diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index 4ccb7a8d..29e9b99f 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js @@ -66,7 +66,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { var canvas; if(!this._useExistingCanvas()) { - canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", null, true); + canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height, drawData.planeMat, drawData.midPt, canvas); -- cgit v1.2.3 From 31781742ad40854a48ede88cf3c7a6d700b35cbb Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 20 Feb 2012 15:35:09 -0800 Subject: formatting cleanup Signed-off-by: Valerio Virgillito --- js/tools/SelectionTool.js | 13 +------------ js/tools/modifier-tool-base.js | 3 +-- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 48548271..f76a6d85 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -115,8 +115,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleLeftButtonUp: { value: function(event) { var selectedItems, - point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, - new WebKitPoint(event.pageX, event.pageY)); + point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); this.isDrawing = false; this.application.ninja.stage.showSelectionBounds = true; @@ -186,21 +185,11 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleDoubleClick: { value: function(event) { - /* - var selectedObject = stageManagerModule.stageManager.GetObjectFromPoint(event.layerX, event.layerY, this._canOperateOnStage); - - if(selectedObject) { - if(selectionManagerModule.selectionManager.findSelectedElement(selectedObject) === -1) { - selectionManagerModule.selectionManager.setSingleSelection(selectedObject); - } - } - */ // Temporary Code for Breadcrumb if(this.application.ninja.selectedElements.length > 0) { this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element; } else { - console.log(this.application.ninja.currentDocument.documentRoot.uuid); this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; } diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index 67b217c4..54bc06be 100755 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js @@ -791,8 +791,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { HandleLeftButtonDown: { value: function(event) { - var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, - new WebKitPoint(event.pageX, event.pageY)); + var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); this.downPoint.x = point.x; this.downPoint.y = point.y; -- cgit v1.2.3 From f9d34a54baf61ccdf77732b1aaedb29d296b8c2e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 20 Feb 2012 23:03:48 -0800 Subject: enabling nested selection Signed-off-by: Valerio Virgillito --- js/tools/SelectionTool.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index f76a6d85..37029e8c 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -183,18 +183,21 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { } }, + /** + * Double click handler + * + * Sets the currentSelectionContainer to the current selected element. If no elements are selected set the + * currentSelectionContainer to the userDocument div. + */ HandleDoubleClick: { - value: function(event) { - - // Temporary Code for Breadcrumb - if(this.application.ninja.selectedElements.length > 0) { - this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element; - } else { - this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; - } - + value: function(event) { + if(this.application.ninja.selectedElements.length > 0) { + this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element; + } else { + this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; } - }, + } + }, HandleKeyPress: { value: function(event){ -- cgit v1.2.3