From 0e1a276f19ea70009c5a649e9667861d7c346a7e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 6 Jun 2012 00:25:27 -0700 Subject: first iteration of adding serializable to ninja plus other changes to run the latest montage Signed-off-by: Valerio Virgillito --- .../sections/position-size.reel/position-size.html | 9 ++-- .../sections/position-size.reel/position-size.js | 41 ++++++++++++++++ .../sections/three-d-view.reel/three-d-view.html | 2 - .../sections/three-d-view.reel/three-d-view.js | 55 ++++++++++++++++++++++ 4 files changed, 100 insertions(+), 7 deletions(-) (limited to 'js/panels/properties.reel/sections') diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.html b/js/panels/properties.reel/sections/position-size.reel/position-size.html index 5d1a805a..ccc7a159 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.html +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.html @@ -32,7 +32,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "minValue": -10000 }, "bindings": { - "value": {"<<->": "@owner.leftPosition"} + "value": {"<->": "@owner.leftPosition"} } }, "PosY": { @@ -43,7 +43,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "minValue": -10000 }, "bindings": { - "value": {"<<->": "@owner.topPosition"} + "value": {"<->": "@owner.topPosition"} } }, @@ -53,7 +53,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "element": {"#": "PosH"} }, "bindings": { - "value": {"<<->": "@owner.heightSize"} + "value": {"<->": "@owner.heightSize"} } }, @@ -65,7 +65,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "units": "px" }, "bindings": { - "value": {"<<->": "@owner.widthSize"} + "value": {"<->": "@owner.widthSize"} } }, @@ -74,7 +74,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "properties": { "element": {"#": "posBound"}, "pressedClass": "lockUp", - "preventFocus": true, "identifier": "ratio" } } diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.js b/js/panels/properties.reel/sections/position-size.reel/position-size.js index 7c24e02a..fef2b195 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.js +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.js @@ -8,6 +8,47 @@ var Montage = require("montage/core/core").Montage; var Component = require("montage/ui/component").Component; exports.PositionSize = Montage.create(Component, { + + position: { + value: null, + serializable: true + }, + + leftLabel: { + value: null, + serializable: true + }, + + leftControl: { + value: null, + serializable: true + }, + + topLabel: { + value: null, + serializable: true + }, + + topControl: { + value: null, + serializable: true + }, + + heightControl: { + value: null, + serializable: true + }, + + widthControl: { + value: null, + serializable: true + }, + + bindButton: { + value: null, + serializable: true + }, + leftPosition: { value: 0 }, diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html index 5ef13fab..572e5a60 100755 --- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html +++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.html @@ -219,7 +219,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "properties": { "element": {"#": "rdioLocal"}, "label": "Local", - "value": "Local", "group": {"@": "axisModeGroup"}, "checked": true } @@ -229,7 +228,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "properties": { "element": {"#": "rdioGlobal"}, "label": "Global", - "value": "Global", "group": {"@": "axisModeGroup"} } }, diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js index 104d474d..70fca99b 100755 --- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js @@ -51,6 +51,61 @@ exports.ThreeD = Montage.create(Component, { } }, + x3DControl: { + value: null, + serializable: true + }, + + y3DControl: { + value: null, + serializable: true + }, + + z3DControl: { + value: null, + serializable: true + }, + + x3DLabel: { + value: null, + serializable: true + }, + + y3DLabel: { + value: null, + serializable: true + }, + + z3DLabel: { + value: null, + serializable: true + }, + + xAngleControl: { + value: null, + serializable: true + }, + + yAngleControl: { + value: null, + serializable: true + }, + + zAngleControl: { + value: null, + serializable: true + }, + + axisModeGroupControl: { + value: null, + serializable: true + }, + + flattenControl: { + value: null, + serializable: true + }, + x3D: { value: 0 }, -- cgit v1.2.3 From 471776facca730c57b0f6b8448535914df6624fd Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 11:12:32 -0700 Subject: adding more nonexistent properties Signed-off-by: Valerio Virgillito --- .../sections/custom-rows/single-row.reel/single-row.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/panels/properties.reel/sections') diff --git a/js/panels/properties.reel/sections/custom-rows/single-row.reel/single-row.js b/js/panels/properties.reel/sections/custom-rows/single-row.reel/single-row.js index b606d6b8..a11cd3f6 100755 --- a/js/panels/properties.reel/sections/custom-rows/single-row.reel/single-row.js +++ b/js/panels/properties.reel/sections/custom-rows/single-row.reel/single-row.js @@ -8,6 +8,10 @@ var Montage = require("montage/core/core").Montage; var Component = require("montage/ui/component").Component; exports.SingleRow = Montage.create(Component, { + slot: { + value: null + }, + id: { value: null }, -- cgit v1.2.3 From 509092ff335f74517a413cfb2deeb9d2de20f8e3 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 12 Jun 2012 15:13:09 -0700 Subject: Fixing properties panel to support px and % for body and other elements. Signed-off-by: Nivesh Rajbhandari --- .../properties.reel/sections/custom.reel/custom.js | 6 ++++ .../sections/position-size.reel/position-size.html | 16 +++++++-- .../sections/position-size.reel/position-size.js | 40 +++++++++++++++------- 3 files changed, 47 insertions(+), 15 deletions(-) (limited to 'js/panels/properties.reel/sections') diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index 9df16112..c599dcb0 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js @@ -233,6 +233,12 @@ exports.CustomSection = Montage.create(Component, { boundObjectPropertyPath: "value" }); + //Bind object value to controls list so it can be manipulated + Object.defineBinding(this.controls, aField.id + "Units", { + boundObject: obj, + boundObjectPropertyPath: "units" + }); + return obj; } }, diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.html b/js/panels/properties.reel/sections/position-size.reel/position-size.html index 5d1a805a..bc93da33 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.html +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.html @@ -29,9 +29,12 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "properties": { "element": {"#": "PosX"}, "maxValue": 10000, - "minValue": -10000 + "minValue": -10000, + "acceptableUnits" : ["px", "%"], + "units": "px" }, "bindings": { + "units": {"<<->": "@owner.leftUnits"}, "value": {"<<->": "@owner.leftPosition"} } }, @@ -40,9 +43,12 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "properties": { "element": {"#": "PosY"}, "maxValue": 10000, - "minValue": -10000 + "minValue": -10000, + "acceptableUnits" : ["px", "%"], + "units": "px" }, "bindings": { + "units": {"<<->": "@owner.topUnits"}, "value": {"<<->": "@owner.topPosition"} } }, @@ -50,9 +56,12 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "PosH": { "prototype": "js/components/hottextunit.reel[HotTextUnit]", "properties": { - "element": {"#": "PosH"} + "element": {"#": "PosH"}, + "acceptableUnits" : ["px", "%"], + "units": "px" }, "bindings": { + "units": {"<<->": "@owner.heightUnits"}, "value": {"<<->": "@owner.heightSize"} } }, @@ -65,6 +74,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "units": "px" }, "bindings": { + "units": {"<<->": "@owner.widthUnits"}, "value": {"<<->": "@owner.widthSize"} } diff --git a/js/panels/properties.reel/sections/position-size.reel/position-size.js b/js/panels/properties.reel/sections/position-size.reel/position-size.js index 7c24e02a..d9fd629c 100755 --- a/js/panels/properties.reel/sections/position-size.reel/position-size.js +++ b/js/panels/properties.reel/sections/position-size.reel/position-size.js @@ -12,17 +12,33 @@ exports.PositionSize = Montage.create(Component, { value: 0 }, + leftUnits: { + value: "px" + }, + topPosition: { value: 0 }, + topUnits: { + value: "px" + }, + heightSize: { value: 0 }, + heightUnits: { + value: "px" + }, + widthSize: { value: 0 }, + + widthUnits: { + value: "px" + }, /* widthSize: { get: function() { return this._widthSize;}, @@ -132,7 +148,7 @@ exports.PositionSize = Montage.create(Component, { if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "left", [this.leftControl.value + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "left", [this.leftControl.value + this.leftControl.units] , "Change", "pi", prevPosition); this.savedPosition = null; } } @@ -145,7 +161,7 @@ exports.PositionSize = Montage.create(Component, { if(!event.wasSetByCode) { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; - this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "top", [this.topControl.value + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "top", [this.topControl.value + this.topControl.units] , "Change", "pi", prevPosition); this.savedPosition = null; } } @@ -156,7 +172,7 @@ exports.PositionSize = Montage.create(Component, { var prevPosition, items; if(!event.wasSetByCode) { - if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; + if(this.savedPosition) prevPosition = [this.savedPosition]; this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; @@ -170,7 +186,7 @@ exports.PositionSize = Montage.create(Component, { this.application.ninja.elementMediator.setProperty(items, "width", [newWidth + "px"] , "Change", "pi"); } - this.application.ninja.elementMediator.setProperty(items, "height", [this.heightControl.value + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty(items, "height", [this.heightControl.value + this.heightControl.units] , "Change", "pi", prevPosition); this.savedPosition = null; } } @@ -181,7 +197,7 @@ exports.PositionSize = Montage.create(Component, { var prevPosition, items; if(!event.wasSetByCode) { - if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; + if(this.savedPosition) prevPosition = [this.savedPosition]; this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; @@ -196,7 +212,7 @@ exports.PositionSize = Montage.create(Component, { } - this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + "px"] , "Change", "pi", prevPosition); + this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + this.widthControl.units] , "Change", "pi", prevPosition); this.savedPosition = null; } @@ -208,7 +224,7 @@ exports.PositionSize = Montage.create(Component, { value: function(event) { if(!event.wasSetByCode) { if(!this.savedPosition) this.savedPosition = this.leftPosition; - this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "left", [this.leftControl.value + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "left", [this.leftControl.value + this.leftControl.units] , "Changing", "pi"); } } @@ -218,7 +234,7 @@ exports.PositionSize = Montage.create(Component, { value: function(event) { if(!event.wasSetByCode) { if(!this.savedPosition) this.savedPosition = this.topPosition; - this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "top", [this.topControl.value + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty(this.application.ninja.selectedElements, "top", [this.topControl.value + this.topControl.units] , "Changing", "pi"); } } @@ -229,7 +245,7 @@ exports.PositionSize = Montage.create(Component, { var items; if(!event.wasSetByCode) { - if(!this.savedPosition) this.savedPosition = this.heightSize; + if(!this.savedPosition) this.savedPosition = this.heightSize + " " + this.heightUnits; this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; @@ -243,7 +259,7 @@ exports.PositionSize = Montage.create(Component, { this.application.ninja.elementMediator.setProperty(items, "width", [newWidth + "px"] , "Changing", "pi"); } - this.application.ninja.elementMediator.setProperty(items, "height", [this.heightControl.value + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty(items, "height", [this.heightSize + this.heightUnits] , "Changing", "pi"); } } @@ -254,7 +270,7 @@ exports.PositionSize = Montage.create(Component, { var items; if(!event.wasSetByCode) { - if(!this.savedPosition) this.savedPosition = this.widthSize; + if(!this.savedPosition) this.savedPosition = this.widthSize + " " + this.widthUnits; this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.model.documentRoot]; @@ -267,7 +283,7 @@ exports.PositionSize = Montage.create(Component, { this.application.ninja.elementMediator.setProperty(items, "height", [newHeight + "px"] , "Changing", "pi"); } - this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + "px"] , "Changing", "pi"); + this.application.ninja.elementMediator.setProperty(items, "width", [this.widthSize + this.widthUnits] , "Changing", "pi"); } } } -- cgit v1.2.3