diff options
author | Valerio Virgillito | 2012-02-14 15:53:08 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-14 15:53:08 -0800 |
commit | 69f0dbbe2ebbbc8d7fa89afe1a7078d0fe206be9 (patch) | |
tree | 43f7106cba8a6b8ea85a6147f1caa9e00b1d93b9 /js/panels/Components/ComponentsPanelBase.reel | |
parent | c4265fa1484867e717c50bdb19d164ec56a081f4 (diff) | |
download | ninja-69f0dbbe2ebbbc8d7fa89afe1a7078d0fe206be9.tar.gz |
Adding all the components to the panel
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/panels/Components/ComponentsPanelBase.reel')
-rw-r--r-- | js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | 90 |
1 files changed, 88 insertions, 2 deletions
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js index 7e5a76ee..bb6b049a 100644 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | |||
@@ -26,14 +26,59 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
26 | "text": "Montage Components", | 26 | "text": "Montage Components", |
27 | "children": [ | 27 | "children": [ |
28 | { | 28 | { |
29 | "text": "Anchor", | ||
30 | "dataFile" : "node_modules/components-data/anchor.json", | ||
31 | "component": "anchor" | ||
32 | }, | ||
33 | { | ||
29 | "text": "Button", | 34 | "text": "Button", |
30 | "dataFile" : "node_modules/components-data/button.json", | 35 | "dataFile" : "node_modules/components-data/button.json", |
31 | "component": "button" | 36 | "component": "button" |
32 | }, | 37 | }, |
33 | { | 38 | { |
39 | "text": "Checkbox", | ||
40 | "dataFile" : "node_modules/components-data/checkbox.json", | ||
41 | "component": "checkbox" | ||
42 | }, | ||
43 | { | ||
44 | "text": "Image Component", | ||
45 | "dataFile" : "node_modules/components-data/image.json", | ||
46 | "component": "imageComponent" | ||
47 | }, | ||
48 | { | ||
49 | "text": "NumberInput", | ||
50 | "dataFile" : "node_modules/components-data/number-input.json", | ||
51 | "component": "numberInput" | ||
52 | }, | ||
53 | { | ||
54 | "text": "Select Input", | ||
55 | "dataFile" : "node_modules/components-data/select.json", | ||
56 | "component": "select" | ||
57 | }, | ||
58 | { | ||
59 | "text": "Radio Button", | ||
60 | "dataFile" : "node_modules/components-data/radio-button.json", | ||
61 | "component": "radioButton" | ||
62 | }, | ||
63 | { | ||
64 | "text": "Range Input", | ||
65 | "dataFile" : "node_modules/components-data/range-input.json", | ||
66 | "component": "rangeInput" | ||
67 | }, | ||
68 | { | ||
69 | "text": "TextArea", | ||
70 | "dataFile" : "node_modules/components-data/textarea.json", | ||
71 | "component": "textarea" | ||
72 | }, | ||
73 | { | ||
34 | "text": "Textfield", | 74 | "text": "Textfield", |
35 | "dataFile" : "node_modules/components-data/textfield.json", | 75 | "dataFile" : "node_modules/components-data/textfield.json", |
36 | "component": "textfield" | 76 | "component": "textfield" |
77 | }, | ||
78 | { | ||
79 | "text": "Toogle Button", | ||
80 | "dataFile" : "node_modules/components-data/toggle-button.json", | ||
81 | "component": "toggleButton" | ||
37 | } | 82 | } |
38 | ] | 83 | ] |
39 | } | 84 | } |
@@ -211,6 +256,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
211 | 256 | ||
212 | NJevent("elementAdding", {"el": element, "data":styles}); | 257 | NJevent("elementAdding", {"el": element, "data":styles}); |
213 | }); | 258 | }); |
259 | |||
214 | } | 260 | } |
215 | }, | 261 | }, |
216 | 262 | ||
@@ -219,18 +265,58 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
219 | var el; | 265 | var el; |
220 | 266 | ||
221 | switch(name) { | 267 | switch(name) { |
268 | case "anchor": | ||
269 | el = NJUtils.makeNJElement("a", "Anchor", "component"); | ||
270 | el.elementModel.pi = "AnchorPi"; | ||
271 | break; | ||
222 | case "button": | 272 | case "button": |
223 | el = NJUtils.makeNJElement(name, "Button", "component"); | 273 | el = NJUtils.makeNJElement(name, "Button", "component"); |
224 | el.elementModel.pi = "ButtonPi"; | 274 | el.elementModel.pi = "ButtonPi"; |
225 | el.setAttribute("type", "button"); | 275 | el.setAttribute("type", "button"); |
226 | el.innerHTML = "Button"; | 276 | el.innerHTML = "Button"; |
227 | break; | 277 | break; |
228 | case "textfield": { | 278 | case "checkbox": |
279 | el = NJUtils.makeNJElement("input", "Checkbox", "component"); | ||
280 | el.elementModel.pi = "CheckboxPi"; | ||
281 | el.setAttribute("type", "checkbox"); | ||
282 | break; | ||
283 | case "imageComponent": | ||
284 | el = NJUtils.makeNJElement("image", "Image", "component"); | ||
285 | el.elementModel.pi = "ImageComponentPi"; | ||
286 | break; | ||
287 | case "numberInput": | ||
288 | el = NJUtils.makeNJElement("input", "Number Input", "component"); | ||
289 | el.elementModel.pi = "NumberInputPi"; | ||
290 | el.setAttribute("type", "number"); | ||
291 | break; | ||
292 | case "select": | ||
293 | el = NJUtils.makeNJElement("select", "Select", "component"); | ||
294 | el.elementModel.pi = "SelectPi"; | ||
295 | break; | ||
296 | case "radioButton": | ||
297 | el = NJUtils.makeNJElement("input", "Radio Button", "component"); | ||
298 | el.elementModel.pi = "RadioButtonPi"; | ||
299 | el.setAttribute("type", "radio"); | ||
300 | break; | ||
301 | case "rangeInput": | ||
302 | el = NJUtils.makeNJElement("input", "Range Input", "component"); | ||
303 | el.elementModel.pi = "RangeInputPi"; | ||
304 | el.setAttribute("type", "range"); | ||
305 | break; | ||
306 | case "textfield": | ||
229 | el = NJUtils.makeNJElement("input", "Textfield", "component"); | 307 | el = NJUtils.makeNJElement("input", "Textfield", "component"); |
230 | el.elementModel.pi = "TextfieldPi"; | 308 | el.elementModel.pi = "TextfieldPi"; |
231 | el.setAttribute("type", "text"); | 309 | el.setAttribute("type", "text"); |
232 | break; | 310 | break; |
233 | } | 311 | case "textarea": |
312 | el = NJUtils.makeNJElement("textarea", "TextArea", "component"); | ||
313 | el.elementModel.pi = "TextArea"; | ||
314 | break; | ||
315 | case "toggleButton": | ||
316 | el = NJUtils.makeNJElement("button", "Toggle Button", "component"); | ||
317 | el.elementModel.pi = "ToggleButtonPi"; | ||
318 | el.innerHTML = "Off"; | ||
319 | break; | ||
234 | } | 320 | } |
235 | 321 | ||
236 | return el; | 322 | return el; |