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/panels/properties/content.reel/content.css | 0 js/panels/properties/content.reel/content.html | 0 js/panels/properties/content.reel/content.js | 0 js/panels/properties/properties-panel.js | 0 js/panels/properties/section.reel/section.html | 0 js/panels/properties/section.reel/section.js | 0 .../properties/sections/custom-rows/color-select.reel/color-select.html | 0 .../properties/sections/custom-rows/color-select.reel/color-select.js | 0 js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.html | 0 js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.js | 0 js/panels/properties/sections/custom-rows/single-row.reel/single-row.html | 0 js/panels/properties/sections/custom-rows/single-row.reel/single-row.js | 0 js/panels/properties/sections/custom.reel/custom.html | 0 js/panels/properties/sections/custom.reel/custom.js | 0 .../properties/sections/position-and-size.reel/position-and-size.css | 0 .../properties/sections/position-and-size.reel/position-and-size.html | 0 js/panels/properties/sections/position-and-size.reel/position-and-size.js | 0 js/panels/properties/sections/three-d-view.reel/three-d-view.html | 0 js/panels/properties/sections/three-d-view.reel/three-d-view.js | 0 19 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 js/panels/properties/content.reel/content.css mode change 100644 => 100755 js/panels/properties/content.reel/content.html mode change 100644 => 100755 js/panels/properties/content.reel/content.js mode change 100644 => 100755 js/panels/properties/properties-panel.js mode change 100644 => 100755 js/panels/properties/section.reel/section.html mode change 100644 => 100755 js/panels/properties/section.reel/section.js mode change 100644 => 100755 js/panels/properties/sections/custom-rows/color-select.reel/color-select.html mode change 100644 => 100755 js/panels/properties/sections/custom-rows/color-select.reel/color-select.js mode change 100644 => 100755 js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.html mode change 100644 => 100755 js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.js mode change 100644 => 100755 js/panels/properties/sections/custom-rows/single-row.reel/single-row.html mode change 100644 => 100755 js/panels/properties/sections/custom-rows/single-row.reel/single-row.js mode change 100644 => 100755 js/panels/properties/sections/custom.reel/custom.html mode change 100644 => 100755 js/panels/properties/sections/custom.reel/custom.js mode change 100644 => 100755 js/panels/properties/sections/position-and-size.reel/position-and-size.css mode change 100644 => 100755 js/panels/properties/sections/position-and-size.reel/position-and-size.html mode change 100644 => 100755 js/panels/properties/sections/position-and-size.reel/position-and-size.js mode change 100644 => 100755 js/panels/properties/sections/three-d-view.reel/three-d-view.html mode change 100644 => 100755 js/panels/properties/sections/three-d-view.reel/three-d-view.js (limited to 'js/panels/properties') diff --git a/js/panels/properties/content.reel/content.css b/js/panels/properties/content.reel/content.css old mode 100644 new mode 100755 diff --git a/js/panels/properties/content.reel/content.html b/js/panels/properties/content.reel/content.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/properties-panel.js b/js/panels/properties/properties-panel.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/section.reel/section.html b/js/panels/properties/section.reel/section.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/section.reel/section.js b/js/panels/properties/section.reel/section.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom-rows/color-select.reel/color-select.html b/js/panels/properties/sections/custom-rows/color-select.reel/color-select.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom-rows/color-select.reel/color-select.js b/js/panels/properties/sections/custom-rows/color-select.reel/color-select.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.html b/js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.js b/js/panels/properties/sections/custom-rows/dual-row.reel/dual-row.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom-rows/single-row.reel/single-row.html b/js/panels/properties/sections/custom-rows/single-row.reel/single-row.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom-rows/single-row.reel/single-row.js b/js/panels/properties/sections/custom-rows/single-row.reel/single-row.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom.reel/custom.html b/js/panels/properties/sections/custom.reel/custom.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/custom.reel/custom.js b/js/panels/properties/sections/custom.reel/custom.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/position-and-size.reel/position-and-size.css b/js/panels/properties/sections/position-and-size.reel/position-and-size.css old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/position-and-size.reel/position-and-size.html b/js/panels/properties/sections/position-and-size.reel/position-and-size.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/position-and-size.reel/position-and-size.js b/js/panels/properties/sections/position-and-size.reel/position-and-size.js old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.html b/js/panels/properties/sections/three-d-view.reel/three-d-view.html old mode 100644 new mode 100755 diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.js b/js/panels/properties/sections/three-d-view.reel/three-d-view.js old mode 100644 new mode 100755 -- cgit v1.2.3 From 26bfb7a4cbf66c35e23eec46def045bd295be2e1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 9 Feb 2012 21:21:29 -0800 Subject: disabling the auto open of a document on load. Temporary using the new project button to open a document. Signed-off-by: Valerio Virgillito --- js/panels/properties/content.reel/content.js | 9 ++++++ .../sections/three-d-view.reel/three-d-view.js | 35 ++++++++++++---------- 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'js/panels/properties') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 0088447a..51b776f1 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -54,8 +54,17 @@ exports.Content = Montage.create(Component, { this.eventManager.addEventListener( "elementChanging", this, false); } + this.eventManager.addEventListener("openDocument", this, false); + } + }, + + // Document is opened - Display the current selection + handleOpenDocument: { + value: function() { + this.eventManager.addEventListener( "elementChange", this, false); + // For now always assume that the stage is selected by default if(this.application.ninja.selectedElements.length === 0) { this.displayStageProperties(); } diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.js b/js/panels/properties/sections/three-d-view.reel/three-d-view.js index 0c4a9171..35591afa 100755 --- a/js/panels/properties/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties/sections/three-d-view.reel/three-d-view.js @@ -207,29 +207,32 @@ exports.ThreeD = Montage.create(Component, { templateDidLoad : { value: function() { Object.defineBinding(this, "axisMode", { - boundObject: this.axisModeGroupControl, - boundObjectPropertyPath: "selectedIndex", - oneway: false - }); + boundObject: this.axisModeGroupControl, + boundObjectPropertyPath: "selectedIndex", + oneway: false + }); + + this.eventManager.addEventListener("openDocument", this, false); + } + }, + + handleOpenDocument: { + value: function() { Object.defineBinding(this, "item", { - boundObject: this, - boundObjectPropertyPath: "application.ninja.selectedElements", - boundValueMutator: this._getSelectedItem, - oneway: true - }); + boundObject: this, + boundObjectPropertyPath: "application.ninja.selectedElements", + boundValueMutator: this._getSelectedItem, + oneway: true + }); } }, _getSelectedItem: { - value: function(els) - { - if(els.length) - { + value: function(els) { + if(els.length) { return els[0]._element || els[0]; - } - else - { + } else { return this.boundObject.application.ninja.currentDocument.documentRoot; } } -- cgit v1.2.3 From a30d76ff641ce89686cf5fbd9f04ac9ab4e9c830 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 10 Feb 2012 17:21:28 -0800 Subject: initial color chip for the stage Signed-off-by: Valerio Virgillito --- js/panels/properties/content.reel/content.js | 37 +++++++++++++++++ .../properties/sections/custom.reel/custom.js | 46 +++++++++++++++++++--- 2 files changed, 78 insertions(+), 5 deletions(-) (limited to 'js/panels/properties') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 0088447a..b15f2d71 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -150,6 +150,43 @@ exports.Content = Montage.create(Component, { this.customPi = stage.elementModel.pi; this.displayCustomProperties(stage, stage.elementModel.pi); } + + // For now hardcode the background since it is the only custom property + // No need to loop through all the properties. + var backgroundChip = this.customSections[0].content.controls["background"]; + backgroundChip.initialColor = ElementsMediator.getProperty(stage, "background"); + + // Get stage color + //var backgroundColor = + //console.log(backgroundColor); + + /* + var customPI = PiData[this.customPi]; + // Get all the custom section for the custom PI + for(var i = 0, customSec; customSec = customPI[i]; i++) { + + // Now set the Fields for the custom PI + for(var j = 0, fields; fields = customSec.Section[j]; j++) { + for(var k = 0, control; control = fields[k]; k++) { + + var colorChipEl = this.customSections[i].content.controls[control.id]; + this.foo = colorChipEl; + colorChipEl.addEventListener("firstDraw", this, false); + + } + } + } + */ + } + }, + + foo: { + value: null + }, + + handleFirstDraw: { + value: function() { + this.foo.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); } }, diff --git a/js/panels/properties/sections/custom.reel/custom.js b/js/panels/properties/sections/custom.reel/custom.js index 992db8e6..5315defc 100644 --- a/js/panels/properties/sections/custom.reel/custom.js +++ b/js/panels/properties/sections/custom.reel/custom.js @@ -6,6 +6,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage; var Component = require("montage/ui/component").Component; +var ElementsMediator = require("js/mediators/element-mediator").ElementMediator; //Custom Rows var SingleRow = require("js/panels/properties/sections/custom-rows/single-row.reel").SingleRow; @@ -18,7 +19,7 @@ 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; var Checkbox = require("js/components/checkbox.reel").Checkbox; - +var ColorChip = require("js/components/ui/color-chip.reel").ColorChip; exports.CustomSection = Montage.create(Component, { @@ -88,10 +89,8 @@ exports.CustomSection = Montage.create(Component, { value:{} }, - handleChanging: - { - value:function(event) - { + handleChanging: { + value:function(event) { var obj = event.currentTarget; this._dispatchPropEvent({"type": "changing", "id": obj.id, "prop": obj.prop, "value": obj.value, "control": obj}); } @@ -106,6 +105,26 @@ exports.CustomSection = Montage.create(Component, { } }, + handleColorChange: { + value: function(event) { + // Change the stage color for now + console.log(this); + console.log(event); + console.log(event._event.color.css); + ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], "background", [event._event.color.css], "Change", "pi", 'foo'); + /* + var propEvent = document.createEvent("CustomEvent"); + propEvent.initEvent("propertyChange", true, true); + propEvent.type = "propertyChange"; + + propEvent.prop = "background";//event.prop; + propEvent.value = event._event.color.css; + + this.dispatchEvent(propEvent); + */ + } + }, + _dispatchPropEvent: { value: function(event) { // console.log(event); @@ -140,6 +159,7 @@ exports.CustomSection = Montage.create(Component, { case "textbox" : return this.createTextField(fields); case "file" : return this.createFileInput(fields); case "checkbox" : return this.createCheckbox(fields); + case "chip" : return this.createColorChip(fields); } } }, @@ -303,6 +323,22 @@ exports.CustomSection = Montage.create(Component, { boundObjectPropertyPath: "checked" }); + return obj; + } + }, + + createColorChip: { + value: function(aField) { + var obj = ColorChip.create(); + obj.chip = true; + obj.iconType = "fillIcon"; + obj.mode = "chip"; + obj.offset = 0; + + obj.changeDelegate = this.handleColorChange; + + this.controls[aField.id] = obj; + return obj; } } -- cgit v1.2.3 From 0d7d6d4d98437a93f31ededa14ca6eb5382c9e58 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 13 Feb 2012 14:05:10 -0800 Subject: Cleaning up the stage background color chip. Signed-off-by: Valerio Virgillito --- js/panels/properties/content.reel/content.js | 8 -------- js/panels/properties/sections/custom.reel/custom.js | 13 +++++++++---- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'js/panels/properties') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index b15f2d71..1ec6d769 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -156,10 +156,6 @@ exports.Content = Montage.create(Component, { var backgroundChip = this.customSections[0].content.controls["background"]; backgroundChip.initialColor = ElementsMediator.getProperty(stage, "background"); - // Get stage color - //var backgroundColor = - //console.log(backgroundColor); - /* var customPI = PiData[this.customPi]; // Get all the custom section for the custom PI @@ -180,10 +176,6 @@ exports.Content = Montage.create(Component, { } }, - foo: { - value: null - }, - handleFirstDraw: { value: function() { this.foo.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); diff --git a/js/panels/properties/sections/custom.reel/custom.js b/js/panels/properties/sections/custom.reel/custom.js index 5315defc..a2b9b9fa 100644 --- a/js/panels/properties/sections/custom.reel/custom.js +++ b/js/panels/properties/sections/custom.reel/custom.js @@ -105,13 +105,14 @@ exports.CustomSection = Montage.create(Component, { } }, + /** + * Color change handler. Hard coding the stage for now since only the stage PI uses this color chip + */ handleColorChange: { value: function(event) { // Change the stage color for now - console.log(this); - console.log(event); - console.log(event._event.color.css); - ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], "background", [event._event.color.css], "Change", "pi", 'foo'); + //console.log(this, event); + ElementsMediator.setProperty([this.application.ninja.currentDocument.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); /* var propEvent = document.createEvent("CustomEvent"); propEvent.initEvent("propertyChange", true, true); @@ -330,11 +331,15 @@ exports.CustomSection = Montage.create(Component, { createColorChip: { value: function(aField) { var obj = ColorChip.create(); + obj.chip = true; obj.iconType = "fillIcon"; obj.mode = "chip"; obj.offset = 0; + if (aField.id) obj.id = aField.id; + if (aField.prop) obj.prop = aField.prop; + obj.changeDelegate = this.handleColorChange; this.controls[aField.id] = obj; -- cgit v1.2.3