diff options
author | Pushkar Joshi | 2012-02-24 12:08:49 -0800 |
---|---|---|
committer | Pushkar Joshi | 2012-02-24 12:08:49 -0800 |
commit | 03ca7a5ed13c25faaa9100bb666e062fd15335e6 (patch) | |
tree | c51112223ceb9121cd595a60335eb2795215590f /js/panels/properties | |
parent | fcb12cc09eb3cd3b42bd215877ba18f449275b75 (diff) | |
parent | 053fc63a2950c7a5ee4ebf98033b64d474a3c46e (diff) | |
download | ninja-03ca7a5ed13c25faaa9100bb666e062fd15335e6.tar.gz |
Merge branch 'pentool' into brushtool
Conflicts:
imports/codemirror/mode/scheme/scheme.js
js/tools/BrushTool.js
Diffstat (limited to 'js/panels/properties')
19 files changed, 117 insertions, 22 deletions
diff --git a/js/panels/properties/content.reel/content.css b/js/panels/properties/content.reel/content.css index 2537aea2..2537aea2 100644..100755 --- a/js/panels/properties/content.reel/content.css +++ b/js/panels/properties/content.reel/content.css | |||
diff --git a/js/panels/properties/content.reel/content.html b/js/panels/properties/content.reel/content.html index ab485323..ab485323 100644..100755 --- a/js/panels/properties/content.reel/content.html +++ b/js/panels/properties/content.reel/content.html | |||
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 0088447a..8fa33a75 100644..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, { | |||
54 | this.eventManager.addEventListener( "elementChanging", this, false); | 54 | this.eventManager.addEventListener( "elementChanging", this, false); |
55 | } | 55 | } |
56 | 56 | ||
57 | this.eventManager.addEventListener("openDocument", this, false); | ||
58 | } | ||
59 | }, | ||
60 | |||
61 | // Document is opened - Display the current selection | ||
62 | handleOpenDocument: { | ||
63 | value: function() { | ||
64 | |||
57 | this.eventManager.addEventListener( "elementChange", this, false); | 65 | this.eventManager.addEventListener( "elementChange", this, false); |
58 | 66 | ||
67 | // For now always assume that the stage is selected by default | ||
59 | if(this.application.ninja.selectedElements.length === 0) { | 68 | if(this.application.ninja.selectedElements.length === 0) { |
60 | this.displayStageProperties(); | 69 | this.displayStageProperties(); |
61 | } | 70 | } |
@@ -150,6 +159,35 @@ exports.Content = Montage.create(Component, { | |||
150 | this.customPi = stage.elementModel.pi; | 159 | this.customPi = stage.elementModel.pi; |
151 | this.displayCustomProperties(stage, stage.elementModel.pi); | 160 | this.displayCustomProperties(stage, stage.elementModel.pi); |
152 | } | 161 | } |
162 | |||
163 | // For now hardcode the background since it is the only custom property | ||
164 | // No need to loop through all the properties. | ||
165 | var backgroundChip = this.customSections[0].content.controls["background"]; | ||
166 | backgroundChip.color = ElementsMediator.getProperty(stage, "background"); | ||
167 | |||
168 | /* | ||
169 | var customPI = PiData[this.customPi]; | ||
170 | // Get all the custom section for the custom PI | ||
171 | for(var i = 0, customSec; customSec = customPI[i]; i++) { | ||
172 | |||
173 | // Now set the Fields for the custom PI | ||
174 | for(var j = 0, fields; fields = customSec.Section[j]; j++) { | ||
175 | for(var k = 0, control; control = fields[k]; k++) { | ||
176 | |||
177 | var colorChipEl = this.customSections[i].content.controls[control.id]; | ||
178 | this.foo = colorChipEl; | ||
179 | colorChipEl.addEventListener("firstDraw", this, false); | ||
180 | |||
181 | } | ||
182 | } | ||
183 | } | ||
184 | */ | ||
185 | } | ||
186 | }, | ||
187 | |||
188 | handleFirstDraw: { | ||
189 | value: function() { | ||
190 | this.foo.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); | ||
153 | } | 191 | } |
154 | }, | 192 | }, |
155 | 193 | ||
@@ -217,6 +255,12 @@ exports.Content = Montage.create(Component, { | |||
217 | 255 | ||
218 | if(currentValue) | 256 | if(currentValue) |
219 | { | 257 | { |
258 | if(currentValue.color) | ||
259 | { | ||
260 | currentValue.color.wasSetByCode = true; | ||
261 | currentValue.color.type = "change"; | ||
262 | } | ||
263 | |||
220 | if(currentValue.mode === "gradient") | 264 | if(currentValue.mode === "gradient") |
221 | { | 265 | { |
222 | this.application.ninja.colorController.colorModel["gradient"] = | 266 | this.application.ninja.colorController.colorModel["gradient"] = |
@@ -229,7 +273,14 @@ exports.Content = Montage.create(Component, { | |||
229 | this.application.ninja.colorController.colorModel.alpha = | 273 | this.application.ninja.colorController.colorModel.alpha = |
230 | {value: currentValue.color.a, wasSetByCode: true, type: 'change'}; | 274 | {value: currentValue.color.a, wasSetByCode: true, type: 'change'}; |
231 | } | 275 | } |
232 | this.application.ninja.colorController.colorModel[currentValue.color.mode] = currentValue.color; | 276 | if(currentValue.color.mode) |
277 | { | ||
278 | this.application.ninja.colorController.colorModel[currentValue.color.mode] = currentValue.color; | ||
279 | } | ||
280 | else | ||
281 | { | ||
282 | this.application.ninja.colorController.colorModel["rgb"] = currentValue.color; | ||
283 | } | ||
233 | } | 284 | } |
234 | } | 285 | } |
235 | else | 286 | else |
diff --git a/js/panels/properties/properties-panel.js b/js/panels/properties/properties-panel.js index 31bc4919..31bc4919 100644..100755 --- a/js/panels/properties/properties-panel.js +++ b/js/panels/properties/properties-panel.js | |||
diff --git a/js/panels/properties/section.reel/section.html b/js/panels/properties/section.reel/section.html index 8a331119..8a331119 100644..100755 --- a/js/panels/properties/section.reel/section.html +++ b/js/panels/properties/section.reel/section.html | |||
diff --git a/js/panels/properties/section.reel/section.js b/js/panels/properties/section.reel/section.js index b246c171..b246c171 100644..100755 --- a/js/panels/properties/section.reel/section.js +++ b/js/panels/properties/section.reel/section.js | |||
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 index 9c2588b9..9c2588b9 100644..100755 --- 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 | |||
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 index 60f8efef..60f8efef 100644..100755 --- 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 | |||
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 index 0398ff4c..0398ff4c 100644..100755 --- 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 | |||
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 index 72d216ca..72d216ca 100644..100755 --- 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 | |||
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 index 27c02380..27c02380 100644..100755 --- 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 | |||
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 index b606d6b8..b606d6b8 100644..100755 --- 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 | |||
diff --git a/js/panels/properties/sections/custom.reel/custom.html b/js/panels/properties/sections/custom.reel/custom.html index 6d4cf0cd..6d4cf0cd 100644..100755 --- a/js/panels/properties/sections/custom.reel/custom.html +++ b/js/panels/properties/sections/custom.reel/custom.html | |||
diff --git a/js/panels/properties/sections/custom.reel/custom.js b/js/panels/properties/sections/custom.reel/custom.js index 992db8e6..a2b9b9fa 100644..100755 --- 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 | |||
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage; | 7 | var Montage = require("montage/core/core").Montage; |
8 | var Component = require("montage/ui/component").Component; | 8 | var Component = require("montage/ui/component").Component; |
9 | var ElementsMediator = require("js/mediators/element-mediator").ElementMediator; | ||
9 | 10 | ||
10 | //Custom Rows | 11 | //Custom Rows |
11 | var SingleRow = require("js/panels/properties/sections/custom-rows/single-row.reel").SingleRow; | 12 | 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; | |||
18 | var TextField = require("js/components/textfield.reel").TextField; | 19 | var TextField = require("js/components/textfield.reel").TextField; |
19 | var FileInput = require("js/components/ui/file-input.reel").FileInput; | 20 | var FileInput = require("js/components/ui/file-input.reel").FileInput; |
20 | var Checkbox = require("js/components/checkbox.reel").Checkbox; | 21 | var Checkbox = require("js/components/checkbox.reel").Checkbox; |
21 | 22 | var ColorChip = require("js/components/ui/color-chip.reel").ColorChip; | |
22 | 23 | ||
23 | exports.CustomSection = Montage.create(Component, { | 24 | exports.CustomSection = Montage.create(Component, { |
24 | 25 | ||
@@ -88,10 +89,8 @@ exports.CustomSection = Montage.create(Component, { | |||
88 | value:{} | 89 | value:{} |
89 | }, | 90 | }, |
90 | 91 | ||
91 | handleChanging: | 92 | handleChanging: { |
92 | { | 93 | value:function(event) { |
93 | value:function(event) | ||
94 | { | ||
95 | var obj = event.currentTarget; | 94 | var obj = event.currentTarget; |
96 | this._dispatchPropEvent({"type": "changing", "id": obj.id, "prop": obj.prop, "value": obj.value, "control": obj}); | 95 | this._dispatchPropEvent({"type": "changing", "id": obj.id, "prop": obj.prop, "value": obj.value, "control": obj}); |
97 | } | 96 | } |
@@ -106,6 +105,27 @@ exports.CustomSection = Montage.create(Component, { | |||
106 | } | 105 | } |
107 | }, | 106 | }, |
108 | 107 | ||
108 | /** | ||