diff options
author | Valerio Virgillito | 2012-02-06 14:32:11 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-06 14:32:11 -0800 |
commit | 08eafdff4ec25d34e2e76b386145a9fd122431dc (patch) | |
tree | 18037d553feed5ed66417c2a80c5b908b5a1942d | |
parent | f849f62ef2eba6d3439156639b8d1880d1498c16 (diff) | |
download | ninja-08eafdff4ec25d34e2e76b386145a9fd122431dc.tar.gz |
Moving the data files to a separate folder for now until montage provides the final files.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
-rw-r--r-- | js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | 28 | ||||
-rw-r--r-- | node_modules/components-data/button.json (renamed from node_modules/montage/ui/button.reel/button.json) | 0 | ||||
-rw-r--r-- | node_modules/components-data/textfield.json | 21 |
3 files changed, 48 insertions, 1 deletions
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js index d9decd2c..51822150 100644 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | |||
@@ -43,17 +43,34 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
43 | didCreate: { | 43 | didCreate: { |
44 | value: function() { | 44 | value: function() { |
45 | this._loadComponents(); | 45 | this._loadComponents(); |
46 | |||
47 | // var req = new XMLHttpRequest(); | ||
48 | // req.identifier = "searchRequest"; | ||
49 | // req.open("GET", url); | ||
50 | // req.addEventListener("load", this, false); | ||
51 | // req.addEventListener("error", this, false); | ||
52 | // req.send(); | ||
53 | |||
46 | } | 54 | } |
47 | }, | 55 | }, |
48 | 56 | ||
49 | _loadComponents: { | 57 | _loadComponents: { |
50 | value: function() { | 58 | value: function() { |
51 | this.components = [ | 59 | this.components = [ |
52 | {name: "Button", data: "montage/ui/button.reel/button.json"} | 60 | {name: "Button", data: "node_modules/components-data/button.json"}, |
61 | {name: "Textfield", data: "node_modules/components-data/textfield.json"} | ||
53 | ]; | 62 | ]; |
54 | 63 | ||
55 | // Build the PI objects for each component | 64 | // Build the PI objects for each component |
56 | for(var i = 0, component; component = this.components[i]; i++) { | 65 | for(var i = 0, component; component = this.components[i]; i++) { |
66 | var req = new XMLHttpRequest(); | ||
67 | //req.identifier = "searchRequest"; | ||
68 | req.open("GET", component.data); | ||
69 | req.addEventListener("load", this, false); | ||
70 | req.addEventListener("error", this, false); | ||
71 | req.send(); | ||
72 | |||
73 | /* | ||
57 | var piIdentifier = component.name + "Pi"; | 74 | var piIdentifier = component.name + "Pi"; |
58 | var piObj = []; | 75 | var piObj = []; |
59 | var section = {}; | 76 | var section = {}; |
@@ -75,12 +92,21 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
75 | 92 | ||
76 | PIData[piIdentifier] = []; | 93 | PIData[piIdentifier] = []; |
77 | PIData[piIdentifier].push(section); | 94 | PIData[piIdentifier].push(section); |
95 | */ | ||
78 | 96 | ||
79 | } | 97 | } |
80 | 98 | ||
81 | } | 99 | } |
82 | }, | 100 | }, |
83 | 101 | ||
102 | handleLoad: { | ||
103 | value: function(evt) { | ||
104 | var response = JSON.parse(evt.target.responseText); | ||
105 | console.log(response); | ||
106 | |||
107 | } | ||
108 | }, | ||
109 | |||
84 | getControlType: { | 110 | getControlType: { |
85 | value: function(type) { | 111 | value: function(type) { |
86 | switch(type) { | 112 | switch(type) { |
diff --git a/node_modules/montage/ui/button.reel/button.json b/node_modules/components-data/button.json index a931afcb..a931afcb 100644 --- a/node_modules/montage/ui/button.reel/button.json +++ b/node_modules/components-data/button.json | |||
diff --git a/node_modules/components-data/textfield.json b/node_modules/components-data/textfield.json new file mode 100644 index 00000000..2a21394a --- /dev/null +++ b/node_modules/components-data/textfield.json | |||
@@ -0,0 +1,21 @@ | |||
1 | { | ||
2 | "component": "textfield", | ||
3 | |||
4 | "module": "montage/ui/textfield.reel", | ||
5 | |||
6 | "name": "Textfield", | ||
7 | |||
8 | "properties": [ | ||
9 | |||
10 | { | ||
11 | "name": "value", | ||
12 | "type": "string", | ||
13 | "default": "Button" | ||
14 | }, | ||
15 | { | ||
16 | "name": "enabled", | ||
17 | "type": "boolean", | ||
18 | "default": "true" | ||
19 | } | ||
20 | ] | ||
21 | } \ No newline at end of file | ||