plugins/main/js/main.js in rsence-pre-3.0.0.8 vs plugins/main/js/main.js in rsence-pre-3.0.0.9
- old
+ new
@@ -1,41 +1,37 @@
// List of apps initialized utilizing GUITrees, by GUIPlugin name
RSence.apps = { };
-// Subview that utilizes GUITrees
-RSence.GUIView = HControl.extend({
-
-});
-
// Application that handles GUITrees, populates its values dynamically
RSence.GUIApp = HApplication.extend({
constructor: function(_options){
-
+
var
+ i = 0,
_this = this,
-
+
// Application priority
_priority = _options.priority?_options.priority:100,
-
+
// Application label / title
_label = _options.label?_options.label:'Untitled Application',
-
+
// Application description (multiline)
_descr = _options.descr?_options.descr:'No Description',
-
+
// Allow multiple instances?
_allowMulti = _options.allowMulti?_options.allowMulti:false,
-
+
// The GUI Tree
_valueObj = _options.valueObj?_options.valueObj:false,
-
+
// Signal input (from server to client)
- _sigInput = _options.sigInput?COMM.Values.values[_options.sigInput]:false,
-
+ _sigInput = _options.sigInput?_this.getValueById(_options.sigInput):false,
+
// Signal output (from client to server)
- _sigOutput = _options.sigOutput?COMM.Values.values[_options.sigOutput]:false,
-
+ _sigOutput = _options.sigOutput?_this.getValueById(_options.sigOutput):false,
+
// Icon image url.
// Minimum size is 16x16 and multiple sizes are stacked on top of each other,
// largest topmost, smaller versions aligned left below in size order.
// Image formats supported are: SVG (except for IE), PNG (all), GIF (all), JPG (all).
// Recommended formats are: SVG and PNG24 with transparency / translucency.
@@ -46,47 +42,69 @@
// 512x768 -> 512x512, 256x256
// 512x640 -> 512x512, 128x128
// 512x896 -> 512x512, 256x256 and 128x128
// etc..
_iconUrl = _options.iconUrl?COMM.Values.values[_options.iconUrl]:false;
-
+
// Construct the application base:
_this.base( _priority, _label );
-
+
// Options combined from vars above
_this.options = HClass.extend(_options).extend({
label: _label,
descr: _descr,
allowMulti: _allowMulti,
sigInput: _sigInput,
sigOutput: _sigOutput,
icon: { url: _iconUrl, width: null, height: null },
pid: this.appId,
+ elemId: 0,
views: []
}).nu();
-
- _this.valueObj = _valueObj;
- _this.value = _valueObj.value;
-
+ this.elemId = _this.options.elemId;
+
+ if( _options.values ){
+ _this.valueIds = _options.values;
+ _this.values = {};
+ for( i in _options.values ){
+ _this.values = _this.getValueById(i);
+ }
+ }
+
+ if( _options.localized ){
+ _this.localized = _options.localized;
+ }
+
+ if( _options.strings ){
+ _this.strings = _options.strings;
+ }
+
+ if(_valueObj){
+ _this.valueObj.bind(_this);
+ }
+ else {
+ _this.value = _options.value;
+ }
+
// _this.app = _this;
-
- //
+
+ //
// _this.renderer = COMM.JSONRenderer.extend({
- //
+ //
// }).nu( _this.value, _this );
_this.drawSubviews();
if( _this.options.subviews ){
_this.options.subviews.call(_this);
}
},
drawSubviews: function(){
},
-
+
die: function(){
this.base();
-
+
}
-
+
});