//----------------------- our roo verison
+// single instance controlled by projectmanager.
Roo = XObject.define(
function(cfg) {
this.map = cfg;
}
-
-
-
-
- }
-);
-
- // static load @ starttime.
-XObject.extend(Roo, {
- proplist: false,
-
load : function()
{
var file = Gio.file_new_for_path(__script_path__ +'/../rooprops.json');
var _this = this;
- file.read_async(0, null, function(source,result) {
- var stream = source.read_finish(result)
- var dstream = new Gio.DataInputStream.c_new(stream);
- var data = dstream.read_until("");
- _this.proplist = JSON.parse(data).data;
-
- });
+
+ var data = File.read(__script_path__ +'/../rooprops.json');
+ this.proplist = JSON.parse(data).data;
}
+ getPropertiesFor: function(ename, type)
+ {
+ if (typeof(this.proplist[ename]) == 'undefined' ||
+ typeof(this.proplist[ename][type]) == 'undefined' ) {
+ return [];
+ }
+ return this.proplist[ename][type];
+ }
+
+
+
+ }
+);
+
+ // static load @ starttime.
+XObject.extend(Roo, {
+ proplist: false,
+
+
});