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
File without changes
@@ -0,0 +1,233 @@
1
+ /* RSence
2
+ * Copyright 2010 Riassence Inc.
3
+ * http://riassence.com/
4
+ *
5
+ * You should have received a copy of the GNU General Public License along
6
+ * with this software package. If not, contact licensing@riassence.com
7
+ */
8
+
9
+ /*** = Description
10
+ ** HPropertyListEditor is a subcomponent of HPropertyList that handles
11
+ ** editing of the selected row.
12
+ **
13
+ ***/
14
+ var//RSence.Lists
15
+ HPropertyListEditor = HControl.extend({
16
+
17
+ defaultEvents: {
18
+ keyDown: 'repeat'
19
+ },
20
+
21
+ keyDown: function(chr){
22
+ if(chr===38){
23
+ this.parent.parent.editPrevItem();
24
+ return true;
25
+ }
26
+ else if(chr===40){
27
+ this.parent.parent.editNextItem();
28
+ return true;
29
+ }
30
+ return false;
31
+ },
32
+
33
+ refreshValue: function(){
34
+
35
+ this.base();
36
+
37
+ this.nameEditor.setValue(this.value.name);
38
+
39
+ this.typeEditor && this.typeEditor.setValue( this.value.type );
40
+
41
+ if(this.value.type === 's'){
42
+ this.stringEditor.show();
43
+ this.stringEditor.setValue(this.value.value);
44
+ }
45
+ else{
46
+ this.stringEditor.hide();
47
+ }
48
+
49
+ if(this.value.type === 'n'){
50
+ this.numberEditor.show();
51
+ this.numberEditor.setValue(this.value.value);
52
+ }
53
+ else{
54
+ this.numberEditor.hide();
55
+ }
56
+
57
+ if(this.value.type === 'b'){
58
+ this.boolEditor.show();
59
+ this.boolEditor.setValue(this.value.value);
60
+ }
61
+ else{
62
+ this.boolEditor.hide();
63
+ }
64
+
65
+ this.resizeKeyColumn();
66
+ },
67
+
68
+ lostActiveStatus: function(newActive){
69
+ this.base();
70
+ if( newActive &&
71
+ ( (newActive === this) || (newActive.parents.indexOf(this) !== -1) )
72
+ ){
73
+ return;
74
+ }
75
+ this.hide();
76
+ },
77
+
78
+ resizeKeyColumn: function(){
79
+
80
+ var
81
+ parent = this.parent.parent,
82
+ nameEditor = this.nameEditor;
83
+
84
+ nameEditor.rect.setLeft( this.value.left+6 );
85
+ nameEditor.rect.setRight( parent.keyColumnRight()-3 );
86
+ nameEditor.refresh();
87
+
88
+ var
89
+ stringEditor = this.stringEditor,
90
+ numberEditor = this.numberEditor,
91
+ boolEditor = this.boolEditor;
92
+
93
+ stringEditor.rect.setLeft( parent.valueColumnLeft()+5 );
94
+ numberEditor.rect.setLeft( parent.valueColumnLeft()+4 );
95
+ boolEditor.rect.setLeft( parent.valueColumnLeft()+4 );
96
+
97
+ if(this['typeEditor']){
98
+ var
99
+ typeEditor = this.typeEditor;
100
+
101
+ typeEditor.rect.setLeft( parent.typeColumnLeft()+2 );
102
+ typeEditor.rect.setRight( parent.typeColumnRight()-1 );
103
+ typeEditor.drawRect();
104
+ }
105
+
106
+ stringEditor.drawRect();
107
+ numberEditor.drawRect();
108
+ boolEditor.drawRect();
109
+ },
110
+ nameEditor: null,
111
+ typeEditor: null,
112
+ valueEditor: null,
113
+ drawSubviews: function(){
114
+
115
+ this.setStyle('border-top','1px solid #999');
116
+ this.setStyle('border-bottom','1px solid #999');
117
+
118
+ var
119
+ _stateElemId = ELEM.make( this.elemId );
120
+ this.markupElemIds = { state: _stateElemId };
121
+ ELEM.setCSS( _stateElemId, 'position:absolute;left:0;top:0;right:0;bottom:0;background-color:#fff;' );
122
+ ELEM.setStyle( _stateElemId, 'opacity', 0.8 );
123
+
124
+ var
125
+ parent = this.parent.parent,
126
+ opts = parent.options;
127
+ this.nameEditor = HTextControl.extend({
128
+ boldTypes: ['a','h'],
129
+ lostActiveStatus: function(newActive){
130
+ this.base();
131
+ this.parent.lostActiveStatus(newActive);
132
+ },
133
+ refreshValue: function(){
134
+ if(this.drawn){
135
+ if(this.boldTypes.indexOf(this.parent.value.type)!==-1){
136
+ this.setStyle('font-weight','bold',true);
137
+ }
138
+ else{
139
+ this.setStyle('font-weight','normal',true);
140
+ }
141
+ }
142
+ this.base();
143
+ }
144
+ }).nu(
145
+ [0,-1,1,opts.rowHeight+4],
146
+ this, {
147
+ style: [
148
+ [ 'font-size', '11px' ],
149
+ [ 'text-indent', '1px' ]
150
+ ]
151
+ }
152
+ );
153
+
154
+ var
155
+ height = this.nameEditor.rect.height;
156
+ if(!opts.hideTypeColumn){
157
+ this.typeEditor = HMiniMenu.extend({
158
+ lostActiveStatus: function(newActive){
159
+ this.parent.lostActiveStatus(newActive);
160
+ this.base();
161
+ }
162
+ }).nu(
163
+ [0,1,1,height],
164
+ this, {
165
+ value: 'a',
166
+ menuItemGeom: {
167
+ width: 75,
168
+ left: -15
169
+ }
170
+ }
171
+ );
172
+
173
+ var _arrTypes = [];
174
+
175
+ for( var i in parent.typeNames ){
176
+ _arrTypes.push( [i, parent.typeNames[i]] );
177
+ }
178
+
179
+ this.typeEditor.setListItems( _arrTypes );
180
+
181
+ }
182
+
183
+ this.stringEditor = HTextArea.extend({
184
+ lostActiveStatus: function(newActive){
185
+ this.parent.lostActiveStatus(newActive);
186
+ this.base();
187
+ }
188
+ }).nu(
189
+ [0,-1,null,height,4,null],
190
+ this, {
191
+ style: [
192
+ [ 'font-size', '11px' ],
193
+ [ 'text-indent', '1px' ],
194
+ [ 'padding-top', '3px' ]
195
+ ]
196
+ }
197
+ );
198
+
199
+ this.numberEditor = HNumericTextControl.extend({
200
+ lostActiveStatus: function(newActive){
201
+ this.parent.lostActiveStatus(newActive);
202
+ this.base();
203
+ }
204
+ }).nu(
205
+ [0,-1,null,height,4,null],
206
+ this, {
207
+ style: [
208
+ [ 'font-size', '11px' ],
209
+ [ 'text-indent', '1px' ]
210
+ ]
211
+ }
212
+ );
213
+
214
+ this.boolEditor = HCheckbox.extend({
215
+ lostActiveStatus: function(newActive){
216
+ this.parent.lostActiveStatus(newActive);
217
+ this.base();
218
+ }
219
+ }).nu(
220
+ [0,-3,null,24,4,null],
221
+ this, {
222
+ style: [
223
+ [ 'font-size', '11px' ],
224
+ [ 'text-indent', '1px' ]
225
+ ],
226
+ label: "Enabled"
227
+ }
228
+ );
229
+
230
+ this.resizeKeyColumn();
231
+
232
+ }
233
+ });
@@ -51,17 +51,21 @@ HRadioButtonList = HControl.extend({
51
51
  _listItem = _listItems[i];
52
52
  _value = _listItem[0];
53
53
  _label = _listItem[1];
54
- _radioButton = HRadiobutton.nu(
55
- [ 4, (i*23)+4, null, 23, 4, null ],
56
- this, {
57
- label: _label
58
- }
59
- );
60
- this.listItemViews[i] = _radioButton;
54
+ _component = this.createComponent( i, _label );
55
+ this.listItemViews[i] = _component;
61
56
  }
62
57
  this.refreshValue();
63
58
  },
64
59
 
60
+ createComponent: function( i, _label ){
61
+ return HRadiobutton.nu(
62
+ [ 4, (i*23)+4, null, 23, 4, null ],
63
+ this, {
64
+ label: _label
65
+ }
66
+ );
67
+ },
68
+
65
69
  /** = Description
66
70
  * Destructor. Sets listItems and listItemViews to null and initiates
67
71
  * destructor for radioButtonIndexValue.
@@ -70,7 +74,7 @@ HRadioButtonList = HControl.extend({
70
74
  die: function(){
71
75
  this.listItems = null;
72
76
  this.listItemViews = null;
73
- this.radioButtonIndexValue.die();
77
+ this.radioButtonIndexValue && this.radioButtonIndexValue.die();
74
78
  this.base();
75
79
  },
76
80
  radioButtonIndexValue: false,
@@ -91,6 +95,9 @@ HRadioButtonList = HControl.extend({
91
95
  }
92
96
  }
93
97
  }),
98
+
99
+
100
+
94
101
  refreshValue: function(){
95
102
  var _value = this.value;
96
103
  if ( this.listItems.length !== 0 && this['valueMatrix'] !== undefined ) {
File without changes
@@ -0,0 +1,139 @@
1
+ /* RSence
2
+ * Copyright 2010 Riassence Inc.
3
+ * http://riassence.com/
4
+ *
5
+ * You should have received a copy of the GNU General Public License along
6
+ * with this software package. If not, contact licensing@riassence.com
7
+ */
8
+
9
+
10
+ /*** = Description
11
+ ** Simple small menu component for selecting one value amongst several.
12
+ ** It's limited to 15px height by the default theme.
13
+ ***/
14
+ var//RSence.Menus
15
+ HMiniMenu = HRadioButtonList.extend({
16
+
17
+ componentName: 'minimenu',
18
+
19
+ defaultEvents: {
20
+ draggable: true,
21
+ click: true
22
+ },
23
+
24
+ repositionMenuItems: function(){
25
+ var
26
+ x = this.pageX(),
27
+ y = this.pageY(),
28
+ w = this.rect.width,
29
+ h = this.listItems.length*15,
30
+ i = 0,
31
+ listItem = null;
32
+ for(;i<this.listItems.length && listItem === null;i++){
33
+ if(this.listItems[i][0]===this.value){
34
+ listItem = this.listItems[i];
35
+ }
36
+ }
37
+ y -= (i-1)*15;
38
+ if(y < 0){
39
+ y = y%15;
40
+ }
41
+ if(this.options['menuItemGeom']){
42
+ if(this.options.menuItemGeom.width){
43
+ w += this.options.menuItemGeom.width;
44
+ }
45
+ if(this.options.menuItemGeom.width){
46
+ x += this.options.menuItemGeom.left;
47
+ }
48
+ }
49
+ this.menuItemView.rect.set( x, y, x+w, y+h );
50
+ this.menuItemView.refresh();
51
+ },
52
+
53
+ click: function(){
54
+ this.menuShow();
55
+ },
56
+
57
+ refreshValue: function(){
58
+ this.base();
59
+ for(var i=0;i<this.listItems.length;i++){
60
+ if(this.listItems[i][0]===this.value){
61
+ this.setLabel( this.listItems[i][1] );
62
+ return;
63
+ }
64
+ }
65
+ },
66
+
67
+ menuShow: function(){
68
+ this.repositionMenuItems();
69
+ this.menuItemView.bringToFront();
70
+ this.menuItemView.show();
71
+ return true;
72
+ },
73
+
74
+ menuHide: function(){
75
+ this.menuItemView.sendToBack();
76
+ this.menuItemView.hide();
77
+ },
78
+
79
+ startDrag: function(x,y){
80
+ this.dragStart = [x,y];
81
+ this.menuShow();
82
+ },
83
+
84
+ lostActiveStatus: function(newActive){
85
+ this.menuHide();
86
+ },
87
+
88
+ endDrag: function(x,y){
89
+ if( (Math.round(this.dragStart[0]*0.2)===Math.round(x*0.2)) &&
90
+ (Math.round(this.dragStart[1]*0.2)===Math.round(y*0.2))
91
+ ){
92
+ this.menuShow();
93
+ }
94
+ else {
95
+ this.menuHide();
96
+ }
97
+ },
98
+
99
+ die: function(){
100
+ this.menuItemView.die();
101
+ this.base();
102
+ },
103
+
104
+ drawSubviews: function(){
105
+ this.markupElemIds.subview = 0;
106
+ this.menuItemView = HView.extend({
107
+ bringToFront: function(){
108
+ this.setStyle('z-index',10000);//this.app.views.length);
109
+ }
110
+ }).nu(
111
+ [ this.rect.left, this.rect.top, this.rect.width, 500 ],
112
+ this, {
113
+ visible: false,
114
+ style: [
115
+ ['background-color','#f6f6f6'],
116
+ ['border', '1px solid #999'],
117
+ ['overflow-y', 'auto'],
118
+ ['opacity', 0.9]
119
+ ]
120
+ }
121
+ );
122
+ },
123
+
124
+ setListItems: function(listItems){
125
+ this.base(listItems);
126
+ this.valueMatrix = this.menuItemView.valueMatrix;
127
+ this.refreshValue();
128
+ },
129
+
130
+ createComponent: function( i, _label ){
131
+ return HMiniMenuItem.nu(
132
+ [ 0, (i*15), null, 15, 0, null ],
133
+ this.menuItemView, {
134
+ label: _label
135
+ }
136
+ );
137
+ }
138
+
139
+ });
File without changes
@@ -0,0 +1,33 @@
1
+ /* RSence
2
+ * Copyright 2010 Riassence Inc.
3
+ * http://riassence.com/
4
+ *
5
+ * You should have received a copy of the GNU General Public License along
6
+ * with this software package. If not, contact licensing@riassence.com
7
+ */
8
+
9
+
10
+ /*** = Description
11
+ ** Menu item for the HMiniMenu component.
12
+ ***/
13
+ var//RSence.Menus
14
+ HMiniMenuItem = HRadioButton.extend({
15
+
16
+ componentName: 'minimenuitem',
17
+
18
+ defaultEvents: {
19
+ click: true,
20
+ mouseUp: true
21
+ },
22
+
23
+ click: function(){
24
+ this.base();
25
+ EVENT.changeActiveControl(this.parent.parent);
26
+ },
27
+
28
+ mouseUp: function(){
29
+ this.base();
30
+ this.click();
31
+ }
32
+
33
+ });