From 929007fa4a5e7ddc2d52a9a389e7b07c8d7a5dbd Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 13 Mar 2012 16:08:39 -0700 Subject: Temp Fix for: IKNINJA-1078 --- js/panels/properties.reel/properties.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'js/panels/properties.reel') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 947d7937..580d945d 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -283,7 +283,7 @@ exports.Properties = Montage.create(Component, { this.customPi = el.elementModel.pi; this.displayCustomProperties(el, el.elementModel.pi); } - + var previousInput = this.application.ninja.colorController.colorModel.input; customPI = PiData[this.customPi]; // Get all the custom section for the custom PI for(var i = 0, customSec; customSec = customPI[i]; i++) { @@ -352,6 +352,33 @@ exports.Properties = Montage.create(Component, { } } } + this.application.ninja.colorController.colorModel.input = previousInput; + var color = this.application.ninja.colorController.colorModel.colorHistory[previousInput][this.application.ninja.colorController.colorModel.colorHistory[previousInput].length-1]; + color.c.wasSetByCode = true; + color.c.type = 'change'; + switch (color.m) { + case 'rgb': + this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'}; + this.application.ninja.colorController.colorModel.rgb = color.c; + break; + case 'hsl': + this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'}; + this.application.ninja.colorController.colorModel.hsl = color.c; + break; + case 'hex': + //TODO: Check if anything needed here + break; + case 'gradient': + this.application.ninja.colorController.colorModel.gradient = color.c; + break; + case 'hsv': + this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'}; + this.application.ninja.colorController.colorModel.hsv = color.c; + break; + default: + this.application.ninja.colorController.colorModel.applyNoColor(); + break; + } } } }, -- cgit v1.2.3 From e07ec7dd1a4b8df747f6af0d54fe95e3a237f0c8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 14 Mar 2012 11:47:06 -0700 Subject: Removing the name attribute from the PI. Fixing the ID and Class attribute from the PI Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.html | 70 ++++++------------------------- js/panels/properties.reel/properties.js | 64 +++++++++++++++------------- 2 files changed, 47 insertions(+), 87 deletions(-) (limited to 'js/panels/properties.reel') diff --git a/js/panels/properties.reel/properties.html b/js/panels/properties.reel/properties.html index 72a6def6..bcf54b95 100755 --- a/js/panels/properties.reel/properties.html +++ b/js/panels/properties.reel/properties.html @@ -10,35 +10,19 @@ @@ -335,7 +359,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
- +
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 35591afa..0d3d111d 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 @@ -79,6 +79,10 @@ exports.ThreeD = Montage.create(Component, { value: 0 }, + flatten: { + value: false + }, + _disableTranslation: { value: true }, @@ -107,6 +111,16 @@ exports.ThreeD = Montage.create(Component, { value: null }, + handleAction: { + value: function(event) { + if(event.currentTarget.identifier === "flatten") { + this.application.ninja.elementMediator.setProperty([this.item], + "-webkit-transform-style", + event.currentTarget.checked ? ["flat"] : ["preserve-3d"]); + } + } + }, + handleChange: { value: function(event) { if(event.wasSetByCode) { -- cgit v1.2.3 From a11ef2eed7049835c8bdfa50a2b893632c46eaa0 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 4 Apr 2012 11:11:58 -0700 Subject: Squashed commit of Preparing for the montage undo-manager: Architecture changes Reworked the add and remove elements into 1 function which can take 1 or more elements. Removed the _element from the selection array Many other changes related to those 2 changes Undo/Redo shortcuts are now using montage undo/redo manager. Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.js | 16 +++++++--------- .../sections/three-d-view.reel/three-d-view.js | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'js/panels/properties.reel') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 40e9b86a..d5acd503 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -87,7 +87,7 @@ exports.Properties = Montage.create(Component, { this.displayStageProperties(); } else { if(this.application.ninja.selectedElements.length === 1) { - this.displayElementProperties(this.application.ninja.selectedElements[0]._element); + this.displayElementProperties(this.application.ninja.selectedElements[0]); } else { this.displayGroupProperties(this.application.ninja.selectedElements); } @@ -120,7 +120,6 @@ exports.Properties = Montage.create(Component, { } else if(event.target.id === "elementClass") { if(this.application.ninja.selectedElements.length) { ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, "Change", "pi"); - console.log(this.application.ninja.selectedElements[0]._element.className); } else { ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); } @@ -138,8 +137,8 @@ exports.Properties = Montage.create(Component, { handleElementChanging: { value: function(event) { -// this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "left")); -// this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "top")); +// this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0], "left")); +// this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0], "top")); } }, @@ -148,23 +147,22 @@ exports.Properties = Montage.create(Component, { // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update if(event.detail.source && event.detail.source !== "pi") { // TODO - This should only update the properties that were changed. - var el = this.application.ninja.selectedElements[0]._element || this.application.ninja.selectedElements[0]; + var el = this.application.ninja.selectedElements[0]; this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left")); this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top")); this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); - if(this.threeD.inGlobalMode) - { + if(this.threeD.inGlobalMode) { this.threeD.x3D = ElementsMediator.get3DProperty(el, "x3D"); this.threeD.y3D = ElementsMediator.get3DProperty(el, "y3D"); this.threeD.z3D = ElementsMediator.get3DProperty(el, "z3D"); this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle"); this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle"); this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle"); + } } } - } }, handleSelectionChange: { @@ -173,7 +171,7 @@ exports.Properties = Montage.create(Component, { this.displayStageProperties(); } else { if(this.application.ninja.selectedElements.length === 1) { - this.displayElementProperties(this.application.ninja.selectedElements[0]._element); + this.displayElementProperties(this.application.ninja.selectedElements[0]); } else { this.displayGroupProperties(this.application.ninja.selectedElements); } 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 35591afa..f72d1ff6 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 @@ -231,7 +231,7 @@ exports.ThreeD = Montage.create(Component, { _getSelectedItem: { value: function(els) { if(els.length) { - return els[0]._element || els[0]; + return els[0]; } else { return this.boundObject.application.ninja.currentDocument.documentRoot; } -- cgit v1.2.3 From 488afcf1604df3d611eca5253d57cc5a79ed80c3 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 4 Apr 2012 16:17:52 -0700 Subject: Styling PI's Materials edit button. Signed-off-by: Nivesh Rajbhandari --- js/panels/properties.reel/properties.css | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/panels/properties.reel') diff --git a/js/panels/properties.reel/properties.css b/js/panels/properties.reel/properties.css index f82d3660..0928da3a 100755 --- a/js/panels/properties.reel/properties.css +++ b/js/panels/properties.reel/properties.css @@ -47,6 +47,11 @@ padding-right:6px; } +.propertiesPanel button.nj-skinned { + margin-left: -12px; + margin-top: -3px; +} + .propertiesPanel hr { border: 0; border-top: 1px solid #3c3c3c; -- cgit v1.2.3 From b60e576af3915ce0cd7b60ed5e8ed6ff6f1ea9dc Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 4 Apr 2012 16:55:04 -0700 Subject: fixing the number fields to not have units. Signed-off-by: Valerio Virgillito --- .../properties.reel/sections/custom.reel/custom.js | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'js/panels/properties.reel') diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index ac316907..876fe110 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js @@ -15,6 +15,7 @@ var ColorSelect = require("js/panels/properties.reel/sections/custom-rows/color- // Components Needed to make this work var Hottext = require("js/components/hottextunit.reel").HotTextUnit; +var HT = require("js/components/hottext.reel").HotText; var Dropdown = require("js/components/combobox.reel").Combobox; var TextField = require("js/components/textfield.reel").TextField; var FileInput = require("js/components/ui/file-input.reel").FileInput; @@ -168,6 +169,7 @@ exports.CustomSection = Montage.create(Component, { value: function(fields) { switch(fields.type) { case "hottext" : return this.createHottext(fields); + case "ht" : return this.createHT(fields); case "dropdown" : return this.createDropdown(fields); case "textbox" : return this.createTextField(fields); case "file" : return this.createFileInput(fields); @@ -178,6 +180,33 @@ exports.CustomSection = Montage.create(Component, { } }, + createHT: { + value: function(aField) { + + // Generate Hottext + var obj = HT.create(); + + // Set Values for HottextRow + if (aField.id) obj.id = aField.id; + if (aField.value) obj.value = aField.value; + if (aField.min) obj._minValue = aField.min; + if (aField.max) obj._maxValue = aField.max; + if (aField.prop) obj.prop = aField.prop; + + //Initiate onChange Events + obj.addEventListener("change", this, false); + obj.addEventListener("changing", this, false); + + //Bind object value to controls list so it can be manipulated + Object.defineBinding(this.controls, aField.id, { + boundObject: obj, + boundObjectPropertyPath: "value" + }); + + return obj; + } + }, + //Breaking Up Switch Case Statement to functions to return a row createHottext: { value: function(aField) { -- cgit v1.2.3