From 08eafdff4ec25d34e2e76b386145a9fd122431dc Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 6 Feb 2012 14:32:11 -0800 Subject: Moving the data files to a separate folder for now until montage provides the final files. Signed-off-by: Valerio Virgillito --- .../ComponentsPanelBase.js | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'js/panels/Components/ComponentsPanelBase.reel') 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 didCreate: { value: function() { this._loadComponents(); + +// var req = new XMLHttpRequest(); +// req.identifier = "searchRequest"; +// req.open("GET", url); +// req.addEventListener("load", this, false); +// req.addEventListener("error", this, false); +// req.send(); + } }, _loadComponents: { value: function() { this.components = [ - {name: "Button", data: "montage/ui/button.reel/button.json"} + {name: "Button", data: "node_modules/components-data/button.json"}, + {name: "Textfield", data: "node_modules/components-data/textfield.json"} ]; // Build the PI objects for each component for(var i = 0, component; component = this.components[i]; i++) { + var req = new XMLHttpRequest(); + //req.identifier = "searchRequest"; + req.open("GET", component.data); + req.addEventListener("load", this, false); + req.addEventListener("error", this, false); + req.send(); + +/* var piIdentifier = component.name + "Pi"; var piObj = []; var section = {}; @@ -75,12 +92,21 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component PIData[piIdentifier] = []; PIData[piIdentifier].push(section); + */ } } }, + handleLoad: { + value: function(evt) { + var response = JSON.parse(evt.target.responseText); + console.log(response); + + } + }, + getControlType: { value: function(type) { switch(type) { -- cgit v1.2.3