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
@@ -27,6 +27,13 @@ var//RSence.Lists
|
|
27
27
|
HListItems = HValueResponder.extend({
|
28
28
|
|
29
29
|
constructor: function( _rect, _parent, _options ){
|
30
|
+
if( _rect.hasAncestor && _rect.hasAncestor( HView ) ){
|
31
|
+
_options = _parent;
|
32
|
+
_parent = _rect;
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
console.warn && console.warn( "Warning: the rect constructor argument of HListItems is deprecated." );
|
36
|
+
}
|
30
37
|
this.parent = _parent;
|
31
38
|
if ( this.parent.setListItemResponder ){
|
32
39
|
this.parent.setListItemResponder( this );
|
@@ -35,10 +42,10 @@ HListItems = HValueResponder.extend({
|
|
35
42
|
console.log('Warning; parent does not respond to setListItemResponder');
|
36
43
|
}
|
37
44
|
if (_options instanceof Object) {
|
38
|
-
if (_options
|
45
|
+
if (_options.valueObj !== undefined) {
|
39
46
|
_options.valueObj.bind( this );
|
40
47
|
}
|
41
|
-
else if(_options
|
48
|
+
else if(_options.value !== undefined) {
|
42
49
|
this.value = _options.value;
|
43
50
|
this.refresh();
|
44
51
|
}
|
@@ -54,10 +61,6 @@ HListItems = HValueResponder.extend({
|
|
54
61
|
_this.value = null;
|
55
62
|
},
|
56
63
|
|
57
|
-
_warningMessage: function(_messageText){
|
58
|
-
console.log("Warning; HListItems: "+_messageText);
|
59
|
-
},
|
60
|
-
|
61
64
|
/** = Description
|
62
65
|
* Iterates through this.value array and calls
|
63
66
|
* the setListItems function of the parent class.
|
@@ -65,40 +68,51 @@ HListItems = HValueResponder.extend({
|
|
65
68
|
**/
|
66
69
|
refresh: function(){
|
67
70
|
if ( this.value instanceof Array ) {
|
68
|
-
|
69
|
-
_row, _rowType,
|
70
|
-
_label, _value,
|
71
|
-
i = 0;
|
72
|
-
for ( ; i < this.value.length ; i++ ){
|
73
|
-
_row = this.value[i];
|
74
|
-
_rowType = COMM.Values.type( _row );
|
75
|
-
// console.log('row:',_row,' rowType:',_rowType);
|
76
|
-
// hashes
|
77
|
-
if ( _rowType === 'h' ) {
|
78
|
-
_label = _row['label'];
|
79
|
-
_value = _row['value'];
|
80
|
-
if ( _label === undefined || _value === undefined ){
|
81
|
-
this._warningMessage( "The value or label of row "+_row+" is undefined (ignored)" );
|
82
|
-
}
|
83
|
-
_listItems.push( [_value, _label] );
|
84
|
-
}
|
85
|
-
// Arrays as-is
|
86
|
-
else if ( _rowType == 'a' ){
|
87
|
-
_listItems.push( _row );
|
88
|
-
}
|
89
|
-
// strings and integers
|
90
|
-
else if ( ['s','n'].indexOf(_rowType) !== -1 ){
|
91
|
-
_label = _row.toString();
|
92
|
-
_value = _row;
|
93
|
-
_listItems.push( [_value, _label] );
|
94
|
-
}
|
95
|
-
else {
|
96
|
-
this._warningMessage( "The row "+_row+" is has unsupported row type: '"+_rowType+"' (ignored)" );
|
97
|
-
}
|
98
|
-
}
|
99
|
-
this.parent.setListItems( _listItems );
|
71
|
+
this.parent.setListItems( this.value );
|
100
72
|
}
|
101
73
|
}
|
102
74
|
});
|
103
75
|
|
76
|
+
var
|
77
|
+
HListItemControl = HControl.extend({
|
104
78
|
|
79
|
+
_cleanListItems: function(_listItemsIn){
|
80
|
+
var _listItems = [],
|
81
|
+
_row, _rowType,
|
82
|
+
_label, _value,
|
83
|
+
i = 0;
|
84
|
+
for ( ; i < _listItemsIn.length ; i++ ){
|
85
|
+
_row = _listItemsIn[i];
|
86
|
+
_rowType = COMM.Values.type( _row );
|
87
|
+
// console.log('row:',_row,' rowType:',_rowType);
|
88
|
+
// hashes
|
89
|
+
if ( _rowType === 'h' ) {
|
90
|
+
_label = _row.label;
|
91
|
+
_value = _row.value;
|
92
|
+
if ( _label === undefined || _value === undefined ){
|
93
|
+
console.log( "The value or label of row "+_row+" is undefined (ignored)" );
|
94
|
+
}
|
95
|
+
_listItems.push( [_value, _label] );
|
96
|
+
}
|
97
|
+
// Arrays as-is
|
98
|
+
else if ( _rowType == 'a' ){
|
99
|
+
_listItems.push( _row );
|
100
|
+
}
|
101
|
+
// strings and integers
|
102
|
+
else if ( ['s','n'].indexOf(_rowType) !== -1 ){
|
103
|
+
_label = _row.toString();
|
104
|
+
_value = _row;
|
105
|
+
_listItems.push( [_value, _label] );
|
106
|
+
}
|
107
|
+
else {
|
108
|
+
console.log( "The row "+_row+" has an unsupported row type: '"+_rowType+"' (ignored)" );
|
109
|
+
}
|
110
|
+
}
|
111
|
+
return _listItems;
|
112
|
+
},
|
113
|
+
|
114
|
+
setListItems: function( _listItems ){
|
115
|
+
_listItems = this._cleanListItems(_listItems);
|
116
|
+
}
|
117
|
+
|
118
|
+
});
|
@@ -11,9 +11,10 @@
|
|
11
11
|
** The value of the instance is the selected key in the listItems.
|
12
12
|
***/
|
13
13
|
var//RSence.Lists
|
14
|
-
HRadioButtonList =
|
14
|
+
HRadioButtonList = HListItemControl.extend({
|
15
15
|
drawSubviews: function(){
|
16
|
-
this.setStyle('border','1px solid #
|
16
|
+
this.setStyle('border','1px solid #999999');
|
17
|
+
this.setStyle('border-radius','3px');
|
17
18
|
this.setStyle('overflow-y','auto');
|
18
19
|
},
|
19
20
|
listItems: [],
|
@@ -32,6 +33,7 @@ HRadioButtonList = HControl.extend({
|
|
32
33
|
*
|
33
34
|
**/
|
34
35
|
setListItems: function(_listItems){
|
36
|
+
_listItems = this._cleanListItems(_listItems);
|
35
37
|
var _listItem,
|
36
38
|
_value,
|
37
39
|
_label,
|
@@ -61,7 +63,8 @@ HRadioButtonList = HControl.extend({
|
|
61
63
|
return HRadiobutton.nu(
|
62
64
|
[ 4, (i*23)+4, null, 23, 4, null ],
|
63
65
|
this, {
|
64
|
-
label: _label
|
66
|
+
label: _label,
|
67
|
+
enabled: this.enabled
|
65
68
|
}
|
66
69
|
);
|
67
70
|
},
|
@@ -83,8 +86,10 @@ HRadioButtonList = HControl.extend({
|
|
83
86
|
}
|
84
87
|
this.radioButtonIndexValue && this.radioButtonIndexValue.die();
|
85
88
|
this.listItems = null;
|
86
|
-
|
87
|
-
this.listItemViews
|
89
|
+
if( this.listItemViews ){
|
90
|
+
for(var i=0;i<this.listItemViews.length;i++){
|
91
|
+
this.listItemViews[i].die();
|
92
|
+
}
|
88
93
|
}
|
89
94
|
this.listItemViews = null;
|
90
95
|
this.radioButtonIndexValue && this.radioButtonIndexValue.die();
|
@@ -92,6 +97,13 @@ HRadioButtonList = HControl.extend({
|
|
92
97
|
},
|
93
98
|
radioButtonIndexValue: false,
|
94
99
|
radioButtonResponder: false,
|
100
|
+
setEnabled: function(_state){
|
101
|
+
this.base(_state);
|
102
|
+
if(!this['listItemViews']){ return; }
|
103
|
+
for(var i=0;i<this.listItems.length;i++){
|
104
|
+
this.listItemViews[i].setEnabled(_state)
|
105
|
+
}
|
106
|
+
},
|
95
107
|
|
96
108
|
/** = Description
|
97
109
|
*
|
@@ -102,12 +114,15 @@ HRadioButtonList = HControl.extend({
|
|
102
114
|
this.parent = _parent;
|
103
115
|
},
|
104
116
|
refresh: function(){
|
105
|
-
var
|
117
|
+
var
|
118
|
+
_listItems = this.parent.listItems,
|
119
|
+
_value;
|
106
120
|
if(_listItems === undefined || _listItems === null){
|
107
121
|
return;
|
108
122
|
}
|
109
123
|
if(_listItems[ this.value ] !== undefined){
|
110
|
-
|
124
|
+
_value = _listItems[ this.value ];
|
125
|
+
this.parent.setValue( _value[0] );
|
111
126
|
}
|
112
127
|
}
|
113
128
|
}),
|
@@ -117,6 +132,7 @@ HRadioButtonList = HControl.extend({
|
|
117
132
|
refreshValue: function(){
|
118
133
|
var _value = this.value;
|
119
134
|
if ( this.listItems && this.listItems.length !== 0 && this['valueMatrix'] !== undefined ) {
|
135
|
+
// debugger;
|
120
136
|
if ( this.radioButtonResponder === false ){
|
121
137
|
this.radioButtonIndexValue = HValue.nu( false, 0 );
|
122
138
|
this.radioButtonIndexValue.bind( this.valueMatrix );
|
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
.menuitem_control,
|
3
|
+
.menuitem_label,
|
4
|
+
.menuitem_state {
|
5
|
+
position: absolute;
|
6
|
+
top: 0px; height: 24px;
|
7
|
+
}
|
8
|
+
|
9
|
+
.menuitem_control {
|
10
|
+
left: 0px; right: 0px;
|
11
|
+
cursor: pointer;
|
12
|
+
}
|
13
|
+
.menuitem_control:hover {
|
14
|
+
background-color: #fff;
|
15
|
+
}
|
16
|
+
|
17
|
+
.menuitem_state {
|
18
|
+
left: 4px; top: 7px; height: 12px; width: 12px;
|
19
|
+
background-image: #{this.getCssFilePath('minimenuitem_checkmark.png')};
|
20
|
+
}
|
21
|
+
.checked .menuitem_state {
|
22
|
+
visibility: inherit;
|
23
|
+
}
|
24
|
+
.unchecked .menuitem_state {
|
25
|
+
visibility: hidden;
|
26
|
+
}
|
27
|
+
|
28
|
+
.menuitem_label {
|
29
|
+
left: 20px; right: 11px; top: 0px;
|
30
|
+
height: 24px; line-height: 24px;
|
31
|
+
text-align: left;
|
32
|
+
text-overflow: ellipsis;
|
33
|
+
overflow: hidden;
|
34
|
+
white-space:nowrap;
|
35
|
+
vertical-align: middle;
|
36
|
+
font-family: Arial, sans-serif;
|
37
|
+
font-size: 12px;
|
38
|
+
color: #333;
|
39
|
+
}
|
40
|
+
.menuitem_label:hover {
|
41
|
+
color: #000;
|
42
|
+
}
|
43
|
+
.disabled .menuitem_control {
|
44
|
+
opacity: 0.8;
|
45
|
+
}
|
@@ -18,7 +18,14 @@ HMiniMenu = HRadioButtonList.extend({
|
|
18
18
|
|
19
19
|
defaultEvents: {
|
20
20
|
draggable: true,
|
21
|
-
click: true
|
21
|
+
click: true,
|
22
|
+
resize: true
|
23
|
+
},
|
24
|
+
|
25
|
+
subComponentHeight: 15,
|
26
|
+
|
27
|
+
resize: function(){
|
28
|
+
this.repositionMenuItems();
|
22
29
|
},
|
23
30
|
|
24
31
|
repositionMenuItems: function(){
|
@@ -26,7 +33,7 @@ HMiniMenu = HRadioButtonList.extend({
|
|
26
33
|
x = this.pageX(),
|
27
34
|
y = this.pageY(),
|
28
35
|
w = this.rect.width,
|
29
|
-
h = this.listItems.length*
|
36
|
+
h = this.listItems.length*this.subComponentHeight,
|
30
37
|
i = 0,
|
31
38
|
listItem = null;
|
32
39
|
for(;i<this.listItems.length && listItem === null;i++){
|
@@ -34,9 +41,9 @@ HMiniMenu = HRadioButtonList.extend({
|
|
34
41
|
listItem = this.listItems[i];
|
35
42
|
}
|
36
43
|
}
|
37
|
-
y -= (i-1)*
|
44
|
+
y -= (i-1)*this.subComponentHeight;
|
38
45
|
if(y < 0){
|
39
|
-
y = y
|
46
|
+
y = this.subComponentHeight%y;
|
40
47
|
}
|
41
48
|
if(this.options['menuItemGeom']){
|
42
49
|
if(this.options.menuItemGeom.width){
|
@@ -52,6 +59,7 @@ HMiniMenu = HRadioButtonList.extend({
|
|
52
59
|
|
53
60
|
click: function(){
|
54
61
|
this.menuShow();
|
62
|
+
return false;
|
55
63
|
},
|
56
64
|
|
57
65
|
refreshValue: function(){
|
@@ -81,10 +89,20 @@ HMiniMenu = HRadioButtonList.extend({
|
|
81
89
|
startDrag: function(x,y){
|
82
90
|
this.dragStart = [x,y];
|
83
91
|
this.menuShow();
|
92
|
+
return false;
|
84
93
|
},
|
85
94
|
|
86
|
-
lostActiveStatus: function(
|
87
|
-
|
95
|
+
lostActiveStatus: function(_newActive){
|
96
|
+
// console.log('menu lost active status',_newActive);
|
97
|
+
if( !_newActive.isChildOf( this.menuItemView ) ){
|
98
|
+
this.menuHide();
|
99
|
+
}
|
100
|
+
this.base(_newActive);
|
101
|
+
},
|
102
|
+
|
103
|
+
gainedActiveStatus: function(_prevActive){
|
104
|
+
// console.log('menu gained active status',_prevActive);
|
105
|
+
this.base(_prevActive);
|
88
106
|
},
|
89
107
|
|
90
108
|
endDrag: function(x,y){
|
@@ -96,39 +114,52 @@ HMiniMenu = HRadioButtonList.extend({
|
|
96
114
|
else {
|
97
115
|
this.menuHide();
|
98
116
|
}
|
117
|
+
return false;
|
99
118
|
},
|
100
119
|
|
101
120
|
die: function(){
|
102
121
|
this.valueMatrix = null;
|
103
122
|
var _menuItemView = this.menuItemView;
|
104
123
|
this.base();
|
105
|
-
_menuItemView
|
124
|
+
if( _menuItemView ){
|
125
|
+
_menuItemView.die();
|
126
|
+
}
|
106
127
|
},
|
107
128
|
|
108
129
|
drawSubviews: function(){
|
130
|
+
var
|
131
|
+
itemStyle = {
|
132
|
+
'background-color': '#f6f6f6',
|
133
|
+
'border': '1px solid #999',
|
134
|
+
'overflow': 'auto',
|
135
|
+
'overflow-x': 'hidden'
|
136
|
+
};
|
137
|
+
if(!BROWSER_TYPE.ie){
|
138
|
+
itemStyle.opacity = 0.9;
|
139
|
+
}
|
109
140
|
this.menuItemView = HView.nu(
|
110
141
|
[ this.rect.left, this.rect.top, this.rect.width, 10 ],
|
111
142
|
this.app, {
|
112
143
|
visible: false,
|
113
|
-
style:
|
114
|
-
|
115
|
-
['border', '1px solid #999'],
|
116
|
-
['overflow-y', 'auto'],
|
117
|
-
['opacity', 0.9]
|
118
|
-
]
|
144
|
+
style: itemStyle,
|
145
|
+
logicParent: this
|
119
146
|
}
|
120
147
|
);
|
121
148
|
},
|
122
149
|
|
123
|
-
setListItems: function(
|
124
|
-
this.base(
|
150
|
+
setListItems: function(_listItems){
|
151
|
+
this.base(_listItems);
|
125
152
|
this.valueMatrix = this.menuItemView.valueMatrix;
|
126
153
|
this.refreshValue();
|
154
|
+
if( this.options.initialVisibility ){
|
155
|
+
EVENT.changeActiveControl(this);
|
156
|
+
this.menuShow();
|
157
|
+
}
|
127
158
|
},
|
128
159
|
|
129
160
|
createComponent: function( i, _label ){
|
130
161
|
return HMiniMenuItem.nu(
|
131
|
-
[ 0, (i*
|
162
|
+
[ 0, (i*this.subComponentHeight), null, this.subComponentHeight, 0, null ],
|
132
163
|
this.menuItemView, {
|
133
164
|
label: _label
|
134
165
|
}
|
@@ -0,0 +1,62 @@
|
|
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
|
+
mouseDown: true
|
22
|
+
},
|
23
|
+
|
24
|
+
_activateParentParent: function(){
|
25
|
+
var _parentParent = this.parent.options.logicParent;
|
26
|
+
EVENT.changeActiveControl(_parentParent);
|
27
|
+
},
|
28
|
+
|
29
|
+
// gainedActiveStatus: function( _prevActive ){
|
30
|
+
// console.log('menuitem gained active status',_prevActive === this.parent.options.logicParent);
|
31
|
+
// this.base( _prevActive );
|
32
|
+
// },
|
33
|
+
|
34
|
+
lostActiveStatus: function( _newActive ){
|
35
|
+
this.parent.options.logicParent.menuHide();
|
36
|
+
this.base( _newActive );
|
37
|
+
},
|
38
|
+
|
39
|
+
_parentLastActivation: 0,
|
40
|
+
click: function(){
|
41
|
+
var _now = new Date().getTime();
|
42
|
+
if( _now - this._parentLastActivation > 200 ){
|
43
|
+
this.base();
|
44
|
+
this._parentLastActivation = _now;
|
45
|
+
this._activateParentParent();
|
46
|
+
}
|
47
|
+
return true;
|
48
|
+
},
|
49
|
+
|
50
|
+
mouseDown: function(){
|
51
|
+
this.base();
|
52
|
+
this.click();
|
53
|
+
return true;
|
54
|
+
},
|
55
|
+
|
56
|
+
mouseUp: function(){
|
57
|
+
this.base();
|
58
|
+
this.click();
|
59
|
+
return true;
|
60
|
+
}
|
61
|
+
|
62
|
+
});
|