aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Components
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Components')
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js74
1 files changed, 65 insertions, 9 deletions
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
index b4eec771..87c68a52 100755
--- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
+++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
@@ -23,6 +23,36 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
23 "text": "styles", 23 "text": "styles",
24 "children": [ 24 "children": [
25 { 25 {
26 "text": "Widgets",
27 "children": [
28 {
29 "text": "Feed Reader",
30 "dataFile" : "node_modules/components-data/feed-reader.json",
31 "component": "feedreader"
32 },
33 {
34 "text": "Map",
35 "dataFile" : "node_modules/components-data/map.json",
36 "component": "map"
37 },
38 {
39 "text": "Picasa Carousel",
40 "dataFile" : "node_modules/components-data/picasa-carousel.json",
41 "component": "picasa-carousel"
42 },
43 {
44 "text": "Search Bar",
45 "dataFile" : "node_modules/components-data/searchfield.json",
46 "component": "searchfield"
47 },
48 {
49 "text": "Youtube Channel",
50 "dataFile" : "node_modules/components-data/youtube-channel.json",
51 "component": "youtube-channel"
52 }
53 ]
54 },
55 {
26 "text": "Montage Components", 56 "text": "Montage Components",
27 "children": [ 57 "children": [
28 { 58 {
@@ -50,7 +80,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
50 "dataFile" : "node_modules/components-data/number-input.json", 80 "dataFile" : "node_modules/components-data/number-input.json",
51 "component": "numberInput" 81 "component": "numberInput"
52 }, 82 },
53 { 83 {
54 "text": "Select Input", 84 "text": "Select Input",
55 "dataFile" : "node_modules/components-data/select.json", 85 "dataFile" : "node_modules/components-data/select.json",
56 "component": "select" 86 "component": "select"
@@ -129,15 +159,19 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
129 _loadComponents: { 159 _loadComponents: {
130 value: function() { 160 value: function() {
131 161
132 this.componentsToLoad = this.components.children[0].children.length; 162 for(var cat in this.components.children) {
163
164 this.componentsToLoad += this.components.children[cat].children.length;
165
166 for(var i = 0, component; component = this.components.children[cat].children[i]; i++) {
167 var req = new XMLHttpRequest();
168 //req.identifier = "searchRequest";
169 req.open("GET", component.dataFile);
170 req.addEventListener("load", this, false);
171 req.addEventListener("error", this, false);
172 req.send();
173 }
133 174
134 for(var i = 0, component; component = this.components.children[0].children[i]; i++) {
135 var req = new XMLHttpRequest();
136 //req.identifier = "searchRequest";
137 req.open("GET", component.dataFile);
138 req.addEventListener("load", this, false);
139 req.addEventListener("error", this, false);
140 req.send();
141 } 175 }
142 } 176 }
143 }, 177 },
@@ -313,6 +347,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
313 el.setAttribute("type", "range"); 347 el.setAttribute("type", "range");
314 break; 348 break;
315 case "textfield": 349 case "textfield":
350 case "searchfield":
316 el = NJUtils.makeNJElement("input", "Textfield", "component"); 351 el = NJUtils.makeNJElement("input", "Textfield", "component");
317 el.elementModel.pi = "TextfieldPi"; 352 el.elementModel.pi = "TextfieldPi";
318 el.setAttribute("type", "text"); 353 el.setAttribute("type", "text");
@@ -326,6 +361,27 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
326 el.elementModel.pi = "ToggleButtonPi"; 361 el.elementModel.pi = "ToggleButtonPi";
327 el.innerHTML = "Off"; 362 el.innerHTML = "Off";
328 break; 363 break;
364 case "map":
365 el = NJUtils.makeNJElement("div", "Map", "component");
366 el.elementModel.pi = "MapPi";
367 el.elementModel.isComponent = true;
368 break;
369 case "feedreader":
370 el = NJUtils.makeNJElement("div", "Feed Reader", "component");
371 el.elementModel.pi = "FeedReaderPi";
372 el.elementModel.isComponent = true;
373 break;
374 case "picasa-carousel":
375 el = NJUtils.makeNJElement("div", "Picasa Carousel", "component");
376 el.elementModel.pi = "PicasaCarouselPi";
377 el.elementModel.isComponent = true;
378 break;
379 case "youtube-channel":
380 el = NJUtils.makeNJElement("div", "Youtube Channel", "component");
381 el.elementModel.pi = "YoutubeChannelPi";
382 el.elementModel.isComponent = true;
383 break;
384
329 } 385 }
330 386
331 return el; 387 return el;