rsence 2.1.11 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL.rdoc +5 -3
- data/README.rdoc +23 -22
- data/VERSION +1 -1
- data/conf/default_conf.yaml +65 -29
- data/conf/rsence_command_strings.yaml +101 -71
- data/js/comm/autosync/autosync.js +3 -3
- data/js/comm/jsloader/jsloader.js +16 -3
- data/js/comm/queue/queue.js +1 -1
- data/js/comm/transporter/transporter.js +106 -83
- data/js/comm/values/values.js +8 -2
- data/js/controls/button/button.js +9 -4
- data/js/controls/button/themes/default/button.css +1 -1
- data/js/controls/checkbox/themes/default/checkbox.css +1 -1
- data/js/controls/dialogs/sheet/sheet.js +27 -18
- data/js/controls/radiobutton/themes/default/radiobutton.css +1 -1
- data/js/controls/searchfield/searchfield.coffee +2 -0
- data/js/controls/searchfield/themes/default/searchfield.css +96 -0
- data/js/controls/searchfield/themes/default/searchfield.html +12 -0
- data/js/controls/searchfield/themes/default/searchfield_parts1-ie6.gif +0 -0
- data/js/controls/searchfield/themes/default/searchfield_parts1.png +0 -0
- data/js/controls/sliders/slider/slider.js +7 -1
- data/js/controls/stepper/stepper.js +6 -1
- data/js/controls/stringview/stringview.js +50 -39
- data/js/controls/tab/tab.js +103 -7
- data/js/controls/tab/themes/default/tab.css +2 -0
- data/js/controls/textarea/themes/default/textarea.css +4 -0
- data/js/controls/textcontrol/textcontrol.js +32 -2
- data/js/controls/textcontrol/themes/default/textcontrol.css +17 -2
- data/js/controls/uploader/themes/default/uploader.css +3 -3
- data/js/controls/uploader/themes/default/uploader.html +1 -1
- data/js/controls/uploader/uploader.coffee +110 -0
- data/js/controls/window/themes/default/window.css +28 -5
- data/js/controls/window/themes/default/window.html +2 -0
- data/js/controls/window/window.js +5 -1
- data/js/core/class/class.js +22 -4
- data/js/core/elem/elem.coffee +816 -0
- data/js/core/event/event.js +2 -2
- data/js/core/rsence_ns/rsence_ns.coffee +31 -0
- data/js/core/rsence_ns/rsence_ns.js +6 -6
- data/js/datetime/calendar/calendar.coffee +307 -0
- data/js/datetime/calendar/themes/default/calendar.css +90 -9
- data/js/datetime/calendar/themes/default/calendar.html +11 -0
- data/js/datetime/calendar/themes/default/calendar_bg-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_bg.png +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts1-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts1.png +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts2-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts2.png +0 -0
- data/js/datetime/datetimepicker/datetimepicker.js +217 -0
- data/js/datetime/datetimevalue/datetimevalue.js +22 -5
- data/js/datetime/timesheet/themes/default/timesheet.css +51 -22
- data/js/datetime/timesheet/themes/default/timesheet.html +4 -2
- data/js/datetime/timesheet/timesheet.js +782 -192
- data/js/datetime/timesheet_item/themes/default/timesheet_item.css +42 -11
- data/js/datetime/timesheet_item/themes/default/timesheet_item.html +4 -2
- data/js/datetime/timesheet_item/themes/default/timesheet_item_icons.png +0 -0
- data/js/datetime/timesheet_item/timesheet_item.js +158 -254
- data/js/datetime/timesheet_item_edit/timesheet_item_edit.js +0 -274
- data/js/foundation/application/application.js +52 -9
- data/js/foundation/control/eventresponder/eventresponder.js +7 -4
- data/js/foundation/control/valueaction/valueaction.js +71 -0
- data/js/foundation/eventmanager/eventmanager.js +71 -33
- data/js/foundation/geom/rect/rect.js +39 -7
- data/js/foundation/json_renderer/json_renderer.js +278 -62
- data/js/foundation/locale_settings/locale_settings.js +131 -0
- data/js/foundation/system/system.js +40 -13
- data/js/foundation/thememanager/thememanager.js +21 -0
- data/js/foundation/view/markupview/markupview.js +12 -12
- data/js/foundation/view/view.js +221 -27
- data/js/graphics/svgcontrol/svgcontrol.js +400 -0
- data/js/lists/checkboxlist/checkboxlist.js +18 -7
- data/js/lists/listitems/listitems.js +52 -38
- data/js/lists/radiobuttonlist/radiobuttonlist.js +23 -7
- data/js/menus/menuitem/menuitem.js +5 -0
- data/js/menus/menuitem/themes/default/menuitem.css +45 -0
- data/js/menus/menuitem/themes/default/menuitem.html +4 -0
- data/js/menus/minimenu/minimenu.js +47 -16
- data/js/menus/minimenuitem/minimenuitem.js +62 -0
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem.css +2 -2
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem.html +0 -0
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem_checkmark.png +0 -0
- data/js/menus/popupmenu/popupmenu.js +14 -0
- data/js/menus/popupmenu/themes/default/popupmenu.css +65 -0
- data/js/menus/popupmenu/themes/default/popupmenu.html +7 -0
- data/js/menus/popupmenu/themes/default/popupmenu.png +0 -0
- data/js/no_pkg/no_pkg.js +2 -0
- data/js/util/reloadapp/reloadapp.js +1 -1
- data/js/views/scrollview/scrollview.js +6 -0
- data/lib/rsence.rb +136 -3
- data/lib/rsence/argv.rb +218 -0
- data/lib/rsence/argv/argv_util.rb +58 -0
- data/lib/rsence/argv/env_check.rb +58 -0
- data/lib/rsence/argv/help_argv.rb +15 -0
- data/lib/rsence/argv/initenv_argv.rb +218 -0
- data/lib/rsence/argv/save_argv.rb +92 -0
- data/lib/rsence/argv/startup_argv.rb +118 -0
- data/lib/rsence/argv/status_argv.rb +132 -0
- data/lib/rsence/argv/test_port.rb +32 -0
- data/lib/{daemon → rsence}/daemon.rb +67 -23
- data/lib/{conf/default.rb → rsence/default_config.rb} +18 -10
- data/lib/{plugins → rsence}/dependencies.rb +0 -0
- data/lib/{util → rsence}/gzstring.rb +0 -0
- data/lib/rsence/http.rb +3 -0
- data/lib/{http → rsence/http}/broker.rb +106 -19
- data/lib/{http → rsence/http}/rackup.rb +0 -0
- data/lib/{http → rsence/http}/request.rb +0 -4
- data/lib/{http → rsence/http}/response.rb +0 -1
- data/lib/{session → rsence}/msg.rb +17 -1
- data/lib/{plugins → rsence}/pluginmanager.rb +29 -12
- data/lib/{plugins → rsence}/plugins.rb +7 -7
- data/lib/{plugins → rsence/plugins}/gui_plugin.rb +8 -3
- data/lib/{plugins → rsence/plugins}/guiparser.rb +9 -6
- data/lib/{plugins → rsence/plugins}/plugin.rb +23 -4
- data/lib/{plugins → rsence/plugins}/plugin_base.rb +11 -1
- data/lib/{plugins → rsence/plugins}/plugin_plugins.rb +2 -2
- data/lib/{plugins → rsence/plugins}/plugin_sqlite_db.rb +0 -0
- data/lib/{plugins → rsence/plugins}/servlet.rb +0 -0
- data/lib/{session → rsence}/sessionmanager.rb +101 -39
- data/lib/{session → rsence}/sessionstorage.rb +30 -16
- data/lib/{daemon → rsence}/sigcomm.rb +0 -0
- data/lib/{transporter → rsence}/transporter.rb +13 -11
- data/lib/{values/hvalue.rb → rsence/value.rb} +6 -1
- data/lib/{values → rsence}/valuemanager.rb +1 -1
- data/plugins/client_pkg/client_pkg.rb +14 -4
- data/plugins/client_pkg/info.yaml +2 -2
- data/plugins/client_pkg/lib/client_pkg_build.rb +145 -45
- data/plugins/client_pkg/lib/client_pkg_cache.rb +1 -1
- data/plugins/client_pkg/lib/client_pkg_serve.rb +1 -1
- data/plugins/main/main.rb +43 -3
- data/plugins/main/tmpl/index.html +2 -10
- data/plugins/main/values.yaml +3 -1
- data/plugins/ticket/lib/common.rb +6 -3
- data/plugins/ticket/ticket.rb +11 -3
- metadata +144 -174
- data/js/comm/autosync/js.inc +0 -0
- data/js/comm/js.inc +0 -0
- data/js/comm/jsloader/js.inc +0 -0
- data/js/comm/queue/js.inc +0 -0
- data/js/comm/session/js.inc +0 -0
- data/js/comm/sessionwatcher/js.inc +0 -0
- data/js/comm/transporter/js.inc +0 -0
- data/js/comm/urlresponder/js.inc +0 -0
- data/js/comm/values/js.inc +0 -0
- data/js/controls/button/js.inc +0 -0
- data/js/controls/checkbox/js.inc +0 -0
- data/js/controls/dialogs/alert_sheet/js.inc +0 -0
- data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
- data/js/controls/dialogs/sheet/js.inc +0 -0
- data/js/controls/imageview/js.inc +0 -0
- data/js/controls/passwordcontrol/js.inc +0 -0
- data/js/controls/progress/progressbar/js.inc +0 -0
- data/js/controls/progress/progressindicator/js.inc +0 -0
- data/js/controls/radiobutton/js.inc +0 -0
- data/js/controls/sliders/slider/js.inc +0 -0
- data/js/controls/sliders/vslider/js.inc +0 -0
- data/js/controls/stepper/js.inc +0 -0
- data/js/controls/stringview/js.inc +0 -0
- data/js/controls/tab/js.inc +0 -0
- data/js/controls/textarea/js.inc +0 -0
- data/js/controls/textcontrol/js.inc +0 -0
- data/js/controls/uploader/js.inc +0 -0
- data/js/controls/uploader/uploader.js +0 -154
- data/js/controls/validatorview/js.inc +0 -0
- data/js/controls/window/js.inc +0 -0
- data/js/core/class/js.inc +0 -0
- data/js/core/elem/elem.js +0 -1325
- data/js/core/elem/js.inc +0 -0
- data/js/core/event/js.inc +0 -0
- data/js/core/iefix/js.inc +0 -0
- data/js/core/rsence_ns/js.inc +0 -0
- data/js/datetime/calendar/calendar.js +0 -198
- data/js/datetime/calendar/js.inc +0 -0
- data/js/datetime/datetimevalue/js.inc +0 -0
- data/js/datetime/timesheet/js.inc +0 -0
- data/js/datetime/timesheet/old_timesheet.js +0 -292
- data/js/datetime/timesheet/themes/default/old_timesheet.css +0 -30
- data/js/datetime/timesheet/themes/default/old_timesheet.html +0 -2
- data/js/datetime/timesheet_item/js.inc +0 -0
- data/js/datetime/timesheet_item/old_timesheet_item.js +0 -308
- data/js/datetime/timesheet_item/themes/default/old_timesheet_item.css +0 -42
- data/js/datetime/timesheet_item/themes/default/old_timesheet_item.html +0 -8
- data/js/datetime/timesheet_item_edit/js.inc +0 -0
- data/js/datetime/timesheet_item_edit/old_timesheet_item_edit.js +0 -274
- data/js/foundation/application/js.inc +0 -0
- data/js/foundation/control/controldefaults/js.inc +0 -0
- data/js/foundation/control/dummyvalue/js.inc +0 -0
- data/js/foundation/control/dyncontrol/js.inc +0 -0
- data/js/foundation/control/eventresponder/js.inc +0 -0
- data/js/foundation/control/js.inc +0 -0
- data/js/foundation/control/valuematrix/js.inc +0 -0
- data/js/foundation/control/valueresponder/js.inc +0 -0
- data/js/foundation/eventmanager/js.inc +0 -0
- data/js/foundation/geom/point/js.inc +0 -0
- data/js/foundation/geom/rect/js.inc +0 -0
- data/js/foundation/json_renderer/js.inc +0 -0
- data/js/foundation/system/js.inc +0 -0
- data/js/foundation/thememanager/js.inc +0 -0
- data/js/foundation/value/js.inc +0 -0
- data/js/foundation/view/js.inc +0 -0
- data/js/foundation/view/markupview/js.inc +0 -0
- data/js/foundation/view/morphanimation/js.inc +0 -0
- data/js/foundation/view/viewdefaults/js.inc +0 -0
- data/js/lists/checkboxlist/js.inc +0 -0
- data/js/lists/listitems/js.inc +0 -0
- data/js/lists/propertylist/js.inc +0 -0
- data/js/lists/propertylist/propertylisteditor/js.inc +0 -0
- data/js/lists/radiobuttonlist/js.inc +0 -0
- data/js/menus/minimenu/js.inc +0 -0
- data/js/menus/minimenu/minimenuitem/js.inc +0 -0
- data/js/menus/minimenu/minimenuitem/minimenuitem.js +0 -33
- data/js/util/reloadapp/js.inc +0 -0
- data/js/util/sha/js.inc +0 -0
- data/js/views/centerview/js.inc +0 -0
- data/js/views/inlineview/js.inc +0 -0
- data/js/views/scrollview/js.inc +0 -0
- data/lib/conf/argv.rb +0 -880
@@ -1,274 +0,0 @@
|
|
1
|
-
/* RSence
|
2
|
-
* Copyright 2009 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
|
-
** Editor control for HTimeSheet. Editor can access the HTimeSheetItems
|
11
|
-
** on HTimeSheet.
|
12
|
-
***/
|
13
|
-
var//RSence.DateTime
|
14
|
-
HTimeSheetEditor = HControl.extend({
|
15
|
-
timeSheetItem: false,
|
16
|
-
createId: 0,
|
17
|
-
|
18
|
-
/** = Description
|
19
|
-
* Selects a HTimeSheetItem to edit.
|
20
|
-
*
|
21
|
-
* = Parameters
|
22
|
-
* +_timeSheetItem+:: A HTimeSheetItem to edit.
|
23
|
-
*
|
24
|
-
**/
|
25
|
-
setTimeSheetItem: function(_timeSheetItem){
|
26
|
-
this.timeSheetItem = _timeSheetItem;
|
27
|
-
this.textField.setValue( _timeSheetItem.label );
|
28
|
-
},
|
29
|
-
|
30
|
-
/** = Description
|
31
|
-
* Opens HTimeSheetEditor for the selected HTimeSheetItem.
|
32
|
-
*
|
33
|
-
**/
|
34
|
-
show: function(){
|
35
|
-
if(this.timeSheetItem!==false){
|
36
|
-
var _newRect = HRect.nu(this.timeSheetItem.rect);
|
37
|
-
if(_newRect.height < 40){
|
38
|
-
_newRect.setHeight( 40 );
|
39
|
-
}
|
40
|
-
if(_newRect.width < 200){
|
41
|
-
_newRect.setWidth( 200 );
|
42
|
-
}
|
43
|
-
var _timeSheetItemParentRect = this.timeSheetItem.parent.rect;
|
44
|
-
_newRect.offsetBy( _timeSheetItemParentRect.left, _timeSheetItemParentRect.top );
|
45
|
-
this.setRect( _newRect );
|
46
|
-
this.drawRect();
|
47
|
-
}
|
48
|
-
this.base();
|
49
|
-
},
|
50
|
-
|
51
|
-
/** = Description
|
52
|
-
* Hides the HTimeSheetEditor.
|
53
|
-
*
|
54
|
-
**/
|
55
|
-
hide: function(){
|
56
|
-
this.base();
|
57
|
-
},
|
58
|
-
origParent: null,
|
59
|
-
|
60
|
-
/** = Description
|
61
|
-
* Creates a new item.
|
62
|
-
*
|
63
|
-
* = Parameters
|
64
|
-
* +_properties+:: Properties for the new item.
|
65
|
-
*
|
66
|
-
**/
|
67
|
-
createItem: function( _properties ){
|
68
|
-
if(_properties['id'] === undefined){
|
69
|
-
this.createId--;
|
70
|
-
_properties['id'] = this.createId;
|
71
|
-
}
|
72
|
-
var _value = COMM.Values.clone( this.value ),
|
73
|
-
_create = _value['create'],
|
74
|
-
i = 0,
|
75
|
-
_item = false;
|
76
|
-
for(;i<_create.length;i++){
|
77
|
-
if(_create[i]['id'] === _properties['id']){
|
78
|
-
_item = _create[i];
|
79
|
-
break;
|
80
|
-
}
|
81
|
-
}
|
82
|
-
if(!_item){
|
83
|
-
_create.push( _properties );
|
84
|
-
}
|
85
|
-
else {
|
86
|
-
for( var _key in _properties ){
|
87
|
-
_item[_key] = _properties[_key];
|
88
|
-
}
|
89
|
-
}
|
90
|
-
this.setValue( _value );
|
91
|
-
},
|
92
|
-
|
93
|
-
/** = Description
|
94
|
-
* Modifies an item.
|
95
|
-
*
|
96
|
-
* = Parameters
|
97
|
-
* +_properties+:: Properties to change.
|
98
|
-
*
|
99
|
-
**/
|
100
|
-
modifyItem: function( _properties ){
|
101
|
-
if(_properties['id'] < 0){
|
102
|
-
this.createItem( _properties );
|
103
|
-
}
|
104
|
-
else {
|
105
|
-
var _value = COMM.Values.clone( this.value ),
|
106
|
-
_modify = _value['modify'],
|
107
|
-
i = 0,
|
108
|
-
_item = false;
|
109
|
-
for(;i<_modify.length;i++){
|
110
|
-
if(_modify[i]['id'] === _properties['id']){
|
111
|
-
_item = _modify[i];
|
112
|
-
break;
|
113
|
-
}
|
114
|
-
}
|
115
|
-
if(!_item){
|
116
|
-
_modify.push( _properties );
|
117
|
-
}
|
118
|
-
else {
|
119
|
-
for( var _key in _properties ){
|
120
|
-
_item[_key] = _properties[_key];
|
121
|
-
}
|
122
|
-
}
|
123
|
-
this.setValue( _value );
|
124
|
-
}
|
125
|
-
},
|
126
|
-
|
127
|
-
/** = Description
|
128
|
-
* Deletes an item with id given as parameter.
|
129
|
-
*
|
130
|
-
* = Parameters
|
131
|
-
* +_itemId+:: Id of an item to be deleted.
|
132
|
-
*
|
133
|
-
**/
|
134
|
-
deleteItem: function( _itemId ){
|
135
|
-
var _value = COMM.Values.clone( this.value );
|
136
|
-
if(_value['delete'].indexOf( _itemId ) === -1){
|
137
|
-
_value['delete'].push( _itemId );
|
138
|
-
this.setValue( _value );
|
139
|
-
}
|
140
|
-
},
|
141
|
-
|
142
|
-
/** = Description
|
143
|
-
* Refreshes the values by iterating through value['response'] and checking
|
144
|
-
* the new values from the response array.
|
145
|
-
*
|
146
|
-
**/
|
147
|
-
refreshValue: function(){
|
148
|
-
var _value = COMM.Values.clone( this.value ),
|
149
|
-
i = 0,
|
150
|
-
_parent = this.origParent?this.origParent:this.parent,
|
151
|
-
_listItemViews = _parent.listItemViews,
|
152
|
-
_response = _value['response'],
|
153
|
-
_item,
|
154
|
-
_itemValue,
|
155
|
-
_responseItem,
|
156
|
-
j, k;
|
157
|
-
for( ; i < _response.length; i++ ){
|
158
|
-
for( j = 0; j < _listItemViews.length; j++ ){
|
159
|
-
_responseItem = _response[i];
|
160
|
-
_item = _listItemViews[j];
|
161
|
-
if( _item.value['id'] === _responseItem['id'] ){
|
162
|
-
_itemValue = COMM.Values.clone( _item.value );
|
163
|
-
if(_responseItem['modify'] !== undefined){
|
164
|
-
for( k in _responseItem['modify'] ){
|
165
|
-
_itemValue[k] = _responseItem['modify'][k];
|
166
|
-
}
|
167
|
-
_item.setValue( _itemValue );
|
168
|
-
}
|
169
|
-
}
|
170
|
-
}
|
171
|
-
}
|
172
|
-
_value['response'] = [];
|
173
|
-
this.setValue( _value );
|
174
|
-
},
|
175
|
-
|
176
|
-
/** = Description
|
177
|
-
* Draws ok, delete and cancel buttons.
|
178
|
-
*
|
179
|
-
**/
|
180
|
-
drawSubviews: function(){
|
181
|
-
this.origParent = this.parent;
|
182
|
-
this.remove();
|
183
|
-
this.origParent.parent.addView( this );
|
184
|
-
ELEM.append( this.elemId, this.parent.elemId );
|
185
|
-
this.textField = HTextArea.nu(
|
186
|
-
[0,0,null,20,0,26],
|
187
|
-
this, {
|
188
|
-
value: ''
|
189
|
-
}
|
190
|
-
);
|
191
|
-
this.delButton = HButton.extend({
|
192
|
-
|
193
|
-
/** = Description
|
194
|
-
* Click function for delete button. Will call delete function on click
|
195
|
-
* for the current item.
|
196
|
-
*
|
197
|
-
**/
|
198
|
-
click: function(){
|
199
|
-
this.parent.hide();
|
200
|
-
var _sheetItem = this.parent.timeSheetItem;
|
201
|
-
if(_sheetItem!==false){
|
202
|
-
this.parent.deleteItem( _sheetItem.value['id'] );
|
203
|
-
_sheetItem.die();
|
204
|
-
var _parent = this.parent.origParent?this.parent.origParent:this.parent.parent;
|
205
|
-
var _sheetIdx = _parent.listItemViews.indexOf( _sheetItem );
|
206
|
-
_parent.listItemViews.splice( _sheetIdx, 1 );
|
207
|
-
this.parent.timeSheetItem = false;
|
208
|
-
}
|
209
|
-
}
|
210
|
-
}).nu(
|
211
|
-
[2,null,60,24,null,0],
|
212
|
-
this, {
|
213
|
-
label: 'Delete',
|
214
|
-
events: {
|
215
|
-
click: true
|
216
|
-
}
|
217
|
-
}
|
218
|
-
);
|
219
|
-
this.okButton = HButton.extend({
|
220
|
-
|
221
|
-
/** = Description
|
222
|
-
* Click function for okButton will ok the modifications for the current item.
|
223
|
-
*
|
224
|
-
**/
|
225
|
-
click: function(){
|
226
|
-
this.parent.hide();
|
227
|
-
if(this.parent.timeSheetItem!==false){
|
228
|
-
var _label = this.parent.textField.getTextFieldValue(),
|
229
|
-
_id = this.parent.timeSheetItem.value['id'],
|
230
|
-
_data = this.parent.timeSheetItem.value;
|
231
|
-
_data['label'] = _label;
|
232
|
-
this.parent.modifyItem( _data );
|
233
|
-
this.parent.timeSheetItem.setTimeSheetItemLabel( _label );
|
234
|
-
this.parent.timeSheetItem = false;
|
235
|
-
}
|
236
|
-
}
|
237
|
-
}).nu(
|
238
|
-
[null,null,60,24,2,0],
|
239
|
-
this, {
|
240
|
-
label: 'Save',
|
241
|
-
events: {
|
242
|
-
click: true
|
243
|
-
}
|
244
|
-
}
|
245
|
-
);
|
246
|
-
this.cancelButton = HButton.extend({
|
247
|
-
/** = Description
|
248
|
-
* Click function for cancel button will cancel
|
249
|
-
* the modifications for the current item.
|
250
|
-
*
|
251
|
-
**/
|
252
|
-
click: function(){
|
253
|
-
this.parent.hide();
|
254
|
-
if(this.timeSheetItem!==false){
|
255
|
-
this.parent.timeSheetItem = false;
|
256
|
-
}
|
257
|
-
}
|
258
|
-
}).nu(
|
259
|
-
[null,null,60,24,66,0],
|
260
|
-
this, {
|
261
|
-
label: 'Cancel',
|
262
|
-
events: {
|
263
|
-
click: true
|
264
|
-
}
|
265
|
-
}
|
266
|
-
);
|
267
|
-
this.textField.setStyle('text-align','center');
|
268
|
-
this.textField.setStyle('line-height','12px');
|
269
|
-
this.textField.setStyle('font-size','12px');
|
270
|
-
this.textField.setStyle('font-family','Arial, sans-serif');
|
271
|
-
this.origParent.setEditor( this );
|
272
|
-
}
|
273
|
-
});
|
274
|
-
|
@@ -94,7 +94,7 @@ HApplication = HClass.extend({
|
|
94
94
|
/** = Description
|
95
95
|
* Adds a view to the app, +HView+ defines an indentical structure for subviews.
|
96
96
|
*
|
97
|
-
* Called from inside the +HView+ constructor and should be automatic for all
|
97
|
+
* Called from inside the +HView+ constructor and should be automatic for all
|
98
98
|
* components that accept the +_parent+ parameter, usually the second argument,
|
99
99
|
* after the +HRect+ instance.
|
100
100
|
*
|
@@ -129,7 +129,24 @@ HApplication = HClass.extend({
|
|
129
129
|
*
|
130
130
|
**/
|
131
131
|
removeView: function(_viewId){
|
132
|
-
|
132
|
+
if( typeof _viewId === 'object' ){
|
133
|
+
console.log('warning, viewId not a number:',_viewId,', trying to call its remove method directly..');
|
134
|
+
_viewId.remove();
|
135
|
+
return this;
|
136
|
+
}
|
137
|
+
var
|
138
|
+
_view = HSystem.views[_viewId];
|
139
|
+
if( _view ){
|
140
|
+
if( _view['remove'] ){
|
141
|
+
HSystem.views[_viewId].remove();
|
142
|
+
}
|
143
|
+
else {
|
144
|
+
console.log('view does not have method "remove":',_view);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
else {
|
148
|
+
console.log('tried to remove non-existent viewId:'+_viewId);
|
149
|
+
}
|
133
150
|
},
|
134
151
|
|
135
152
|
/** = Description
|
@@ -166,21 +183,45 @@ HApplication = HClass.extend({
|
|
166
183
|
**/
|
167
184
|
destroyAllViews: function(){
|
168
185
|
for(var i = 0; i < this.views.length; i++) {
|
169
|
-
|
186
|
+
try{
|
187
|
+
HSystem.views[this.views[i]].die();
|
188
|
+
}
|
189
|
+
catch(e){
|
190
|
+
console.log('unable to destroy:',this.views[i]);
|
191
|
+
}
|
170
192
|
}
|
171
193
|
},
|
172
194
|
|
195
|
+
renice: function(_priority){
|
196
|
+
HSystem.reniceApp(this.appId,_priority);
|
197
|
+
},
|
173
198
|
|
174
199
|
/* Calls the idle method of each view. Don't extend this method. */
|
175
200
|
_pollViews: function(){
|
176
|
-
|
177
|
-
|
178
|
-
|
201
|
+
this._pollViewsRecurse( this.views );
|
202
|
+
},
|
203
|
+
_pollViewsRecurse: function( _views ){
|
204
|
+
var i = 0, _viewId, _view, _pollViews = [];
|
205
|
+
for( ; i < _views.length;i++){
|
206
|
+
_viewId = _views[i];
|
179
207
|
_view = HSystem.views[_viewId];
|
180
|
-
if(
|
181
|
-
_view
|
208
|
+
if( _view !== undefined && _view !== null && typeof _view === 'object' ){
|
209
|
+
if( _view['idle'] !== undefined && typeof _view['idle'] === 'function' ){
|
210
|
+
_view.idle();
|
211
|
+
}
|
212
|
+
if( _view['onIdle'] !== undefined && typeof _view['onIdle'] === 'function' ){
|
213
|
+
_view.onIdle();
|
214
|
+
}
|
215
|
+
if( _view['hasAncestor'] !== undefined && typeof _view.hasAncestor === 'function' && _view.hasAncestor( HView ) ) {
|
216
|
+
if( _view.views && _view.views instanceof Array ){
|
217
|
+
_pollViews.push( _view.views );
|
218
|
+
}
|
219
|
+
}
|
182
220
|
}
|
183
221
|
}
|
222
|
+
while( _pollViews.length > 0 ){
|
223
|
+
this._pollViewsRecurse( _pollViews.shift() );
|
224
|
+
}
|
184
225
|
},
|
185
226
|
|
186
227
|
/** Gets called by +HSystem+. It makes +onIdle+ extensions more failure
|
@@ -191,6 +232,7 @@ HApplication = HClass.extend({
|
|
191
232
|
HSystem.busyApps[ _this.appId ] = true;
|
192
233
|
this._busyTimer = setTimeout(
|
193
234
|
function(){
|
235
|
+
_this.idle();
|
194
236
|
_this.onIdle();
|
195
237
|
_this._pollViews();
|
196
238
|
HSystem.busyApps[ _this.appId ] = false;
|
@@ -209,6 +251,7 @@ HApplication = HClass.extend({
|
|
209
251
|
**/
|
210
252
|
onIdle: function(){
|
211
253
|
/* Your code here */
|
212
|
-
}
|
254
|
+
},
|
255
|
+
idle: function(){}
|
213
256
|
});
|
214
257
|
HApplication.implement(HValueResponder.nu());
|
@@ -503,15 +503,18 @@ HEventResponder = HClass.extend({
|
|
503
503
|
*
|
504
504
|
**/
|
505
505
|
lostActiveStatus: function(_newActiveControl) {
|
506
|
-
|
506
|
+
return true;
|
507
507
|
},
|
508
508
|
|
509
509
|
// --A low-level handler for lost active status, don't extend this.++
|
510
510
|
_lostActiveStatus: function(_newActiveControl) {
|
511
|
-
if(this.
|
512
|
-
|
511
|
+
if( this.lostActiveStatus(_newActiveControl) !== false ){
|
512
|
+
if(this.enabled) {
|
513
|
+
this.toggleCSSClass(this.elemId, HControl.CSS_ACTIVE, false);
|
514
|
+
}
|
515
|
+
return true;
|
513
516
|
}
|
514
|
-
|
517
|
+
return false;
|
515
518
|
},
|
516
519
|
|
517
520
|
|
@@ -0,0 +1,71 @@
|
|
1
|
+
/* RSence
|
2
|
+
* Copyright 2011 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
|
+
var
|
10
|
+
HValueAction = HClass.extend({
|
11
|
+
constructor: function( _rect, _parent, _options ){
|
12
|
+
this.parent = _parent;
|
13
|
+
this.options = _options;
|
14
|
+
if( _options.value ){
|
15
|
+
this.value = _options.value;
|
16
|
+
}
|
17
|
+
if( _options.valueObj ){
|
18
|
+
_options.valueObj.bind( this );
|
19
|
+
}
|
20
|
+
if( this.parent.addView instanceof Function ){
|
21
|
+
this.viewId = this.parent.addView( this );
|
22
|
+
}
|
23
|
+
this.refresh();
|
24
|
+
},
|
25
|
+
remove: function(){
|
26
|
+
if( this.parent ) {
|
27
|
+
var _viewZIdx = this.parent.viewsZOrder.indexOf(this.viewId),
|
28
|
+
_viewPIdx = this.parent.views.indexOf(this.viewId);
|
29
|
+
this.parent.views.splice(_viewPIdx,1);
|
30
|
+
HSystem.delView(this.viewId);
|
31
|
+
this.parent.viewsZOrder.splice( _viewZIdx, 1 );
|
32
|
+
var _sysUpdateZIndexOfChildrenBufferIndex = HSystem._updateZIndexOfChildrenBuffer.indexOf( this.viewId );
|
33
|
+
if(_sysUpdateZIndexOfChildrenBufferIndex !== -1){
|
34
|
+
HSystem._updateZIndexOfChildrenBuffer.splice( _sysUpdateZIndexOfChildrenBufferIndex, 1 );
|
35
|
+
}
|
36
|
+
this.parent = null;
|
37
|
+
this.parents = [];
|
38
|
+
}
|
39
|
+
return this;
|
40
|
+
},
|
41
|
+
die: function(){
|
42
|
+
this.parent.removeView( this.viewId );
|
43
|
+
if( this.valueObj ){
|
44
|
+
this.valueObj.release( this );
|
45
|
+
}
|
46
|
+
this.value = null;
|
47
|
+
this.viewId = null;
|
48
|
+
},
|
49
|
+
refresh: function(){
|
50
|
+
if( this.options.refreshAction || this.options.action ){
|
51
|
+
var
|
52
|
+
_refreshAction = this.options.refreshAction ? this.options.refreshAction : this.options.action;
|
53
|
+
if( this.parent ){
|
54
|
+
if( this.parent[_refreshAction] ){
|
55
|
+
if( (this.parent[_refreshAction] instanceof Function) ){
|
56
|
+
this.parent[_refreshAction]( this.value );
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
this.parent[_refreshAction] = this.value;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
},
|
65
|
+
onIdle: function(){
|
66
|
+
|
67
|
+
}
|
68
|
+
});
|
69
|
+
|
70
|
+
HValueAction.implement( HValueResponder );
|
71
|
+
|