diff options
author | hwc487 | 2012-04-19 13:01:43 -0700 |
---|---|---|
committer | hwc487 | 2012-04-19 13:01:43 -0700 |
commit | e6a20fe64574763483dc602bd759278ccf5e5e68 (patch) | |
tree | 69defe7200206f0257fe90697136fadef59d521e /js/panels/properties.reel | |
parent | ae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff) | |
parent | 9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff) | |
download | ninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts:
js/lib/drawing/world.js
js/lib/geom/geom-obj.js
js/lib/rdge/materials/cloud-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/panels/properties.reel')
5 files changed, 107 insertions, 14 deletions
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; | |||
47 | 47 | ||
48 | } | 48 | } |
49 | 49 | ||
50 | .propertiesPanel button.nj-skinned { | ||
51 | margin-left: -12px; | ||
52 | margin-top: -3px; | ||
53 | } | ||
54 | |||
50 | .propertiesPanel hr { | 55 | .propertiesPanel hr { |
51 | border: 0; | 56 | border: 0; |
52 | border-top: 1px solid #3c3c3c; | 57 | border-top: 1px solid #3c3c3c; |
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 40e9b86a..d9dca538 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js | |||
@@ -87,7 +87,7 @@ exports.Properties = Montage.create(Component, { | |||
87 | this.displayStageProperties(); | 87 | this.displayStageProperties(); |
88 | } else { | 88 | } else { |
89 | if(this.application.ninja.selectedElements.length === 1) { | 89 | if(this.application.ninja.selectedElements.length === 1) { |
90 | this.displayElementProperties(this.application.ninja.selectedElements[0]._element); | 90 | this.displayElementProperties(this.application.ninja.selectedElements[0]); |
91 | } else { | 91 | } else { |
92 | this.displayGroupProperties(this.application.ninja.selectedElements); | 92 | this.displayGroupProperties(this.application.ninja.selectedElements); |
93 | } | 93 | } |
@@ -113,14 +113,14 @@ exports.Properties = Montage.create(Component, { | |||
113 | } | 113 | } |
114 | 114 | ||
115 | if(this.application.ninja.selectedElements.length) { | 115 | if(this.application.ninja.selectedElements.length) { |
116 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); | 116 | // ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); |
117 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi"); | ||
117 | } else { | 118 | } else { |
118 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id); | 119 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id); |
119 | } | 120 | } |
120 | } else if(event.target.id === "elementClass") { | 121 | } else if(event.target.id === "elementClass") { |
121 | if(this.application.ninja.selectedElements.length) { | 122 | if(this.application.ninja.selectedElements.length) { |
122 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, "Change", "pi"); | 123 | ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi"); |
123 | console.log(this.application.ninja.selectedElements[0]._element.className); | ||
124 | } else { | 124 | } else { |
125 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); | 125 | ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); |
126 | } | 126 | } |
@@ -138,8 +138,8 @@ exports.Properties = Montage.create(Component, { | |||
138 | 138 | ||
139 | handleElementChanging: { | 139 | handleElementChanging: { |
140 | value: function(event) { | 140 | value: function(event) { |
141 | // this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "left")); | 141 | // this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0], "left")); |
142 | // this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0]._element, "top")); | 142 | // this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(this.application.ninja.selectedElements[0], "top")); |
143 | } | 143 | } |
144 | }, | 144 | }, |
145 | 145 | ||
@@ -147,24 +147,27 @@ exports.Properties = Montage.create(Component, { | |||
147 | value: function(event) { | 147 | value: function(event) { |
148 | // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update | 148 | // console.log("Element Change PI ", event.detail.source); // If the event comes from the pi don't need to update |
149 | if(event.detail.source && event.detail.source !== "pi") { | 149 | if(event.detail.source && event.detail.source !== "pi") { |
150 | var el = this.application.ninja.currentDocument.documentRoot; | ||
151 | if(this.application.ninja.selectedElements.length) { | ||
152 | el = this.application.ninja.selectedElements[0]; | ||
153 | } | ||
154 | |||
150 | // TODO - This should only update the properties that were changed. | 155 | // TODO - This should only update the properties that were changed. |
151 | var el = this.application.ninja.selectedElements[0]._element || this.application.ninja.selectedElements[0]; | ||
152 | this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left")); | 156 | this.positionSize.leftPosition = parseFloat(ElementsMediator.getProperty(el, "left")); |
153 | this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top")); | 157 | this.positionSize.topPosition = parseFloat(ElementsMediator.getProperty(el, "top")); |
154 | this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); | 158 | this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); |
155 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); | 159 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); |
156 | 160 | ||
157 | if(this.threeD.inGlobalMode) | 161 | if(this.threeD.inGlobalMode) { |
158 | { | ||
159 | this.threeD.x3D = ElementsMediator.get3DProperty(el, "x3D"); | 162 | this.threeD.x3D = ElementsMediator.get3DProperty(el, "x3D"); |
160 | this.threeD.y3D = ElementsMediator.get3DProperty(el, "y3D"); | 163 | this.threeD.y3D = ElementsMediator.get3DProperty(el, "y3D"); |
161 | this.threeD.z3D = ElementsMediator.get3DProperty(el, "z3D"); | 164 | this.threeD.z3D = ElementsMediator.get3DProperty(el, "z3D"); |
162 | this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle"); | 165 | this.threeD.xAngle = ElementsMediator.get3DProperty(el, "xAngle"); |
163 | this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle"); | 166 | this.threeD.yAngle = ElementsMediator.get3DProperty(el, "yAngle"); |
164 | this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle"); | 167 | this.threeD.zAngle = ElementsMediator.get3DProperty(el, "zAngle"); |
168 | } | ||
165 | } | 169 | } |
166 | } | 170 | } |
167 | } | ||
168 | }, | 171 | }, |
169 | 172 | ||
170 | handleSelectionChange: { | 173 | handleSelectionChange: { |
@@ -173,7 +176,7 @@ exports.Properties = Montage.create(Component, { | |||
173 | this.displayStageProperties(); | 176 | this.displayStageProperties(); |
174 | } else { | 177 | } else { |
175 | if(this.application.ninja.selectedElements.length === 1) { | 178 | if(this.application.ninja.selectedElements.length === 1) { |
176 | this.displayElementProperties(this.application.ninja.selectedElements[0]._element); | 179 | this.displayElementProperties(this.application.ninja.selectedElements[0]); |
177 | } else { | 180 | } else { |
178 | this.displayGroupProperties(this.application.ninja.selectedElements); | 181 | this.displayGroupProperties(this.application.ninja.selectedElements); |
179 | } | 182 | } |
@@ -196,6 +199,19 @@ exports.Properties = Montage.create(Component, { | |||
196 | this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height")); | 199 | this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(stage, "height")); |
197 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); | 200 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); |
198 | 201 | ||
202 | if(this.threeD.inGlobalMode) | ||
203 | { | ||
204 | this.threeD.xAngle = ElementsMediator.get3DProperty(stage, "xAngle"); | ||
205 | this.threeD.yAngle = ElementsMediator.get3DProperty(stage, "yAngle"); | ||
206 | this.threeD.zAngle = ElementsMediator.get3DProperty(stage, "zAngle"); | ||
207 | } | ||
208 | |||
209 | if(ElementsMediator.getProperty(stage, "-webkit-transform-style") === "preserve-3d") { | ||
210 | this.threeD.flatten = false; | ||
211 | } else { | ||
212 | this.threeD.flatten = true; | ||
213 | } | ||
214 | |||
199 | if(this.customPi !== stage.elementModel.pi) { | 215 | if(this.customPi !== stage.elementModel.pi) { |
200 | // We need to unregister color chips from the previous selection from the Color Model | 216 | // We need to unregister color chips from the previous selection from the Color Model |
201 | var len = this.customSections.length; | 217 | var len = this.customSections.length; |
@@ -260,6 +276,11 @@ exports.Properties = Montage.create(Component, { | |||
260 | this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); | 276 | this.positionSize.heightSize = parseFloat(ElementsMediator.getProperty(el, "height")); |
261 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); | 277 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(el, "width")); |
262 | 278 | ||
279 | if(ElementsMediator.getProperty(el, "-webkit-transform-style") === "preserve-3d") { | ||
280 | this.threeD.flatten = false; | ||
281 | } else { | ||
282 | this.threeD.flatten = true; | ||
283 | } | ||
263 | 284 | ||
264 | if(this.threeD.inGlobalMode) | 285 | if(this.threeD.inGlobalMode) |
265 | { | 286 | { |
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- | |||
15 | 15 | ||
16 | // Components Needed to make this work | 16 | // Components Needed to make this work |
17 | var Hottext = require("js/components/hottextunit.reel").HotTextUnit; | 17 | var Hottext = require("js/components/hottextunit.reel").HotTextUnit; |
18 | var HT = require("js/components/hottext.reel").HotText; | ||
18 | var Dropdown = require("js/components/combobox.reel").Combobox; | 19 | var Dropdown = require("js/components/combobox.reel").Combobox; |
19 | var TextField = require("js/components/textfield.reel").TextField; | 20 | var TextField = require("js/components/textfield.reel").TextField; |
20 | var FileInput = require("js/components/ui/file-input.reel").FileInput; | 21 | var FileInput = require("js/components/ui/file-input.reel").FileInput; |
@@ -168,6 +169,7 @@ exports.CustomSection = Montage.create(Component, { | |||
168 | value: function(fields) { | 169 | value: function(fields) { |
169 | switch(fields.type) { | 170 | switch(fields.type) { |
170 | case "hottext" : return this.createHottext(fields); | 171 | case "hottext" : return this.createHottext(fields); |
172 | case "ht" : return this.createHT(fields); | ||
171 | case "dropdown" : return this.createDropdown(fields); | 173 | case "dropdown" : return this.createDropdown(fields); |
172 | case "textbox" : return this.createTextField(fields); | 174 | case "textbox" : return this.createTextField(fields); |
173 | case "file" : return this.createFileInput(fields); | 175 | case "file" : return this.createFileInput(fields); |
@@ -178,6 +180,33 @@ exports.CustomSection = Montage.create(Component, { | |||
178 | } | 180 | } |
179 | }, | 181 | }, |
180 | 182 | ||
183 | createHT: { | ||
184 | value: function(aField) { | ||
185 | |||
186 | // Generate Hottext | ||
187 | var obj = HT.create(); | ||
188 | |||
189 | // Set Values for HottextRow | ||
190 | if (aField.id) obj.id = aField.id; | ||
191 | if (aField.value) obj.value = aField.value; | ||
192 | if (aField.min) obj._minValue = aField.min; | ||