From 27935436ad8cd0675311667f70b6a285eb126a94 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 17:10:01 -0700 Subject: Fixing references to iframe's styles in new template. Signed-off-by: Nivesh Rajbhandari --- js/ninja.reel/ninja.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index cf7c6cf4..edc1efa4 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -300,7 +300,7 @@ exports.Ninja = Montage.create(Component, { // Turn on WebGL animation during preview _toggleWebGlAnimation: { value: function(inLivePreview) { - var glCanvases = this.currentDocument.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'), + var glCanvases = this.currentDocument.model.views.design.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'), glShapeModel; if(glCanvases) { for(var i = 0, len = glCanvases.length; i --- js/ninja.reel/ninja.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 4d7d883d..f518378a 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -284,19 +284,23 @@ exports.Ninja = Montage.create(Component, { var background, overflow, transitionStopRule; this.stage.hideCanvas(this.appModel.livePreview); + // TODO: Remove marker for old template: NINJA-STAGE-REWORK if(this.appModel.livePreview) { - background = "#000000"; - overflow = "hidden"; +// background = "#000000"; +// overflow = "hidden"; transitionStopRule = "nj-css-garbage-selector"; } else { - background = "#808080"; - overflow = "visible"; +// background = "#808080"; +// overflow = "visible"; transitionStopRule = "*" } - this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); - this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); - this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); + // TODO: Remove marker for old template: NINJA-STAGE-REWORK +// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); +// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); +// this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); + + this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = transitionStopRule; this._toggleWebGlAnimation(this.appModel.livePreview); } -- cgit v1.2.3 From f6f722feecf88c8afe59327eaf8557ce4012abc7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 22:40:02 -0700 Subject: Fixing the dirty document flag. Disabling the stylesheets dirty flag because === true on document open. Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index f518378a..3fcce925 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -346,31 +346,6 @@ exports.Ninja = Montage.create(Component, { } }, - _handleAppLoaded: { - value: function(event){ - - /* - Object.defineBinding(docBar, "type", { - boundObject: DocumentManagerModule.DocumentManager, - boundObjectPropertyPath: "activeDocument.documentType" - }); - - Object.defineBinding(docBar, "currentView", { - boundObject: DocumentManagerModule.DocumentManager, - boundObjectPropertyPath: "activeDocument.currentView", - oneway: false - }); - - Object.defineBinding(docBar, "zoomFactor", { - boundObject: DocumentManagerModule.DocumentManager, - boundObjectPropertyPath: "activeDocument.zoomFactor", - oneway: false - }); - */ - - } - }, - setupGlobalHelpers: { value: function() { -- cgit v1.2.3 From fd54dabad7cbc27a0efb0957155c00d578912909 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:32:36 -0700 Subject: changing @change to propertyChangeListener Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 3fcce925..87167d4c 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -165,9 +165,9 @@ exports.Ninja = Montage.create(Component, { this.eventManager.addEventListener( "selectSubTool", this, false); this.eventManager.addEventListener( "onOpenDocument", this, false); - this.addEventListener("change@appModel.livePreview", this.executeLivePreview, false); - this.addEventListener("change@appModel.chromePreview", this.executeChromePreview, false); - this.addEventListener("change@appModel.debug", this.toggleDebug, false); + this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); + this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); + this.addPropertyChangeListener("appModel.debug", this.toggleDebug, false); NJevent("appLoading"); } -- cgit v1.2.3 From 7a94696e19b14e15261df516e2ba75e693b1313d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:21:56 -0700 Subject: enabling basic document switching Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 9f0456ae..ba87e2d5 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -161,9 +161,10 @@ exports.Ninja = Montage.create(Component, { window.addEventListener("resize", this, false); - this.eventManager.addEventListener( "selectTool", this, false); - this.eventManager.addEventListener( "selectSubTool", this, false); - this.eventManager.addEventListener( "onOpenDocument", this, false); + this.eventManager.addEventListener("selectTool", this, false); + this.eventManager.addEventListener("selectSubTool", this, false); + this.eventManager.addEventListener("onOpenDocument", this, false); + this.eventManager.addEventListener("switchDocument", this, false); this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); @@ -279,6 +280,16 @@ exports.Ninja = Montage.create(Component, { } }, + handleSwitchDocument: { + value: function() { + this.currentDocument = this.documentController.activeDocument; + + if(this.currentDocument.documentRoot) { + this.application.ninja.currentSelectedContainer = this.currentDocument.documentRoot; + } + } + }, + executeLivePreview: { value: function() { var background, overflow, transitionStopRule; -- cgit v1.2.3 From 084bb924bc3c3a6ad1e2e21099399bba4d473fed Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:41:31 -0700 Subject: fixing some snapping bugs Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index ba87e2d5..067a005f 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -134,10 +134,21 @@ exports.Ninja = Montage.create(Component, { value: [] }, - currentSelectedContainer: { + _currentSelectedContainer: { value: null }, + currentSelectedContainer: { + get: function() { + return this._currentSelectedContainer; + }, + set: function(value) { + if(value !== this._currentSelectedContainer) { + this._currentSelectedContainer = value; + } + } + }, + templateDidLoad: { value: function() { this.ninjaVersion = window.ninjaVersion.ninja.version; @@ -285,7 +296,7 @@ exports.Ninja = Montage.create(Component, { this.currentDocument = this.documentController.activeDocument; if(this.currentDocument.documentRoot) { - this.application.ninja.currentSelectedContainer = this.currentDocument.documentRoot; + this._currentSelectedContainer = this.selectionController._currentSelectedContainer = this.currentDocument.documentRoot; } } }, -- cgit v1.2.3 From 24d1873302b2fffc25d254e15e8aa36f59eedb88 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 01:36:05 -0700 Subject: fixed a switch documents bug where the layout was getting called before setting the container. Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 067a005f..6d41cd53 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -175,7 +175,7 @@ exports.Ninja = Montage.create(Component, { this.eventManager.addEventListener("selectTool", this, false); this.eventManager.addEventListener("selectSubTool", this, false); this.eventManager.addEventListener("onOpenDocument", this, false); - this.eventManager.addEventListener("switchDocument", this, false); + this.eventManager.addEventListener("onSwitchDocument", this, false); this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); @@ -291,13 +291,15 @@ exports.Ninja = Montage.create(Component, { } }, - handleSwitchDocument: { + handleOnSwitchDocument: { value: function() { this.currentDocument = this.documentController.activeDocument; if(this.currentDocument.documentRoot) { this._currentSelectedContainer = this.selectionController._currentSelectedContainer = this.currentDocument.documentRoot; } + + NJevent("switchDocument"); } }, -- cgit v1.2.3 From fdfba499f0b84360b96096fa866a981e96e8756c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 16:35:56 -0700 Subject: fixing the color chip for the document root Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 6d41cd53..80d1b406 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -280,7 +280,7 @@ exports.Ninja = Montage.create(Component, { this.currentDocument = event.detail; if(this.currentDocument.documentRoot) { - this.application.ninja.currentSelectedContainer = this.currentDocument.documentRoot; + this.currentSelectedContainer = this.currentDocument.documentRoot; } else { alert("The current document has not loaded yet"); return; -- cgit v1.2.3 From 2b207ef8b2594927f8cd6cd63a8483d205cb86c4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 22 May 2012 15:41:51 -0700 Subject: fixing the selection in multiple documents and some code cleanup Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 80d1b406..9f1d1b3b 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -296,7 +296,7 @@ exports.Ninja = Montage.create(Component, { this.currentDocument = this.documentController.activeDocument; if(this.currentDocument.documentRoot) { - this._currentSelectedContainer = this.selectionController._currentSelectedContainer = this.currentDocument.documentRoot; + this._currentSelectedContainer = this.selectionController._selectionContainer = this.currentDocument.documentRoot; } NJevent("switchDocument"); -- cgit v1.2.3 From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:07:23 -0700 Subject: Cleaning up referencing to 'documentRoot' and '_document' Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view. --- js/ninja.reel/ninja.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 9f1d1b3b..d0eb1557 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -279,8 +279,8 @@ exports.Ninja = Montage.create(Component, { value: function(event) { this.currentDocument = event.detail; - if(this.currentDocument.documentRoot) { - this.currentSelectedContainer = this.currentDocument.documentRoot; + if(this.currentDocument.model.documentRoot) { + this.currentSelectedContainer = this.currentDocument.model.documentRoot; } else { alert("The current document has not loaded yet"); return; @@ -295,8 +295,8 @@ exports.Ninja = Montage.create(Component, { value: function() { this.currentDocument = this.documentController.activeDocument; - if(this.currentDocument.documentRoot) { - this._currentSelectedContainer = this.selectionController._selectionContainer = this.currentDocument.documentRoot; + if(this.currentDocument.model.documentRoot) { + this._currentSelectedContainer = this.selectionController._selectionContainer = this.currentDocument.model.documentRoot; } NJevent("switchDocument"); @@ -320,9 +320,9 @@ exports.Ninja = Montage.create(Component, { } // TODO: Remove marker for old template: NINJA-STAGE-REWORK -// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); -// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); -// this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); +// this.currentDocument.model.documentRoot.elementModel.controller.setProperty(this.currentDocument.model.documentRoot, "body-background", background); +// this.currentDocument.model.documentRoot.elementModel.controller.setProperty(this.currentDocument.model.documentRoot, "overflow", overflow); +// this.currentDocument.model.documentRoot.elementModel.controller.changeSelector(this.currentDocument.model.documentRoot, "transitionStopRule", transitionStopRule); this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = transitionStopRule; -- cgit v1.2.3