From 480c3c43f15162980390cf762411b93f7d02db19 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 9 May 2012 15:40:50 -0700 Subject: fixing the components for the new dom Signed-off-by: Valerio Virgillito --- js/panels/components-panel.reel/components-panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/panels/components-panel.reel') diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 4169423b..9b237229 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -278,7 +278,7 @@ exports.ComponentsPanel = Montage.create(Component, { that = this; element = this.makeComponent(component.component); - this.application.ninja.currentDocument._window.addComponent(element, {name: component.name, path: component.module}, function(instance, element) { + this.application.ninja.currentDocument.model.views.design.iframe.contentWindow.addComponent(element, {name: component.name, path: component.module}, function(instance, element) { //var pos = that.getStageCenter(); @@ -297,7 +297,7 @@ exports.ComponentsPanel = Montage.create(Component, { instance.addEventListener('firstDraw', that, false); - that.application.ninja.currentDocument.setComponentInstance(instance, element); + that.application.ninja.currentDocument.model.setComponentInstance(instance, element); that.application.ninja.elementMediator.addElements(element, styles); }); -- cgit v1.2.3 From ec37028c6fe7a6799f9a3b3ee5eb36754c1dc924 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 16:12:56 -0700 Subject: Fixing the select and text area PI Signed-off-by: Valerio Virgillito --- js/panels/components-panel.reel/components-panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/panels/components-panel.reel') diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 9b237229..171bef57 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -346,7 +346,7 @@ exports.ComponentsPanel = Montage.create(Component, { break; case "select": el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Select"); + document.application.njUtils.createModelForComponent(el, "SelectInput"); break; case "radioButton": el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); @@ -366,7 +366,7 @@ exports.ComponentsPanel = Montage.create(Component, { break; case "textarea": el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "TextArea"); + document.application.njUtils.createModelForComponent(el, "Textarea"); break; case "toggleButton": el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); -- cgit v1.2.3 From 90d158a3372b6c8ac2deb8b82070d76135e72397 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 16:49:18 -0700 Subject: Fixing the components double click center stage position. Signed-off-by: Valerio Virgillito --- js/panels/components-panel.reel/components-panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/panels/components-panel.reel') diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 171bef57..87d5082d 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -404,8 +404,8 @@ exports.ComponentsPanel = Montage.create(Component, { //if(!this.centerStage) { var top, left; - top = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); - left = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); + top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); + left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); //this.centerStage = [top, left]; return [left, top]; //} -- cgit v1.2.3 From 80f2b57b2126bbe90ce6ab3663ac04ffcc40a393 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 11:27:44 -0700 Subject: adding data-montage-id to the components Signed-off-by: Valerio Virgillito --- js/panels/components-panel.reel/components-panel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/panels/components-panel.reel') diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 87d5082d..53049cad 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -6,7 +6,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component, - NJUtils = require("js/lib/NJUtils").NJUtils; + ClassUUID = require("js/components/core/class-uuid").ClassUuid; var PIData = require("js/data/pi/pi-data").PiData; @@ -392,6 +392,8 @@ exports.ComponentsPanel = Montage.create(Component, { } + el.setAttribute("data-montage-id", ClassUUID.generate()); + return el; } }, -- cgit v1.2.3 From 99f16ae08fbb0a6dfe6008c9833f2253b18c19e5 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 14:13:28 -0700 Subject: removing first draw on the component event Signed-off-by: Valerio Virgillito --- js/panels/components-panel.reel/components-panel.js | 8 -------- 1 file changed, 8 deletions(-) (limited to 'js/panels/components-panel.reel') diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 53049cad..37fd9b44 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -295,8 +295,6 @@ exports.ComponentsPanel = Montage.create(Component, { } } - instance.addEventListener('firstDraw', that, false); - that.application.ninja.currentDocument.model.setComponentInstance(instance, element); that.application.ninja.elementMediator.addElements(element, styles); @@ -304,12 +302,6 @@ exports.ComponentsPanel = Montage.create(Component, { } }, - - handleFirstDraw: { - value: function (e) { - NJevent("addComponentFirstDraw"); - } - }, makeComponent: { value: function(name) { -- cgit v1.2.3 From ac750fd9b9c311dcd48c6ee309607edc6fa048e1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 16 May 2012 14:22:18 -0700 Subject: Adding basic montage components I/O Only for saving basic components without a reel. --- js/panels/components-panel.reel/components-panel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/panels/components-panel.reel') diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 53049cad..fdf744d2 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -6,9 +6,9 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component, - ClassUUID = require("js/components/core/class-uuid").ClassUuid; - -var PIData = require("js/data/pi/pi-data").PiData; + NJUtils = require("js/lib/NJUtils").NJUtils; + ClassUUID = require("js/components/core/class-uuid").ClassUuid, + PIData = require("js/data/pi/pi-data").PiData; String.prototype.capitalizeFirstChar = function() { return this.charAt(0).toUpperCase() + this.slice(1); -- 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/panels/components-panel.reel/components-panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/panels/components-panel.reel') diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index e028d1db..3ad1763d 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -398,8 +398,8 @@ exports.ComponentsPanel = Montage.create(Component, { //if(!this.centerStage) { var top, left; - top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); - left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); + top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.model.documentRoot, "height"))) / 2); + left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.model.documentRoot, "width"))) / 2); //this.centerStage = [top, left]; return [left, top]; //} -- cgit v1.2.3