From 61a419422b1a05a779fd9a66c53de3fa8ab5f65a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 22 Mar 2012 10:28:34 -0700 Subject: - enable/disable save, saveAs, saveAll, close, closeAll as per documents open - added close file and close all menu items Signed-off-by: Ananya Sen Conflicts: js/helper-classes/3D/draw-utils.js Signed-off-by: Ananya Sen --- js/document/text-document.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'js/document') diff --git a/js/document/text-document.js b/js/document/text-document.js index 88464d87..54a53999 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -163,7 +163,13 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { needsSave: { get: function() { return this._needsSave; }, - set: function(value) { this._needsSave = value } + set: function(value) { + var i=0, canSaveAll=false; + this._needsSave = value; + + this.application.ninja.documentController.canSave = value;//for save menu state update + this.application.ninja.documentController.canSaveAll = value;//for save menu state update..currently save all is tried to the current document only + } }, callback: { -- cgit v1.2.3 From fea875906664f12feaad0f282901fa8d9a8b054a Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 22 Mar 2012 11:52:44 -0700 Subject: Presets Panel - Adding presets controller and removing functionality from panel code --- js/document/templates/montage-html/default_html.css | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/document') diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css index 68300edf..24a752bc 100755 --- a/js/document/templates/montage-html/default_html.css +++ b/js/document/templates/montage-html/default_html.css @@ -72,4 +72,9 @@ body .elem-red-outline { outline: red solid thin; +} + +.nj-preset-transition { + -webkit-transition: all 450ms linear !important; + background-color: red; } \ No newline at end of file -- cgit v1.2.3 From bda9f8f5829c943486f8850e68c991e83f8fb8c8 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Sat, 24 Mar 2012 13:50:46 -0700 Subject: Adding logic for flatten checkbox in PI. This requires minor modifications to both StageController and ComponentController. Also removing unused global3DSettings CSS. Signed-off-by: Nivesh Rajbhandari --- js/document/templates/montage-html/default_html.css | 5 ----- js/document/templates/montage-html/index.html | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'js/document') diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css index 68300edf..1cdd7114 100755 --- a/js/document/templates/montage-html/default_html.css +++ b/js/document/templates/montage-html/default_html.css @@ -65,11 +65,6 @@ body display: none; } -.global3DSettings { - -webkit-transform-style: preserve-3d; - -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); -} - .elem-red-outline { outline: red solid thin; } \ No newline at end of file diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html index edfab2b0..b3f68030 100755 --- a/js/document/templates/montage-html/index.html +++ b/js/document/templates/montage-html/index.html @@ -40,7 +40,7 @@ - + -- cgit v1.2.3 From 668a3e832c0f4dd1ea0c3d56e3a79756c0a236b1 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 27 Mar 2012 11:43:37 -0700 Subject: Presets Controller - Removing test background from transition class --- js/document/templates/montage-html/default_html.css | 1 - 1 file changed, 1 deletion(-) (limited to 'js/document') diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css index 24a752bc..6c2b415f 100755 --- a/js/document/templates/montage-html/default_html.css +++ b/js/document/templates/montage-html/default_html.css @@ -76,5 +76,4 @@ body .nj-preset-transition { -webkit-transition: all 450ms linear !important; - background-color: red; } \ No newline at end of file -- cgit v1.2.3 From 903b01b9d0501e6f974034273385a0517107b1e3 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 27 Mar 2012 12:42:42 -0700 Subject: File IO for the brush stroke AND changing the data type of brush stroke from GEOM_TYPE_CUBIC_BEZIER to GEOM_TYPE_BRUSH_STROKE --- js/document/html-document.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index 8f9d2870..42a7d537 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -340,6 +340,12 @@ exports.HTMLDocument = Montage.create(TextDocument, { shapeModel.slope = root._slope; break; + case root.GEOM_TYPE_BRUSH_STROKE: + elementModel.selection = "BrushStroke"; + elementModel.pi = "BrushStrokePi"; + break; + + default: console.log( "geometry type not supported for file I/O, " + root.geomType()); break; -- cgit v1.2.3 From 5b4f6b1618cf571a6bce5a631f976a008e04a64e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 29 Mar 2012 15:52:08 -0700 Subject: Updated shapes to always check for its stroke and fill colors and materials instead of relying on the shapeModel cache because it can get out of sync. Signed-off-by: Nivesh Rajbhandari --- js/document/html-document.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index 8f9d2870..6ca9eaa3 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -307,19 +307,15 @@ exports.HTMLDocument = Montage.create(TextDocument, { { shapeModel.GLGeomObj = root; shapeModel.strokeSize = root._strokeWidth; - shapeModel.stroke = root._strokeColor.slice(); - shapeModel.strokeMaterial = root._strikeMaterial ? root._strokeMaterial.dup() : null; + shapeModel.stroke = root._strokeColor; shapeModel.strokeStyle = "solid"; //shapeModel.strokeStyleIndex - //shapeModel.border - //shapeModel.background switch (root.geomType()) { case root.GEOM_TYPE_RECTANGLE: elementModel.selection = "Rectangle"; elementModel.pi = "RectanglePi"; - shapeModel.fill = root._fillColor.slice(); - shapeModel.fillMaterial = root._fillMaterial ? root._fillMaterial.dup() : null; + shapeModel.fill = root._fillColor; shapeModel.tlRadius = root._tlRadius; shapeModel.trRadius = root._trRadius; shapeModel.blRadius = root._blRadius; @@ -329,8 +325,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { case root.GEOM_TYPE_CIRCLE: elementModel.selection = "Oval"; elementModel.pi = "OvalPi"; - shapeModel.fill = root._fillColor.slice(); - shapeModel.fillMaterial = root._fillMaterial ? root._fillMaterial.dup() : null; + shapeModel.fill = root._fillColor; shapeModel.innerRadius = root._innerRadius; break; -- cgit v1.2.3 From 4d132fcbde4540c2cac6c0df613940353e2690f6 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 3 Apr 2012 12:03:16 -0700 Subject: Give user feedback about which element the Fill/InkBottle tools will act on. Signed-off-by: Nivesh Rajbhandari --- js/document/templates/montage-html/default_html.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/document') diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css index 6c2b415f..424c5801 100755 --- a/js/document/templates/montage-html/default_html.css +++ b/js/document/templates/montage-html/default_html.css @@ -70,8 +70,8 @@ body -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } -.elem-red-outline { - outline: red solid thin; +.active-element-outline { + outline: #adff2f solid 2px; } .nj-preset-transition { -- cgit v1.2.3 From d5d4dcac78ebf8ba3163a8c7055d783b6397a435 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Tue, 3 Apr 2012 12:55:54 -0700 Subject: Namespaced the canvas runtime file and updated all dependencies --- js/document/html-document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index 42a7d537..c9887b88 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -212,7 +212,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { { /* // Use this code to test the runtime version of WebGL - var cdm = new CanvasDataManager(); + var cdm = new NinjaCvsRt.CanvasDataManager(); cdm.loadGLData(elt, value, null ); */ -- cgit v1.2.3 From 18609d375e7aab9cb48c9b3f5b291f85cbd28683 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Tue, 3 Apr 2012 13:39:32 -0700 Subject: removed old unused import and export functions. --- js/document/html-document.js | 8 -------- 1 file changed, 8 deletions(-) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index c9887b88..953f909c 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -276,13 +276,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { var world = new GLWorld( canvas, useWebGL ); world.importJSON( jObj ); } - else - { - var index = importStr.indexOf( "webGL: " ); - var useWebGL = (index >= 0); - var world = new GLWorld( canvas, useWebGL ); - world.import( importStr ); - } this.buildShapeModel( canvas.elementModel, world ); } @@ -432,7 +425,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) { var data = elt.elementModel.shapeModel.GLWorld.exportJSON(); - //var data = elt.elementModel.shapeModel.GLWorld.export(); dataArray.push( data ); } -- cgit v1.2.3 From 7433f0bfbc3a7ea44320550ed2c1d90dc5e6f170 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Tue, 3 Apr 2012 16:27:01 -0700 Subject: Removed the dependence on an "assets" directory for the RDGE runtime. Now Ninja does not need to create duplicate files when it sets up the users Ninja Projects directory for RDGE support. --- js/document/html-document.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index 953f909c..e96c9943 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -869,11 +869,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { //TODO: Add logic to handle save before preview this.application.ninja.documentController.handleExecuteSaveAll(null); //Temp check for webGL Hack - if (this.application.ninja.documentController.activeDocument.glData.length && this.application.ninja.documentController.activeDocument.glData.length > 1) {//TODO: Should be 0, temp hack fix - setTimeout(function () {window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);}.bind(this), 3500); - } else { - window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); - } + window.open(this.application.ninja.coreIoApi.rootUrl + this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); } }, -- cgit v1.2.3 From d5b429f4d1fad1f9b83e81d2d742d43ec39bd585 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 4 Apr 2012 15:14:33 -0700 Subject: [CR] Keep Save related menu items always enabled, if there is an open document Signed-off-by: Ananya Sen --- js/document/text-document.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'js/document') diff --git a/js/document/text-document.js b/js/document/text-document.js index 54a53999..2574b67c 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -164,11 +164,7 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { needsSave: { get: function() { return this._needsSave; }, set: function(value) { - var i=0, canSaveAll=false; this._needsSave = value; - - this.application.ninja.documentController.canSave = value;//for save menu state update - this.application.ninja.documentController.canSaveAll = value;//for save menu state update..currently save all is tried to the current document only } }, -- cgit v1.2.3 From 4dc89306c43e86cdac254c81fb9bb3a92eb4a8b9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 5 Apr 2012 12:12:36 -0700 Subject: Removing fill, stroke, fillMaterial and strokeMaterial from the shapeModel cache because they can easily get out of sync with the actual colors and materials. Instead, we will always query the object for these values. Signed-off-by: Nivesh Rajbhandari --- js/document/html-document.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index 6324d5ed..2531465d 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -300,7 +300,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { { shapeModel.GLGeomObj = root; shapeModel.strokeSize = root._strokeWidth; - shapeModel.stroke = root._strokeColor; shapeModel.strokeStyle = "solid"; //shapeModel.strokeStyleIndex switch (root.geomType()) @@ -308,7 +307,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { case root.GEOM_TYPE_RECTANGLE: elementModel.selection = "Rectangle"; elementModel.pi = "RectanglePi"; - shapeModel.fill = root._fillColor; shapeModel.tlRadius = root._tlRadius; shapeModel.trRadius = root._trRadius; shapeModel.blRadius = root._blRadius; @@ -318,7 +316,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { case root.GEOM_TYPE_CIRCLE: elementModel.selection = "Oval"; elementModel.pi = "OvalPi"; - shapeModel.fill = root._fillColor; shapeModel.innerRadius = root._innerRadius; break; -- cgit v1.2.3