rsence 2.0.9.23 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/INSTALL.rdoc +61 -49
  2. data/README.rdoc +20 -4
  3. data/VERSION +1 -1
  4. data/conf/default_conf.yaml +8 -0
  5. data/conf/rsence_command_strings.yaml +31 -20
  6. data/docs/ExampleGuiPlugin.rdoc +2 -2
  7. data/js/comm/comm.js +27 -5
  8. data/js/comm/transporter/transporter.js +1 -1
  9. data/js/comm/values/values.js +12 -5
  10. data/js/controls/button/button.js +12 -2
  11. data/js/controls/dialogs/alert_sheet/alert_sheet.js +13 -1
  12. data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +13 -2
  13. data/js/controls/dialogs/sheet/sheet.js +35 -28
  14. data/js/controls/imageview/imageview.js +13 -13
  15. data/js/controls/progress/progressindicator/progressindicator.js +5 -5
  16. data/js/controls/sliders/slider/slider.js +4 -31
  17. data/js/controls/stepper/stepper.js +12 -19
  18. data/js/controls/textcontrol/textcontrol.js +0 -50
  19. data/js/controls/textcontrol/themes/default/textcontrol.html +1 -1
  20. data/js/controls/window/window.js +1 -1
  21. data/js/core/elem/elem.js +146 -160
  22. data/js/core/rsence_ns/rsence_ns.js +7 -0
  23. data/js/foundation/control/eventresponder/eventresponder.js +8 -7
  24. data/js/foundation/eventmanager/eventmanager.js +81 -48
  25. data/js/foundation/geom/rect/rect.js +1 -1
  26. data/js/foundation/json_renderer/json_renderer.js +4 -1
  27. data/js/foundation/system/system.js +37 -34
  28. data/js/foundation/view/morphanimation/morphanimation.js +53 -43
  29. data/js/foundation/view/view.js +119 -118
  30. data/js/lists/listitems/listitems.js +10 -10
  31. data/js/lists/propertylist/js.inc +0 -0
  32. data/js/lists/propertylist/propertylist.js +574 -0
  33. data/js/lists/propertylist/propertylisteditor/js.inc +0 -0
  34. data/js/lists/propertylist/propertylisteditor/propertylisteditor.js +233 -0
  35. data/js/lists/radiobuttonlist/radiobuttonlist.js +15 -8
  36. data/js/menus/minimenu/js.inc +0 -0
  37. data/js/menus/minimenu/minimenu.js +139 -0
  38. data/js/menus/minimenu/minimenuitem/js.inc +0 -0
  39. data/js/menus/minimenu/minimenuitem/minimenuitem.js +33 -0
  40. data/js/menus/minimenu/minimenuitem/themes/default/minimenuitem.css +45 -0
  41. data/js/menus/minimenu/minimenuitem/themes/default/minimenuitem.html +4 -0
  42. data/js/menus/minimenu/minimenuitem/themes/default/minimenuitem_checkmark.png +0 -0
  43. data/js/menus/minimenu/themes/default/minimenu.css +63 -0
  44. data/js/menus/minimenu/themes/default/minimenu.html +7 -0
  45. data/js/menus/minimenu/themes/default/minimenu.png +0 -0
  46. data/js/util/reloadapp/reloadapp.js +1 -1
  47. data/lib/conf/argv.rb +40 -11
  48. data/lib/daemon/daemon.rb +63 -22
  49. data/lib/plugins/gui_plugin.rb +28 -31
  50. data/lib/plugins/guiparser.rb +37 -7
  51. data/lib/plugins/plugin.rb +260 -28
  52. data/lib/plugins/plugin_base.rb +14 -0
  53. data/lib/plugins/plugin_plugins.rb +11 -1
  54. data/lib/plugins/pluginmanager.rb +127 -44
  55. data/lib/plugins/plugins.rb +10 -1
  56. data/lib/session/msg.rb +25 -1
  57. data/lib/session/sessionmanager.rb +11 -2
  58. data/lib/session/sessionstorage.rb +14 -14
  59. data/lib/transporter/transporter.rb +29 -13
  60. data/lib/values/hvalue.rb +30 -0
  61. data/plugins/client_pkg/info.yaml +2 -2
  62. data/plugins/{index_html → main}/img/loading.gif +0 -0
  63. data/plugins/{index_html → main}/img/riassence.gif +0 -0
  64. data/plugins/main/info.yaml +5 -4
  65. data/plugins/main/main.rb +180 -24
  66. data/plugins/{index_html → main}/tmpl/index.html +4 -2
  67. data/plugins/ticket/info.yaml +2 -2
  68. data/plugins/ticket/lib/upload.rb +57 -5
  69. data/plugins/ticket/ticket.rb +10 -4
  70. data/setup/welcome/info.yaml +2 -2
  71. data/setup/welcome/text/welcome.html +1 -1
  72. metadata +22 -11
  73. data/plugins/index_html/index_html.rb +0 -120
  74. data/plugins/index_html/info.yaml +0 -18
@@ -1,6 +1,6 @@
1
1
  = Example: The "welcome" GUIPlugin bundle
2
2
 
3
- This bundle is installed by default for each new RSence project environment, when created by the +rsence initenv+ command. It displays a simple user interface that contains a congratulatory message of a successful setup. Feel free to experiment with the plugin in your project environment.
3
+ This bundle is installed by default for each new RSence project environment, when created by the +rsence init+ command. It displays a simple user interface that contains a congratulatory message of a successful setup. Feel free to experiment with the plugin in your project environment.
4
4
 
5
5
  === File / directory structure
6
6
  This is just an example, the meaning of gui/
@@ -28,7 +28,7 @@ A brief description of the package
28
28
  !!!yaml
29
29
  description: |
30
30
  This is a simple welcome message plugin. It's installed in new project
31
- environments, when the rsence initenv in executed.
31
+ environments, when the rsence init in executed.
32
32
  You may safely remove this plugin bundle.
33
33
 
34
34
  System version requirements. In this case "RSence 2.0.0 or newer"
data/js/comm/comm.js CHANGED
@@ -129,16 +129,35 @@ COMM = {
129
129
  _username = _options.username?_options.username:null,
130
130
  _password = _options.username?_options.password:null;
131
131
  if(!_options.onFailure){
132
- _this.onFailure = function(resp){console.log('No failure handler specified, response: ',resp);};
132
+ _this.onFailure = function(resp){
133
+ console.log(
134
+ 'No failure handler specified, response: ',
135
+ resp
136
+ );
137
+ };
133
138
  }
134
139
  if(!_options.onSuccess){
135
- _this.onSuccess = function(resp){console.log('No success handler specified, response: ',resp);};
140
+ _this.onSuccess = function(resp){
141
+ console.log('No success handler specified, response: ',resp);
142
+ };
136
143
  }
137
144
  if(!_options.on302){
138
145
  /** Redirection handler **/
139
146
  _this.on503 = function(_this){
140
- var _retryAfter = parseInt(_this.X.getResponseHeader('Retry-After'),10)*1000,
141
- _timeout = setTimeout(function(){COMM.request(_this.url,_this.options);},_retryAfter);
147
+ var
148
+ _retryAfter = parseInt(
149
+ _this.X.getResponseHeader('Retry-After'),
150
+ 10
151
+ )*1000,
152
+ _timeout = setTimeout(
153
+ function(){
154
+ COMM.request(
155
+ _this.url,
156
+ _this.options
157
+ );
158
+ },
159
+ _retryAfter
160
+ );
142
161
  };
143
162
  }
144
163
  _this.url = _url;
@@ -148,7 +167,10 @@ COMM = {
148
167
  _url += ((_url.indexOf('?')!==-1)?'&':'?')+_comm._arrayToQueryString(_params);
149
168
  }
150
169
  if(!_async){
151
- console.log("WARNING: Synchronous "+_method+" request to "+_url+", these will fail on the Symbian web browser.");
170
+ console.log(
171
+ "WARNING: Synchronous "+_method+" request to "+_url+
172
+ ", these will fail on the Symbian web browser."
173
+ );
152
174
  }
153
175
  _this.X.open(
154
176
  _method,
@@ -239,7 +239,7 @@ COMM.Transporter = HApplication.extend({
239
239
  }
240
240
  // console.log('sync.');
241
241
  this.busy = true;
242
- if(window['sesWatcher']){
242
+ if(window['sesWatcher'] && window.sesWatcher['sesTimeoutValue']){
243
243
  sesWatcher.sesTimeoutValue.set( new Date().getTime() );
244
244
  }
245
245
  var _this = this,
@@ -144,11 +144,15 @@ COMM.Values = HClass.extend({
144
144
  * - 'b': Boolean (true/false)
145
145
  * - 'n': Number (integers and floats)
146
146
  * - 's': String
147
+ * - '~': Null
148
+ * - '-': Undefined
147
149
  *
148
150
  **/
149
151
  type: function(_obj){
150
- if(_obj === null || _obj === undefined){
151
- console.log('null or undefined obj:',_obj);
152
+ if(_obj === null){
153
+ return '~';
154
+ }
155
+ else if (_obj === undefined){
152
156
  return '-';
153
157
  }
154
158
  var _type = (typeof _obj).slice(0,1);
@@ -366,9 +370,12 @@ COMM.Values = HClass.extend({
366
370
  *
367
371
  **/
368
372
  clone: function( _obj, _shallow ){
369
- if(_obj === null || _obj === undefined){
370
- console.log('null or undefined obj:',_obj);
371
- return _obj;
373
+ if(_obj === null){
374
+ return null;
375
+ }
376
+ else if (_obj === undefined){
377
+ console.log('Undefined object, supplementing with null.');
378
+ return null;
372
379
  }
373
380
  var _item,
374
381
  _cloned;
@@ -53,7 +53,12 @@ HClickButton = HButton.extend({
53
53
  *
54
54
  **/
55
55
  refreshValue: function(){
56
- this.setEnabled( this.value === 0 );
56
+ if( this.options.inverseValue ){
57
+ this.setEnabled( this.value === 1 );
58
+ }
59
+ else {
60
+ this.setEnabled( this.value === 0 );
61
+ }
57
62
  },
58
63
  /** = Description
59
64
  * Click method, sets the value to disabled if the button is enabled.
@@ -61,7 +66,12 @@ HClickButton = HButton.extend({
61
66
  **/
62
67
  click: function(){
63
68
  if(this.enabled){
64
- this.setValue(1);
69
+ if( this.options.inverseValue ){
70
+ this.setValue(0);
71
+ }
72
+ else {
73
+ this.setValue(1);
74
+ }
65
75
  }
66
76
  }
67
77
 
@@ -49,7 +49,7 @@ HAlertSheet = HSheet.extend({
49
49
  *
50
50
  **/
51
51
  alertButtons: function(){
52
- this.okButton = HClickValueButton.nu(
52
+ this.okButton = HClickButton.nu(
53
53
  [ null, null, 60, 23, 8, 8 ],
54
54
  this, {
55
55
  label: 'OK',
@@ -59,5 +59,17 @@ HAlertSheet = HSheet.extend({
59
59
  }
60
60
  }
61
61
  );
62
+ },
63
+
64
+ /** = Description
65
+ * Binds the same value to okButton.
66
+ *
67
+ **/
68
+ setValueObj: function( valueObj ){
69
+ this.base( valueObj );
70
+ if ( this['okButton'] ) {
71
+ valueObj.bind( this.okButton );
72
+ }
62
73
  }
74
+
63
75
  });
@@ -18,7 +18,7 @@ HConfirmSheet = HAlertSheet.extend({
18
18
  *
19
19
  **/
20
20
  alertButtons: function(){
21
- this.cancelButton = HClickValueButton.extend({
21
+ this.cancelButton = HClickButton.extend({
22
22
  click: function(){
23
23
  this.setValue( -1 );
24
24
  }
@@ -33,5 +33,16 @@ HConfirmSheet = HAlertSheet.extend({
33
33
  }
34
34
  );
35
35
  this.base();
36
- }
36
+ },
37
+
38
+ /** = Description
39
+ * Binds the same value to cancelButton.
40
+ *
41
+ **/
42
+ setValueObj: function( valueObj ){
43
+ this.base( valueObj );
44
+ if ( this['cancelButton'] ) {
45
+ valueObj.bind( this.cancelButton );
46
+ }
47
+ }
37
48
  });
@@ -10,16 +10,21 @@
10
10
  /*** = Description
11
11
  ** HSheet is a container component that toggles its visibility
12
12
  ** based on its value. When the value is 0, it's visible, otherwise
13
- ** it's hidden. It expands to fill its parent view, the rect
14
- ** specifies the size of the sheet inside. The sheet is
15
- ** centered. It's practical when combined with button
16
- ** values. Also see HAlertSheet and HConfirmSheet components.
17
- **
13
+ ** it's hidden. It expands to fill its parent view.
14
+ **
15
+ ** Its rect specifies the relative size and position of the centered inner
16
+ ** sheet, which acts as a subview.
17
+ **
18
+ ** It's practical when combined with button values.
19
+ **
20
+ ** Also see HAlertSheet and HConfirmSheet components.
21
+ **
18
22
  ***/
19
23
  var//RSence.Controls
20
24
  HSheet = HControl.extend({
25
+
21
26
  componentName: 'sheet',
22
-
27
+
23
28
  /** = Description
24
29
  * Shows of hides HSheet depending on the value.
25
30
  * If the value is 0 the HSheet#show() will be called.
@@ -34,7 +39,7 @@ HSheet = HControl.extend({
34
39
  this.hide();
35
40
  }
36
41
  },
37
-
42
+
38
43
  /** = Description
39
44
  * Draws the sheet rectangle once it has been created and
40
45
  * if it has not been set as hidden by constructor.
@@ -45,36 +50,38 @@ HSheet = HControl.extend({
45
50
  **/
46
51
  drawRect: function() {
47
52
  if (this.parent && this.rect.isValid) {
48
- var _this = this,
49
- _elemId = _this.elemId,
50
- _styl = ELEM.setStyle,
51
- _rect = _this.rect,
52
- _width = _rect.width,
53
- _left = 0-Math.floor(_rect.width/2),
54
- _height = _rect.height;
53
+ var
54
+ _this = this,
55
+ _elemId = _this.elemId,
56
+ _styl = ELEM.setStyle,
57
+ _rect = _this.rect,
58
+ _width = _rect.width,
59
+ _top = _rect.top,
60
+ _left = 0-Math.floor(_rect.width/2)+_rect.left,
61
+ _height = _rect.height;
55
62
 
56
- _styl( _elemId, 'left', '0px', true);
57
- _styl( _elemId, 'top', '0px', true);
58
- _styl( _elemId, 'right', '0px', true);
59
- _styl( _elemId, 'bottom', '0px', true);
60
- _styl( _elemId, 'width', 'auto', true);
61
- _styl( _elemId, 'height', 'auto', true);
62
- _styl( _elemId, 'min-width', _width+'px', true);
63
- _styl( _elemId, 'min-height', _height+'px', true);
63
+ _styl( _elemId, 'left', '0px');
64
+ _styl( _elemId, 'top', '0px');
65
+ _styl( _elemId, 'right', '0px');
66
+ _styl( _elemId, 'bottom', '0px');
67
+ _styl( _elemId, 'width', 'auto');
68
+ _styl( _elemId, 'height', 'auto');
69
+ _styl( _elemId, 'min-width', _width+'px');
70
+ _styl( _elemId, 'min-height', _height+'px');
64
71
 
65
72
  if(_this['markupElemIds']){
66
73
  var _stateId = _this.markupElemIds['state'];
67
- _styl( _stateId, 'left', _left+'px', true );
68
- _styl( _stateId, 'top', '0px', true );
69
- _styl( _stateId, 'width', _width+'px', true );
70
- _styl( _stateId, 'height', _height+'px', true );
74
+ _styl( _stateId, 'left', _left+'px' );
75
+ _styl( _stateId, 'top', _top+'px' );
76
+ _styl( _stateId, 'width', _width+'px' );
77
+ _styl( _stateId, 'height', _height+'px' );
71
78
  }
72
79
  //-- Show the rectangle once it gets created, unless visibility was set to++
73
80
  //-- hidden in the constructor.++
74
81
  if(undefined === _this.isHidden || _this.isHidden === false) {
75
- _styl( _elemId, 'visibility', 'inherit', true);
82
+ _styl( _elemId, 'visibility', 'inherit');
76
83
  }
77
- _styl( _elemId, 'display', 'block', true);
84
+ _styl( _elemId, 'display', 'block');
78
85
  _this._updateZIndex();
79
86
  _this.drawn = true;
80
87
  }
@@ -18,28 +18,28 @@
18
18
  var//RSence.Controls
19
19
  HImageView = HControl.extend({
20
20
 
21
+ getImgSrc: function(){
22
+ var _value = (this.value!==null)?this.value:(this.options.valueObj?this.options.valueObj.value:this.options.value);
23
+ if (!_value){
24
+ _value = this.getThemeGfxPath() + "/blank.gif";
25
+ }
26
+ return _value;
27
+ },
28
+
21
29
  controlDefaults: (HControlDefaults.extend({
22
30
  scaleToFit: true,
23
- value: null,
24
- constructor: function(_ctrl){
25
- if(this.value===null){
26
- // default to a blank image
27
- this.value = _ctrl.getThemeGfxPath() + "/blank.gif";
28
- }
29
- }
31
+ value: null
30
32
  })),
31
33
 
32
34
  _makeScaleToFit: function(_parentId){
33
- var _value = (this.value!==null)?this.value:(this.options.valueObj?this.options.valueObj.value:this.options.value);
34
35
  this.elemId = ELEM.make(_parentId,'img');
35
- ELEM.setAttr(this.elemId,'src',_value);
36
+ ELEM.setAttr(this.elemId,'src',this.getImgSrc());
36
37
  ELEM.setAttr(this.elemId,'alt',this.label);
37
38
  ELEM.setAttr(this.elemId,'title',this.label);
38
39
  },
39
40
  _makeScaleToOriginal: function(_parentId){
40
- var _value = (this.value!==null)?this.value:(this.options.valueObj?this.options.valueObj.value:this.options.value);
41
41
  this.elemId = ELEM.make(_parentId,'div');
42
- ELEM.setStyle(this.elemId,'background-image','url('+_value+')');
42
+ ELEM.setStyle(this.elemId,'background-image','url('+this.getImgSrc()+')');
43
43
  ELEM.setStyle(this.elemId,'background-position','0px 0px');
44
44
  ELEM.setStyle(this.elemId,'background-repeat','no-repeat');
45
45
  ELEM.setAttr(this.elemId,'title',this.label);
@@ -59,10 +59,10 @@ HImageView = HControl.extend({
59
59
  **/
60
60
  refreshValue: function(){
61
61
  if(this.options.scaleToFit){
62
- ELEM.setAttr(this.elemId,'src',this.value);
62
+ ELEM.setAttr(this.elemId,'src',this.getImgSrc());
63
63
  }
64
64
  else{
65
- ELEM.setStyle(this.elemId,'background-image','url('+this.value+')');
65
+ ELEM.setStyle(this.elemId,'background-image','url('+this.getImgSrc()+')');
66
66
  }
67
67
  },
68
68
 
@@ -19,13 +19,13 @@ HProgressIndicator = HView.extend({
19
19
  _indicator: null,
20
20
  _animDirection: 0,
21
21
  drawSubviews: function(){
22
- var _this = this;
22
+ var _this = this,
23
+ _rect = _this.rect,
24
+ _height = _rect.height,
25
+ _width = _rect.width;
26
+ _width -= 2;
23
27
  _this.setStyle( 'border', '1px solid #999' );
24
28
  _this.setStyle( 'background-color', '#ccc' );
25
- var _height = _this.rect.height,
26
- _visibleWidth = ELEM.getVisibleSize( _this.elemId )[0],
27
- _width = (_visibleWidth===0)?_this.rect.width:_visibleWidth;
28
- _width -= 2;
29
29
  _this['_rect'+0] = HRect.nu( 0,0,_height,_height );
30
30
  _this['_rect'+1] = HRect.nu( _width-_height, 0, _width, _height );
31
31
  _this._indicator = HView.nu( HRect.nu( _this['_rect'+0] ), _this );
@@ -36,7 +36,7 @@ HSlider = HControl.extend({
36
36
 
37
37
  defaultEvents: {
38
38
  draggable: true,
39
- keyDown: true,
39
+ keyDown: 'repeat',
40
40
  keyUp: true,
41
41
  mouseWheel: true
42
42
  },
@@ -44,8 +44,6 @@ HSlider = HControl.extend({
44
44
  controlDefaults: (HControlDefaults.extend({
45
45
  minValue: 0,
46
46
  maxValue: 1,
47
- repeatDelay: 300,
48
- repeatInterval: 50,
49
47
  inverseAxis: false
50
48
  })),
51
49
 
@@ -154,12 +152,10 @@ HSlider = HControl.extend({
154
152
  // Arrow keys move the thumb 5% at a time.
155
153
  if ( (_keycode === Event.KEY_LEFT && !this._isVertical) ||
156
154
  (_keycode === Event.KEY_DOWN && this._isVertical) ) {
157
- this._moving = true;
158
155
  this._moveThumb(-0.05);
159
156
  }
160
157
  else if ( (_keycode === Event.KEY_RIGHT && !this._isVertical) ||
161
158
  (_keycode === Event.KEY_UP && this._isVertical) ) {
162
- this._moving = true;
163
159
  this._moveThumb(0.05);
164
160
  }
165
161
  // Home key moves the thumb to the beginning and end key to the end.
@@ -171,15 +167,12 @@ HSlider = HControl.extend({
171
167
  }
172
168
  // Page up and page down keys move the thumb 25% at a time.
173
169
  else if (_keycode === Event.KEY_PAGEDOWN) {
174
- this._moving = true;
175
170
  this._moveThumb(-0.25);
176
171
  }
177
172
  else if (_keycode === Event.KEY_PAGEUP) {
178
- this._moving = true;
179
173
  this._moveThumb(0.25);
180
174
  }
181
-
182
-
175
+ return true;
183
176
  },
184
177
 
185
178
 
@@ -191,7 +184,7 @@ HSlider = HControl.extend({
191
184
  *
192
185
  **/
193
186
  keyUp: function(_keycode) {
194
- this._moving = false;
187
+ return true;
195
188
  },
196
189
 
197
190
 
@@ -223,29 +216,9 @@ HSlider = HControl.extend({
223
216
 
224
217
  // --private method++
225
218
  _moveThumb: function(_valueChange, _rate) {
226
-
227
- if (!_rate) {
228
- // --If the key is held down, wait for a while before starting repeat.++
229
- _rate = this.options.repeatDelay;
230
- }
231
- else if (_rate === this.options.repeatDelay) {
232
- _rate = this.options.repeatInterval;
233
- }
234
-
235
- if (this._moving && this.active) {
236
-
219
+ if (this.active) {
237
220
  var _value = (this.maxValue - this.minValue) * _valueChange;
238
-
239
221
  this.setValue( this.value + _value);
240
-
241
- var _that = this;
242
- if (this._thumbMoveTimeout) {
243
- window.clearTimeout(this._thumbMoveTimeout);
244
- this._thumbMoveTimeout = null;
245
- }
246
- this._thumbMoveTimeout = window.setTimeout(function(){
247
- _that._moveThumb(_valueChange, _rate);
248
- }, _rate);
249
222
  }
250
223
 
251
224
  },