From 4937b39fb0cf542f57cdadc7d1e2ed9798f7ef87 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 15 Feb 2012 16:09:14 -0800 Subject: fixes to document tabbing Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/stage') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 31ace49c..2144af84 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -187,7 +187,6 @@ exports.StageView = Montage.create(Component, { }, hideOtherDocuments:{ value:function(docUuid){ - //use CodeMirror toTextArea() to remove editor and save content into textarea this.application.ninja.documentController._documents.forEach(function(aDoc){ if(aDoc.currentView === "design"){ aDoc.container.parentNode.style["display"] = "none"; -- cgit v1.2.3 From 302ae3c1812086d976eb67c9cf693c43205f3904 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 16 Feb 2012 11:13:05 -0800 Subject: hide the rulers when no document is open Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 2144af84..cd19f361 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -123,7 +123,7 @@ exports.StageView = Montage.create(Component, { switchDocument:{ value: function(doc){ //save editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.hline = this.application.ninja.documentController.activeDocument.editor.getCursor(true); } this.application.ninja.documentController._hideCurrentDocument(); @@ -136,7 +136,7 @@ exports.StageView = Montage.create(Component, { var documentController = this.application.ninja.documentController; //restore editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.editor.setCursor(this.application.ninja.documentController.activeDocument.hline); document.getElementById("codeMirror_"+this.application.ninja.documentController.activeDocument.uuid).getElementsByClassName("CodeMirror")[0].focus(); } -- cgit v1.2.3 From a7e3ef9f80d5e29515c9f8dd5374c89b9d2496de Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 17 Feb 2012 12:39:12 -0800 Subject: use method to update dirtyFlag Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index cd19f361..7ee41fb4 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -98,9 +98,9 @@ exports.StageView = Montage.create(Component, { onChange: function(){ var historySize = doc.editor.historySize(); if(historySize.undo>0){ - doc.dirtyFlag=true; + doc.markDocumentEditted(); }else if(historySize.undo===0 && historySize.redo>0){ - doc.dirtyFlag=false; + doc.markDocumentUneditted(); } }, onCursorActivity: function() { -- cgit v1.2.3 From 96178309ddcdb54c0c451b69ea6fb8cdf76fcf62 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 17 Feb 2012 12:54:07 -0800 Subject: renamed methods to use better words Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 7ee41fb4..0b74105c 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -98,9 +98,9 @@ exports.StageView = Montage.create(Component, { onChange: function(){ var historySize = doc.editor.historySize(); if(historySize.undo>0){ - doc.markDocumentEditted(); + doc.markEdited(); }else if(historySize.undo===0 && historySize.redo>0){ - doc.markDocumentUneditted(); + doc.markUnedited(); } }, onCursorActivity: function() { -- cgit v1.2.3 From 9e566515f7e3a4ae26b39a2581008a15cf662c95 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 20 Feb 2012 22:35:28 -0800 Subject: formatting and removing un-used code from the stage Signed-off-by: Valerio Virgillito --- js/stage/stage.reel/stage.js | 48 +++++++++++++------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 37b1df35..44e14827 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -19,8 +19,6 @@ exports.Stage = Montage.create(Component, { zoomFactor: {value : 1 }, _canvasSelectionPrefs: { value: { "thickness" : 1.0, "color" : "#46a1ff" } }, - _editSymbolPrefs: { value: { "thickness" : 2.0, "color" : "#C61F00" } }, - _canvasDrawingPrefs: { value: { "thickness" : 1.0, "color" : "#000" } }, drawingContextPreferences: { get: function() { return this._canvasDrawingPrefs; } }, @@ -260,7 +258,6 @@ exports.Stage = Montage.create(Component, { this.application.ninja.toolsData.selectedToolInstance._configure(true); this.addEventListener("change@appModel.show3dGrid", this, false); - } }, @@ -533,8 +530,7 @@ exports.Stage = Montage.create(Component, { drawUtils.updatePlanes(); //TODO Set this variable in the needs draw so that it does not have to be calculated again for each draw for selection change - if(this.application.ninja.selectedElements.length) - { + if(this.application.ninja.selectedElements.length) { // drawUtils.drawSelectionBounds handles the single selection case as well, // so we don't have to special-case the single selection case. // TODO drawUtils.drawSelectionBounds expects an array of elements. @@ -542,8 +538,7 @@ exports.Stage = Montage.create(Component, { // TODO to work on _element instead of re-creating a new Array here. var selArray = new Array(); - for(var i = 0; this.application.ninja.selectedElements[i];i++) - { + for(var i = 0; this.application.ninja.selectedElements[i];i++) { var curElement = this.application.ninja.selectedElements[i]._element; // Add element to array that is used to calculate 3d-bounding box of all elements @@ -576,7 +571,7 @@ exports.Stage = Montage.create(Component, { * @params: x, y, w, h */ draw3DSelectionRectangle: { - value:function(x0,y0, x1,y1, x2,y2, x3,y3){ + value:function(x0,y0, x1,y1, x2,y2, x3,y3) { // this.clearCanvas(); this.clearDrawingCanvas(); this._drawingContext.strokeStyle = this._canvasDrawingPrefs.color; @@ -621,7 +616,7 @@ exports.Stage = Montage.create(Component, { * Draws selection highlight and reg. point for a given element */ drawElementBoundingBox: { - value: function(elt, editMode) { + value: function(elt) { this.stageDeps.viewUtils.setViewportObj( elt ); var bounds3D = this.stageDeps.viewUtils.getElementViewBounds3D( elt ); @@ -632,18 +627,16 @@ exports.Stage = Montage.create(Component, { // } var zoomFactor = 1; - if (this._viewport.style && this._viewport.style.zoom) - { + if (this._viewport.style && this._viewport.style.zoom) { zoomFactor = Number(this._viewport.style.zoom); } + var tmpMat = this.stageDeps.viewUtils.getLocalToGlobalMatrix( elt ); - for (var j=0; j<4; j++) - { + for (var j=0; j<4; j++) { var localPt = bounds3D[j]; var tmpPt = this.stageDeps.viewUtils.localToGlobal2(localPt, tmpMat); - if(zoomFactor !== 1) - { + if(zoomFactor !== 1) { tmpPt = vecUtils.vecScale(3, tmpPt, zoomFactor); tmpPt[0] += this._scrollLeft*(zoomFactor - 1); @@ -653,13 +646,9 @@ exports.Stage = Montage.create(Component, { } // draw it - if(editMode) { - this.context.strokeStyle = this._editSymbolPrefs.color; - this.context.lineWidth = this._editSymbolPrefs.thickness; - } else { - this.context.strokeStyle = this._canvasSelectionPrefs.color; - this.context.lineWidth = this._canvasSelectionPrefs.thickness; - } + this.context.strokeStyle = this._canvasSelectionPrefs.color; + this.context.lineWidth = this._canvasSelectionPrefs.thickness; + this.context.beginPath(); @@ -673,13 +662,6 @@ exports.Stage = Montage.create(Component, { this.context.closePath(); this.context.stroke(); - - /** Bug #25 - Do Not Draw the Registration point anymore on the top left since it's assumed there. - this.context.beginPath(); - this.context.arc(bounds3D[0][0], bounds3D[0][1] , 5, 0, Math.PI*2, false); - this.context.stroke(); - */ - } }, @@ -691,10 +673,8 @@ exports.Stage = Montage.create(Component, { * * @params: x, y, w, h */ - draw3DProjectedAndUnprojectedRectangles: - { - value:function(unProjPts, projPts) - { + draw3DProjectedAndUnprojectedRectangles: { + value:function(unProjPts, projPts) { this.clearDrawingCanvas(); this._drawingContext.strokeStyle = this._canvasDrawingPrefs.color; this._drawingContext.lineWidth = this._canvasDrawingPrefs.thickness; @@ -748,7 +728,7 @@ exports.Stage = Montage.create(Component, { * @params: x0, y0, x1, y1 */ drawLine: { - value:function(x0, y0, x1, y1, strokeSize, strokeColor){ + value:function(x0, y0, x1, y1, strokeSize, strokeColor) { this.clearDrawingCanvas(); this._drawingContext.strokeStyle = strokeColor; this._drawingContext.lineWidth = strokeSize; -- 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/stage/layout.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'js/stage') diff --git a/js/stage/layout.js b/js/stage/layout.js index 1a491210..56bb70bf 100755 --- a/js/stage/layout.js +++ b/js/stage/layout.js @@ -195,11 +195,30 @@ exports.Layout = Montage.create(Component, { bounds3D[j] = tmpPt; } - // Draw the Item ouline - this._dashedLine(bounds3D[3][0] - 0.5,bounds3D[3][1]- 0.5,bounds3D[0][0] + 2.5, bounds3D[0][1] - 0.5,[5,5]); - this._dashedLine(bounds3D[0][0] - 0.5, bounds3D[0][1] - 0.5, bounds3D[1][0]- 0.5, bounds3D[1][1] + 0.5, [5,5] ); - this._dashedLine(bounds3D[1][0] - 0.5 , bounds3D[1][1] + 0.5, bounds3D[2][0]+ 0.5, bounds3D[2][1] + 0.5, [5,5] ); - this._dashedLine(bounds3D[2][0] + 0.5, bounds3D[2][1] + 0.5, bounds3D[3][0] + 0.5, bounds3D[3][1] - 0.5, [5,5] ); + if(item.uuid === this.application.ninja.currentSelectedContainer.uuid) { + this.ctx.save(); + this.ctx.strokeStyle = "#C61F00"; + + this.ctx.beginPath(); + + this.ctx.moveTo( bounds3D[3][0] + 0.5 , bounds3D[3][1] - 0.5 ); + + this.ctx.lineTo( bounds3D[0][0] - 0.5 , bounds3D[0][1] - 0.5 ); + this.ctx.lineTo( bounds3D[1][0] - 0.5 , bounds3D[1][1] + 0.5 ); + this.ctx.lineTo( bounds3D[2][0] + 0.5 , bounds3D[2][1] + 0.5 ); + this.ctx.lineTo( bounds3D[3][0] + 0.5 , bounds3D[3][1] + 0.5 ); + + this.ctx.closePath(); + this.ctx.stroke(); + + this.ctx.restore(); + } else { + // Draw the Item ouline + this._dashedLine(bounds3D[3][0] - 0.5,bounds3D[3][1]- 0.5,bounds3D[0][0] + 2.5, bounds3D[0][1] - 0.5,[5,5]); + this._dashedLine(bounds3D[0][0] - 0.5, bounds3D[0][1] - 0.5, bounds3D[1][0]- 0.5, bounds3D[1][1] + 0.5, [5,5] ); + this._dashedLine(bounds3D[1][0] - 0.5 , bounds3D[1][1] + 0.5, bounds3D[2][0]+ 0.5, bounds3D[2][1] + 0.5, [5,5] ); + this._dashedLine(bounds3D[2][0] + 0.5, bounds3D[2][1] + 0.5, bounds3D[3][0] + 0.5, bounds3D[3][1] - 0.5, [5,5] ); + } // Draw the Label is all mode if(this.layoutView === "layoutAll") { -- cgit v1.2.3 From b1daf0b285a4a96bfd0086709c20e3682d75551a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 21 Feb 2012 14:32:17 -0800 Subject: fixing the dirty flag and removing sass changes Signed-off-by: Valerio Virgillito --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 31f40d09..dc9980f0 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -98,9 +98,9 @@ exports.StageView = Montage.create(Component, { onChange: function(){ var historySize = doc.editor.historySize(); if(historySize.undo>0){ - doc.markEdited(); + doc.needsSave = true; }else if(historySize.undo===0 && historySize.redo>0){ - doc.markUnedited(); + doc.needsSave = false; } }, onCursorActivity: function() { -- cgit v1.2.3