diff options
author | Pushkar Joshi | 2012-04-06 12:13:59 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-04-06 12:13:59 -0700 |
commit | 6cce5e9367676f5b452c28dd7d960aa46f4e464c (patch) | |
tree | 779125b7c1fc668c02e0dfbb661494a16242c329 /js/panels | |
parent | f61545fd7054088efc88aafffd78e11df80d750d (diff) | |
parent | 7656b6eac7aec59697c6cddbe2a507fe9e4aa187 (diff) | |
download | ninja-6cce5e9367676f5b452c28dd7d960aa46f4e464c.tar.gz |
Merge branch 'master' into pentool
Diffstat (limited to 'js/panels')
-rwxr-xr-x | js/panels/Components/ComponentsPanel.js | 47 | ||||
-rwxr-xr-x | js/panels/components-panel.reel/components-panel.css (renamed from js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.css) | 0 | ||||
-rwxr-xr-x | js/panels/components-panel.reel/components-panel.html (renamed from js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html) | 6 | ||||
-rwxr-xr-x | js/panels/components-panel.reel/components-panel.js (renamed from js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js) | 18 | ||||
-rwxr-xr-x | js/panels/properties.reel/sections/custom.reel/custom.js | 29 |
5 files changed, 41 insertions, 59 deletions
diff --git a/js/panels/Components/ComponentsPanel.js b/js/panels/Components/ComponentsPanel.js deleted file mode 100755 index df1d74bb..00000000 --- a/js/panels/Components/ComponentsPanel.js +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage; | ||
8 | |||
9 | var PanelBase = require("js/panels/PanelBase").PanelBase; | ||
10 | var ComponentsPanelBase = require("js/panels/Components/ComponentsPanelBase.reel").ComponentsPanelBase; | ||
11 | |||
12 | exports.ComponentsPanel = Montage.create(PanelBase, { | ||
13 | id : {value : "componentsPanel", writable:true, enumerable:true, configurable:true}, | ||
14 | panelName : {value : "Components", writable:true, enumerable:true, configurable:true}, | ||
15 | panelHeaderID : {value : "componentsPanelHeader", writable:true, enumerable:true, configurable:true}, | ||
16 | disclosureIconID : {value : "componentsPanelDisclosureIcon", writable:true, enumerable:true, configurable:true}, | ||
17 | closeButtonID : {value : "componentsPanelCloseButton", writable:true, enumerable:true, configurable:true}, | ||
18 | panelContentID : {value : "componentsPanelContent", writable:true, enumerable:true, configurable:true}, | ||
19 | |||
20 | init : { | ||
21 | value : function() | ||
22 | { | ||
23 | this.contentHeight = 200; | ||
24 | this.minHeight = 100; | ||
25 | this.defaultHeight = 200; | ||
26 | |||
27 | /* OLD WAY -- Removing the temporary div | ||
28 | // TODO: Remove this comment once this is tested. | ||
29 | var panelContainer = document.createElement("div"); | ||
30 | this._componentsPanelBase = ComponentsPanelBase.create(); | ||
31 | this._componentsPanelBase.element = panelContainer; | ||
32 | |||
33 | this.content = this._componentsPanelBase; | ||
34 | this._componentsPanelBase.needsDraw = true; | ||
35 | */ | ||
36 | |||
37 | this.content = ComponentsPanelBase.create(); | ||
38 | } | ||
39 | }, | ||
40 | |||
41 | _componentsPanelBase:{ | ||
42 | enumerable: true, | ||
43 | value: null, | ||
44 | writable:true | ||
45 | } | ||
46 | |||
47 | }); \ No newline at end of file | ||
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.css b/js/panels/components-panel.reel/components-panel.css index ac250c83..ac250c83 100755 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.css +++ b/js/panels/components-panel.reel/components-panel.css | |||
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html b/js/panels/components-panel.reel/components-panel.html index 6d7c8a2c..f598a1ee 100755 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.html +++ b/js/panels/components-panel.reel/components-panel.html | |||
@@ -7,13 +7,13 @@ | |||
7 | <html lang="en"> | 7 | <html lang="en"> |
8 | <head> | 8 | <head> |
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | 9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
10 | <link rel="stylesheet" type="text/css" href="ComponentsPanelBase.css"> | 10 | <link rel="stylesheet" type="text/css" href="components-panel.css"> |
11 | 11 | ||
12 | <script type="text/montage-serialization"> | 12 | <script type="text/montage-serialization"> |
13 | { | 13 | { |
14 | "owner": { | 14 | "owner": { |
15 | "module": "js/panels/Components/ComponentsPanelBase.reel", | 15 | "module": "js/panels/components-panel.reel", |
16 | "name": "ComponentsPanelBase", | 16 | "name": "ComponentsPanel", |
17 | "properties": { | 17 | "properties": { |
18 | "element": {"#": "components_panel"}, | 18 | "element": {"#": "components_panel"}, |
19 | "controller": {"@": "componentsTree"} | 19 | "controller": {"@": "componentsTree"} |
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/components-panel.reel/components-panel.js index e990551b..acbf702f 100755 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/components-panel.reel/components-panel.js | |||
@@ -16,7 +16,7 @@ String.prototype.capitalizeFirstChar = function() { | |||
16 | }; | 16 | }; |
17 | 17 | ||
18 | 18 | ||
19 | var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component, { | 19 | exports.ComponentsPanel = Montage.create(Component, { |
20 | 20 | ||
21 | components: { | 21 | components: { |
22 | value: { | 22 | value: { |
@@ -80,11 +80,6 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
80 | "dataFile" : "node_modules/components-data/number-input.json", | 80 | "dataFile" : "node_modules/components-data/number-input.json", |
81 | "component": "numberInput" | 81 | "component": "numberInput" |
82 | }, | 82 | }, |
83 | { | ||
84 | "text": "Select Input", | ||
85 | "dataFile" : "node_modules/components-data/select.json", | ||
86 | "component": "select" | ||
87 | }, | ||
88 | { | 83 | { |
89 | "text": "Radio Button", | 84 | "text": "Radio Button", |
90 | "dataFile" : "node_modules/components-data/radio-button.json", | 85 | "dataFile" : "node_modules/components-data/radio-button.json", |
@@ -96,6 +91,11 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
96 | "component": "rangeInput" | 91 | "component": "rangeInput" |
97 | }, | 92 | }, |
98 | { | 93 | { |
94 | "text": "Select Input", | ||
95 | "dataFile" : "node_modules/components-data/select.json", | ||
96 | "component": "select" | ||
97 | }, | ||
98 | { | ||
99 | "text": "TextArea", | 99 | "text": "TextArea", |
100 | "dataFile" : "node_modules/components-data/textarea.json", | 100 | "dataFile" : "node_modules/components-data/textarea.json", |
101 | "component": "textarea" | 101 | "component": "textarea" |
@@ -106,7 +106,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
106 | "component": "textfield" | 106 | "component": "textfield" |
107 | }, | 107 | }, |
108 | { | 108 | { |
109 | "text": "Toogle Button", | 109 | "text": "Toggle Button", |
110 | "dataFile" : "node_modules/components-data/toggle-button.json", | 110 | "dataFile" : "node_modules/components-data/toggle-button.json", |
111 | "component": "toggleButton" | 111 | "component": "toggleButton" |
112 | } | 112 | } |
@@ -230,9 +230,9 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
230 | case "select": | 230 | case "select": |
231 | return "dropdown"; | 231 | return "dropdown"; |
232 | case "number": | 232 | case "number": |
233 | return "hottext"; | 233 | return "ht"; |
234 | default: | 234 | default: |
235 | alert("Conversion not implemented for ", type); | 235 | alert("Conversion not implemented for " + type); |
236 | } | 236 | } |
237 | } | 237 | } |
238 | }, | 238 | }, |
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; | ||
193 | if (aField.max) obj._maxValue = aField.max; | ||
194 | if (aField.prop) obj.prop = aField.prop; | ||
195 | |||
196 | //Initiate onChange Events | ||
197 | obj.addEventListener("change", this, false); | ||
198 | obj.addEventListener("changing", this, false); | ||
199 | |||
200 | //Bind object value to controls list so it can be manipulated | ||
201 | Object.defineBinding(this.controls, aField.id, { | ||
202 | boundObject: obj, | ||
203 | boundObjectPropertyPath: "value" | ||
204 | }); | ||
205 | |||
206 | return obj; | ||