diff options
Diffstat (limited to 'js')
-rwxr-xr-x | js/controllers/document-controller.js | 71 | ||||
-rwxr-xr-x | js/document/document-html.js | 2 | ||||
-rwxr-xr-x | js/helper-classes/3D/draw-utils.js | 2 | ||||
-rwxr-xr-x | js/helper-classes/3D/snap-manager.js | 13 | ||||
-rwxr-xr-x | js/helper-classes/3D/view-utils.js | 53 | ||||
-rwxr-xr-x | js/stage/stage-deps.js | 61 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.html | 3 | ||||
-rwxr-xr-x | js/tools/drawing-tool-base.js | 39 |
8 files changed, 80 insertions, 164 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index cf46e73e..50874725 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -454,58 +454,57 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
454 | // Open document callback | 454 | // Open document callback |
455 | _onOpenDocument: { | 455 | _onOpenDocument: { |
456 | value: function(doc){ | 456 | value: function(doc){ |
457 | 457 | var currentDocument; | |
458 | if(this.activeDocument) { | 458 | if(this.activeDocument) { |
459 | // There is a document currently opened | 459 | // There is a document currently opened |
460 | 460 | currentDocument = this.activeDocument; | |
461 | |||
462 | 461 | ||
463 | //this.application.ninja.stage.stageView.showCodeViewBar(false); | 462 | //this.application.ninja.stage.stageView.showCodeViewBar(false); |
464 | //this.application.ninja.stage.stageView.restoreAllPanels(); | 463 | //this.application.ninja.stage.stageView.restoreAllPanels(); |
465 | 464 | ||
466 | // | 465 | //this.activeDocument.saveAppState(); |
467 | /* | ||
468 | if(this.activeDocument.currentView === "design"){ | ||
469 | this.activeDocument.saveAppState(); | ||
470 | this.activeDocument.container.parentNode.style["display"] = "none"; | ||
471 | this.application.ninja.stage.hideCanvas(true); | ||
472 | this.application.ninja.stage.stageView.hideRulers(); | ||
473 | } | ||
474 | 466 | ||
475 | this.activeDocument.container.style["display"] = "none"; | 467 | // TODO: Do we need this? |
476 | */ | 468 | //this.application.ninja.stage.hideCanvas(true); |
477 | 469 | //this.application.ninja.stage.stageView.hideRulers(); | |
478 | /* | 470 | |
479 | this.activeDocument.container.style["display"] = "block"; | 471 | //this.activeDocument.restoreAppState(); |
480 | if(this.activeDocument.currentView === "design"){ | ||
481 | this.activeDocument.container.parentNode.style["display"] = "block"; | ||
482 | this.activeDocument.restoreAppState(); | ||
483 | }else{ | ||
484 | //hide the iframe when switching to code view | ||
485 | document.getElementById("iframeContainer").style.display = "none"; | ||
486 | } | ||
487 | |||
488 | */ | ||
489 | // hide current document | ||
490 | } else { | 472 | } else { |
491 | // There is no document opened | 473 | // There is no document opened |
492 | 474 | ||
493 | // Set the active document | 475 | // Show the rulers |
494 | this.activeDocument = doc; | 476 | // TODO: Move this indo design view |
477 | this.application.ninja.stage.stageView.showRulers(); | ||
495 | 478 | ||
496 | // Show the canvas | 479 | // Show the canvas |
497 | this.application.ninja.stage.hideCanvas(false); | 480 | this.application.ninja.stage.hideCanvas(false); |
481 | } | ||
498 | 482 | ||
499 | // Show the rulers | ||
500 | // TODO: Move this indo design view | ||
501 | this.application.ninja.stage.stageView.showRulers(); | ||
502 | 483 | ||
503 | // Initialize the documentRoot styles | 484 | // Set the active document |
504 | this.initializeRootStyles(doc.documentRoot); | 485 | this.activeDocument = doc; |
505 | // Flag to stop stylesheet dirty event | 486 | |
506 | this._hackInitialStyles = false; | 487 | // Initialize the documentRoot styles |
488 | this.initializeRootStyles(doc.documentRoot); | ||
489 | // Flag to stop stylesheet dirty event | ||
490 | this._hackInitialStyles = false; | ||
491 | |||
492 | this.switchDocuments(currentDocument, doc); | ||
493 | |||
494 | NJevent("onOpenDocument", doc); | ||
495 | |||
496 | //Setting opacity to be viewable after load | ||
497 | //doc.model.views.design.iframe.style.opacity = 1; | ||
498 | |||
499 | } | ||
500 | }, | ||
501 | |||
502 | switchDocuments: { | ||
503 | value: function(current, newDocument) { | ||
504 | newDocument.model.views.design.iframe.style.opacity = 1; | ||
507 | 505 | ||
508 | NJevent("onOpenDocument", doc); | 506 | if(current) { |
507 | current.model.views.design.hide(); | ||
509 | } | 508 | } |
510 | } | 509 | } |
511 | }, | 510 | }, |
diff --git a/js/document/document-html.js b/js/document/document-html.js index 56d9db02..c77ed7bc 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -119,8 +119,6 @@ exports.HtmlDocument = Montage.create(Component, { | |||
119 | this._observer = null; | 119 | this._observer = null; |
120 | //Making callback after view is loaded | 120 | //Making callback after view is loaded |
121 | this.loaded.callback.call(this.loaded.context, this); | 121 | this.loaded.callback.call(this.loaded.context, this); |
122 | //Setting opacity to be viewable after load | ||
123 | this.model.views.design.iframe.style.opacity = 1; | ||
124 | } | 122 | } |
125 | }, | 123 | }, |
126 | //////////////////////////////////////////////////////////////////// | 124 | //////////////////////////////////////////////////////////////////// |
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index a6d2d899..a8bc16ef 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js | |||
@@ -138,7 +138,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
138 | l, | 138 | l, |
139 | t, | 139 | t, |
140 | plane, | 140 | plane, |
141 | elt | 141 | elt; |
142 | for(i=0; i<len; i++) { | 142 | for(i=0; i<len; i++) { |
143 | elt = documentRootChildren[i]; | 143 | elt = documentRootChildren[i]; |
144 | plane = this.addElement(elt); | 144 | plane = this.addElement(elt); |
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 2e8020d3..7194524e 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js | |||
@@ -21,7 +21,6 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
21 | /////////////////////////////////////////////////////////////////////// | 21 | /////////////////////////////////////////////////////////////////////// |
22 | // Instance variables | 22 | // Instance variables |
23 | /////////////////////////////////////////////////////////////////////// | 23 | /////////////////////////////////////////////////////////////////////// |
24 | currentStage: { value: null, writable: true }, | ||
25 | drawingCanvas: { value: null, writable: true}, | 24 | drawingCanvas: { value: null, writable: true}, |
26 | 25 | ||
27 | // we keep a stack of working planes to facilitate working on other planes temporarily | 26 | // we keep a stack of working planes to facilitate working on other planes temporarily |
@@ -84,14 +83,14 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
84 | popWorkingPlane : { value: function () { workingPlane = this._workingPlaneStack.pop(); return workingPlane; }}, | 83 | popWorkingPlane : { value: function () { workingPlane = this._workingPlaneStack.pop(); return workingPlane; }}, |
85 | 84 | ||
86 | getStageWidth : { value: function () { | 85 | getStageWidth : { value: function () { |
87 | return parseInt(this.currentStage.offsetWidth); | 86 | return parseInt(this.application.ninja.currentDocument.documentRoot.offsetWidth); |
88 | }}, | 87 | }}, |
89 | 88 | ||
90 | getStageHeight : { value: function () { | 89 | getStageHeight : { value: function () { |
91 | return parseInt(this.currentStage.offsetHeight); | 90 | return parseInt(this.application.ninja.currentDocument.documentRoot.offsetHeight); |
92 | }}, | 91 | }}, |
93 | 92 | ||
94 | getStage : { value: function() { return this.currentStage; }}, | 93 | getStage : { value: function() { return this.application.ninja.currentDocument.documentRoot; }}, |
95 | 94 | ||
96 | getGridVertexHitRad : { value: function() { return this._gridVertexHitRad; }}, | 95 | getGridVertexHitRad : { value: function() { return this._gridVertexHitRad; }}, |
97 | getGridEdgeHitRad : { value: function() { return this._gridEdgeHitRad; }}, | 96 | getGridEdgeHitRad : { value: function() { return this._gridEdgeHitRad; }}, |
@@ -185,12 +184,6 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
185 | } | 184 | } |
186 | }, | 185 | }, |
187 | 186 | ||
188 | setCurrentStage: { | ||
189 | value: function(stage) { | ||
190 | this.currentStage = stage; | ||
191 | } | ||
192 | }, | ||
193 | |||
194 | snap : { | 187 | snap : { |
195 | value: function (xScreen, yScreen, snap3D, quadPt) | 188 | value: function (xScreen, yScreen, snap3D, quadPt) |
196 | { | 189 | { |
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 8c338f84..20f61be1 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js | |||
@@ -18,18 +18,14 @@ exports.ViewUtils = Montage.create(Component, { | |||
18 | // Instance variables | 18 | // Instance variables |
19 | /////////////////////////////////////////////////////////////////////// | 19 | /////////////////////////////////////////////////////////////////////// |
20 | 20 | ||
21 | m_viewportObj : { value: null, writable: true}, | 21 | m_viewportObj : { value: null}, |
22 | _perspectiveDist: { value: null, writable: true}, | 22 | _perspectiveDist: { value: null}, |
23 | 23 | ||
24 | // keep a stack of viewport objects | 24 | // keep a stack of viewport objects |
25 | _viewportObjStack: { value: [], writable: true }, | 25 | _viewportObjStack: { value: []}, |
26 | 26 | ||
27 | _currentDocument: { value: null , writable: true}, | 27 | _userContentLeft: { value: null}, |
28 | _userContentLeft: { value: null , writable: true}, | 28 | _userContentTop: { value: null}, |
29 | _userContentTop: { value: null , writable: true}, | ||
30 | |||
31 | _rootElement: { value: null, writable: true}, | ||
32 | _stageElement: { value: null, writable: true}, | ||
33 | 29 | ||
34 | /////////////////////////////////////////////////////////////////////// | 30 | /////////////////////////////////////////////////////////////////////// |
35 | // Property accessors | 31 | // Property accessors |
@@ -43,18 +39,9 @@ exports.ViewUtils = Montage.create(Component, { | |||
43 | }, | 39 | }, |
44 | getViewportObj: { value: function() { return this.m_viewportObj; } }, | 40 | getViewportObj: { value: function() { return this.m_viewportObj; } }, |
45 | 41 | ||
46 | setRootElement: { value: function( elt ) { this._rootElement = elt; } }, | ||