From 3a754133dbc138390503341fd2e9beba3e43aa4b Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 27 Jan 2012 12:05:17 -0800 Subject: Merged old FileIO --- js/controllers/elements/block-controller.js | 0 js/controllers/elements/canvas-controller.js | 0 js/controllers/elements/component-controller.js | 0 js/controllers/elements/controller-factory.js | 0 js/controllers/elements/element-controller.js | 0 js/controllers/elements/image-controller.js | 0 js/controllers/elements/shapes-controller.js | 0 js/controllers/elements/stage-controller.js | 0 js/controllers/elements/video-controller.js | 0 9 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 js/controllers/elements/block-controller.js mode change 100644 => 100755 js/controllers/elements/canvas-controller.js mode change 100644 => 100755 js/controllers/elements/component-controller.js mode change 100644 => 100755 js/controllers/elements/controller-factory.js mode change 100644 => 100755 js/controllers/elements/element-controller.js mode change 100644 => 100755 js/controllers/elements/image-controller.js mode change 100644 => 100755 js/controllers/elements/shapes-controller.js mode change 100644 => 100755 js/controllers/elements/stage-controller.js mode change 100644 => 100755 js/controllers/elements/video-controller.js (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/block-controller.js b/js/controllers/elements/block-controller.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/image-controller.js b/js/controllers/elements/image-controller.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js old mode 100644 new mode 100755 diff --git a/js/controllers/elements/video-controller.js b/js/controllers/elements/video-controller.js old mode 100644 new mode 100755 -- cgit v1.2.3 From 0dca2755c07f9928e9d9b0b7feace48edf969900 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 27 Jan 2012 15:05:27 -0800 Subject: Updated canvas controller to override setProperties so we don't set styles when updating width and height. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/canvas-controller.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js index 7af7e824..21de9879 100755 --- a/js/controllers/elements/canvas-controller.js +++ b/js/controllers/elements/canvas-controller.js @@ -33,5 +33,13 @@ exports.CanvasController = Montage.create(ElementController, { ElementController.setProperty(el, p, value); } } + }, + + setProperties: { + value: function(el, props, index) { + for(var p in props) { + el.elementModel.controller.setProperty(el, p, props[p][index]); + } + } } }); \ No newline at end of file -- cgit v1.2.3 From d26a13de2aca25c36cb35f85604de1ac2b9befbb Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 1 Feb 2012 14:37:30 -0800 Subject: Simple button native widget test. Added a controller, pi and panel code. Signed-off-by: Valerio Virgillito --- js/controllers/elements/component-controller.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index 458e6b46..7a8acb3a 100644 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js @@ -9,4 +9,27 @@ var Montage = require("montage/core/core").Montage, exports.ComponentController = Montage.create(ElementController, { + getProperty: { + value: function(el, prop) { + switch(prop) { + case "label": + return this.application.ninja.currentDocument.getComponentFromElement(el).label; + break; + default: + return ElementController.getProperty(el, prop); + } + } + }, + + setProperty: { + value: function(el, p, value) { + switch(p) { + case "label": + this.application.ninja.currentDocument.getComponentFromElement(el).label = value; + break; + default: + ElementController.setProperty(el, p, value); + } + } + } }); -- cgit v1.2.3 From dbd3a60478db35b0b12baa2ca54a0712d880951f Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 3 Feb 2012 15:50:35 -0800 Subject: button component using json data Signed-off-by: Valerio Virgillito --- js/controllers/elements/component-controller.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index 7a8acb3a..1b0591be 100644 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js @@ -15,8 +15,11 @@ exports.ComponentController = Montage.create(ElementController, { case "label": return this.application.ninja.currentDocument.getComponentFromElement(el).label; break; + case "enabled": + return this.application.ninja.currentDocument.getComponentFromElement(el).enabled; + break; default: - return ElementController.getProperty(el, prop); + return ElementController.getProperty(el, prop, true); } } }, @@ -27,6 +30,9 @@ exports.ComponentController = Montage.create(ElementController, { case "label": this.application.ninja.currentDocument.getComponentFromElement(el).label = value; break; + case "enabled": + this.application.ninja.currentDocument.getComponentFromElement(el).enabled = value; + break; default: ElementController.setProperty(el, p, value); } -- cgit v1.2.3 From 47df0aff81c25334b129047bb227ea5015357eda Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 9 Feb 2012 16:22:03 -0800 Subject: Setting defaults and more cleanup Signed-off-by: Valerio Virgillito --- js/controllers/elements/component-controller.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index 1b0591be..33b9b79a 100644 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js @@ -18,6 +18,12 @@ exports.ComponentController = Montage.create(ElementController, { case "enabled": return this.application.ninja.currentDocument.getComponentFromElement(el).enabled; break; + case "disabled": + return this.application.ninja.currentDocument.getComponentFromElement(el).disabled; + break; + case "value": + return this.application.ninja.currentDocument.getComponentFromElement(el).value; + break; default: return ElementController.getProperty(el, prop, true); } @@ -33,6 +39,12 @@ exports.ComponentController = Montage.create(ElementController, { case "enabled": this.application.ninja.currentDocument.getComponentFromElement(el).enabled = value; break; + case "disabled": + this.application.ninja.currentDocument.getComponentFromElement(el).disabled = value; + break; + case "value": + this.application.ninja.currentDocument.getComponentFromElement(el).value = value; + break; default: ElementController.setProperty(el, p, value); } -- cgit v1.2.3 From 08101852de934ed674807b26ab89f432daa4d6fe Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 14 Feb 2012 12:01:57 -0800 Subject: Fixing the live preview background issue. Signed-off-by: Valerio Virgillito --- js/controllers/elements/stage-controller.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js index af7c4858..a8546662 100644 --- a/js/controllers/elements/stage-controller.js +++ b/js/controllers/elements/stage-controller.js @@ -92,7 +92,11 @@ exports.StageController = Montage.create(ElementController, { setProperty: { value: function(el, p, value) { + switch(p) { + case "body-background": + el.elementModel.body.style.setProperty("background", value); + break; case "background": el.elementModel.stageBackground.style.setProperty(p, value); break; -- cgit v1.2.3 From 68f8788c80d7f8d7815aca65ffabaa40b9434705 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 14 Feb 2012 23:47:33 -0800 Subject: fixing the controller to handle all properties Signed-off-by: Valerio Virgillito --- js/controllers/elements/component-controller.js | 43 +++++++++++-------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index 33b9b79a..7fa62d1e 100644 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js @@ -12,20 +12,15 @@ exports.ComponentController = Montage.create(ElementController, { getProperty: { value: function(el, prop) { switch(prop) { - case "label": - return this.application.ninja.currentDocument.getComponentFromElement(el).label; - break; - case "enabled": - return this.application.ninja.currentDocument.getComponentFromElement(el).enabled; - break; - case "disabled": - return this.application.ninja.currentDocument.getComponentFromElement(el).disabled; - break; - case "value": - return this.application.ninja.currentDocument.getComponentFromElement(el).value; - break; - default: + case "id": + case "class": + case "left": + case "top": + case "width": + case "height": return ElementController.getProperty(el, prop, true); + default: + return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; } } }, @@ -33,20 +28,18 @@ exports.ComponentController = Montage.create(ElementController, { setProperty: { value: function(el, p, value) { switch(p) { - case "label": - this.application.ninja.currentDocument.getComponentFromElement(el).label = value; - break; - case "enabled": - this.application.ninja.currentDocument.getComponentFromElement(el).enabled = value; - break; - case "disabled": - this.application.ninja.currentDocument.getComponentFromElement(el).disabled = value; - break; - case "value": - this.application.ninja.currentDocument.getComponentFromElement(el).value = value; + case "id": + case "class": + case "left": + case "top": + case "width": + case "height": + ElementController.setProperty(el, p, value); break; default: - ElementController.setProperty(el, p, value); + this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value; + break; + } } } -- cgit v1.2.3 From 747616980cad14f0b65fbcc7f497ed9680a39d29 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 15 Feb 2012 14:55:21 -0800 Subject: Adding more components pi Added rest of the components pi. Missing text-input and select Signed-off-by: Valerio Virgillito --- js/controllers/elements/component-controller.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index 7fa62d1e..83450d0f 100644 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js @@ -18,7 +18,11 @@ exports.ComponentController = Montage.create(ElementController, { case "top": case "width": case "height": - return ElementController.getProperty(el, prop, true); + if(el.nodeName === "IMG" && (prop === "width" || prop === "height")) { + return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; + } else { + return ElementController.getProperty(el, prop, true); + } default: return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; } @@ -34,9 +38,15 @@ exports.ComponentController = Montage.create(ElementController, { case "top": case "width": case "height": - ElementController.setProperty(el, p, value); + if(el.nodeName === "IMG" && (p === "width" || p === "height")) { + this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value; + } else { + ElementController.setProperty(el, p, value); + } break; default: + if(p === "min" || p === "max") value = parseFloat(value); + this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value; break; -- cgit v1.2.3 From e0bead5a36ae987c558607b77745c4018caf59f8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 16 Feb 2012 21:42:56 -0800 Subject: Adding a data-RDGE-id attribute to each canvas to save/load canvas data Signed-off-by: Valerio Virgillito --- js/controllers/elements/shapes-controller.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 640119c4..15a18a51 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -59,6 +59,7 @@ exports.ShapesController = Montage.create(CanvasController, { break; case "useWebGl": var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true); + canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom()); canvas.width = el.width; canvas.height = el.height; this.application.ninja.elementMediator.replaceElement(el, canvas); -- 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/controllers/elements/element-controller.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 65d26bdd..ac14def4 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -12,6 +12,9 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, addElement: { value: function(el, styles) { this.application.ninja.currentDocument.documentRoot.appendChild(el); + // Nested elements - + // TODO make sure the CSS is correct before nesting elements + // this.application.ninja.currentSelectedContainer.appendChild(el); this.application.ninja.stylesController.setElementStyles(el, styles); } }, -- cgit v1.2.3