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
@@ -3,40 +3,71 @@
|
|
3
3
|
.timesheet_item_label,
|
4
4
|
.timesheet_item_resize_top,
|
5
5
|
.timesheet_item_move,
|
6
|
+
.timesheet_item_time,
|
7
|
+
.timesheet_item_icons,
|
6
8
|
.timesheet_item_resize_bottom {
|
7
9
|
position: absolute;
|
8
10
|
left: 0px; right: 0px;
|
9
11
|
}
|
10
12
|
.timesheet_item {
|
11
13
|
top: 0px; bottom: 0px;
|
12
|
-
border: 1px solid #
|
13
|
-
|
14
|
+
border: 1px solid #ccc;
|
15
|
+
border-radius: 7px;
|
14
16
|
opacity: 0.75;
|
15
17
|
}
|
16
|
-
.
|
17
|
-
|
18
|
+
.timesheet_item_time,
|
19
|
+
.timesheet_item_label {
|
20
|
+
font-size: 12px;
|
21
|
+
color: #333;
|
22
|
+
font-family: Helvetica, Arial, sans-serif;
|
23
|
+
}
|
24
|
+
.timesheet_item_time {
|
25
|
+
top: 0px; height: 12px; line-height: 12px;
|
26
|
+
text-indent: 4px; padding-top: 2px;
|
27
|
+
font-weight: bold;
|
28
|
+
}
|
29
|
+
.active > .timesheet_item .timesheet_item_time {
|
30
|
+
border-radius: 7px 7px 0 0;
|
31
|
+
border-bottom: 1px solid #000;
|
32
|
+
/* opacity: 0.2;*/
|
33
|
+
}
|
34
|
+
.active > .timesheet_item {
|
35
|
+
border-color: #000;
|
36
|
+
opacity: 1;
|
18
37
|
}
|
19
38
|
.timesheet_item_middle {
|
20
39
|
top: 50%; height: 0px;
|
21
40
|
overflow: visible;
|
22
41
|
}
|
23
42
|
.timesheet_item_label {
|
24
|
-
top: -6px; height: 12px;
|
25
|
-
font-size: 12px;
|
26
43
|
text-align: center;
|
27
|
-
color: #333;
|
28
44
|
opacity: 1;
|
29
|
-
|
45
|
+
top: -6px; height: 12px;
|
30
46
|
}
|
31
47
|
.timesheet_item_resize_top {
|
32
|
-
top: 0px; height:
|
48
|
+
top: 0px; height: 6px;
|
33
49
|
cursor: n-resize;
|
34
50
|
}
|
35
51
|
.timesheet_item_move {
|
36
|
-
top:
|
52
|
+
top: 6px; bottom: 6px;
|
37
53
|
cursor: move;
|
38
54
|
}
|
39
55
|
.timesheet_item_resize_bottom {
|
40
|
-
bottom: 0px; height:
|
56
|
+
bottom: 0px; height: 6px;
|
41
57
|
cursor: s-resize;
|
42
58
|
}
|
59
|
+
.timesheet_item_icons {
|
60
|
+
top: 0px; height: 16px;
|
61
|
+
}
|
62
|
+
.timesheet_item_icon {
|
63
|
+
position: absolute;
|
64
|
+
top: 0px; width: 16px; height: 16px;
|
65
|
+
background-position: 0px 0px;
|
66
|
+
background-image: url(#{this.getThemeGfxFile('/timesheet_item_icons.png')});
|
67
|
+
}
|
68
|
+
|
69
|
+
.locked .timesheet_item_move,
|
70
|
+
.locked .timesheet_item_resize_bottom,
|
71
|
+
.locked .timesheet_item_resize_top {
|
72
|
+
cursor: pointer;
|
73
|
+
}
|
@@ -1,8 +1,10 @@
|
|
1
|
-
<div class="timesheet_item">
|
1
|
+
<div class="timesheet_item" id="bg#{_ID}">
|
2
|
+
<div class="timesheet_item_time" id="state#{_ID}"></div>
|
2
3
|
<div class="timesheet_item_middle">
|
3
4
|
<div class="timesheet_item_label" id="label#{_ID}">#{this.label}</div>
|
4
5
|
</div>
|
6
|
+
<div class="timesheet_item_icons" id="icons#{_ID}"></div>
|
5
7
|
<div class="timesheet_item_resize_top"></div>
|
6
8
|
<div class="timesheet_item_resize_bottom"></div>
|
7
9
|
<div class="timesheet_item_move" id="subview#{_ID}"></div>
|
8
|
-
</div>
|
10
|
+
</div>
|
Binary file
|
@@ -13,296 +13,200 @@ var//RSence.DateTime
|
|
13
13
|
HTimeSheetItem = HControl.extend({
|
14
14
|
|
15
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
|
-
},
|
16
|
+
markupElemNames: ['bg', 'label', 'state', 'icons', 'value', 'subview'],
|
31
17
|
|
32
18
|
controlDefaults: HControlDefaults.extend({
|
33
|
-
|
34
|
-
constructor: function(_ctrl){
|
35
|
-
_ctrl.dragMode = this.dragMode;
|
36
|
-
}
|
19
|
+
displayTime: true
|
37
20
|
}),
|
38
21
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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();
|
22
|
+
drawIcon: function( _iconOrder, _iconId ){
|
23
|
+
var
|
24
|
+
_iconElemId = ELEM.make( this.markupElemIds.icons, 'div' );
|
25
|
+
ELEM.addClassName( _iconElemId, 'timesheet_item_icon' );
|
26
|
+
ELEM.setStyle( _iconElemId, 'right', ((_iconOrder*16)+_iconOrder)+'px' );
|
27
|
+
ELEM.setStyle( _iconElemId, 'background-position', '0px '+(_iconId*-16)+'px' );
|
28
|
+
return _iconElemId;
|
99
29
|
},
|
100
30
|
|
101
|
-
|
102
|
-
|
103
|
-
|
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;
|
31
|
+
clearAllIcons: function(){
|
32
|
+
if(this.icons instanceof Array){
|
33
|
+
for( var i=0; i < this.icons.length; i++ ){
|
34
|
+
ELEM.del( this.icons[i] );
|
125
35
|
}
|
126
36
|
}
|
127
|
-
|
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);
|
37
|
+
this.icons = [];
|
143
38
|
},
|
144
39
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
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 );
|
40
|
+
die: function(){
|
41
|
+
this.clearAllIcons();
|
42
|
+
this.icons = null;
|
43
|
+
this.base();
|
159
44
|
},
|
160
45
|
|
161
|
-
|
162
|
-
|
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;
|
46
|
+
refreshState: function( _start, _duration ){
|
47
|
+
if(!this.options.displayTime){
|
48
|
+
return;
|
174
49
|
}
|
175
|
-
|
50
|
+
var
|
51
|
+
_startTime = _start || this.value.start,
|
52
|
+
_endTime = _startTime + ( _duration || this.value.duration ),
|
53
|
+
_locale = HLocale.dateTime,
|
54
|
+
_stateText = _locale.formatTime( _startTime ) + _locale.strings.rangeDelimitter + _locale.formatTime( _endTime );
|
55
|
+
ELEM.setHTML( this.markupElemIds.state, _stateText );
|
176
56
|
},
|
177
57
|
|
178
|
-
|
179
|
-
|
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;
|
58
|
+
refreshValue: function(){
|
59
|
+
if ( !(this.value instanceof Object) ){
|
60
|
+
return;
|
191
61
|
}
|
192
|
-
this.
|
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);
|
62
|
+
this.drawRect();
|
63
|
+
if ( this.value.color ) {
|
64
|
+
this.setStyleOfPart( 'bg', 'background-color', this.value.color );
|
209
65
|
}
|
210
|
-
else
|
211
|
-
this.
|
66
|
+
else {
|
67
|
+
this.setStyleOfPart( 'bg', 'background-color', '#999' );
|
212
68
|
}
|
213
|
-
|
214
|
-
this.
|
69
|
+
if ( this.value.label ) {
|
70
|
+
this.setLabel( this.value.label );
|
215
71
|
}
|
216
|
-
|
217
|
-
this.
|
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
|
-
}
|
72
|
+
if ( this.value.locked ) {
|
73
|
+
ELEM.addClassName( this.elemId, 'locked' );
|
248
74
|
}
|
249
75
|
else {
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
76
|
+
ELEM.removeClassName( this.elemId, 'locked' );
|
77
|
+
}
|
78
|
+
this.refreshState();
|
79
|
+
this.clearAllIcons();
|
80
|
+
if( this.value.icons instanceof Array ){
|
81
|
+
for( var i = 0; i < this.value.icons.length; i++ ){
|
82
|
+
this.icons.push( this.drawIcon( i, this.value.icons[i] ) );
|
255
83
|
}
|
256
84
|
}
|
257
|
-
this.setValue( _value );
|
258
|
-
this.dragMode = 'normal';
|
259
|
-
return true;
|
260
85
|
},
|
261
86
|
|
262
|
-
|
263
|
-
|
87
|
+
click: function(){
|
88
|
+
this.bringToFront();
|
264
89
|
},
|
265
90
|
|
266
|
-
|
267
|
-
|
91
|
+
doubleClick: function( x, y ){
|
92
|
+
this.bringToFront();
|
93
|
+
var _time = this.parent.pxToTime( y-this.parent.pageY() );
|
94
|
+
this.parent.activateEditor( this );
|
268
95
|
},
|
269
96
|
|
270
|
-
|
271
|
-
|
97
|
+
dragMode: 0, // none
|
98
|
+
_isValueValidForDrag: function(){
|
99
|
+
return (this.value instanceof Object) && (!this.value.locked);
|
272
100
|
},
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
101
|
+
startDrag: function( x, y ){
|
102
|
+
this.bringToFront();
|
103
|
+
if( this._isValueValidForDrag() ){
|
104
|
+
var
|
105
|
+
_topY = y-this.pageY(),
|
106
|
+
_bottomY = this.rect.height - _topY,
|
107
|
+
_resizeTop = ( _topY >= 0 && _topY <= 6 ),
|
108
|
+
_resizeBottom = ( _bottomY >= 0 && _bottomY <= 6 ),
|
109
|
+
_move = ( _topY > 6 && _bottomY > 6 );
|
110
|
+
if( _resizeTop ){
|
111
|
+
this.dragMode = 2; // resize-top
|
112
|
+
}
|
113
|
+
else if ( _resizeBottom ){
|
114
|
+
this.dragMode = 3; // resize-bottom
|
115
|
+
}
|
116
|
+
else if ( _move ){
|
117
|
+
this.dragMode = 1; // move
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
this.dragMode = 0; // none
|
121
|
+
}
|
122
|
+
if( this.dragMode === 0 ){
|
123
|
+
this.originY = false;
|
124
|
+
}
|
125
|
+
else {
|
126
|
+
var
|
127
|
+
_originY = y-this.parent.pageY(),
|
128
|
+
_parentY = this.parent.pageY(),
|
129
|
+
_originTimeStart = this.value.start,
|
130
|
+
_originTimeEnd = _originTimeStart + this.value.duration;
|
131
|
+
this.originY = _originY;
|
132
|
+
this.originTopPx = this.rect.top;
|
133
|
+
this.originBottomPx = this.rect.bottom;
|
134
|
+
this.originTimeStart = _originTimeStart;
|
135
|
+
this.originTimeEnd = _originTimeEnd;
|
136
|
+
this.originDuration = _originTimeEnd - _originTimeStart;
|
137
|
+
this.dragTimeStart = _originTimeStart;
|
138
|
+
this.dragDuration = this.originDuration;
|
139
|
+
}
|
140
|
+
}
|
280
141
|
},
|
281
142
|
|
282
|
-
|
283
|
-
|
143
|
+
drag: function( x, y ){
|
144
|
+
if( this._isValueValidForDrag() && (this.dragMode !== 0) ){
|
145
|
+
y -= this.parent.pageY();
|
146
|
+
var
|
147
|
+
_movePx = y - this.originY,
|
148
|
+
_topPx = this.parent.snapPx( this.originTopPx + _movePx ),
|
149
|
+
_parentY = this.parent.pageY(),
|
150
|
+
_bottomPx, _minBottomPx, _maxBottomPx, _maxTopPx, _timeStart, _timeEnd, _duration;
|
151
|
+
if( this.dragMode === 1 ){ // move
|
152
|
+
_maxTopPx = this.parent.timeToPx( this.parent.options.timeEnd ) - this.rect.height;
|
153
|
+
if( _topPx > _maxTopPx ){
|
154
|
+
_topPx = _maxTopPx;
|
155
|
+
}
|
156
|
+
_timeStart = this.parent.pxToTime(_topPx);
|
157
|
+
_duration = this.originDuration;
|
158
|
+
this.rect.offsetTo( this.rect.left, _topPx );
|
159
|
+
this.drawRect();
|
160
|
+
this.dragTimeStart = _timeStart;
|
161
|
+
this.dragDuration = _duration;
|
162
|
+
}
|
163
|
+
else if( this.dragMode === 2 ){ // resize-top
|
164
|
+
_maxTopPx = this.parent.timeToPx( this.originTimeEnd - this.parent.minDuration );
|
165
|
+
if( _topPx > _maxTopPx ){
|
166
|
+
_topPx = _maxTopPx;
|
167
|
+
}
|
168
|
+
_timeStart = this.parent.pxToTime(_topPx);
|
169
|
+
_timeEnd = this.originTimeEnd;
|
170
|
+
if( (this.rect.bottom - _topPx) < this.parent.options.itemMinHeight ){
|
171
|
+
_topPx = this.rect.bottom - this.parent.options.itemMinHeight;
|
172
|
+
}
|
173
|
+
this.rect.setTop( _topPx );
|
174
|
+
this.drawRect();
|
175
|
+
this.dragTimeStart = _timeStart;
|
176
|
+
this.dragDuration = _timeEnd - _timeStart;
|
177
|
+
}
|
178
|
+
else if( this.dragMode === 3 ){ // resize-top
|
179
|
+
_minBottomPx = this.parent.timeToPx( this.originTimeStart + this.parent.minDuration );
|
180
|
+
_bottomPx = this.parent.snapPx( this.originBottomPx + _movePx );
|
181
|
+
if( _bottomPx < _minBottomPx ){
|
182
|
+
_bottomPx = _minBottomPx;
|
183
|
+
}
|
184
|
+
_timeStart = this.originTimeStart;
|
185
|
+
_timeEnd = this.parent.pxToTime(_bottomPx);
|
186
|
+
if( _bottomPx - this.rect.top < this.parent.options.itemMinHeight ){
|
187
|
+
_bottomPx = this.rect.top + this.parent.options.itemMinHeight;
|
188
|
+
}
|
189
|
+
this.rect.setBottom( _bottomPx );
|
190
|
+
this.drawRect();
|
191
|
+
this.dragTimeStart = _timeStart;
|
192
|
+
this.dragDuration = _timeEnd - _timeStart;
|
193
|
+
}
|
194
|
+
this.refreshState( this.dragTimeStart, this.dragDuration );
|
195
|
+
}
|
284
196
|
},
|
285
197
|
|
286
|
-
|
287
|
-
|
288
|
-
*
|
289
|
-
**/
|
290
|
-
refreshValue: function(){
|
291
|
-
if ( HVM.type(this.value) === 'h' ){
|
198
|
+
endDrag: function( x, y ){
|
199
|
+
if( this._isValueValidForDrag() && (this.dragMode !== 0) ){
|
292
200
|
var
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
201
|
+
_startChanged = ( this.dragTimeStart !== this.originTimeStart ) && ( this.dragTimeStart !== this.value.start ),
|
202
|
+
_durationChanged = ( this.dragDuration !== this.originDuration ) && ( this.dragDuration !== this.value.duration );
|
203
|
+
if( _startChanged || _durationChanged ){
|
204
|
+
if( this.parent['editor'] ){
|
205
|
+
var _modValue = { id: this.value.id, start: this.dragTimeStart, duration: this.dragDuration, label: this.value.label };
|
206
|
+
this.parent.editor.modifyItem( _modValue );
|
207
|
+
}
|
300
208
|
}
|
301
|
-
this.rect.setTop( _top );
|
302
|
-
this.rect.setBottom( _bottom );
|
303
|
-
this.drawRect();
|
304
209
|
}
|
305
210
|
}
|
211
|
+
|
306
212
|
});
|
307
|
-
|
308
|
-
|