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,30 +0,0 @@
|
|
1
|
-
.timesheet_hours_col {
|
2
|
-
position: absolute;
|
3
|
-
top: 0px; left: 0px; width: 32px;
|
4
|
-
font-family: Arial, sans-serif;
|
5
|
-
font-size: 11px;
|
6
|
-
color: #666;
|
7
|
-
vertical-align: middle;
|
8
|
-
text-align: right;
|
9
|
-
}
|
10
|
-
.timesheet_hours_row {
|
11
|
-
position: absolute;
|
12
|
-
left: 0px; width: 32px;
|
13
|
-
}
|
14
|
-
.timesheet_lines_col {
|
15
|
-
position: absolute;
|
16
|
-
top: 0px; left: 36px; right: 0px;
|
17
|
-
border-left: 1px solid #aaa;
|
18
|
-
border-bottom: 1px solid #aaa;
|
19
|
-
border-right: 1px solid #aaa;
|
20
|
-
}
|
21
|
-
.timesheet_lines_row0,
|
22
|
-
.timesheet_lines_row1 {
|
23
|
-
position: absolute;
|
24
|
-
left: 0px; right: 0px; height: 1px;
|
25
|
-
line-height: 1px; font-size: 0px;
|
26
|
-
background-color: #ccc;
|
27
|
-
}
|
28
|
-
.timesheet_lines_row0 {
|
29
|
-
background-color: #aaa;
|
30
|
-
}
|
File without changes
|
@@ -1,308 +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
|
-
** Item class to be used with HTimeSheet.
|
11
|
-
***/
|
12
|
-
var//RSence.DateTime
|
13
|
-
HTimeSheetItem = HControl.extend({
|
14
|
-
|
15
|
-
componentName: 'timesheet_item',
|
16
|
-
|
17
|
-
/* Which mode the component is in. When created by dragging, acts in 'create' mode, otherwise is 'normal'. Can be overridden in options. */
|
18
|
-
dragMode: 'create',
|
19
|
-
|
20
|
-
/* The previous coordinate. Used to detect double-drag as double-click */
|
21
|
-
prevXY: [0,0],
|
22
|
-
|
23
|
-
/* The time at the previous coordinate. Used to detect double-drag as double-click. */
|
24
|
-
prevXYTime: 0,
|
25
|
-
|
26
|
-
defaultEvents: {
|
27
|
-
draggable: true,
|
28
|
-
click: true,
|
29
|
-
doubleClick: true
|
30
|
-
},
|
31
|
-
|
32
|
-
controlDefaults: HControlDefaults.extend({
|
33
|
-
dragMode: 'create',
|
34
|
-
constructor: function(_ctrl){
|
35
|
-
_ctrl.dragMode = this.dragMode;
|
36
|
-
}
|
37
|
-
}),
|
38
|
-
|
39
|
-
/** = Description
|
40
|
-
* Dragging is used to change coordinates.
|
41
|
-
*
|
42
|
-
* = Parameters
|
43
|
-
* +x+:: X coordinate at the start of drag.
|
44
|
-
* +y+:: Y coordinate at the start of drag.
|
45
|
-
*
|
46
|
-
**/
|
47
|
-
startDrag: function(x,y){
|
48
|
-
this.origY = y-this.parent.pageY();
|
49
|
-
if(this.dragMode === 'normal'){
|
50
|
-
var _timeNow = new Date().getTime(),
|
51
|
-
_xEquals = (Math.round(this.prevXY[0]/4) === Math.round(x/4)),
|
52
|
-
_yEquals = (Math.round(this.prevXY[1]/4) === Math.round(y/4)),
|
53
|
-
_noTimeout = ((_timeNow - this.prevXYTime) < 500);
|
54
|
-
if( _xEquals && _yEquals && _noTimeout ) { // doubleClick
|
55
|
-
return true;
|
56
|
-
}
|
57
|
-
else {
|
58
|
-
var _diffTop = this.rect.top - this.origY,
|
59
|
-
_diffBottom = this.rect.bottom - this.origY;
|
60
|
-
if(0 >= _diffTop && _diffTop >= -3){
|
61
|
-
this.dragMode = 'resize-top';
|
62
|
-
}
|
63
|
-
else if(0 <= _diffBottom && _diffBottom <= 4){
|
64
|
-
this.dragMode = 'resize-bottom';
|
65
|
-
}
|
66
|
-
else {
|
67
|
-
this.dragMode = 'move';
|
68
|
-
this.moveDiff = this.origY - this.rect.top;
|
69
|
-
}
|
70
|
-
this.bringToFront();
|
71
|
-
}
|
72
|
-
}
|
73
|
-
this.prevXY = [x,y];
|
74
|
-
this.prevXYTime = _timeNow;
|
75
|
-
return true;
|
76
|
-
},
|
77
|
-
|
78
|
-
doubleClick: function(x,y){
|
79
|
-
if( this.parent['editor'] ){
|
80
|
-
var _editor = this.parent.editor;
|
81
|
-
_editor.setTimeSheetItem(this);
|
82
|
-
_editor.bringToFront();
|
83
|
-
_editor.show();
|
84
|
-
return true;
|
85
|
-
}
|
86
|
-
return false;
|
87
|
-
},
|
88
|
-
|
89
|
-
/** = Description
|
90
|
-
* Label setter function.
|
91
|
-
*
|
92
|
-
* = Parameters
|
93
|
-
* +_label+:: New label
|
94
|
-
*
|
95
|
-
**/
|
96
|
-
setTimeSheetItemLabel: function(_label){
|
97
|
-
this.label = _label;
|
98
|
-
this.refreshLabel();
|
99
|
-
},
|
100
|
-
|
101
|
-
/** = Description
|
102
|
-
* Function used to calculate the right size for a new
|
103
|
-
* item created by dragging.
|
104
|
-
*
|
105
|
-
* = Parameters
|
106
|
-
* +_y+:: Y coordinate at the start of drag.
|
107
|
-
*
|
108
|
-
**/
|
109
|
-
dragCreate: function(_y){
|
110
|
-
var _negative = (_y < this.origY),
|
111
|
-
_lineHeight = Math.floor(this.parent.pxPerHour/2),
|
112
|
-
_top, _bottom, _diff;
|
113
|
-
if(_negative){
|
114
|
-
var _floorY = Math.floor(_y/_lineHeight)*_lineHeight,
|
115
|
-
_ceilYo = Math.ceil(this.origY/_lineHeight)*_lineHeight;
|
116
|
-
if(_floorY<0){_floorY=0;}
|
117
|
-
_diff = _floorY-_ceilYo;
|
118
|
-
if( _diff <= 0-_lineHeight ){
|
119
|
-
_top = _floorY;
|
120
|
-
_bottom = _ceilYo;
|
121
|
-
}
|
122
|
-
else if( _diff === 0 ){
|
123
|
-
_top = _floorY-_lineHeight;
|
124
|
-
_bottom = _ceilYo;
|
125
|
-
}
|
126
|
-
}
|
127
|
-
else {
|
128
|
-
var _ceilY = Math.ceil(_y/_lineHeight)*_lineHeight,
|
129
|
-
_floorYo = Math.floor(this.origY/_lineHeight)*_lineHeight;
|
130
|
-
if(_ceilY>(_lineHeight*48)){_ceilY=_lineHeight*48;}
|
131
|
-
_diff = _ceilY-_floorYo;
|
132
|
-
if( _diff >= _lineHeight ){
|
133
|
-
_top = _floorYo;
|
134
|
-
_bottom = _ceilY;
|
135
|
-
}
|
136
|
-
else if( _diff === 0 ){
|
137
|
-
_top = _floorYo;
|
138
|
-
_bottom = _ceilY+_lineHeight;
|
139
|
-
}
|
140
|
-
}
|
141
|
-
this.rect.setTop(_top);
|
142
|
-
this.rect.setBottom(_bottom);
|
143
|
-
},
|
144
|
-
|
145
|
-
/** = Description
|
146
|
-
* Resize top by dragging auxiliary function.
|
147
|
-
*
|
148
|
-
* = Parameters
|
149
|
-
* +_y+:: Y coordinate at the start of drag.
|
150
|
-
**/
|
151
|
-
dragResizeTop: function(_y){
|
152
|
-
var _lineHeight = Math.floor(this.parent.pxPerHour/2),
|
153
|
-
_top = Math.floor( _y/_lineHeight )*_lineHeight;
|
154
|
-
if(_top < 0){ _top = 0; }
|
155
|
-
if(_top+_lineHeight > this.rect.bottom){
|
156
|
-
_top = this.rect.bottom - _lineHeight;
|
157
|
-
}
|
158
|
-
this.rect.setTop( _top );
|
159
|
-
},
|
160
|
-
|
161
|
-
/** = Description
|
162
|
-
* Resize function for resizing the bottom of item.
|
163
|
-
*
|
164
|
-
* = Parameters
|
165
|
-
* +_y+:: Y coordinate at the start of drag.
|
166
|
-
*
|
167
|
-
**/
|
168
|
-
dragResizeBottom: function(_y){
|
169
|
-
var _lineHeight = Math.floor(this.parent.pxPerHour/2),
|
170
|
-
_bottom = Math.floor( _y/_lineHeight )*_lineHeight;
|
171
|
-
if(_bottom > _lineHeight*48){ _bottom = _lineHeight*48; }
|
172
|
-
if(_bottom-_lineHeight < this.rect.top){
|
173
|
-
_bottom = this.rect.top + _lineHeight;
|
174
|
-
}
|
175
|
-
this.rect.setBottom( _bottom );
|
176
|
-
},
|
177
|
-
|
178
|
-
/** = Description
|
179
|
-
* Move function for item by dragging and dropping.
|
180
|
-
*
|
181
|
-
* = Parameters
|
182
|
-
* +_y+:: Y coordinate at the start of drag.
|
183
|
-
*
|
184
|
-
**/
|
185
|
-
dragMove: function(_y){
|
186
|
-
var _lineHeight = Math.floor(this.parent.pxPerHour/2),
|
187
|
-
_top = Math.floor( (0-this.moveDiff+_y)/_lineHeight )*_lineHeight;
|
188
|
-
if(_top<0){_top = 0;}
|
189
|
-
if(_top+this.rect.height>_lineHeight*48){
|
190
|
-
_top = _lineHeight*48 - this.rect.height;
|
191
|
-
}
|
192
|
-
this.rect.offsetTo( this.rect.left, _top );
|
193
|
-
},
|
194
|
-
|
195
|
-
/** = Description
|
196
|
-
* Drag function for item. Decides whether the user wants to create a new
|
197
|
-
* item, resize top, resize bottom or move an existing item.
|
198
|
-
*
|
199
|
-
* = Parameters
|
200
|
-
* +x+:: X coordinate at the start of drag.
|
201
|
-
* +y+:: Y coordinate at the start of drag.
|
202
|
-
*
|
203
|
-
**/
|
204
|
-
drag: function(x,y){
|
205
|
-
var _pageY = this.parent.pageY(),
|
206
|
-
_y = y - _pageY;
|
207
|
-
if(this.dragMode === 'create'){
|
208
|
-
this.dragCreate(_y);
|
209
|
-
}
|
210
|
-
else if(this.dragMode === 'resize-top'){
|
211
|
-
this.dragResizeTop(_y);
|
212
|
-
}
|
213
|
-
else if(this.dragMode === 'resize-bottom'){
|
214
|
-
this.dragResizeBottom(_y);
|
215
|
-
}
|
216
|
-
else if(this.dragMode === 'move'){
|
217
|
-
this.dragMove(_y);
|
218
|
-
}
|
219
|
-
this.drawRect();
|
220
|
-
return true;
|
221
|
-
},
|
222
|
-
|
223
|
-
/** = Description
|
224
|
-
* Modifies the existing item's coordinates or creates a new one.
|
225
|
-
*
|
226
|
-
* = Parameters
|
227
|
-
* +x+:: X coordinate at the end of drag.
|
228
|
-
* +y+:: Y coordinate at the end of drag.
|
229
|
-
*
|
230
|
-
**/
|
231
|
-
endDrag: function(x,y){
|
232
|
-
var
|
233
|
-
_pxPerHour = Math.floor(this.parent.pxPerHour),
|
234
|
-
_value,
|
235
|
-
_yEquals = (Math.round(this.prevXY[1]/4) === Math.round(y/4));
|
236
|
-
if(_yEquals){ // nothing moved, just return.
|
237
|
-
return true;
|
238
|
-
}
|
239
|
-
if(this.dragMode === 'create'){
|
240
|
-
this.parent.listItemViews.push( this );
|
241
|
-
_value = {};
|
242
|
-
this._setValueTop( _value );
|
243
|
-
this._setValueBottom( _value );
|
244
|
-
this._setValueLabel( _value );
|
245
|
-
if(this.parent['editor']){
|
246
|
-
this.parent.editor.createItem( _value );
|
247
|
-
}
|
248
|
-
}
|
249
|
-
else {
|
250
|
-
_value = COMM.Values.clone( this.value );
|
251
|
-
this._setValueTop( _value );
|
252
|
-
this._setValueBottom( _value );
|
253
|
-
if(this.parent['editor']){
|
254
|
-
this.parent.editor.modifyItem( _value );
|
255
|
-
}
|
256
|
-
}
|
257
|
-
this.setValue( _value );
|
258
|
-
this.dragMode = 'normal';
|
259
|
-
return true;
|
260
|
-
},
|
261
|
-
|
262
|
-
_setValueTop: function( _value ) {
|
263
|
-
_value['timeBegin'] = this.rect.top/this.parent.pxPerHour;
|
264
|
-
},
|
265
|
-
|
266
|
-
_setValueBottom: function( _value ) {
|
267
|
-
_value['timeEnd'] = this.rect.bottom/this.parent.pxPerHour;
|
268
|
-
},
|
269
|
-
|
270
|
-
_setValueLabel: function( _value ) {
|
271
|
-
_value['label'] = this.label;
|
272
|
-
},
|
273
|
-
|
274
|
-
_getValueLabel: function( _value ){
|
275
|
-
return _value.label;
|
276
|
-
},
|
277
|
-
|
278
|
-
_getValueTop: function( _value ){
|
279
|
-
return (_value.timeBegin * this.parent.pxPerHour)+1;
|
280
|
-
},
|
281
|
-
|
282
|
-
_getValueBottom: function( _value ){
|
283
|
-
return (_value.timeEnd * this.parent.pxPerHour)-2;
|
284
|
-
},
|
285
|
-
|
286
|
-
/** = Description
|
287
|
-
* Refreshes the object's label and place on the HTimeSheet.
|
288
|
-
*
|
289
|
-
**/
|
290
|
-
refreshValue: function(){
|
291
|
-
if ( HVM.type(this.value) === 'h' ){
|
292
|
-
var
|
293
|
-
_label = this._getValueLabel( this.value ),
|
294
|
-
_top = this._getValueTop( this.value ),
|
295
|
-
_bottom = this._getValueBottom( this.value ),
|
296
|
-
_minHeight = this.parent.options.itemMinHeight;
|
297
|
-
this.setLabel( _label );
|
298
|
-
if( (_bottom - _top) < _minHeight ){
|
299
|
-
_bottom = _top + _minHeight;
|
300
|
-
}
|
301
|
-
this.rect.setTop( _top );
|
302
|
-
this.rect.setBottom( _bottom );
|
303
|
-
this.drawRect();
|
304
|
-
}
|
305
|
-
}
|
306
|
-
});
|
307
|
-
|
308
|
-
|
@@ -1,42 +0,0 @@
|
|
1
|
-
.timesheet_item,
|
2
|
-
.timesheet_item_middle,
|
3
|
-
.timesheet_item_label,
|
4
|
-
.timesheet_item_resize_top,
|
5
|
-
.timesheet_item_move,
|
6
|
-
.timesheet_item_resize_bottom {
|
7
|
-
position: absolute;
|
8
|
-
left: 0px; right: 0px;
|
9
|
-
}
|
10
|
-
.timesheet_item {
|
11
|
-
top: 0px; bottom: 0px;
|
12
|
-
border: 1px solid #c00;
|
13
|
-
background-color: #c66;
|
14
|
-
opacity: 0.75;
|
15
|
-
}
|
16
|
-
.active .timesheet_item {
|
17
|
-
opacity: 1.0;
|
18
|
-
}
|
19
|
-
.timesheet_item_middle {
|
20
|
-
top: 50%; height: 0px;
|
21
|
-
overflow: visible;
|
22
|
-
}
|
23
|
-
.timesheet_item_label {
|
24
|
-
top: -6px; height: 12px;
|
25
|
-
font-size: 12px;
|
26
|
-
text-align: center;
|
27
|
-
color: #333;
|
28
|
-
opacity: 1;
|
29
|
-
font-family: Arial, sans-serif;
|
30
|
-
}
|
31
|
-
.timesheet_item_resize_top {
|
32
|
-
top: 0px; height: 3px;
|
33
|
-
cursor: n-resize;
|
34
|
-
}
|
35
|
-
.timesheet_item_move {
|
36
|
-
top: 3px; bottom: 3px;
|
37
|
-
cursor: move;
|
38
|
-
}
|
39
|
-
.timesheet_item_resize_bottom {
|
40
|
-
bottom: 0px; height: 3px;
|
41
|
-
cursor: s-resize;
|
42
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<div class="timesheet_item">
|
2
|
-
<div class="timesheet_item_middle">
|
3
|
-
<div class="timesheet_item_label" id="label#{_ID}">#{this.label}</div>
|
4
|
-
</div>
|
5
|
-
<div class="timesheet_item_resize_top"></div>
|
6
|
-
<div class="timesheet_item_resize_bottom"></div>
|
7
|
-
<div class="timesheet_item_move" id="subview#{_ID}"></div>
|
8
|
-
</div>
|
File without changes
|
@@ -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
|
-
|