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 +++++++++++++++++++++- node_modules/components-data/button.json | 21 ++++++++++++++++ node_modules/components-data/textfield.json | 21 ++++++++++++++++ node_modules/montage/ui/button.reel/button.json | 21 ---------------- 4 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 node_modules/components-data/button.json create mode 100644 node_modules/components-data/textfield.json delete mode 100644 node_modules/montage/ui/button.reel/button.json 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) { diff --git a/node_modules/components-data/button.json b/node_modules/components-data/button.json new file mode 100644 index 00000000..a931afcb --- /dev/null +++ b/node_modules/components-data/button.json @@ -0,0 +1,21 @@ +{ + "component": "button", + + "module": "montage/ui/button.reel", + + "name": "Button", + + "properties": [ + + { + "name": "label", + "type": "string", + "default": "Button" + }, + { + "name": "enabled", + "type": "boolean", + "default": "true" + } + ] +} \ No newline at end of file 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 @@ +{ + "component": "textfield", + + "module": "montage/ui/textfield.reel", + + "name": "Textfield", + + "properties": [ + + { + "name": "value", + "type": "string", + "default": "Button" + }, + { + "name": "enabled", + "type": "boolean", + "default": "true" + } + ] +} \ No newline at end of file diff --git a/node_modules/montage/ui/button.reel/button.json b/node_modules/montage/ui/button.reel/button.json deleted file mode 100644 index a931afcb..00000000 --- a/node_modules/montage/ui/button.reel/button.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "component": "button", - - "module": "montage/ui/button.reel", - - "name": "Button", - - "properties": [ - - { - "name": "label", - "type": "string", - "default": "Button" - }, - { - "name": "enabled", - "type": "boolean", - "default": "true" - } - ] -} \ No newline at end of file -- cgit v1.2.3