dhtmlx-scheduler 5.3.14 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -10
- package/bower.json +2 -2
- package/codebase/dhtmlxscheduler.css +10 -11
- package/codebase/dhtmlxscheduler.d.ts +163 -11
- package/codebase/dhtmlxscheduler.js +36 -354
- package/codebase/dhtmlxscheduler.js.map +1 -0
- package/codebase/dhtmlxscheduler_contrast_black.css +10 -11
- package/codebase/dhtmlxscheduler_contrast_white.css +10 -11
- package/codebase/dhtmlxscheduler_flat.css +10 -11
- package/codebase/dhtmlxscheduler_material.css +10 -11
- package/codebase/dhtmlxscheduler_terrace.css +10 -11
- package/codebase/sources/{skins/dhtmlxscheduler.css → dhtmlxscheduler.css} +125 -78
- package/codebase/sources/dhtmlxscheduler.js +29536 -9186
- package/codebase/sources/less/package.json +2 -2
- package/codebase/sources/less/skins/basic/ext.less +30 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/but_repeat.gif +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/buttons.png +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/calendar.gif +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/clock_big.gif +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/clock_small.gif +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/collapse_expand_icon.gif +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/controls.gif +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/databg.png +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/databg_now.png +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/export_ical.png +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/export_pdf.png +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/icon.png +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/images.png +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/loading.gif +0 -0
- package/codebase/{imgs → sources/less/skins/basic/imgs}/resize_dots.png +0 -0
- package/codebase/sources/less/skins/basic/lightbox.less +12 -0
- package/codebase/sources/less/skins/basic/message_default.less +43 -27
- package/codebase/sources/less/skins/basic/skin.less +2 -2
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/arrow_left.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/arrow_right.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/but_repeat.gif +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/calendar.gif +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/clock_big.gif +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/clock_small.gif +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/close_icon.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/collapse_expand_icon.gif +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/controls.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/databg.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/databg_now.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/export_ical.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/export_pdf.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/resize_dots.png +0 -0
- package/codebase/{imgs_contrast_black → sources/less/skins/contrast_black/imgs_contrast_black}/resizing.png +0 -0
- package/codebase/sources/less/skins/contrast_black/skin.less +5 -5
- package/codebase/sources/less/skins/contrast_white/dhx_skin_contrast_white.less +3 -3
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/arrow_left.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/arrow_right.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/but_repeat.gif +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/calendar.gif +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/clock_big.gif +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/clock_small.gif +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/close_icon.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/collapse_expand_icon.gif +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/controls.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/databg.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/export_ical.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/export_pdf.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/quick_info_edit.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/resize_dots.png +0 -0
- package/codebase/{imgs_contrast_white → sources/less/skins/contrast_white/imgs_contrast_white}/resizing.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/flat/imgs_flat}/agenda_bg.gif +0 -0
- package/codebase/{imgs_flat → sources/less/skins/flat/imgs_flat}/arrow_left.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/flat/imgs_flat}/arrow_right.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/but_repeat.gif +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/calendar.gif +0 -0
- package/codebase/{imgs_flat → sources/less/skins/flat/imgs_flat}/clock.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/clock_big.gif +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/clock_small.gif +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/flat/imgs_flat}/close_icon.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/collapse_expand_icon.gif +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/flat/imgs_flat}/controls.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/databg.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/databg_now.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/flat/imgs_flat}/export_ical.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/flat/imgs_flat}/export_pdf.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/flat/imgs_flat}/resize_dots.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/flat/imgs_flat}/resizing.png +0 -0
- package/codebase/sources/less/skins/flat/skin.less +5 -5
- package/codebase/sources/less/skins/material/add_styles.less +17 -16
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/Shape.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/agenda-calendar-hov.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/agenda-calendar.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/agenda_bg.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/arrow_left.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/arrow_left_hov.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/arrow_right.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/arrow_right_hov.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/but_repeat.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/calendar.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/clock_big.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/clock_small.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/material/imgs_dhx_material}/close_icon.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/collapse_expand_icon.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/material/imgs_dhx_material}/controls.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/databg.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/drag-horizontal.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/drag-vertical.svg +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/material/imgs_dhx_material}/export_ical.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/material/imgs_dhx_material}/export_pdf.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/icon.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/menu-down.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/resizing.png +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/time.svg +0 -0
- package/codebase/{imgs_dhx_material → sources/less/skins/material/imgs_dhx_material}/tree_arrow.svg +0 -0
- package/codebase/sources/less/skins/material/skin.less +3 -3
- package/codebase/{imgs_dhx_terrace → sources/less/skins/terrace/imgs_dhx_terrace}/arrow_left.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/terrace/imgs_dhx_terrace}/arrow_right.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/but_repeat.gif +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/calendar.gif +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/clock_big.gif +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/clock_small.gif +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/close_icon.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/collapse_expand_icon.gif +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/controls.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/databg.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/databg_now.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/export_ical.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/export_pdf.png +0 -0
- package/codebase/{imgs_flat → sources/less/skins/terrace/imgs_dhx_terrace}/resize_dots.png +0 -0
- package/codebase/{imgs_dhx_terrace → sources/less/skins/terrace/imgs_dhx_terrace}/resizing.png +0 -0
- package/codebase/sources/less/skins/terrace/skin.less +2 -2
- package/codebase/sources/skins/dhtmlxscheduler_contrast_black.css +126 -79
- package/codebase/sources/skins/dhtmlxscheduler_contrast_white.css +138 -91
- package/codebase/sources/skins/dhtmlxscheduler_flat.css +121 -74
- package/codebase/sources/skins/dhtmlxscheduler_material.css +162 -114
- package/codebase/sources/skins/dhtmlxscheduler_terrace.css +125 -78
- package/package.json +1 -1
- package/whatsnew.md +27 -0
- package/codebase/ext/dhtmlxscheduler_active_links.js +0 -13
- package/codebase/ext/dhtmlxscheduler_agenda_view.js +0 -18
- package/codebase/ext/dhtmlxscheduler_all_timed.js +0 -17
- package/codebase/ext/dhtmlxscheduler_collision.js +0 -15
- package/codebase/ext/dhtmlxscheduler_container_autoresize.js +0 -23
- package/codebase/ext/dhtmlxscheduler_cookie.js +0 -14
- package/codebase/ext/dhtmlxscheduler_csp.js +0 -16
- package/codebase/ext/dhtmlxscheduler_editors.js +0 -18
- package/codebase/ext/dhtmlxscheduler_expand.js +0 -15
- package/codebase/ext/dhtmlxscheduler_html_templates.js +0 -12
- package/codebase/ext/dhtmlxscheduler_key_nav.js +0 -111
- package/codebase/ext/dhtmlxscheduler_layer.js +0 -33
- package/codebase/ext/dhtmlxscheduler_limit.js +0 -44
- package/codebase/ext/dhtmlxscheduler_map_view.js +0 -35
- package/codebase/ext/dhtmlxscheduler_minical.js +0 -35
- package/codebase/ext/dhtmlxscheduler_monthheight.js +0 -13
- package/codebase/ext/dhtmlxscheduler_multiselect.js +0 -15
- package/codebase/ext/dhtmlxscheduler_multisource.js +0 -12
- package/codebase/ext/dhtmlxscheduler_mvc.js +0 -15
- package/codebase/ext/dhtmlxscheduler_outerdrag.js +0 -14
- package/codebase/ext/dhtmlxscheduler_pdf.js +0 -28
- package/codebase/ext/dhtmlxscheduler_quick_info.js +0 -23
- package/codebase/ext/dhtmlxscheduler_readonly.js +0 -18
- package/codebase/ext/dhtmlxscheduler_recurring.js +0 -54
- package/codebase/ext/dhtmlxscheduler_serialize.js +0 -16
- package/codebase/ext/dhtmlxscheduler_tooltip.js +0 -19
- package/codebase/ext/dhtmlxscheduler_url.js +0 -14
- package/codebase/ext/dhtmlxscheduler_wp.js +0 -12
- package/codebase/ext/dhtmlxscheduler_year_view.js +0 -30
- package/codebase/locale/locale_ar.js +0 -14
- package/codebase/locale/locale_be.js +0 -16
- package/codebase/locale/locale_ca.js +0 -14
- package/codebase/locale/locale_cn.js +0 -15
- package/codebase/locale/locale_cs.js +0 -16
- package/codebase/locale/locale_da.js +0 -16
- package/codebase/locale/locale_de.js +0 -16
- package/codebase/locale/locale_el.js +0 -16
- package/codebase/locale/locale_en.js +0 -16
- package/codebase/locale/locale_es.js +0 -16
- package/codebase/locale/locale_fi.js +0 -17
- package/codebase/locale/locale_fr.js +0 -16
- package/codebase/locale/locale_he.js +0 -16
- package/codebase/locale/locale_hu.js +0 -14
- package/codebase/locale/locale_id.js +0 -14
- package/codebase/locale/locale_it.js +0 -16
- package/codebase/locale/locale_jp.js +0 -14
- package/codebase/locale/locale_nb.js +0 -16
- package/codebase/locale/locale_nl.js +0 -16
- package/codebase/locale/locale_no.js +0 -14
- package/codebase/locale/locale_pl.js +0 -16
- package/codebase/locale/locale_pt.js +0 -16
- package/codebase/locale/locale_ro.js +0 -16
- package/codebase/locale/locale_ru.js +0 -16
- package/codebase/locale/locale_si.js +0 -14
- package/codebase/locale/locale_sk.js +0 -16
- package/codebase/locale/locale_sv.js +0 -16
- package/codebase/locale/locale_tr.js +0 -14
- package/codebase/locale/locale_ua.js +0 -16
- package/codebase/locale/recurring/locale_recurring_be.js +0 -14
- package/codebase/locale/recurring/locale_recurring_cn.js +0 -14
- package/codebase/locale/recurring/locale_recurring_cs.js +0 -14
- package/codebase/locale/recurring/locale_recurring_da.js +0 -14
- package/codebase/locale/recurring/locale_recurring_de.js +0 -14
- package/codebase/locale/recurring/locale_recurring_el.js +0 -14
- package/codebase/locale/recurring/locale_recurring_en.js +0 -14
- package/codebase/locale/recurring/locale_recurring_es.js +0 -14
- package/codebase/locale/recurring/locale_recurring_fi.js +0 -14
- package/codebase/locale/recurring/locale_recurring_fr.js +0 -14
- package/codebase/locale/recurring/locale_recurring_he.js +0 -14
- package/codebase/locale/recurring/locale_recurring_it.js +0 -14
- package/codebase/locale/recurring/locale_recurring_nb.js +0 -14
- package/codebase/locale/recurring/locale_recurring_nl.js +0 -14
- package/codebase/locale/recurring/locale_recurring_pl.js +0 -14
- package/codebase/locale/recurring/locale_recurring_pt.js +0 -14
- package/codebase/locale/recurring/locale_recurring_ro.js +0 -14
- package/codebase/locale/recurring/locale_recurring_ru.js +0 -14
- package/codebase/locale/recurring/locale_recurring_sk.js +0 -14
- package/codebase/locale/recurring/locale_recurring_sv.js +0 -14
- package/codebase/locale/recurring/locale_recurring_ua.js +0 -14
- package/codebase/locale/recurring/repeat_template_be.html +0 -57
- package/codebase/locale/recurring/repeat_template_cn.html +0 -57
- package/codebase/locale/recurring/repeat_template_de.html +0 -60
- package/codebase/locale/recurring/repeat_template_el.html +0 -57
- package/codebase/locale/recurring/repeat_template_en.html +0 -57
- package/codebase/locale/recurring/repeat_template_es.html +0 -57
- package/codebase/locale/recurring/repeat_template_fr.html +0 -57
- package/codebase/locale/recurring/repeat_template_he.html +0 -61
- package/codebase/locale/recurring/repeat_template_it.html +0 -57
- package/codebase/locale/recurring/repeat_template_nl.html +0 -65
- package/codebase/locale/recurring/repeat_template_ro.html +0 -57
- package/codebase/locale/recurring/repeat_template_ru.html +0 -57
- package/codebase/locale/recurring/repeat_template_sk.html +0 -57
- package/codebase/sources/dhtmlxscheduler.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_active_links.js +0 -50
- package/codebase/sources/ext/dhtmlxscheduler_active_links.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_agenda_view.js +0 -150
- package/codebase/sources/ext/dhtmlxscheduler_agenda_view.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_all_timed.js +0 -193
- package/codebase/sources/ext/dhtmlxscheduler_all_timed.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_collision.js +0 -140
- package/codebase/sources/ext/dhtmlxscheduler_collision.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_container_autoresize.js +0 -338
- package/codebase/sources/ext/dhtmlxscheduler_container_autoresize.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_cookie.js +0 -96
- package/codebase/sources/ext/dhtmlxscheduler_cookie.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_csp.js +0 -106
- package/codebase/sources/ext/dhtmlxscheduler_csp.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_editors.js +0 -183
- package/codebase/sources/ext/dhtmlxscheduler_editors.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_expand.js +0 -87
- package/codebase/sources/ext/dhtmlxscheduler_expand.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_html_templates.js +0 -29
- package/codebase/sources/ext/dhtmlxscheduler_html_templates.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_key_nav.js +0 -3099
- package/codebase/sources/ext/dhtmlxscheduler_key_nav.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_layer.js +0 -424
- package/codebase/sources/ext/dhtmlxscheduler_layer.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_limit.js +0 -1095
- package/codebase/sources/ext/dhtmlxscheduler_limit.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_map_view.js +0 -514
- package/codebase/sources/ext/dhtmlxscheduler_map_view.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_minical.js +0 -570
- package/codebase/sources/ext/dhtmlxscheduler_minical.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_monthheight.js +0 -41
- package/codebase/sources/ext/dhtmlxscheduler_monthheight.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_multiselect.js +0 -112
- package/codebase/sources/ext/dhtmlxscheduler_multiselect.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_multisource.js +0 -36
- package/codebase/sources/ext/dhtmlxscheduler_multisource.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_mvc.js +0 -154
- package/codebase/sources/ext/dhtmlxscheduler_mvc.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_outerdrag.js +0 -86
- package/codebase/sources/ext/dhtmlxscheduler_outerdrag.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_pdf.js +0 -405
- package/codebase/sources/ext/dhtmlxscheduler_pdf.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_quick_info.js +0 -288
- package/codebase/sources/ext/dhtmlxscheduler_quick_info.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_readonly.js +0 -200
- package/codebase/sources/ext/dhtmlxscheduler_readonly.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_recurring.js +0 -1324
- package/codebase/sources/ext/dhtmlxscheduler_recurring.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_serialize.js +0 -116
- package/codebase/sources/ext/dhtmlxscheduler_serialize.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_tooltip.js +0 -229
- package/codebase/sources/ext/dhtmlxscheduler_tooltip.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_url.js +0 -91
- package/codebase/sources/ext/dhtmlxscheduler_url.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_wp.js +0 -27
- package/codebase/sources/ext/dhtmlxscheduler_wp.js.map +0 -1
- package/codebase/sources/ext/dhtmlxscheduler_year_view.js +0 -442
- package/codebase/sources/ext/dhtmlxscheduler_year_view.js.map +0 -1
- package/codebase/sources/less/imgs/but_repeat.gif +0 -0
- package/codebase/sources/less/imgs/buttons.png +0 -0
- package/codebase/sources/less/imgs/calendar.gif +0 -0
- package/codebase/sources/less/imgs/clock_big.gif +0 -0
- package/codebase/sources/less/imgs/clock_small.gif +0 -0
- package/codebase/sources/less/imgs/collapse_expand_icon.gif +0 -0
- package/codebase/sources/less/imgs/controls.gif +0 -0
- package/codebase/sources/less/imgs/databg.png +0 -0
- package/codebase/sources/less/imgs/databg_now.png +0 -0
- package/codebase/sources/less/imgs/export_ical.png +0 -0
- package/codebase/sources/less/imgs/export_pdf.png +0 -0
- package/codebase/sources/less/imgs/icon.png +0 -0
- package/codebase/sources/less/imgs/images.png +0 -0
- package/codebase/sources/less/imgs/loading.gif +0 -0
- package/codebase/sources/less/imgs/resize_dots.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/arrow_left.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/arrow_right.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/but_repeat.gif +0 -0
- package/codebase/sources/less/imgs_contrast_black/calendar.gif +0 -0
- package/codebase/sources/less/imgs_contrast_black/clock_big.gif +0 -0
- package/codebase/sources/less/imgs_contrast_black/clock_small.gif +0 -0
- package/codebase/sources/less/imgs_contrast_black/close_icon.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/collapse_expand_icon.gif +0 -0
- package/codebase/sources/less/imgs_contrast_black/controls.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/databg.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/databg_now.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/export_ical.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/export_pdf.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/resize_dots.png +0 -0
- package/codebase/sources/less/imgs_contrast_black/resizing.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/arrow_left.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/arrow_right.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/but_repeat.gif +0 -0
- package/codebase/sources/less/imgs_contrast_white/calendar.gif +0 -0
- package/codebase/sources/less/imgs_contrast_white/clock_big.gif +0 -0
- package/codebase/sources/less/imgs_contrast_white/clock_small.gif +0 -0
- package/codebase/sources/less/imgs_contrast_white/close_icon.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/collapse_expand_icon.gif +0 -0
- package/codebase/sources/less/imgs_contrast_white/controls.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/databg.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/export_ical.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/export_pdf.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/quick_info_edit.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/resize_dots.png +0 -0
- package/codebase/sources/less/imgs_contrast_white/resizing.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/Shape.svg +0 -3
- package/codebase/sources/less/imgs_dhx_material/agenda-calendar-hov.svg +0 -4
- package/codebase/sources/less/imgs_dhx_material/agenda-calendar.svg +0 -4
- package/codebase/sources/less/imgs_dhx_material/agenda_bg.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/arrow_left.svg +0 -3
- package/codebase/sources/less/imgs_dhx_material/arrow_left_hov.svg +0 -3
- package/codebase/sources/less/imgs_dhx_material/arrow_right.svg +0 -3
- package/codebase/sources/less/imgs_dhx_material/arrow_right_hov.svg +0 -3
- package/codebase/sources/less/imgs_dhx_material/but_repeat.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/calendar.svg +0 -4
- package/codebase/sources/less/imgs_dhx_material/clock_big.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/clock_small.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/close_icon.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/collapse_expand_icon.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/controls.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/databg.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/drag-horizontal.svg +0 -5
- package/codebase/sources/less/imgs_dhx_material/drag-vertical.svg +0 -14
- package/codebase/sources/less/imgs_dhx_material/export_ical.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/export_pdf.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/icon.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/menu-down.svg +0 -1
- package/codebase/sources/less/imgs_dhx_material/resizing.png +0 -0
- package/codebase/sources/less/imgs_dhx_material/time.svg +0 -24
- package/codebase/sources/less/imgs_dhx_material/tree_arrow.svg +0 -3
- package/codebase/sources/less/imgs_dhx_terrace/arrow_left.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/arrow_right.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/but_repeat.gif +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/calendar.gif +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/clock_big.gif +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/clock_small.gif +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/close_icon.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/collapse_expand_icon.gif +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/controls.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/databg.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/databg_now.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/export_ical.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/export_pdf.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/resize_dots.png +0 -0
- package/codebase/sources/less/imgs_dhx_terrace/resizing.png +0 -0
- package/codebase/sources/less/imgs_flat/agenda_bg.gif +0 -0
- package/codebase/sources/less/imgs_flat/arrow_left.png +0 -0
- package/codebase/sources/less/imgs_flat/arrow_right.png +0 -0
- package/codebase/sources/less/imgs_flat/but_repeat.gif +0 -0
- package/codebase/sources/less/imgs_flat/calendar.gif +0 -0
- package/codebase/sources/less/imgs_flat/clock.png +0 -0
- package/codebase/sources/less/imgs_flat/clock_big.gif +0 -0
- package/codebase/sources/less/imgs_flat/clock_small.gif +0 -0
- package/codebase/sources/less/imgs_flat/close_icon.png +0 -0
- package/codebase/sources/less/imgs_flat/collapse_expand_icon.gif +0 -0
- package/codebase/sources/less/imgs_flat/controls.png +0 -0
- package/codebase/sources/less/imgs_flat/databg.png +0 -0
- package/codebase/sources/less/imgs_flat/databg_now.png +0 -0
- package/codebase/sources/less/imgs_flat/export_ical.png +0 -0
- package/codebase/sources/less/imgs_flat/export_pdf.png +0 -0
- package/codebase/sources/less/imgs_flat/resize_dots.png +0 -0
- package/codebase/sources/less/imgs_flat/resizing.png +0 -0
- package/codebase/sources/locale/locale_ar.js +0 -65
- package/codebase/sources/locale/locale_ar.js.map +0 -1
- package/codebase/sources/locale/locale_be.js +0 -104
- package/codebase/sources/locale/locale_be.js.map +0 -1
- package/codebase/sources/locale/locale_ca.js +0 -76
- package/codebase/sources/locale/locale_ca.js.map +0 -1
- package/codebase/sources/locale/locale_cn.js +0 -109
- package/codebase/sources/locale/locale_cn.js.map +0 -1
- package/codebase/sources/locale/locale_cs.js +0 -103
- package/codebase/sources/locale/locale_cs.js.map +0 -1
- package/codebase/sources/locale/locale_da.js +0 -102
- package/codebase/sources/locale/locale_da.js.map +0 -1
- package/codebase/sources/locale/locale_de.js +0 -102
- package/codebase/sources/locale/locale_de.js.map +0 -1
- package/codebase/sources/locale/locale_el.js +0 -103
- package/codebase/sources/locale/locale_el.js.map +0 -1
- package/codebase/sources/locale/locale_en.js +0 -103
- package/codebase/sources/locale/locale_en.js.map +0 -1
- package/codebase/sources/locale/locale_es.js +0 -104
- package/codebase/sources/locale/locale_es.js.map +0 -1
- package/codebase/sources/locale/locale_fi.js +0 -103
- package/codebase/sources/locale/locale_fi.js.map +0 -1
- package/codebase/sources/locale/locale_fr.js +0 -101
- package/codebase/sources/locale/locale_fr.js.map +0 -1
- package/codebase/sources/locale/locale_he.js +0 -103
- package/codebase/sources/locale/locale_he.js.map +0 -1
- package/codebase/sources/locale/locale_hu.js +0 -70
- package/codebase/sources/locale/locale_hu.js.map +0 -1
- package/codebase/sources/locale/locale_id.js +0 -11
- package/codebase/sources/locale/locale_id.js.map +0 -1
- package/codebase/sources/locale/locale_it.js +0 -101
- package/codebase/sources/locale/locale_it.js.map +0 -1
- package/codebase/sources/locale/locale_jp.js +0 -78
- package/codebase/sources/locale/locale_jp.js.map +0 -1
- package/codebase/sources/locale/locale_nb.js +0 -101
- package/codebase/sources/locale/locale_nb.js.map +0 -1
- package/codebase/sources/locale/locale_nl.js +0 -103
- package/codebase/sources/locale/locale_nl.js.map +0 -1
- package/codebase/sources/locale/locale_no.js +0 -76
- package/codebase/sources/locale/locale_no.js.map +0 -1
- package/codebase/sources/locale/locale_pl.js +0 -103
- package/codebase/sources/locale/locale_pl.js.map +0 -1
- package/codebase/sources/locale/locale_pt.js +0 -113
- package/codebase/sources/locale/locale_pt.js.map +0 -1
- package/codebase/sources/locale/locale_ro.js +0 -107
- package/codebase/sources/locale/locale_ro.js.map +0 -1
- package/codebase/sources/locale/locale_ru.js +0 -101
- package/codebase/sources/locale/locale_ru.js.map +0 -1
- package/codebase/sources/locale/locale_si.js +0 -76
- package/codebase/sources/locale/locale_si.js.map +0 -1
- package/codebase/sources/locale/locale_sk.js +0 -103
- package/codebase/sources/locale/locale_sk.js.map +0 -1
- package/codebase/sources/locale/locale_sv.js +0 -102
- package/codebase/sources/locale/locale_sv.js.map +0 -1
- package/codebase/sources/locale/locale_tr.js +0 -74
- package/codebase/sources/locale/locale_tr.js.map +0 -1
- package/codebase/sources/locale/locale_ua.js +0 -102
- package/codebase/sources/locale/locale_ua.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_be.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_be.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_cn.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_cn.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_cs.js +0 -12
- package/codebase/sources/locale/recurring/locale_recurring_cs.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_da.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_da.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_de.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_de.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_el.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_el.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_en.js +0 -11
- package/codebase/sources/locale/recurring/locale_recurring_en.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_es.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_es.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_fi.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_fi.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_fr.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_fr.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_he.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_he.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_it.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_it.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_nb.js +0 -11
- package/codebase/sources/locale/recurring/locale_recurring_nb.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_nl.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_nl.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_pl.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_pl.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_pt.js +0 -11
- package/codebase/sources/locale/recurring/locale_recurring_pt.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_ro.js +0 -17
- package/codebase/sources/locale/recurring/locale_recurring_ro.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_ru.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_ru.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_sk.js +0 -12
- package/codebase/sources/locale/recurring/locale_recurring_sk.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_sv.js +0 -11
- package/codebase/sources/locale/recurring/locale_recurring_sv.js.map +0 -1
- package/codebase/sources/locale/recurring/locale_recurring_ua.js +0 -13
- package/codebase/sources/locale/recurring/locale_recurring_ua.js.map +0 -1
- package/codebase/sources/locale/recurring/repeat_template_be.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_cn.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_de.html +0 -60
- package/codebase/sources/locale/recurring/repeat_template_el.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_en.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_es.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_fr.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_he.html +0 -61
- package/codebase/sources/locale/recurring/repeat_template_it.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_nl.html +0 -65
- package/codebase/sources/locale/recurring/repeat_template_ro.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_ru.html +0 -57
- package/codebase/sources/locale/recurring/repeat_template_sk.html +0 -57
|
@@ -1,3099 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
@license
|
|
4
|
-
dhtmlxScheduler v.5.3.14 Standard
|
|
5
|
-
|
|
6
|
-
To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com
|
|
7
|
-
|
|
8
|
-
(c) XB Software Ltd.
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
(function(){
|
|
12
|
-
|
|
13
|
-
function setupKeyNav(scheduler){
|
|
14
|
-
scheduler.config.key_nav = true;
|
|
15
|
-
scheduler.config.key_nav_step = 30;
|
|
16
|
-
scheduler.addShortcut = function(shortcut, handler, scope){
|
|
17
|
-
var scopeObject = getScope(scope);
|
|
18
|
-
if(scopeObject){
|
|
19
|
-
scopeObject.prototype.bind(shortcut, handler);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
scheduler.getShortcutHandler = function(shortcut, scope){
|
|
24
|
-
var scopeObject = getScope(scope);
|
|
25
|
-
if(scopeObject){
|
|
26
|
-
var commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);
|
|
27
|
-
if(commands.length){
|
|
28
|
-
return scopeObject.prototype.findHandler(commands[0]);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
scheduler.removeShortcut = function(shortcut, scope){
|
|
34
|
-
var scopeObject = getScope(scope);
|
|
35
|
-
if(scopeObject){
|
|
36
|
-
scopeObject.prototype.unbind(shortcut);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
scheduler.focus = function(){
|
|
41
|
-
if(!scheduler.config.key_nav){
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
var disp = scheduler.$keyboardNavigation.dispatcher;
|
|
45
|
-
disp.enable();
|
|
46
|
-
var activeNode = disp.getActiveNode();
|
|
47
|
-
if(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){
|
|
48
|
-
disp.setDefaultNode();
|
|
49
|
-
}else{
|
|
50
|
-
disp.focusNode(disp.getActiveNode());
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
function getScope(mode){
|
|
55
|
-
var scopes = {
|
|
56
|
-
"minicalButton":scheduler.$keyboardNavigation.MinicalButton,
|
|
57
|
-
"minicalDate":scheduler.$keyboardNavigation.MinicalCell,
|
|
58
|
-
"scheduler":scheduler.$keyboardNavigation.SchedulerNode,
|
|
59
|
-
"dataArea": scheduler.$keyboardNavigation.DataArea,
|
|
60
|
-
"timeSlot": scheduler.$keyboardNavigation.TimeSlot,
|
|
61
|
-
"event": scheduler.$keyboardNavigation.Event
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var searchMap = {};
|
|
65
|
-
for(var i in scopes)
|
|
66
|
-
searchMap[i.toLowerCase()] = scopes[i];
|
|
67
|
-
|
|
68
|
-
mode = (mode + "").toLowerCase();
|
|
69
|
-
|
|
70
|
-
return searchMap[mode] || scopes.scheduler;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
scheduler.$keyboardNavigation = {};
|
|
74
|
-
|
|
75
|
-
scheduler._compose = function(){
|
|
76
|
-
var parts = Array.prototype.slice.call(arguments, 0);
|
|
77
|
-
var res = {};
|
|
78
|
-
for(var i = 0; i < parts.length; i++){
|
|
79
|
-
var obj = parts[i];
|
|
80
|
-
if(typeof obj == "function"){
|
|
81
|
-
obj = new obj();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
for(var p in obj){
|
|
85
|
-
res[p] = obj[p];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return res;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
scheduler.$keyboardNavigation.shortcuts = {
|
|
92
|
-
createCommand: function(){
|
|
93
|
-
return {
|
|
94
|
-
modifiers:{
|
|
95
|
-
"shift": false,
|
|
96
|
-
"alt": false,
|
|
97
|
-
"ctrl": false,
|
|
98
|
-
"meta": false
|
|
99
|
-
},
|
|
100
|
-
keyCode: null
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
parse: function(shortcut){
|
|
104
|
-
var commands = [];
|
|
105
|
-
|
|
106
|
-
var expr = this.getExpressions(this.trim(shortcut));
|
|
107
|
-
for(var i = 0; i < expr.length; i++){
|
|
108
|
-
var words = this.getWords(expr[i]);
|
|
109
|
-
|
|
110
|
-
var command = this.createCommand();
|
|
111
|
-
|
|
112
|
-
for(var j = 0; j < words.length; j++){
|
|
113
|
-
if(this.commandKeys[words[j]]){
|
|
114
|
-
command.modifiers[words[j]] = true;
|
|
115
|
-
}else if(this.specialKeys[words[j]]){
|
|
116
|
-
command.keyCode = this.specialKeys[words[j]];
|
|
117
|
-
}else{
|
|
118
|
-
command.keyCode = words[j].charCodeAt(0);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
commands.push(command);
|
|
123
|
-
}
|
|
124
|
-
return commands;
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
getCommandFromEvent: function(domEvent){
|
|
128
|
-
var command = this.createCommand();
|
|
129
|
-
command.modifiers.shift = !!domEvent.shiftKey;
|
|
130
|
-
command.modifiers.alt = !!domEvent.altKey;
|
|
131
|
-
command.modifiers.ctrl = !!domEvent.ctrlKey;
|
|
132
|
-
command.modifiers.meta = !!domEvent.metaKey;
|
|
133
|
-
command.keyCode = domEvent.which || domEvent.keyCode;
|
|
134
|
-
|
|
135
|
-
if(command.keyCode >= 96 && command.keyCode <= 105){
|
|
136
|
-
// numpad keys 96-105 -> 48-57
|
|
137
|
-
command.keyCode -= 48;//convert numpad number code to regular number code
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var printableKey = String.fromCharCode(command.keyCode );
|
|
141
|
-
if(printableKey){
|
|
142
|
-
command.keyCode = printableKey.toLowerCase().charCodeAt(0);
|
|
143
|
-
}
|
|
144
|
-
return command;
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
getHashFromEvent: function(domEvent){
|
|
148
|
-
return this.getHash(this.getCommandFromEvent(domEvent));
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
getHash: function(command){
|
|
152
|
-
var parts = [];
|
|
153
|
-
for(var i in command.modifiers){
|
|
154
|
-
if(command.modifiers[i]){
|
|
155
|
-
parts.push(i);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
parts.push(command.keyCode);
|
|
159
|
-
|
|
160
|
-
return parts.join(this.junctionChar);
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
getExpressions: function(shortcut){
|
|
164
|
-
return shortcut.split(this.junctionChar);
|
|
165
|
-
},
|
|
166
|
-
getWords: function(term){
|
|
167
|
-
return term.split(this.combinationChar);
|
|
168
|
-
},
|
|
169
|
-
trim: function(shortcut){
|
|
170
|
-
return shortcut.replace(/\s/g, "");
|
|
171
|
-
},
|
|
172
|
-
junctionChar:",",
|
|
173
|
-
combinationChar:"+",
|
|
174
|
-
commandKeys:{
|
|
175
|
-
"shift": 16,
|
|
176
|
-
"alt": 18,
|
|
177
|
-
"ctrl": 17,
|
|
178
|
-
"meta": true
|
|
179
|
-
},
|
|
180
|
-
specialKeys:{
|
|
181
|
-
"backspace": 8,
|
|
182
|
-
"tab": 9,
|
|
183
|
-
"enter": 13,
|
|
184
|
-
"esc": 27,
|
|
185
|
-
"space": 32,
|
|
186
|
-
"up": 38,
|
|
187
|
-
"down": 40,
|
|
188
|
-
"left": 37,
|
|
189
|
-
"right": 39,
|
|
190
|
-
"home": 36,
|
|
191
|
-
"end": 35,
|
|
192
|
-
"pageup": 33,
|
|
193
|
-
"pagedown": 34,
|
|
194
|
-
"delete": 46,
|
|
195
|
-
"insert": 45,
|
|
196
|
-
"plus":107,
|
|
197
|
-
"f1": 112,
|
|
198
|
-
"f2": 113,
|
|
199
|
-
"f3": 114,
|
|
200
|
-
"f4": 115,
|
|
201
|
-
"f5": 116,
|
|
202
|
-
"f6": 117,
|
|
203
|
-
"f7": 118,
|
|
204
|
-
"f8": 119,
|
|
205
|
-
"f9": 120,
|
|
206
|
-
"f10": 121,
|
|
207
|
-
"f11": 122,
|
|
208
|
-
"f12": 123
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
scheduler.$keyboardNavigation.EventHandler = {
|
|
212
|
-
_handlers: null,
|
|
213
|
-
findHandler: function(command){
|
|
214
|
-
if(!this._handlers) this._handlers = {};
|
|
215
|
-
var shortcuts = scheduler.$keyboardNavigation.shortcuts;
|
|
216
|
-
var hash = shortcuts.getHash(command);
|
|
217
|
-
|
|
218
|
-
return this._handlers[hash];
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
doAction: function(command, e){
|
|
222
|
-
var handler = this.findHandler(command);
|
|
223
|
-
if(handler){
|
|
224
|
-
handler.call(this, e);
|
|
225
|
-
|
|
226
|
-
if (e.preventDefault) e.preventDefault();
|
|
227
|
-
else e.returnValue = false;
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
bind: function(shortcut, handler){
|
|
232
|
-
if(!this._handlers) this._handlers = {};
|
|
233
|
-
|
|
234
|
-
var shortcuts = scheduler.$keyboardNavigation.shortcuts;
|
|
235
|
-
|
|
236
|
-
var commands = shortcuts.parse(shortcut);
|
|
237
|
-
for(var i = 0; i < commands.length; i++){
|
|
238
|
-
this._handlers[shortcuts.getHash(commands[i])] = handler;
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
unbind: function(shortcut){
|
|
242
|
-
var shortcuts = scheduler.$keyboardNavigation.shortcuts;
|
|
243
|
-
|
|
244
|
-
var commands = shortcuts.parse(shortcut);
|
|
245
|
-
for(var i = 0; i < commands.length; i++){
|
|
246
|
-
if(this._handlers[shortcuts.getHash(commands[i])]){
|
|
247
|
-
delete this._handlers[shortcuts.getHash(commands[i])];
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
bindAll: function(map){
|
|
253
|
-
for(var i in map){
|
|
254
|
-
this.bind(i, map[i]);
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
initKeys: function(){
|
|
258
|
-
if(!this._handlers)
|
|
259
|
-
this._handlers = {};
|
|
260
|
-
if(this.keys){
|
|
261
|
-
this.bindAll(this.keys);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
(function(){
|
|
266
|
-
scheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;
|
|
267
|
-
|
|
268
|
-
scheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){
|
|
269
|
-
if(e.keyCode != 9) return false;
|
|
270
|
-
|
|
271
|
-
var focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);
|
|
272
|
-
var currentFocus = document.activeElement;
|
|
273
|
-
var currentIndex = -1;
|
|
274
|
-
for(var i = 0; i < focusable.length; i++){
|
|
275
|
-
if(focusable[i] == currentFocus){
|
|
276
|
-
currentIndex = i;
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
var nextIndex, nextItem;
|
|
282
|
-
if(e.shiftKey){
|
|
283
|
-
|
|
284
|
-
// back tab
|
|
285
|
-
// go to the last element if we focused on the first
|
|
286
|
-
nextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);
|
|
287
|
-
|
|
288
|
-
nextItem = focusable[nextIndex];
|
|
289
|
-
if(nextItem){
|
|
290
|
-
nextItem.focus();
|
|
291
|
-
e.preventDefault();
|
|
292
|
-
return true;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
}else{
|
|
296
|
-
// forward tab
|
|
297
|
-
// forward tab from last element should go back to the first element
|
|
298
|
-
nextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);
|
|
299
|
-
nextItem = focusable[nextIndex];
|
|
300
|
-
if(nextItem){
|
|
301
|
-
nextItem.focus();
|
|
302
|
-
e.preventDefault();
|
|
303
|
-
return true;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return false;
|
|
309
|
-
};
|
|
310
|
-
})();
|
|
311
|
-
scheduler.$keyboardNavigation.marker = {
|
|
312
|
-
clear: function(){
|
|
313
|
-
var divs = scheduler.$container.querySelectorAll(".dhx_focus_slot");
|
|
314
|
-
for(var i = 0; i < divs.length; i++){
|
|
315
|
-
divs[i].parentNode.removeChild(divs[i]);
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
createElement: function(){
|
|
319
|
-
var element = document.createElement("div");
|
|
320
|
-
element.setAttribute("tabindex", -1);
|
|
321
|
-
element.className = "dhx_focus_slot";
|
|
322
|
-
return element;
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
renderMultiple: function(start, end, method){
|
|
326
|
-
var divs = [];
|
|
327
|
-
var currentStart = new Date(start);
|
|
328
|
-
var currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, "day").valueOf()));
|
|
329
|
-
while(currentStart.valueOf() < end.valueOf()){
|
|
330
|
-
|
|
331
|
-
divs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));
|
|
332
|
-
currentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, "day"));
|
|
333
|
-
|
|
334
|
-
currentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, "day"));
|
|
335
|
-
currentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
return divs;
|
|
339
|
-
},
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
render: function(start, end, section){
|
|
343
|
-
this.clear();
|
|
344
|
-
var divs = [];
|
|
345
|
-
|
|
346
|
-
var modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;
|
|
347
|
-
var view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();
|
|
348
|
-
switch (view){
|
|
349
|
-
case modes.units:
|
|
350
|
-
divs = this.renderVerticalMarker(start, end, section);
|
|
351
|
-
break;
|
|
352
|
-
case modes.timeline:
|
|
353
|
-
divs = this.renderTimelineMarker(start, end, section);
|
|
354
|
-
break;
|
|
355
|
-
case modes.year:
|
|
356
|
-
divs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));
|
|
357
|
-
break;
|
|
358
|
-
case modes.month:
|
|
359
|
-
divs = this.renderMonthMarker(start, end);
|
|
360
|
-
break;
|
|
361
|
-
case modes.weekAgenda:
|
|
362
|
-
divs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));
|
|
363
|
-
break;
|
|
364
|
-
case modes.list:
|
|
365
|
-
divs = this.renderAgendaMarker(start, end);
|
|
366
|
-
break;
|
|
367
|
-
case modes.dayColumns:
|
|
368
|
-
divs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));
|
|
369
|
-
break;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
this.addWaiAriaLabel(divs, start, end, section);
|
|
373
|
-
this.addDataAttributes(divs, start, end, section);
|
|
374
|
-
|
|
375
|
-
for(var i = divs.length - 1; i >= 0; i--){
|
|
376
|
-
if(divs[i].offsetWidth){
|
|
377
|
-
return divs[i];
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return null;
|
|
382
|
-
},
|
|
383
|
-
|
|
384
|
-
addDataAttributes: function(divs, start, end, section){
|
|
385
|
-
var dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);
|
|
386
|
-
|
|
387
|
-
var from = dateToStr(start),
|
|
388
|
-
to = dateToStr(end);
|
|
389
|
-
|
|
390
|
-
for(var i = 0; i < divs.length; i++){
|
|
391
|
-
divs[i].setAttribute("data-start-date", from);
|
|
392
|
-
divs[i].setAttribute("data-end-date", to);
|
|
393
|
-
if(section){
|
|
394
|
-
divs[i].setAttribute("data-section", section);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
|
|
399
|
-
addWaiAriaLabel: function(divs, start, end, section){
|
|
400
|
-
var label = "";
|
|
401
|
-
var state = scheduler.getState();
|
|
402
|
-
var mode = state.mode;
|
|
403
|
-
|
|
404
|
-
var dateTimeLabel = false;
|
|
405
|
-
|
|
406
|
-
label += scheduler.templates.day_date(start);
|
|
407
|
-
|
|
408
|
-
if((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){
|
|
409
|
-
label += " " + scheduler.templates.hour_scale(start);
|
|
410
|
-
dateTimeLabel = true;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
if((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){
|
|
414
|
-
|
|
415
|
-
label += " - " + scheduler.templates.day_date(end);
|
|
416
|
-
if(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){
|
|
417
|
-
label += " " + scheduler.templates.hour_scale(end);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
if(section){
|
|
422
|
-
if(scheduler.matrix && scheduler.matrix[mode]){
|
|
423
|
-
label += ", " + scheduler.templates[mode + "_scale_label"](section.key, section.label, section);
|
|
424
|
-
}else if(scheduler._props && scheduler._props[mode]){
|
|
425
|
-
label += ", " + scheduler.templates[mode + "_scale_text"](section.key, section.label, section);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
for(var i = 0; i < divs.length; i++){
|
|
431
|
-
scheduler._waiAria.setAttributes(divs[i], {
|
|
432
|
-
"aria-label": label,
|
|
433
|
-
"aria-live": "polite"
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
renderWeekAgendaMarker: function(start_date, end_date){
|
|
439
|
-
var divs = scheduler.$container.querySelectorAll(".dhx_wa_day_cont .dhx_wa_scale_bar");
|
|
440
|
-
|
|
441
|
-
var currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));
|
|
442
|
-
|
|
443
|
-
var index = -1;
|
|
444
|
-
var markerDate = scheduler.date.day_start(new Date(start_date));
|
|
445
|
-
for(var i = 0; i < divs.length; i++){
|
|
446
|
-
index++;
|
|
447
|
-
if(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){
|
|
448
|
-
break;
|
|
449
|
-
}else{
|
|
450
|
-
currDate = scheduler.date.add(currDate, 1, "day");
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
if(index != -1) return this._wrapDiv(divs[index]);
|
|
454
|
-
return [];
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
_wrapDiv: function(cell){
|
|
458
|
-
var marker = this.createElement();
|
|
459
|
-
marker.style.top = cell.offsetTop + "px";
|
|
460
|
-
marker.style.left = cell.offsetLeft + "px";
|
|
461
|
-
marker.style.width = cell.offsetWidth + "px";
|
|
462
|
-
marker.style.height = cell.offsetHeight + "px";
|
|
463
|
-
cell.appendChild(marker);
|
|
464
|
-
return [marker];
|
|
465
|
-
},
|
|
466
|
-
renderYearMarker: function(start_date, end_date){
|
|
467
|
-
var cell = scheduler._get_year_cell(start_date);
|
|
468
|
-
cell.style.position = "relative";
|
|
469
|
-
var marker = this.createElement();
|
|
470
|
-
marker.style.top = "0px";
|
|
471
|
-
marker.style.left = "0px";
|
|
472
|
-
marker.style.width = "100%";
|
|
473
|
-
marker.style.height = "100%";
|
|
474
|
-
cell.appendChild(marker);
|
|
475
|
-
return [marker];
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
renderAgendaMarker: function(start_date, end_date){
|
|
479
|
-
var block = this.createElement();
|
|
480
|
-
block.style.height = "1px";
|
|
481
|
-
block.style.width = "100%";
|
|
482
|
-
block.style.opacity = 1;
|
|
483
|
-
block.style.top = "0px";
|
|
484
|
-
block.style.left = "0px";
|
|
485
|
-
scheduler.$container.querySelector(".dhx_cal_data").appendChild(block);
|
|
486
|
-
return [block];
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
renderTimelineMarker: function(start_date, end_date, section){
|
|
490
|
-
var view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);
|
|
491
|
-
var areas = view_opts._scales;
|
|
492
|
-
//timespans must always use actual position, not rounded
|
|
493
|
-
view_opts.round_position = false;
|
|
494
|
-
var blocks = [];
|
|
495
|
-
|
|
496
|
-
var min_date = start_date ? new Date(start_date) : scheduler._min_date;
|
|
497
|
-
var max_date = end_date ? new Date(end_date) : scheduler._max_date;
|
|
498
|
-
|
|
499
|
-
if(min_date.valueOf() < scheduler._min_date.valueOf())
|
|
500
|
-
min_date = new Date(scheduler._min_date);
|
|
501
|
-
if(max_date.valueOf() > scheduler._max_date.valueOf())
|
|
502
|
-
max_date = new Date(scheduler._max_date);
|
|
503
|
-
|
|
504
|
-
if(!view_opts._trace_x) return blocks;
|
|
505
|
-
|
|
506
|
-
for(var i = 0; i < view_opts._trace_x.length; i++){
|
|
507
|
-
if(scheduler._is_column_visible(view_opts._trace_x[i]))
|
|
508
|
-
break;
|
|
509
|
-
}
|
|
510
|
-
if(i == view_opts._trace_x.length)
|
|
511
|
-
return blocks;
|
|
512
|
-
|
|
513
|
-
var area = areas[section];
|
|
514
|
-
|
|
515
|
-
if (!(min_date < end_date && max_date > start_date))
|
|
516
|
-
return blocks;
|
|
517
|
-
|
|
518
|
-
var block = this.createElement();
|
|
519
|
-
|
|
520
|
-
var start_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts)-1;
|
|
521
|
-
var end_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts)-1;
|
|
522
|
-
var height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));
|
|
523
|
-
|
|
524
|
-
var top = 0;
|
|
525
|
-
if (scheduler._isRender('cell')){
|
|
526
|
-
top = area.offsetTop;
|
|
527
|
-
start_pos += view_opts.dx;
|
|
528
|
-
end_pos += view_opts.dx;
|
|
529
|
-
area = scheduler.$container.querySelector(".dhx_cal_data");
|
|
530
|
-
}else{
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
var width = Math.max(1, end_pos - start_pos - 1);
|
|
534
|
-
block.style.cssText = "height: "+height+"px; left: "+start_pos+"px; width: "+width+"px; top: "+top+"px;";
|
|
535
|
-
|
|
536
|
-
area.appendChild(block);
|
|
537
|
-
blocks.push(block);
|
|
538
|
-
|
|
539
|
-
return blocks;
|
|
540
|
-
},
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
renderMonthCell: function(date){
|
|
545
|
-
var cells = scheduler.$container.querySelectorAll(".dhx_month_head");
|
|
546
|
-
|
|
547
|
-
var divs = [];
|
|
548
|
-
for(var i = 0; i < cells.length; i++){
|
|
549
|
-
divs.push(cells[i].parentNode);
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
var firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));
|
|
553
|
-
|
|
554
|
-
var index = -1;
|
|
555
|
-
var weekNumber = 0;
|
|
556
|
-
var dayIndex = -1;
|
|
557
|
-
var currDate = firstDate;
|
|
558
|
-
var markerDate = scheduler.date.day_start(new Date(date));
|
|
559
|
-
for(var i = 0; i < divs.length; i++){
|
|
560
|
-
index++;
|
|
561
|
-
|
|
562
|
-
if(dayIndex == 6){
|
|
563
|
-
weekNumber++;
|
|
564
|
-
dayIndex = 0;
|
|
565
|
-
}else{
|
|
566
|
-
dayIndex++;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
if(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){
|
|
570
|
-
break;
|
|
571
|
-
}else{
|
|
572
|
-
currDate = scheduler.date.add(currDate, 1, "day");
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
if(index == -1){
|
|
577
|
-
return [];
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
var left = scheduler._colsS[dayIndex];
|
|
581
|
-
var top = scheduler._colsS.heights[weekNumber];
|
|
582
|
-
|
|
583
|
-
var div = this.createElement();
|
|
584
|
-
div.style.top = top + "px";
|
|
585
|
-
div.style.left = left + "px";
|
|
586
|
-
div.style.width = scheduler._cols[dayIndex] + "px";
|
|
587
|
-
div.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + "px" ;
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var container = scheduler.$container.querySelector(".dhx_cal_data");
|
|
591
|
-
|
|
592
|
-
var datatable = container.querySelector("table");
|
|
593
|
-
if(datatable.nextSibling){
|
|
594
|
-
container.insertBefore(div, datatable.nextSibling);
|
|
595
|
-
}else{
|
|
596
|
-
container.appendChild(div);
|
|
597
|
-
}
|
|
598
|
-
return div;
|
|
599
|
-
},
|
|
600
|
-
renderMonthMarker: function(start_date, end_date){
|
|
601
|
-
var res = [];
|
|
602
|
-
var currentDate = start_date;
|
|
603
|
-
while(currentDate.valueOf() < end_date.valueOf()){
|
|
604
|
-
res.push(this.renderMonthCell(currentDate));
|
|
605
|
-
currentDate = scheduler.date.add(currentDate, 1, "day");
|
|
606
|
-
}
|
|
607
|
-
return res;
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
renderVerticalMarker: function(start_date, end_date, section){
|
|
611
|
-
var index = scheduler.locate_holder_day(start_date);
|
|
612
|
-
|
|
613
|
-
var divs = [];
|
|
614
|
-
var area = null;
|
|
615
|
-
|
|
616
|
-
var c = scheduler.config;
|
|
617
|
-
if(scheduler._ignores[index]) return divs;
|
|
618
|
-
|
|
619
|
-
if (scheduler._props && scheduler._props[scheduler._mode] && section) {
|
|
620
|
-
var view = scheduler._props[scheduler._mode];
|
|
621
|
-
index = view.order[section];
|
|
622
|
-
|
|
623
|
-
var inner_index = view.order[section];
|
|
624
|
-
if(!(view.days > 1)){
|
|
625
|
-
index = inner_index;
|
|
626
|
-
if (view.size && (index > view.position+view.size)) {
|
|
627
|
-
index = 0;
|
|
628
|
-
}
|
|
629
|
-
}else{
|
|
630
|
-
//var units_l = view.size || view.options.length;
|
|
631
|
-
|
|
632
|
-
index = scheduler.locate_holder_day(start_date) + inner_index;
|
|
633
|
-
//index = index*units_l + inner_index;
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
area = scheduler.locate_holder(index);
|
|
637
|
-
if(!area || area.querySelector(".dhx_scale_hour")){
|
|
638
|
-
// hour scale instead of date column
|
|
639
|
-
return document.createElement("div");
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
var start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
var end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);
|
|
646
|
-
if(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){
|
|
647
|
-
end = c.last_hour*60;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
if (end <= start) {
|
|
651
|
-
return [];
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
var block = this.createElement();
|
|
655
|
-
|
|
656
|
-
// +1 for working with section which really takes up whole height (as % would be == 0)
|
|
657
|
-
var all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;
|
|
658
|
-
var hour_ms = 60*60*1000;
|
|
659
|
-
block.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + "px";
|
|
660
|
-
block.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+"px";
|
|
661
|
-
block.style.width = "100%";
|
|
662
|
-
area.appendChild(block);
|
|
663
|
-
divs.push(block);
|
|
664
|
-
return divs[0];
|
|
665
|
-
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
scheduler.$keyboardNavigation.SchedulerNode = function(){};
|
|
669
|
-
|
|
670
|
-
scheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(
|
|
671
|
-
scheduler.$keyboardNavigation.EventHandler,
|
|
672
|
-
{
|
|
673
|
-
getDefaultNode: function(){
|
|
674
|
-
var node = new scheduler.$keyboardNavigation.TimeSlot();
|
|
675
|
-
|
|
676
|
-
if(!node.isValid()){
|
|
677
|
-
node = node.fallback();
|
|
678
|
-
}
|
|
679
|
-
return node;
|
|
680
|
-
},
|
|
681
|
-
|
|
682
|
-
_modes:{
|
|
683
|
-
month: "month",
|
|
684
|
-
year: "year",
|
|
685
|
-
dayColumns: "dayColumns",
|
|
686
|
-
timeline:"timeline",
|
|
687
|
-
units:"units",
|
|
688
|
-
weekAgenda: "weekAgenda",
|
|
689
|
-
list: "list"
|
|
690
|
-
},
|
|
691
|
-
getMode: function(){
|
|
692
|
-
var state = scheduler.getState();
|
|
693
|
-
|
|
694
|
-
var mode = state.mode;
|
|
695
|
-
if((scheduler.matrix && scheduler.matrix[mode])){
|
|
696
|
-
return this._modes.timeline;
|
|
697
|
-
} else if((scheduler._props && scheduler._props[mode])){
|
|
698
|
-
return this._modes.units;
|
|
699
|
-
}else if(mode == "month"){
|
|
700
|
-
return this._modes.month;
|
|
701
|
-
}else if(mode == "year"){
|
|
702
|
-
return this._modes.year;
|
|
703
|
-
}else if(mode == "week_agenda"){
|
|
704
|
-
return this._modes.weekAgenda;
|
|
705
|
-
}else if(mode == "map" || mode == "agenda" || (scheduler._grid && scheduler["grid_" + mode])){
|
|
706
|
-
return this._modes.list;
|
|
707
|
-
}else{
|
|
708
|
-
return this._modes.dayColumns;
|
|
709
|
-
}
|
|
710
|
-
},
|
|
711
|
-
|
|
712
|
-
focus: function(){
|
|
713
|
-
scheduler.focus();
|
|
714
|
-
},
|
|
715
|
-
|
|
716
|
-
blur: function(){
|
|
717
|
-
|
|
718
|
-
},
|
|
719
|
-
|
|
720
|
-
disable: function(){
|
|
721
|
-
scheduler.$container.setAttribute("tabindex", "0");
|
|
722
|
-
},
|
|
723
|
-
enable: function(){
|
|
724
|
-
if(scheduler.$container)
|
|
725
|
-
scheduler.$container.removeAttribute("tabindex");
|
|
726
|
-
},
|
|
727
|
-
isEnabled: function(){
|
|
728
|
-
return scheduler.$container.hasAttribute("tabindex");
|
|
729
|
-
},
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
_compareEvents: function(a, b){
|
|
733
|
-
if (a.start_date.valueOf() == b.start_date.valueOf())
|
|
734
|
-
return a.id > b.id ? 1 : -1;
|
|
735
|
-
return a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;
|
|
736
|
-
},
|
|
737
|
-
|
|
738
|
-
_pickEvent: function(from, to, startId, reverse){
|
|
739
|
-
var range = scheduler.getState();
|
|
740
|
-
from = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));
|
|
741
|
-
to = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));
|
|
742
|
-
|
|
743
|
-
var evs = scheduler.getEvents(from, to);
|
|
744
|
-
evs.sort(this._compareEvents);
|
|
745
|
-
if(reverse){
|
|
746
|
-
evs = evs.reverse();
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
var trim = !!startId;
|
|
750
|
-
for(var i =0; i < evs.length && trim; i++){
|
|
751
|
-
if(evs[i].id == startId){
|
|
752
|
-
trim = false;
|
|
753
|
-
}
|
|
754
|
-
evs.splice(i, 1);
|
|
755
|
-
i--;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
for(var i = 0; i < evs.length; i++){
|
|
759
|
-
var eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);
|
|
760
|
-
if(eventElement.getNode())
|
|
761
|
-
return evs[i];
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
return null;
|
|
765
|
-
},
|
|
766
|
-
|
|
767
|
-
nextEventHandler: function(id){
|
|
768
|
-
var activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;
|
|
769
|
-
|
|
770
|
-
var startId = id || (activeNode && activeNode.eventId);
|
|
771
|
-
|
|
772
|
-
var nextEvent = null;
|
|
773
|
-
if(startId && scheduler.getEvent(startId)){
|
|
774
|
-
var currEvent = scheduler.getEvent(startId);
|
|
775
|
-
|
|
776
|
-
nextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(
|
|
777
|
-
currEvent.start_date,
|
|
778
|
-
scheduler.date.add(currEvent.start_date, 1, "year"),
|
|
779
|
-
currEvent.id,
|
|
780
|
-
false
|
|
781
|
-
);
|
|
782
|
-
|
|
783
|
-
}
|
|
784
|
-
if(!nextEvent && !id){
|
|
785
|
-
var visibleDates = scheduler.getState();
|
|
786
|
-
|
|
787
|
-
nextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(
|
|
788
|
-
visibleDates.min_date,
|
|
789
|
-
scheduler.date.add(visibleDates.min_date, 1, "year"),
|
|
790
|
-
null,
|
|
791
|
-
false
|
|
792
|
-
);
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
if(nextEvent){
|
|
796
|
-
|
|
797
|
-
var nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);
|
|
798
|
-
if(!nextEv.isValid()){// not visible event
|
|
799
|
-
this.nextEventHandler(nextEvent.id);
|
|
800
|
-
}else{
|
|
801
|
-
if(activeNode){activeNode.blur();}
|
|
802
|
-
scheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
prevEventHandler: function(id){
|
|
808
|
-
var activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;
|
|
809
|
-
|
|
810
|
-
var startId = id || (activeNode && activeNode.eventId);
|
|
811
|
-
|
|
812
|
-
var nextEvent = null;
|
|
813
|
-
if(startId && scheduler.getEvent(startId)){
|
|
814
|
-
var currEvent = scheduler.getEvent(startId);
|
|
815
|
-
|
|
816
|
-
nextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(
|
|
817
|
-
scheduler.date.add(currEvent.end_date, -1, "year"),
|
|
818
|
-
currEvent.end_date,
|
|
819
|
-
currEvent.id,
|
|
820
|
-
true
|
|
821
|
-
);
|
|
822
|
-
}
|
|
823
|
-
if(!nextEvent && !id){
|
|
824
|
-
var visibleDates = scheduler.getState();
|
|
825
|
-
|
|
826
|
-
nextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(
|
|
827
|
-
scheduler.date.add(visibleDates.max_date, -1, "year"),
|
|
828
|
-
visibleDates.max_date,
|
|
829
|
-
null,
|
|
830
|
-
true
|
|
831
|
-
);
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
if(nextEvent){
|
|
835
|
-
var nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);
|
|
836
|
-
if(!nextEv.isValid()){// not visible event
|
|
837
|
-
this.prevEventHandler(nextEvent.id);
|
|
838
|
-
}else{
|
|
839
|
-
if(activeNode){activeNode.blur();}
|
|
840
|
-
scheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
},
|
|
844
|
-
|
|
845
|
-
keys: {
|
|
846
|
-
|
|
847
|
-
"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9": function(e){
|
|
848
|
-
var tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(".dhx_cal_navline .dhx_cal_tab");
|
|
849
|
-
var key = e.key;
|
|
850
|
-
if(key === undefined){
|
|
851
|
-
key = e.keyCode - 48;
|
|
852
|
-
}
|
|
853
|
-
if(tabs[key*1 - 1]){
|
|
854
|
-
tabs[key*1 - 1].click();
|
|
855
|
-
}
|
|
856
|
-
},
|
|
857
|
-
|
|
858
|
-
"ctrl+left,meta+left": function(e){
|
|
859
|
-
scheduler._click.dhx_cal_prev_button();
|
|
860
|
-
},
|
|
861
|
-
"ctrl+right,meta+right": function(e){
|
|
862
|
-
scheduler._click.dhx_cal_next_button();
|
|
863
|
-
},
|
|
864
|
-
"ctrl+up,meta+up":function(e){
|
|
865
|
-
var dataArea = scheduler.$container.querySelector(".dhx_cal_data");
|
|
866
|
-
dataArea.scrollTop -= 20;
|
|
867
|
-
},
|
|
868
|
-
"ctrl+down,meta+down": function(e){
|
|
869
|
-
var dataArea = scheduler.$container.querySelector(".dhx_cal_data");
|
|
870
|
-
dataArea.scrollTop += 20;
|
|
871
|
-
},
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
"e": function(){
|
|
875
|
-
this.nextEventHandler();
|
|
876
|
-
},
|
|
877
|
-
|
|
878
|
-
"home": function(){
|
|
879
|
-
scheduler.setCurrentView(new Date());
|
|
880
|
-
},
|
|
881
|
-
|
|
882
|
-
"shift+e": function(){
|
|
883
|
-
this.prevEventHandler();
|
|
884
|
-
},
|
|
885
|
-
|
|
886
|
-
"ctrl+enter,meta+enter": function(){
|
|
887
|
-
scheduler.addEventNow({start_date: new Date(scheduler.getState().date)});
|
|
888
|
-
},
|
|
889
|
-
|
|
890
|
-
"ctrl+c,meta+c": function(e){
|
|
891
|
-
scheduler._key_nav_copy_paste(e);
|
|
892
|
-
},
|
|
893
|
-
"ctrl+v,meta+v": function(e){
|
|
894
|
-
scheduler._key_nav_copy_paste(e);
|
|
895
|
-
},
|
|
896
|
-
"ctrl+x,meta+x": function(e){
|
|
897
|
-
scheduler._key_nav_copy_paste(e);
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
);
|
|
903
|
-
|
|
904
|
-
scheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);
|
|
905
|
-
scheduler.$keyboardNavigation.KeyNavNode = function(){};
|
|
906
|
-
|
|
907
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(
|
|
908
|
-
scheduler.$keyboardNavigation.EventHandler,
|
|
909
|
-
{
|
|
910
|
-
isValid: function(){
|
|
911
|
-
return true;
|
|
912
|
-
},
|
|
913
|
-
fallback: function(){
|
|
914
|
-
return null;
|
|
915
|
-
},
|
|
916
|
-
|
|
917
|
-
moveTo: function (element) {
|
|
918
|
-
scheduler.$keyboardNavigation.dispatcher.setActiveNode(element);
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
compareTo: function(b){
|
|
922
|
-
// good enough comparison of two random objects
|
|
923
|
-
if(!b) return false;
|
|
924
|
-
for(var i in this){
|
|
925
|
-
if(!!this[i] != !!b[i]) return false;
|
|
926
|
-
|
|
927
|
-
var canStringifyThis = !!(this[i] && this[i].toString);
|
|
928
|
-
var canStringifyThat = !!(b[i] && b[i].toString);
|
|
929
|
-
if(canStringifyThat != canStringifyThis) return false;
|
|
930
|
-
if(!(canStringifyThat && canStringifyThis)) {
|
|
931
|
-
if(b[i] != this[i]) return false;
|
|
932
|
-
}else{
|
|
933
|
-
if(b[i].toString() != this[i].toString())
|
|
934
|
-
return false;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
return true;
|
|
938
|
-
},
|
|
939
|
-
|
|
940
|
-
getNode: function(){},
|
|
941
|
-
focus: function(){
|
|
942
|
-
var node = this.getNode();
|
|
943
|
-
if(node){
|
|
944
|
-
node.setAttribute("tabindex", "-1");
|
|
945
|
-
//node.className += " scheduler_focused";
|
|
946
|
-
if(node.focus) node.focus();
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
},
|
|
950
|
-
blur: function(){
|
|
951
|
-
var node = this.getNode();
|
|
952
|
-
if(node){
|
|
953
|
-
node.setAttribute("tabindex", "-1");
|
|
954
|
-
//node.className = (node.className || "").replace(/ ?scheduler_focused/g, "");
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
);
|
|
960
|
-
|
|
961
|
-
scheduler.$keyboardNavigation.HeaderCell = function(index){
|
|
962
|
-
this.index = index || 0;
|
|
963
|
-
};
|
|
964
|
-
|
|
965
|
-
scheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(
|
|
966
|
-
scheduler.$keyboardNavigation.KeyNavNode,
|
|
967
|
-
{
|
|
968
|
-
getNode: function(index){
|
|
969
|
-
index = index || this.index || 0;
|
|
970
|
-
var nodes = this.getNodes();
|
|
971
|
-
if(nodes[index]) return nodes[index];
|
|
972
|
-
},
|
|
973
|
-
|
|
974
|
-
getNodes: function(selector){
|
|
975
|
-
selector = selector || [
|
|
976
|
-
".dhx_cal_navline .dhx_cal_prev_button",
|
|
977
|
-
".dhx_cal_navline .dhx_cal_next_button",
|
|
978
|
-
".dhx_cal_navline .dhx_cal_today_button",
|
|
979
|
-
".dhx_cal_navline .dhx_cal_tab"
|
|
980
|
-
].join(", ");
|
|
981
|
-
|
|
982
|
-
var nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));
|
|
983
|
-
nodes.sort(function(a, b){
|
|
984
|
-
return a.offsetLeft - b.offsetLeft;
|
|
985
|
-
});
|
|
986
|
-
return nodes;
|
|
987
|
-
},
|
|
988
|
-
|
|
989
|
-
_handlers:null,
|
|
990
|
-
|
|
991
|
-
isValid: function(){
|
|
992
|
-
return !!this.getNode(this.index);
|
|
993
|
-
},
|
|
994
|
-
fallback:function(){
|
|
995
|
-
var defaultCell = this.getNode(0);
|
|
996
|
-
if(!defaultCell){
|
|
997
|
-
defaultCell = new scheduler.$keyboardNavigation.TimeSlot();
|
|
998
|
-
}
|
|
999
|
-
return defaultCell;
|
|
1000
|
-
},
|
|
1001
|
-
|
|
1002
|
-
keys: {
|
|
1003
|
-
"left": function(){
|
|
1004
|
-
var newIndex = this.index - 1;
|
|
1005
|
-
if(newIndex < 0){
|
|
1006
|
-
newIndex = this.getNodes().length - 1;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
this.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));
|
|
1010
|
-
|
|
1011
|
-
},
|
|
1012
|
-
"right": function () {
|
|
1013
|
-
var newIndex = this.index + 1;
|
|
1014
|
-
if(newIndex >= this.getNodes().length){
|
|
1015
|
-
newIndex = 0;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
this.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));
|
|
1019
|
-
},
|
|
1020
|
-
"down": function () {
|
|
1021
|
-
this.moveTo(new scheduler.$keyboardNavigation.TimeSlot());
|
|
1022
|
-
},
|
|
1023
|
-
|
|
1024
|
-
"enter": function(){
|
|
1025
|
-
var node = this.getNode();
|
|
1026
|
-
if(node){
|
|
1027
|
-
node.click();
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
);
|
|
1033
|
-
|
|
1034
|
-
scheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);
|
|
1035
|
-
scheduler.$keyboardNavigation.Event = function(id){
|
|
1036
|
-
this.eventId = null;
|
|
1037
|
-
if(scheduler.getEvent(id)){
|
|
1038
|
-
var ev = scheduler.getEvent(id);
|
|
1039
|
-
this.start = new Date(ev.start_date);
|
|
1040
|
-
this.end = new Date(ev.end_date);
|
|
1041
|
-
|
|
1042
|
-
this.section = this._getSection(ev);
|
|
1043
|
-
this.eventId = id;
|
|
1044
|
-
}
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
scheduler.$keyboardNavigation.Event.prototype = scheduler._compose(
|
|
1048
|
-
scheduler.$keyboardNavigation.KeyNavNode,
|
|
1049
|
-
{
|
|
1050
|
-
_getNodes: function(){
|
|
1051
|
-
return Array.prototype.slice.call(scheduler.$container.querySelectorAll("[event_id]"));
|
|
1052
|
-
},
|
|
1053
|
-
|
|
1054
|
-
_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,
|
|
1055
|
-
|
|
1056
|
-
getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,
|
|
1057
|
-
|
|
1058
|
-
_handlers: null,
|
|
1059
|
-
isValid: function(){
|
|
1060
|
-
return !!(scheduler.getEvent(this.eventId) && this.getNode());
|
|
1061
|
-
},
|
|
1062
|
-
fallback: function(){
|
|
1063
|
-
var eventNode = this._getNodes()[0];
|
|
1064
|
-
var defaultElement = null;
|
|
1065
|
-
if(!eventNode || !(scheduler._locate_event(eventNode))){
|
|
1066
|
-
defaultElement = new scheduler.$keyboardNavigation.TimeSlot();
|
|
1067
|
-
}else{
|
|
1068
|
-
var id = scheduler._locate_event(eventNode);
|
|
1069
|
-
defaultElement = new scheduler.$keyboardNavigation.Event(id);
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
return defaultElement;
|
|
1073
|
-
},
|
|
1074
|
-
|
|
1075
|
-
isScrolledIntoView: function (el) {
|
|
1076
|
-
var eventBox = el.getBoundingClientRect();
|
|
1077
|
-
var viewPort = scheduler.$container.querySelector(".dhx_cal_data").getBoundingClientRect();
|
|
1078
|
-
|
|
1079
|
-
if(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){
|
|
1080
|
-
return false;
|
|
1081
|
-
}
|
|
1082
|
-
return true;
|
|
1083
|
-
},
|
|
1084
|
-
|
|
1085
|
-
getNode: function(){
|
|
1086
|
-
|
|
1087
|
-
var idSelector = "[event_id='"+this.eventId+"']";
|
|
1088
|
-
|
|
1089
|
-
var inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);
|
|
1090
|
-
if(inlineEditor){// is inline editor visible
|
|
1091
|
-
return inlineEditor;
|
|
1092
|
-
}else{
|
|
1093
|
-
if(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){
|
|
1094
|
-
var nodes = scheduler.$container.querySelectorAll(idSelector);
|
|
1095
|
-
for(var i = 0; i < nodes.length; i++){
|
|
1096
|
-
if(this.isScrolledIntoView(nodes[i])){
|
|
1097
|
-
return nodes[i];
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
return nodes[0];
|
|
1101
|
-
}else{
|
|
1102
|
-
return scheduler.$container.querySelector(idSelector);
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
},
|
|
1109
|
-
|
|
1110
|
-
focus: function(){
|
|
1111
|
-
var event = scheduler.getEvent(this.eventId);
|
|
1112
|
-
|
|
1113
|
-
var calendar = scheduler.getState();
|
|
1114
|
-
if(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){
|
|
1115
|
-
scheduler.setCurrentView(event.start_date);
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
var node = this.getNode();
|
|
1119
|
-
if (this.isScrolledIntoView(node)) {
|
|
1120
|
-
scheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){
|
|
1121
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);
|
|
1122
|
-
}).bind(this));
|
|
1123
|
-
} else {
|
|
1124
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
},
|
|
1128
|
-
blur: function(){
|
|
1129
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);
|
|
1130
|
-
},
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
_getSection: function(ev){
|
|
1134
|
-
var section = null;
|
|
1135
|
-
var mode = scheduler.getState().mode;
|
|
1136
|
-
if(scheduler.matrix && scheduler.matrix[mode]){
|
|
1137
|
-
var timeline = scheduler.matrix[scheduler.getState().mode];
|
|
1138
|
-
section = ev[timeline.y_property];
|
|
1139
|
-
}else if(scheduler._props && scheduler._props[mode]){
|
|
1140
|
-
var unit = scheduler._props[mode];
|
|
1141
|
-
section = ev[unit.map_to];
|
|
1142
|
-
}
|
|
1143
|
-
return section;
|
|
1144
|
-
},
|
|
1145
|
-
_moveToSlot: function(dir){
|
|
1146
|
-
var ev = scheduler.getEvent(this.eventId);
|
|
1147
|
-
if(ev){
|
|
1148
|
-
var section =this._getSection(ev);
|
|
1149
|
-
var slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);
|
|
1150
|
-
this.moveTo(slot.nextSlot(slot, dir));
|
|
1151
|
-
}else{
|
|
1152
|
-
this.moveTo(new scheduler.$keyboardNavigation.TimeSlot());
|
|
1153
|
-
}
|
|
1154
|
-
},
|
|
1155
|
-
|
|
1156
|
-
keys: {
|
|
1157
|
-
"left": function(){
|
|
1158
|
-
this._moveToSlot("left");
|
|
1159
|
-
},
|
|
1160
|
-
|
|
1161
|
-
"right": function () {
|
|
1162
|
-
this._moveToSlot("right");
|
|
1163
|
-
},
|
|
1164
|
-
"down": function () {
|
|
1165
|
-
if(this.getMode() == this._modes.list){
|
|
1166
|
-
scheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();
|
|
1167
|
-
}else {
|
|
1168
|
-
this._moveToSlot("down");
|
|
1169
|
-
}
|
|
1170
|
-
},
|
|
1171
|
-
|
|
1172
|
-
"space": function(){
|
|
1173
|
-
var node = this.getNode();
|
|
1174
|
-
if(node && node.click){
|
|
1175
|
-
node.click();
|
|
1176
|
-
}else{
|
|
1177
|
-
this.moveTo(new scheduler.$keyboardNavigation.TimeSlot());
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
},
|
|
1181
|
-
|
|
1182
|
-
"up": function () {
|
|
1183
|
-
if(this.getMode() == this._modes.list){
|
|
1184
|
-
scheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();
|
|
1185
|
-
}else {
|
|
1186
|
-
this._moveToSlot("up");
|
|
1187
|
-
}
|
|
1188
|
-
},
|
|
1189
|
-
|
|
1190
|
-
"delete": function(){
|
|
1191
|
-
if(scheduler.getEvent(this.eventId)) {
|
|
1192
|
-
scheduler._click.buttons["delete"](this.eventId);
|
|
1193
|
-
}else{
|
|
1194
|
-
this.moveTo(new scheduler.$keyboardNavigation.TimeSlot());
|
|
1195
|
-
}
|
|
1196
|
-
},
|
|
1197
|
-
|
|
1198
|
-
// open lightbox
|
|
1199
|
-
"enter": function () {
|
|
1200
|
-
if(scheduler.getEvent(this.eventId)) {
|
|
1201
|
-
scheduler.showLightbox(this.eventId);
|
|
1202
|
-
}else{
|
|
1203
|
-
this.moveTo(new scheduler.$keyboardNavigation.TimeSlot());
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
);
|
|
1209
|
-
scheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);
|
|
1210
|
-
scheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){
|
|
1211
|
-
var state = scheduler.getState();
|
|
1212
|
-
var timeline = scheduler.matrix && scheduler.matrix[state.mode];
|
|
1213
|
-
|
|
1214
|
-
if(!from){
|
|
1215
|
-
from = this.getDefaultDate();
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
if(!to){
|
|
1219
|
-
|
|
1220
|
-
if(timeline){
|
|
1221
|
-
to = scheduler.date.add(from, timeline.x_step, timeline.x_unit);
|
|
1222
|
-
}else{
|
|
1223
|
-
to = scheduler.date.add(from, scheduler.config.key_nav_step, "minute");
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
this.section = section || this._getDefaultSection();
|
|
1229
|
-
this.start_date = new Date(from);
|
|
1230
|
-
this.end_date = new Date(to);
|
|
1231
|
-
this.movingDate = movingDate || null;
|
|
1232
|
-
};
|
|
1233
|
-
|
|
1234
|
-
scheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(
|
|
1235
|
-
scheduler.$keyboardNavigation.KeyNavNode,
|
|
1236
|
-
{
|
|
1237
|
-
_handlers:null,
|
|
1238
|
-
|
|
1239
|
-
getDefaultDate: function(){
|
|
1240
|
-
var from;
|
|
1241
|
-
var state = scheduler.getState();
|
|
1242
|
-
var visibleTime = new Date(state.date);
|
|
1243
|
-
visibleTime.setSeconds(0);
|
|
1244
|
-
visibleTime.setMilliseconds(0);
|
|
1245
|
-
|
|
1246
|
-
var nowTime = new Date();
|
|
1247
|
-
nowTime.setSeconds(0);
|
|
1248
|
-
nowTime.setMilliseconds(0);
|
|
1249
|
-
|
|
1250
|
-
var timeline = scheduler.matrix && scheduler.matrix[state.mode];
|
|
1251
|
-
var showNowTime = false;
|
|
1252
|
-
if(visibleTime.valueOf() === nowTime.valueOf()){
|
|
1253
|
-
showNowTime = true;
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
if(timeline){
|
|
1257
|
-
if(showNowTime){
|
|
1258
|
-
if(timeline.x_unit === "day"){
|
|
1259
|
-
nowTime.setHours(0);
|
|
1260
|
-
nowTime.setMinutes(0);
|
|
1261
|
-
}else if(timeline.x_unit === "hour"){
|
|
1262
|
-
nowTime.setMinutes(0);
|
|
1263
|
-
}
|
|
1264
|
-
from = nowTime;
|
|
1265
|
-
}else{
|
|
1266
|
-
from = scheduler.date[timeline.name + "_start"](new Date(state.date));
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
from = this.findVisibleColumn(from);
|
|
1270
|
-
}else{
|
|
1271
|
-
from = new Date(scheduler.getState().min_date);
|
|
1272
|
-
if(showNowTime){
|
|
1273
|
-
from = nowTime;
|
|
1274
|
-
}
|
|
1275
|
-
from = this.findVisibleColumn(from);
|
|
1276
|
-
if(!showNowTime){
|
|
1277
|
-
from.setHours(scheduler.config.first_hour);
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
if(!scheduler._table_view){
|
|
1281
|
-
var dataContainer = scheduler.$container.querySelector(".dhx_cal_data");
|
|
1282
|
-
if(dataContainer.scrollTop){
|
|
1283
|
-
from.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
return from;
|
|
1289
|
-
},
|
|
1290
|
-
|
|
1291
|
-
clone: function(timeslot){
|
|
1292
|
-
return new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);
|
|
1293
|
-
},
|
|
1294
|
-
_getMultisectionView: function(){
|
|
1295
|
-
var state = scheduler.getState();
|
|
1296
|
-
var view;
|
|
1297
|
-
if(scheduler._props && scheduler._props[state.mode]) {
|
|
1298
|
-
view = scheduler._props[state.mode];
|
|
1299
|
-
}else if(scheduler.matrix && scheduler.matrix[state.mode]){
|
|
1300
|
-
view = scheduler.matrix[state.mode];
|
|
1301
|
-
}
|
|
1302
|
-
return view;
|
|
1303
|
-
},
|
|
1304
|
-
|
|
1305
|
-
_getDefaultSection: function(){
|
|
1306
|
-
var section = null;
|
|
1307
|
-
var view = this._getMultisectionView();
|
|
1308
|
-
if(view && !section){
|
|
1309
|
-
section = this._getNextSection();
|
|
1310
|
-
}
|
|
1311
|
-
return section;
|
|
1312
|
-
},
|
|
1313
|
-
|
|
1314
|
-
_getNextSection: function(sectionId, dir){
|
|
1315
|
-
var view = this._getMultisectionView();
|
|
1316
|
-
var currentIndex = view.order[sectionId];
|
|
1317
|
-
var nextIndex = currentIndex;
|
|
1318
|
-
if(currentIndex !== undefined){
|
|
1319
|
-
nextIndex = currentIndex + dir;
|
|
1320
|
-
}else{
|
|
1321
|
-
nextIndex = (view.size && view.position) ? view.position : 0;
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
var options = view.options || view.y_unit;
|
|
1328
|
-
if(options[nextIndex]){
|
|
1329
|
-
return options[nextIndex].key;
|
|
1330
|
-
}else{
|
|
1331
|
-
return null;
|
|
1332
|
-
}
|
|
1333
|
-
},
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
isValid: function(){
|
|
1337
|
-
var state = scheduler.getState();
|
|
1338
|
-
var isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());
|
|
1339
|
-
|
|
1340
|
-
if(!isInRange) return false;
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
if(!this.isVisible(this.start_date, this.end_date)) return false;
|
|
1344
|
-
|
|
1345
|
-
var view = this._getMultisectionView();
|
|
1346
|
-
|
|
1347
|
-
if(view){
|
|
1348
|
-
return (view.order[this.section] !== undefined);
|
|
1349
|
-
}else{
|
|
1350
|
-
return true;
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
},
|
|
1354
|
-
|
|
1355
|
-
fallback:function(){
|
|
1356
|
-
|
|
1357
|
-
var defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();
|
|
1358
|
-
if(!defaultSlot.isValid()){
|
|
1359
|
-
return new scheduler.$keyboardNavigation.DataArea();
|
|
1360
|
-
}else{
|
|
1361
|
-
return defaultSlot;
|
|
1362
|
-
}
|
|
1363
|
-
},
|
|
1364
|
-
|
|
1365
|
-
getNodes: function(){
|
|
1366
|
-
return Array.prototype.slice.call(scheduler.$container.querySelectorAll(".dhx_focus_slot"));
|
|
1367
|
-
},
|
|
1368
|
-
getNode: function(){
|
|
1369
|
-
return this.getNodes()[0];
|
|
1370
|
-
},
|
|
1371
|
-
|
|
1372
|
-
focus: function(){
|
|
1373
|
-
scheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);
|
|
1374
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);
|
|
1375
|
-
scheduler.$keyboardNavigation._pasteDate = this.start_date;
|
|
1376
|
-
scheduler.$keyboardNavigation._pasteSection = this.section;
|
|
1377
|
-
|
|
1378
|
-
},
|
|
1379
|
-
blur: function(){
|
|
1380
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);
|
|
1381
|
-
scheduler.$keyboardNavigation.marker.clear();
|
|
1382
|
-
},
|
|
1383
|
-
|
|
1384
|
-
_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,
|
|
1385
|
-
|
|
1386
|
-
_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,
|
|
1387
|
-
|
|
1388
|
-
addMonthDate: function(date, dir, extend){
|
|
1389
|
-
var res;
|
|
1390
|
-
switch (dir){
|
|
1391
|
-
case "up":
|
|
1392
|
-
res = scheduler.date.add(date, -1, "week");
|
|
1393
|
-
break;
|
|
1394
|
-
case "down":
|
|
1395
|
-
res = scheduler.date.add(date, 1, "week");
|
|
1396
|
-
break;
|
|
1397
|
-
case "left":
|
|
1398
|
-
res = scheduler.date.day_start(scheduler.date.add(date, -1, "day"));
|
|
1399
|
-
res = this.findVisibleColumn(res, -1);
|
|
1400
|
-
break;
|
|
1401
|
-
case "right":
|
|
1402
|
-
res = scheduler.date.day_start(scheduler.date.add(date, 1, "day"));
|
|
1403
|
-
res = this.findVisibleColumn(res, 1);
|
|
1404
|
-
break;
|
|
1405
|
-
default:
|
|
1406
|
-
res = scheduler.date.day_start(new Date(date));
|
|
1407
|
-
break;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
var state = scheduler.getState();
|
|
1411
|
-
if(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){
|
|
1412
|
-
res = new Date(state.min_date);
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
return res;
|
|
1416
|
-
},
|
|
1417
|
-
|
|
1418
|
-
nextMonthSlot: function(slot, dir, extend){
|
|
1419
|
-
|
|
1420
|
-
var start, end;
|
|
1421
|
-
start = this.addMonthDate(slot.start_date, dir, extend);
|
|
1422
|
-
|
|
1423
|
-
start.setHours(scheduler.config.first_hour);
|
|
1424
|
-
end = new Date(start);
|
|
1425
|
-
end.setHours(scheduler.config.last_hour);
|
|
1426
|
-
return {start_date: start, end_date: end};
|
|
1427
|
-
},
|
|
1428
|
-
|
|
1429
|
-
_alignTimeSlot: function(date, minDate, unit, step){
|
|
1430
|
-
var currentDate = new Date(minDate);
|
|
1431
|
-
while(currentDate.valueOf() < date.valueOf()){
|
|
1432
|
-
currentDate = scheduler.date.add(currentDate, step, unit);
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
if(currentDate.valueOf() > date.valueOf()){
|
|
1436
|
-
currentDate = scheduler.date.add(currentDate, -step, unit);
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
return currentDate;
|
|
1440
|
-
},
|
|
1441
|
-
|
|
1442
|
-
nextTimelineSlot: function(slot, dir, extend){
|
|
1443
|
-
var state = scheduler.getState();
|
|
1444
|
-
var view = scheduler.matrix[state.mode];
|
|
1445
|
-
|
|
1446
|
-
var startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + "_start"](new Date(slot.start_date)), view.x_unit, view.x_step);
|
|
1447
|
-
var endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + "_start"](new Date(slot.end_date)), view.x_unit, view.x_step);
|
|
1448
|
-
|
|
1449
|
-
if(endDate.valueOf() <= startDate.valueOf()){
|
|
1450
|
-
endDate = scheduler.date.add(startDate, view.x_step, view.x_unit);
|
|
1451
|
-
}
|
|
1452
|
-
var newPos = this.clone(slot);
|
|
1453
|
-
newPos.start_date = startDate;
|
|
1454
|
-
newPos.end_date = endDate;
|
|
1455
|
-
newPos.section = slot.section || this._getNextSection();
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
switch (dir){
|
|
1459
|
-
case "up":
|
|
1460
|
-
newPos.section = this._getNextSection(slot.section, -1);
|
|
1461
|
-
break;
|
|
1462
|
-
case "down":
|
|
1463
|
-
newPos.section = this._getNextSection(slot.section, +1);
|
|
1464
|
-
break;
|
|
1465
|
-
case "left":
|
|
1466
|
-
newPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);
|
|
1467
|
-
newPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);
|
|
1468
|
-
break;
|
|
1469
|
-
case "right":
|
|
1470
|
-
newPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);
|
|
1471
|
-
newPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);
|
|
1472
|
-
|
|
1473
|
-
break;
|
|
1474
|
-
default:
|
|
1475
|
-
|
|
1476
|
-
break;
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
if(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){
|
|
1480
|
-
if(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){
|
|
1481
|
-
newPos.start_date = new Date(state.max_date);
|
|
1482
|
-
}else{
|
|
1483
|
-
newPos.start_date = scheduler.date[state.mode + "_start"](scheduler.date.add(state.date, dir == "left" ? -1 : 1, state.mode));
|
|
1484
|
-
newPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
return newPos;
|
|
1489
|
-
},
|
|
1490
|
-
|
|
1491
|
-
nextUnitsSlot: function(slot, dir, extend){
|
|
1492
|
-
var newPos = this.clone(slot);
|
|
1493
|
-
newPos.section = slot.section || this._getNextSection();
|
|
1494
|
-
|
|
1495
|
-
var section = slot.section || this._getNextSection();
|
|
1496
|
-
var state = scheduler.getState();
|
|
1497
|
-
var view = scheduler._props[state.mode];
|
|
1498
|
-
switch (dir){
|
|
1499
|
-
case "left":
|
|
1500
|
-
section = this._getNextSection(slot.section, -1);
|
|
1501
|
-
var optionsCount = view.size ? (view.size - 1) : view.options.length;
|
|
1502
|
-
|
|
1503
|
-
if(view.days > 1 && (view.order[section] == optionsCount - 1)){
|
|
1504
|
-
if(scheduler.date.add(slot.start_date, -1, "day").valueOf() >= state.min_date.valueOf()){
|
|
1505
|
-
newPos = this.nextDaySlot(slot, dir, extend);
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
break;
|
|
1509
|
-
case "right":
|
|
1510
|
-
section = this._getNextSection(slot.section, 1);
|
|
1511
|
-
if(view.days > 1 && !view.order[section]){
|
|
1512
|
-
if(scheduler.date.add(slot.start_date, 1, "day").valueOf() < state.max_date.valueOf()){
|
|
1513
|
-
newPos = this.nextDaySlot(slot, dir, extend);
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
break;
|
|
1518
|
-
default:
|
|
1519
|
-
newPos = this.nextDaySlot(slot, dir, extend);
|
|
1520
|
-
section = slot.section;
|
|
1521
|
-
break;
|
|
1522
|
-
}
|
|
1523
|
-
newPos.section = section;
|
|
1524
|
-
return newPos;
|
|
1525
|
-
},
|
|
1526
|
-
|
|
1527
|
-
_moveDate: function(oldDate, dir){
|
|
1528
|
-
var newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, "day"), dir);
|
|
1529
|
-
newDate.setHours(oldDate.getHours());
|
|
1530
|
-
newDate.setMinutes(oldDate.getMinutes());
|
|
1531
|
-
return newDate;
|
|
1532
|
-
},
|
|
1533
|
-
|
|
1534
|
-
isBeforeLastHour: function(date, isStartDate){
|
|
1535
|
-
var minutes = date.getMinutes(),
|
|
1536
|
-
hours = date.getHours(),
|
|
1537
|
-
last_hour = scheduler.config.last_hour;
|
|
1538
|
-
return (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));
|
|
1539
|
-
},
|
|
1540
|
-
isAfterFirstHour: function(date, isStartDate){
|
|
1541
|
-
var minutes = date.getMinutes(),
|
|
1542
|
-
hours = date.getHours(),
|
|
1543
|
-
first_hour = scheduler.config.first_hour,
|
|
1544
|
-
last_hour = scheduler.config.last_hour;
|
|
1545
|
-
return (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));
|
|
1546
|
-
},
|
|
1547
|
-
isInVisibleDayTime: function(date, isStartDate){
|
|
1548
|
-
return (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1551
|
-
nextDaySlot: function(slot, dir, extend){
|
|
1552
|
-
var start, end;
|
|
1553
|
-
|
|
1554
|
-
var key_nav_step = scheduler.config.key_nav_step;
|
|
1555
|
-
|
|
1556
|
-
var date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), "minute", key_nav_step);
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
var oldStart = slot.start_date;
|
|
1560
|
-
|
|
1561
|
-
switch (dir){
|
|
1562
|
-
case "up":
|
|
1563
|
-
start = scheduler.date.add(date, -key_nav_step, "minute");
|
|
1564
|
-
|
|
1565
|
-
if(!this.isInVisibleDayTime(start, true)){
|
|
1566
|
-
if (!extend || this.isInVisibleDayTime(oldStart, true)) {
|
|
1567
|
-
|
|
1568
|
-
var toNextDay = true;
|
|
1569
|
-
if(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())
|
|
1570
|
-
toNextDay = false;
|
|
1571
|
-
if(toNextDay)
|
|
1572
|
-
start = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, "day"), -1);
|
|
1573
|
-
|
|
1574
|
-
start.setHours(scheduler.config.last_hour);
|
|
1575
|
-
start.setMinutes(0);
|
|
1576
|
-
start = scheduler.date.add(start, -key_nav_step, "minute");
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
end = scheduler.date.add(start, key_nav_step, "minute");
|
|
1580
|
-
break;
|
|
1581
|
-
case "down":
|
|
1582
|
-
start = scheduler.date.add(date, key_nav_step, "minute");
|
|
1583
|
-
|
|
1584
|
-
var testEnd = extend ? start : scheduler.date.add(start, key_nav_step, "minute");
|
|
1585
|
-
if(!this.isInVisibleDayTime(testEnd, false)){
|
|
1586
|
-
if(!extend || this.isInVisibleDayTime(oldStart, false)) {
|
|
1587
|
-
if (!extend) {
|
|
1588
|
-
start = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, "day"), 1);
|
|
1589
|
-
start.setHours(scheduler.config.first_hour);
|
|
1590
|
-
start.setMinutes(0);
|
|
1591
|
-
} else {
|
|
1592
|
-
var toNextDay = true;
|
|
1593
|
-
if (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {
|
|
1594
|
-
toNextDay = false;
|
|
1595
|
-
}
|
|
1596
|
-
if (toNextDay) {
|
|
1597
|
-
start = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, "day"), 1);
|
|
1598
|
-
}
|
|
1599
|
-
start.setHours(scheduler.config.first_hour);
|
|
1600
|
-
start.setMinutes(0);
|
|
1601
|
-
start = scheduler.date.add(start, key_nav_step, "minute");
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
end = scheduler.date.add(start, key_nav_step, "minute");
|
|
1607
|
-
break;
|
|
1608
|
-
case "left":
|
|
1609
|
-
start = this._moveDate(slot.start_date, -1);
|
|
1610
|
-
end = this._moveDate(slot.end_date, -1);
|
|
1611
|
-
break;
|
|
1612
|
-
case "right":
|
|
1613
|
-
start = this._moveDate(slot.start_date, 1);
|
|
1614
|
-
end = this._moveDate(slot.end_date, 1);
|
|
1615
|
-
break;
|
|
1616
|
-
default:
|
|
1617
|
-
start = date;
|
|
1618
|
-
end = scheduler.date.add(start, key_nav_step, "minute");
|
|
1619
|
-
break;
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
return {start_date: start, end_date: end};
|
|
1623
|
-
},
|
|
1624
|
-
nextWeekAgendaSlot: function(slot, dir){
|
|
1625
|
-
var start, end;
|
|
1626
|
-
var state = scheduler.getState();
|
|
1627
|
-
|
|
1628
|
-
switch (dir){
|
|
1629
|
-
case "down":
|
|
1630
|
-
case "left":
|
|
1631
|
-
start = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, "day"));
|
|
1632
|
-
start = this.findVisibleColumn(start, -1);
|
|
1633
|
-
break;
|
|
1634
|
-
case "up":
|
|
1635
|
-
case "right":
|
|
1636
|
-
start = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, "day"));
|
|
1637
|
-
start = this.findVisibleColumn(start, 1);
|
|
1638
|
-
break;
|
|
1639
|
-
default:
|
|
1640
|
-
start = scheduler.date.day_start(slot.start_date);
|
|
1641
|
-
break;
|
|
1642
|
-
}
|
|
1643
|
-
if(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){
|
|
1644
|
-
start = new Date(state.min_date);
|
|
1645
|
-
|
|
1646
|
-
}
|
|
1647
|
-
end = new Date(start);
|
|
1648
|
-
end.setHours(scheduler.config.last_hour);
|
|
1649
|
-
return {start_date: start, end_date: end};
|
|
1650
|
-
},
|
|
1651
|
-
nextAgendaSlot: function(slot, dir){
|
|
1652
|
-
return {start_date: slot.start_date, end_date: slot.end_date};
|
|
1653
|
-
},
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
isDateVisible: function(date){
|
|
1657
|
-
if(!scheduler._ignores_detected)
|
|
1658
|
-
return true;
|
|
1659
|
-
|
|
1660
|
-
var timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];
|
|
1661
|
-
|
|
1662
|
-
var index;
|
|
1663
|
-
if(timeline){
|
|
1664
|
-
index = scheduler._get_date_index(timeline, date);
|
|
1665
|
-
}else{
|
|
1666
|
-
index = scheduler.locate_holder_day(date);
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
return !scheduler._ignores[index];
|
|
1670
|
-
},
|
|
1671
|
-
|
|
1672
|
-
findVisibleColumn: function(start, dir){
|
|
1673
|
-
var date = start;
|
|
1674
|
-
dir = dir || 1;
|
|
1675
|
-
var range = scheduler.getState();
|
|
1676
|
-
|
|
1677
|
-
while(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){
|
|
1678
|
-
date = this.nextDateColumn(date, dir);
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
return date;
|
|
1682
|
-
},
|
|
1683
|
-
|
|
1684
|
-
nextDateColumn: function(start, dir){
|
|
1685
|
-
dir = dir || 1;
|
|
1686
|
-
var timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];
|
|
1687
|
-
|
|
1688
|
-
var date;
|
|
1689
|
-
if(timeline){
|
|
1690
|
-
date = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);
|
|
1691
|
-
}else{
|
|
1692
|
-
date = scheduler.date.day_start(scheduler.date.add(start, dir, "day"));
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
return date;
|
|
1696
|
-
},
|
|
1697
|
-
|
|
1698
|
-
isVisible:function(from, to){
|
|
1699
|
-
if(!scheduler._ignores_detected)
|
|
1700
|
-
return true;
|
|
1701
|
-
|
|
1702
|
-
var current = new Date(from);
|
|
1703
|
-
|
|
1704
|
-
while(current.valueOf() < to.valueOf()){
|
|
1705
|
-
if(this.isDateVisible(current)) return true;
|
|
1706
|
-
current = this.nextDateColumn(current);
|
|
1707
|
-
}
|
|
1708
|
-
return false;
|
|
1709
|
-
},
|
|
1710
|
-
|
|
1711
|
-
nextSlot: function(slot, dir, view, extend){
|
|
1712
|
-
var next;
|
|
1713
|
-
view = view || this._getMode();
|
|
1714
|
-
|
|
1715
|
-
var tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);
|
|
1716
|
-
|
|
1717
|
-
switch (view){
|
|
1718
|
-
case this._modes.units:
|
|
1719
|
-
next = this.nextUnitsSlot(tempSlot, dir, extend);
|
|
1720
|
-
break;
|
|
1721
|
-
case this._modes.timeline:
|
|
1722
|
-
next = this.nextTimelineSlot(tempSlot, dir, extend);
|
|
1723
|
-
break;
|
|
1724
|
-
case this._modes.year:
|
|
1725
|
-
next = this.nextMonthSlot(tempSlot, dir, extend);
|
|
1726
|
-
break;
|
|
1727
|
-
case this._modes.month:
|
|
1728
|
-
next = this.nextMonthSlot(tempSlot, dir, extend);
|
|
1729
|
-
break;
|
|
1730
|
-
case this._modes.weekAgenda:
|
|
1731
|
-
next = this.nextWeekAgendaSlot(tempSlot, dir, extend);
|
|
1732
|
-
break;
|
|
1733
|
-
case this._modes.list:
|
|
1734
|
-
next = this.nextAgendaSlot(tempSlot, dir, extend);
|
|
1735
|
-
break;
|
|
1736
|
-
case this._modes.dayColumns:
|
|
1737
|
-
next = this.nextDaySlot(tempSlot, dir, extend);
|
|
1738
|
-
break;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
if(next.start_date.valueOf() >= next.end_date.valueOf()){
|
|
1742
|
-
next = this.nextSlot(next, dir, view);
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
return scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);
|
|
1746
|
-
|
|
1747
|
-
},
|
|
1748
|
-
|
|
1749
|
-
extendSlot: function(slot, dir){
|
|
1750
|
-
var view = this._getMode();
|
|
1751
|
-
var next;
|
|
1752
|
-
switch (view){
|
|
1753
|
-
case this._modes.units:
|
|
1754
|
-
if(dir == "left" || dir == "right"){
|
|
1755
|
-
next = this.nextUnitsSlot(slot, dir);
|
|
1756
|
-
}else{
|
|
1757
|
-
next = this.extendUnitsSlot(slot, dir);
|
|
1758
|
-
}
|
|
1759
|
-
break;
|
|
1760
|
-
case this._modes.timeline:
|
|
1761
|
-
if(dir == "down" || dir == "up"){
|
|
1762
|
-
next = this.nextTimelineSlot(slot, dir);
|
|
1763
|
-
}else{
|
|
1764
|
-
next = this.extendTimelineSlot(slot, dir);
|
|
1765
|
-
}
|
|
1766
|
-
break;
|
|
1767
|
-
case this._modes.year:
|
|
1768
|
-
next = this.extendMonthSlot(slot, dir);
|
|
1769
|
-
break;
|
|
1770
|
-
case this._modes.month:
|
|
1771
|
-
next = this.extendMonthSlot(slot, dir);
|
|
1772
|
-
break;
|
|
1773
|
-
case this._modes.dayColumns:
|
|
1774
|
-
next = this.extendDaySlot(slot, dir);
|
|
1775
|
-
break;
|
|
1776
|
-
case this._modes.weekAgenda:
|
|
1777
|
-
next = this.extendWeekAgendaSlot(slot, dir);
|
|
1778
|
-
break;
|
|
1779
|
-
default:
|
|
1780
|
-
next = slot;
|
|
1781
|
-
break;
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
var range = scheduler.getState();
|
|
1785
|
-
if(next.start_date.valueOf() < range.min_date.valueOf()){
|
|
1786
|
-
next.start_date = this.findVisibleColumn(range.min_date);
|
|
1787
|
-
next.start_date.setHours(scheduler.config.first_hour);
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
if(next.end_date.valueOf() > range.max_date.valueOf()){
|
|
1791
|
-
// next.end_date = new Date(slot.end_date);
|
|
1792
|
-
next.end_date = this.findVisibleColumn(range.max_date, -1);
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
return scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);
|
|
1797
|
-
},
|
|
1798
|
-
|
|
1799
|
-
extendTimelineSlot: function(slot, direction){
|
|
1800
|
-
return this.extendGenericSlot({
|
|
1801
|
-
"left":"start_date",
|
|
1802
|
-
"right":"end_date"
|
|
1803
|
-
},
|
|
1804
|
-
slot,
|
|
1805
|
-
direction,
|
|
1806
|
-
"timeline"
|
|
1807
|
-
);
|
|
1808
|
-
},
|
|
1809
|
-
|
|
1810
|
-
extendWeekAgendaSlot: function(slot, direction){
|
|
1811
|
-
return this.extendGenericSlot({
|
|
1812
|
-
"left":"start_date",
|
|
1813
|
-
"right":"end_date"
|
|
1814
|
-
},
|
|
1815
|
-
slot,
|
|
1816
|
-
direction,
|
|
1817
|
-
"weekAgenda"
|
|
1818
|
-
);
|
|
1819
|
-
},
|
|
1820
|
-
|
|
1821
|
-
extendGenericSlot: function(allowedDirections, slot, direction, type){
|
|
1822
|
-
var next;
|
|
1823
|
-
var moveDate = slot.movingDate;
|
|
1824
|
-
|
|
1825
|
-
if(!moveDate){
|
|
1826
|
-
moveDate = allowedDirections[direction];
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
if(!moveDate || !allowedDirections[direction]){
|
|
1830
|
-
return slot;
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
if(direction){
|
|
1834
|
-
next = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);
|
|
1835
|
-
|
|
1836
|
-
if(next.start_date.valueOf() == slot.start_date.valueOf()){
|
|
1837
|
-
next = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
next.movingDate = moveDate;
|
|
1841
|
-
}else{
|
|
1842
|
-
return scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
var newDates = this.extendSlotDates(slot, next, next.movingDate);
|
|
1846
|
-
|
|
1847
|
-
if(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){
|
|
1848
|
-
next.movingDate = next.movingDate == "end_date" ? "start_date" : "end_date";
|
|
1849
|
-
}
|
|
1850
|
-
newDates = this.extendSlotDates(slot, next, next.movingDate);
|
|
1851
|
-
|
|
1852
|
-
next.start_date = newDates.start_date;
|
|
1853
|
-
next.end_date = newDates.end_date;
|
|
1854
|
-
return next;
|
|
1855
|
-
},
|
|
1856
|
-
|
|
1857
|
-
extendSlotDates: function(oldSlot, newSlot, dateDirection){
|
|
1858
|
-
var res = {start_date:null, end_date:null};
|
|
1859
|
-
|
|
1860
|
-
if(dateDirection == "start_date"){
|
|
1861
|
-
res.start_date = newSlot.start_date;
|
|
1862
|
-
res.end_date = oldSlot.end_date;
|
|
1863
|
-
}else{
|
|
1864
|
-
res.start_date = oldSlot.start_date;
|
|
1865
|
-
res.end_date = newSlot.start_date;
|
|
1866
|
-
}
|
|
1867
|
-
return res;
|
|
1868
|
-
|
|
1869
|
-
},
|
|
1870
|
-
|
|
1871
|
-
extendMonthSlot: function(slot, direction){
|
|
1872
|
-
var slot = this.extendGenericSlot({
|
|
1873
|
-
"up":"start_date",
|
|
1874
|
-
"down":"end_date",
|
|
1875
|
-
"left":"start_date",
|
|
1876
|
-
"right":"end_date"
|
|
1877
|
-
},
|
|
1878
|
-
slot,
|
|
1879
|
-
direction,
|
|
1880
|
-
"month"
|
|
1881
|
-
);
|
|
1882
|
-
|
|
1883
|
-
slot.start_date.setHours(scheduler.config.first_hour);
|
|
1884
|
-
slot.end_date = scheduler.date.add(slot.end_date, -1, "day");
|
|
1885
|
-
slot.end_date.setHours(scheduler.config.last_hour);
|
|
1886
|
-
return slot;
|
|
1887
|
-
},
|
|
1888
|
-
|
|
1889
|
-
extendUnitsSlot: function(slot, direction){
|
|
1890
|
-
var next;
|
|
1891
|
-
|
|
1892
|
-
switch (direction){
|
|
1893
|
-
case "down":
|
|
1894
|
-
case "up":
|
|
1895
|
-
next = this.extendDaySlot(slot, direction);
|
|
1896
|
-
break;
|
|
1897
|
-
default:
|
|
1898
|
-
next = slot;
|
|
1899
|
-
break;
|
|
1900
|
-
}
|
|
1901
|
-
next.section = slot.section;
|
|
1902
|
-
return next;
|
|
1903
|
-
},
|
|
1904
|
-
extendDaySlot: function(slot, direction){
|
|
1905
|
-
return this.extendGenericSlot({
|
|
1906
|
-
"up":"start_date",
|
|
1907
|
-
"down":"end_date",
|
|
1908
|
-
"left":"start_date",
|
|
1909
|
-
"right":"end_date"
|
|
1910
|
-
},
|
|
1911
|
-
slot,
|
|
1912
|
-
direction,
|
|
1913
|
-
"dayColumns"
|
|
1914
|
-
);
|
|
1915
|
-
},
|
|
1916
|
-
|
|
1917
|
-
scrollSlot: function(dir){
|
|
1918
|
-
var state = scheduler.getState();
|
|
1919
|
-
|
|
1920
|
-
var slot = this.nextSlot(this, dir);
|
|
1921
|
-
if(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){
|
|
1922
|
-
scheduler.setCurrentView(new Date(slot.start_date));
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
this.moveTo(slot);
|
|
1926
|
-
},
|
|
1927
|
-
|
|
1928
|
-
keys: {
|
|
1929
|
-
"left": function(){
|
|
1930
|
-
this.scrollSlot("left");
|
|
1931
|
-
},
|
|
1932
|
-
"right": function () {
|
|
1933
|
-
this.scrollSlot("right");
|
|
1934
|
-
},
|
|
1935
|
-
"down": function () {
|
|
1936
|
-
|
|
1937
|
-
var mode = this._getMode();
|
|
1938
|
-
if(mode == this._modes.list){
|
|
1939
|
-
scheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();
|
|
1940
|
-
}else{
|
|
1941
|
-
this.scrollSlot("down");
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
},
|
|
1945
|
-
|
|
1946
|
-
"up": function () {
|
|
1947
|
-
var mode = this._getMode();
|
|
1948
|
-
if(mode == this._modes.list){
|
|
1949
|
-
scheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();
|
|
1950
|
-
}else{
|
|
1951
|
-
this.scrollSlot("up");
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
},
|
|
1955
|
-
|
|
1956
|
-
"shift+down":function(){
|
|
1957
|
-
this.moveTo(this.extendSlot(this, "down"));
|
|
1958
|
-
},
|
|
1959
|
-
"shift+up":function(){
|
|
1960
|
-
this.moveTo(this.extendSlot(this, "up"));
|
|
1961
|
-
},
|
|
1962
|
-
"shift+right":function(){
|
|
1963
|
-
this.moveTo(this.extendSlot(this, "right"));
|
|
1964
|
-
},
|
|
1965
|
-
"shift+left":function(){
|
|
1966
|
-
this.moveTo(this.extendSlot(this, "left"));
|
|
1967
|
-
},
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
"enter": function(){
|
|
1971
|
-
var obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};
|
|
1972
|
-
|
|
1973
|
-
var mode = scheduler.getState().mode;
|
|
1974
|
-
if(scheduler.matrix && scheduler.matrix[mode]){
|
|
1975
|
-
|
|
1976
|
-
var timeline = scheduler.matrix[scheduler.getState().mode];
|
|
1977
|
-
obj[timeline.y_property] = this.section;
|
|
1978
|
-
}else if(scheduler._props && scheduler._props[mode]){
|
|
1979
|
-
var unit = scheduler._props[mode];
|
|
1980
|
-
obj[unit.map_to] = this.section;
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
scheduler.addEventNow(obj);
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
);
|
|
1988
|
-
|
|
1989
|
-
scheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);
|
|
1990
|
-
scheduler.$keyboardNavigation.MinicalButton = function(div, index){
|
|
1991
|
-
this.container = div;
|
|
1992
|
-
this.index = index || 0;
|
|
1993
|
-
};
|
|
1994
|
-
|
|
1995
|
-
scheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(
|
|
1996
|
-
scheduler.$keyboardNavigation.KeyNavNode,
|
|
1997
|
-
{
|
|
1998
|
-
|
|
1999
|
-
isValid: function(){
|
|
2000
|
-
var container = this.container;
|
|
2001
|
-
return !!container.offsetWidth;// valid if container is visible
|
|
2002
|
-
},
|
|
2003
|
-
|
|
2004
|
-
fallback: function(){
|
|
2005
|
-
var defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();
|
|
2006
|
-
if(defaultSlot.isValid()){
|
|
2007
|
-
return defaultSlot;
|
|
2008
|
-
}else{
|
|
2009
|
-
return new scheduler.$keyboardNavigation.DataArea();
|
|
2010
|
-
}
|
|
2011
|
-
},
|
|
2012
|
-
focus: function(){
|
|
2013
|
-
scheduler.$keyboardNavigation.dispatcher.globalNode.disable();
|
|
2014
|
-
this.container.removeAttribute("tabindex");
|
|
2015
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);
|
|
2016
|
-
|
|
2017
|
-
},
|
|
2018
|
-
blur: function(){
|
|
2019
|
-
this.container.setAttribute("tabindex", "0");
|
|
2020
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);
|
|
2021
|
-
},
|
|
2022
|
-
getNode: function(){
|
|
2023
|
-
if(!this.index){
|
|
2024
|
-
return this.container.querySelector(".dhx_cal_prev_button");
|
|
2025
|
-
}else{
|
|
2026
|
-
return this.container.querySelector(".dhx_cal_next_button");
|
|
2027
|
-
}
|
|
2028
|
-
},
|
|
2029
|
-
|
|
2030
|
-
keys: {
|
|
2031
|
-
"right": function(e){
|
|
2032
|
-
this.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));
|
|
2033
|
-
},
|
|
2034
|
-
"left": function(e){
|
|
2035
|
-
this.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));
|
|
2036
|
-
},
|
|
2037
|
-
"down": function(){
|
|
2038
|
-
var next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);
|
|
2039
|
-
if(next && !next.isValid()){
|
|
2040
|
-
next = next.fallback();
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
this.moveTo(next);
|
|
2044
|
-
},
|
|
2045
|
-
"enter": function(e){
|
|
2046
|
-
this.getNode().click();
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
);
|
|
2051
|
-
|
|
2052
|
-
scheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);
|
|
2053
|
-
scheduler.$keyboardNavigation.MinicalCell = function(div, row, col){
|
|
2054
|
-
this.container = div;
|
|
2055
|
-
this.row = row || 0;
|
|
2056
|
-
this.col = col || 0;
|
|
2057
|
-
};
|
|
2058
|
-
|
|
2059
|
-
scheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(
|
|
2060
|
-
scheduler.$keyboardNavigation.KeyNavNode,
|
|
2061
|
-
{
|
|
2062
|
-
|
|
2063
|
-
isValid: function(){
|
|
2064
|
-
var grid = this._getGrid();
|
|
2065
|
-
return !!(grid[this.row] && grid[this.row][this.col]);
|
|
2066
|
-
},
|
|
2067
|
-
fallback: function(){
|
|
2068
|
-
var row = this.row;
|
|
2069
|
-
var col = this.col;
|
|
2070
|
-
var grid = this._getGrid();
|
|
2071
|
-
if(!grid[row]){
|
|
2072
|
-
row = 0;
|
|
2073
|
-
}
|
|
2074
|
-
var dir = true;
|
|
2075
|
-
if(row > grid.length / 2){
|
|
2076
|
-
dir = false;
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2079
|
-
if(!grid[row]){
|
|
2080
|
-
var defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();
|
|
2081
|
-
if(defaultSlot.isValid()){
|
|
2082
|
-
return defaultSlot;
|
|
2083
|
-
}else{
|
|
2084
|
-
return new scheduler.$keyboardNavigation.DataArea();
|
|
2085
|
-
}
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
if(dir){
|
|
2089
|
-
for(var c = col; grid[row] && c < grid[row].length; c++){
|
|
2090
|
-
if(!grid[row][c] && c == grid[row].length - 1){
|
|
2091
|
-
row++;
|
|
2092
|
-
col = 0;
|
|
2093
|
-
}
|
|
2094
|
-
if(grid[row][c]){
|
|
2095
|
-
return new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);
|
|
2096
|
-
}
|
|
2097
|
-
}
|
|
2098
|
-
}else{
|
|
2099
|
-
for(var c = col; grid[row] && c < grid[row].length; c--){
|
|
2100
|
-
if(!grid[row][c] && !c){
|
|
2101
|
-
row--;
|
|
2102
|
-
col = grid[row].length - 1;
|
|
2103
|
-
}
|
|
2104
|
-
if(grid[row][c]){
|
|
2105
|
-
return new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
|
|
2110
|
-
return new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);
|
|
2111
|
-
},
|
|
2112
|
-
focus: function(){
|
|
2113
|
-
scheduler.$keyboardNavigation.dispatcher.globalNode.disable();
|
|
2114
|
-
|
|
2115
|
-
this.container.removeAttribute("tabindex");
|
|
2116
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);
|
|
2117
|
-
},
|
|
2118
|
-
blur: function(){
|
|
2119
|
-
this.container.setAttribute("tabindex", "0");
|
|
2120
|
-
scheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);
|
|
2121
|
-
},
|
|
2122
|
-
_getNode: function(row, col){
|
|
2123
|
-
return this.container.querySelector(".dhx_year_body tr:nth-child("+(row + 1) + ") td:nth-child("+(col + 1)+")");
|
|
2124
|
-
},
|
|
2125
|
-
getNode: function(){
|
|
2126
|
-
return this._getNode(this.row, this.col);
|
|
2127
|
-
},
|
|
2128
|
-
|
|
2129
|
-
_getGrid: function(){
|
|
2130
|
-
var rows = this.container.querySelectorAll(".dhx_year_body tr");
|
|
2131
|
-
var grid = [];
|
|
2132
|
-
for(var i = 0; i < rows.length; i++){
|
|
2133
|
-
grid[i] = [];
|
|
2134
|
-
var row = rows[i];
|
|
2135
|
-
var cells = row.querySelectorAll("td");
|
|
2136
|
-
for(var c = 0; c < cells.length; c++){
|
|
2137
|
-
var cell = cells[c];
|
|
2138
|
-
var enabled = true;
|
|
2139
|
-
var css = scheduler._getClassName(cell);
|
|
2140
|
-
if(css.indexOf("dhx_after") > -1 || css.indexOf("dhx_before") > -1 || css.indexOf("dhx_scale_ignore") > -1){
|
|
2141
|
-
enabled = false;
|
|
2142
|
-
}
|
|
2143
|
-
grid[i][c] = enabled;
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
return grid;
|
|
2147
|
-
},
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
keys: {
|
|
2151
|
-
"right": function(e){
|
|
2152
|
-
var grid = this._getGrid();
|
|
2153
|
-
var newRow = this.row;
|
|
2154
|
-
var newCol = this.col + 1;
|
|
2155
|
-
if(!grid[newRow] || !grid[newRow][newCol]){
|
|
2156
|
-
if(grid[newRow + 1]){
|
|
2157
|
-
newRow = newRow + 1;
|
|
2158
|
-
newCol = 0;
|
|
2159
|
-
}else{
|
|
2160
|
-
newCol = this.col;
|
|
2161
|
-
}
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
var next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);
|
|
2165
|
-
if(!next.isValid()){
|
|
2166
|
-
next = next.fallback();
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
this.moveTo(next);
|
|
2170
|
-
},
|
|
2171
|
-
"left": function(e){
|
|
2172
|
-
var grid = this._getGrid();
|
|
2173
|
-
var newRow = this.row;
|
|
2174
|
-
var newCol = this.col - 1;
|
|
2175
|
-
if(!grid[newRow] || !grid[newRow][newCol]){
|
|
2176
|
-
if(grid[newRow - 1]){
|
|
2177
|
-
newRow = newRow - 1;
|
|
2178
|
-
newCol = grid[newRow].length - 1;
|
|
2179
|
-
}else{
|
|
2180
|
-
newCol = this.col;
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
|
|
2184
|
-
var next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);
|
|
2185
|
-
if(!next.isValid()){
|
|
2186
|
-
next = next.fallback();
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
this.moveTo(next);
|
|
2190
|
-
},
|
|
2191
|
-
"down": function(){
|
|
2192
|
-
var grid = this._getGrid();
|
|
2193
|
-
var newRow = this.row + 1;
|
|
2194
|
-
var newCol = this.col;
|
|
2195
|
-
|
|
2196
|
-
if(!grid[newRow] || !grid[newRow][newCol]){
|
|
2197
|
-
newRow = this.row;
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
|
-
var next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);
|
|
2201
|
-
if(!next.isValid()){
|
|
2202
|
-
next = next.fallback();
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
this.moveTo(next);
|
|
2206
|
-
},
|
|
2207
|
-
"up": function(){
|
|
2208
|
-
var grid = this._getGrid();
|
|
2209
|
-
var newRow = this.row - 1;
|
|
2210
|
-
var newCol = this.col;
|
|
2211
|
-
|
|
2212
|
-
if(!grid[newRow] || !grid[newRow][newCol]){
|
|
2213
|
-
var index = 0;
|
|
2214
|
-
if(this.col > grid[this.row].length / 2){
|
|
2215
|
-
index = 1;
|
|
2216
|
-
}
|
|
2217
|
-
this.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));
|
|
2218
|
-
}else{
|
|
2219
|
-
var next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);
|
|
2220
|
-
if(!next.isValid()){
|
|
2221
|
-
next = next.fallback();
|
|
2222
|
-
}
|
|
2223
|
-
|
|
2224
|
-
this.moveTo(next);
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
},
|
|
2228
|
-
"enter": function(e){
|
|
2229
|
-
this.getNode().querySelector(".dhx_month_head").click();
|
|
2230
|
-
}
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
);
|
|
2234
|
-
|
|
2235
|
-
scheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);
|
|
2236
|
-
scheduler.$keyboardNavigation.DataArea = function(index){
|
|
2237
|
-
this.index = index || 0;
|
|
2238
|
-
};
|
|
2239
|
-
|
|
2240
|
-
scheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(
|
|
2241
|
-
scheduler.$keyboardNavigation.KeyNavNode,
|
|
2242
|
-
{
|
|
2243
|
-
getNode: function(index){
|
|
2244
|
-
return scheduler.$container.querySelector(".dhx_cal_data");
|
|
2245
|
-
},
|
|
2246
|
-
|
|
2247
|
-
_handlers:null,
|
|
2248
|
-
|
|
2249
|
-
isValid: function(){
|
|
2250
|
-
return true;
|
|
2251
|
-
},
|
|
2252
|
-
fallback:function(){
|
|
2253
|
-
return this;
|
|
2254
|
-
},
|
|
2255
|
-
|
|
2256
|
-
keys: {
|
|
2257
|
-
"up,down,right,left":function(){
|
|
2258
|
-
this.moveTo(new scheduler.$keyboardNavigation.TimeSlot());
|
|
2259
|
-
}
|
|
2260
|
-
}
|
|
2261
|
-
}
|
|
2262
|
-
);
|
|
2263
|
-
|
|
2264
|
-
scheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);
|
|
2265
|
-
if(!dhtmlx._modalsStack){
|
|
2266
|
-
dhtmlx._modalsStack = [];
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
(function(){
|
|
2270
|
-
var modalsStack = [];
|
|
2271
|
-
|
|
2272
|
-
function isModal(){
|
|
2273
|
-
return !!(modalsStack.length || dhtmlx._modalsStack.length);
|
|
2274
|
-
}
|
|
2275
|
-
|
|
2276
|
-
function isChildOf(child, parent){
|
|
2277
|
-
while(child && child != parent){
|
|
2278
|
-
child = child.parentNode;
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
return !!(child == parent);
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
function afterPopup(box){
|
|
2285
|
-
setTimeout(function(){
|
|
2286
|
-
if(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {
|
|
2287
|
-
scheduler.focus();
|
|
2288
|
-
}
|
|
2289
|
-
}, 1);
|
|
2290
|
-
}
|
|
2291
|
-
function startModal(box){
|
|
2292
|
-
scheduler.eventRemove(box, "keydown", trapFocus);
|
|
2293
|
-
scheduler.event(box, "keydown", trapFocus);
|
|
2294
|
-
modalsStack.push(box);
|
|
2295
|
-
//scheduler.$keyboardNavigation.dispatcher.disable();
|
|
2296
|
-
}
|
|
2297
|
-
|
|
2298
|
-
function endModal(){
|
|
2299
|
-
var box = modalsStack.pop();
|
|
2300
|
-
if(box) {
|
|
2301
|
-
scheduler.eventRemove(box, "keydown", trapFocus);
|
|
2302
|
-
}
|
|
2303
|
-
afterPopup(box);
|
|
2304
|
-
|
|
2305
|
-
}
|
|
2306
|
-
|
|
2307
|
-
function isTopModal(box){
|
|
2308
|
-
if(dhtmlx._modalsStack.length){
|
|
2309
|
-
return box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];
|
|
2310
|
-
}else{
|
|
2311
|
-
return box == modalsStack[modalsStack.length - 1];
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
function trapFocus(event){
|
|
2317
|
-
var event = event || window.event;
|
|
2318
|
-
var target = event.currentTarget;
|
|
2319
|
-
if(!isTopModal(target)) return;
|
|
2320
|
-
|
|
2321
|
-
scheduler.$keyboardNavigation.trapFocus(target, event);
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
function traceLightbox(){
|
|
2325
|
-
startModal(scheduler.getLightbox());
|
|
2326
|
-
}
|
|
2327
|
-
|
|
2328
|
-
scheduler.attachEvent("onLightbox", traceLightbox);
|
|
2329
|
-
scheduler.attachEvent("onAfterLightbox", endModal);
|
|
2330
|
-
|
|
2331
|
-
scheduler.attachEvent("onAfterQuickInfo", function(){afterPopup();});
|
|
2332
|
-
|
|
2333
|
-
if(!dhtmlx._keyNavMessagePopup) {
|
|
2334
|
-
dhtmlx._keyNavMessagePopup = true;
|
|
2335
|
-
|
|
2336
|
-
var focusElement = null;
|
|
2337
|
-
var backupFocus = null;
|
|
2338
|
-
dhtmlx.attachEvent("onMessagePopup", function(box){
|
|
2339
|
-
focusElement = document.activeElement;
|
|
2340
|
-
backupFocus = focusElement;
|
|
2341
|
-
|
|
2342
|
-
while(backupFocus && scheduler._getClassName(backupFocus).indexOf("dhx_cal_data") < 0){
|
|
2343
|
-
backupFocus = backupFocus.parentNode;
|
|
2344
|
-
}
|
|
2345
|
-
if(backupFocus){
|
|
2346
|
-
backupFocus = backupFocus.parentNode;
|
|
2347
|
-
}
|
|
2348
|
-
|
|
2349
|
-
scheduler.eventRemove(box, "keydown", trapFocus);
|
|
2350
|
-
scheduler.event(box, "keydown", trapFocus);
|
|
2351
|
-
dhtmlx._modalsStack.push(box);
|
|
2352
|
-
});
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
dhtmlx.attachEvent("onAfterMessagePopup", function () {
|
|
2356
|
-
var box = dhtmlx._modalsStack.pop();
|
|
2357
|
-
if(box) {
|
|
2358
|
-
scheduler.eventRemove(box, "keydown", trapFocus);
|
|
2359
|
-
}
|
|
2360
|
-
setTimeout(function(){
|
|
2361
|
-
|
|
2362
|
-
var currentTarget = document.activeElement;
|
|
2363
|
-
while(currentTarget && scheduler._getClassName(currentTarget).indexOf("dhx_cal_light") < 0){
|
|
2364
|
-
currentTarget = currentTarget.parentNode;
|
|
2365
|
-
}
|
|
2366
|
-
if(currentTarget)
|
|
2367
|
-
return;
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
if(focusElement && focusElement.parentNode){
|
|
2371
|
-
focusElement.focus();
|
|
2372
|
-
|
|
2373
|
-
}else if(backupFocus && backupFocus.parentNode){
|
|
2374
|
-
backupFocus.focus();
|
|
2375
|
-
}
|
|
2376
|
-
focusElement = null;
|
|
2377
|
-
backupFocus = null;
|
|
2378
|
-
|
|
2379
|
-
}, 1);
|
|
2380
|
-
});
|
|
2381
|
-
}
|
|
2382
|
-
|
|
2383
|
-
scheduler.$keyboardNavigation.isModal = isModal;
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
})();
|
|
2387
|
-
scheduler.$keyboardNavigation.dispatcher = {
|
|
2388
|
-
isActive: false,
|
|
2389
|
-
activeNode: null,
|
|
2390
|
-
globalNode: new scheduler.$keyboardNavigation.SchedulerNode(),
|
|
2391
|
-
|
|
2392
|
-
keepScrollPosition: function (callback) {
|
|
2393
|
-
var top, left;
|
|
2394
|
-
|
|
2395
|
-
var scrollable = scheduler.$container.querySelector(".dhx_timeline_scrollable_data");
|
|
2396
|
-
if(!scrollable){
|
|
2397
|
-
scrollable = scheduler.$container.querySelector(".dhx_cal_data");
|
|
2398
|
-
}
|
|
2399
|
-
|
|
2400
|
-
if(scrollable){
|
|
2401
|
-
top = scrollable.scrollTop;
|
|
2402
|
-
left = scrollable.scrollLeft;
|
|
2403
|
-
}
|
|
2404
|
-
|
|
2405
|
-
callback();
|
|
2406
|
-
|
|
2407
|
-
if(scrollable){
|
|
2408
|
-
scrollable.scrollTop = top;
|
|
2409
|
-
scrollable.scrollLeft = left;
|
|
2410
|
-
}
|
|
2411
|
-
},
|
|
2412
|
-
enable: function(){
|
|
2413
|
-
if(!scheduler.$container){
|
|
2414
|
-
// do nothing if not initialized
|
|
2415
|
-
return;
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
this.isActive = true;
|
|
2419
|
-
var self = this;
|
|
2420
|
-
this.keepScrollPosition(function () {
|
|
2421
|
-
self.globalNode.enable();
|
|
2422
|
-
self.setActiveNode(self.getActiveNode());
|
|
2423
|
-
});
|
|
2424
|
-
},
|
|
2425
|
-
|
|
2426
|
-
disable: function(){
|
|
2427
|
-
this.isActive = false;
|
|
2428
|
-
this.globalNode.disable();
|
|
2429
|
-
},
|
|
2430
|
-
|
|
2431
|
-
isEnabled: function(){
|
|
2432
|
-
return !!this.isActive;
|
|
2433
|
-
},
|
|
2434
|
-
|
|
2435
|
-
getDefaultNode: function(){
|
|
2436
|
-
return this.globalNode.getDefaultNode();
|
|
2437
|
-
},
|
|
2438
|
-
|
|
2439
|
-
setDefaultNode: function() {
|
|
2440
|
-
this.setActiveNode(this.getDefaultNode());
|
|
2441
|
-
},
|
|
2442
|
-
|
|
2443
|
-
getActiveNode: function(){
|
|
2444
|
-
var node = this.activeNode;
|
|
2445
|
-
if(node && !node.isValid()){
|
|
2446
|
-
node = node.fallback();
|
|
2447
|
-
}
|
|
2448
|
-
return node;
|
|
2449
|
-
},
|
|
2450
|
-
|
|
2451
|
-
focusGlobalNode: function(){
|
|
2452
|
-
this.blurNode(this.globalNode);
|
|
2453
|
-
this.focusNode(this.globalNode);
|
|
2454
|
-
},
|
|
2455
|
-
|
|
2456
|
-
setActiveNode: function(el){
|
|
2457
|
-
if(!el || !el.isValid())
|
|
2458
|
-
return;
|
|
2459
|
-
|
|
2460
|
-
if(this.activeNode){
|
|
2461
|
-
if(this.activeNode.compareTo(el)){
|
|
2462
|
-
return;
|
|
2463
|
-
}
|
|
2464
|
-
}
|
|
2465
|
-
if(this.isEnabled()){
|
|
2466
|
-
this.blurNode(this.activeNode);
|
|
2467
|
-
this.activeNode = el;
|
|
2468
|
-
this.focusNode(this.activeNode);
|
|
2469
|
-
}
|
|
2470
|
-
},
|
|
2471
|
-
|
|
2472
|
-
focusNode: function(el){
|
|
2473
|
-
if(el && el.focus){
|
|
2474
|
-
el.focus();
|
|
2475
|
-
if(el.getNode && document.activeElement != el.getNode()){
|
|
2476
|
-
this.setActiveNode(new scheduler.$keyboardNavigation.DataArea());
|
|
2477
|
-
}
|
|
2478
|
-
}
|
|
2479
|
-
},
|
|
2480
|
-
blurNode: function(el){
|
|
2481
|
-
if(el && el.blur){
|
|
2482
|
-
el.blur();
|
|
2483
|
-
}
|
|
2484
|
-
},
|
|
2485
|
-
|
|
2486
|
-
getInlineEditor: function(id){
|
|
2487
|
-
var editor = scheduler.$container.querySelector(".dhx_cal_editor[event_id='"+id+"'] textarea");
|
|
2488
|
-
if(editor && editor.offsetWidth){
|
|
2489
|
-
// if exists and visible
|
|
2490
|
-
return editor;
|
|
2491
|
-
}
|
|
2492
|
-
return null;
|
|
2493
|
-
},
|
|
2494
|
-
|
|
2495
|
-
keyDownHandler: function (e) {
|
|
2496
|
-
|
|
2497
|
-
if(e.defaultPrevented){
|
|
2498
|
-
return;
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
var activeElement = this.getActiveNode();
|
|
2502
|
-
|
|
2503
|
-
if(scheduler.$keyboardNavigation.isModal() &&
|
|
2504
|
-
!(activeElement && activeElement.container && scheduler._locate_css({target:activeElement.container}, "dhx_minical_popup", false)))
|
|
2505
|
-
return;
|
|
2506
|
-
|
|
2507
|
-
if(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))
|
|
2508
|
-
return;
|
|
2509
|
-
|
|
2510
|
-
if (!this.isEnabled())
|
|
2511
|
-
return;
|
|
2512
|
-
|
|
2513
|
-
e = e || window.event;
|
|
2514
|
-
|
|
2515
|
-
var schedulerNode = this.globalNode;
|
|
2516
|
-
|
|
2517
|
-
var command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);
|
|
2518
|
-
|
|
2519
|
-
if(!activeElement){
|
|
2520
|
-
this.setDefaultNode();
|
|
2521
|
-
}else if(activeElement.findHandler(command)){
|
|
2522
|
-
activeElement.doAction(command, e);
|
|
2523
|
-
}else if(schedulerNode.findHandler(command)){
|
|
2524
|
-
schedulerNode.doAction(command, e);
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
},
|
|
2528
|
-
|
|
2529
|
-
_timeout: null,
|
|
2530
|
-
delay: function(callback, delay){
|
|
2531
|
-
|
|
2532
|
-
clearTimeout(this._timeout);
|
|
2533
|
-
this._timeout = setTimeout(callback, delay || 1);
|
|
2534
|
-
|
|
2535
|
-
}
|
|
2536
|
-
};
|
|
2537
|
-
//Initial idea and implementation by Steve MC
|
|
2538
|
-
scheduler._temp_key_scope = function (){
|
|
2539
|
-
|
|
2540
|
-
scheduler.config.key_nav = true;
|
|
2541
|
-
|
|
2542
|
-
scheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations
|
|
2543
|
-
scheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations
|
|
2544
|
-
var isCopy = null;
|
|
2545
|
-
|
|
2546
|
-
var pos = {};
|
|
2547
|
-
|
|
2548
|
-
if(!document.body){
|
|
2549
|
-
scheduler.event(window, "load", function(){
|
|
2550
|
-
scheduler.event(document.body, "mousemove", trackMousePosition);
|
|
2551
|
-
});
|
|
2552
|
-
}else{
|
|
2553
|
-
scheduler.event(document.body, "mousemove", trackMousePosition);
|
|
2554
|
-
}
|
|
2555
|
-
|
|
2556
|
-
function trackMousePosition(event){
|
|
2557
|
-
event = event || window.event;
|
|
2558
|
-
pos.x = event.clientX;
|
|
2559
|
-
pos.y = event.clientY;
|
|
2560
|
-
}
|
|
2561
|
-
function currentTarget(){
|
|
2562
|
-
|
|
2563
|
-
var mousePointer = false;
|
|
2564
|
-
var keyNavPointer = false;
|
|
2565
|
-
|
|
2566
|
-
var target = document.elementFromPoint(pos.x, pos.y);
|
|
2567
|
-
while(target && target != scheduler._obj){
|
|
2568
|
-
target = target.parentNode;
|
|
2569
|
-
}
|
|
2570
|
-
mousePointer = !!(target == scheduler._obj);
|
|
2571
|
-
|
|
2572
|
-
keyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();
|
|
2573
|
-
|
|
2574
|
-
return mousePointer || keyNavPointer;
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
scheduler.attachEvent("onMouseMove", function(id,e){
|
|
2578
|
-
var state = scheduler.getState();
|
|
2579
|
-
|
|
2580
|
-
// make sure scheduler is fully initialized before calling scheduler.getActionData
|
|
2581
|
-
if(!(state.mode && state.min_date)){
|
|
2582
|
-
return;
|
|
2583
|
-
}
|
|
2584
|
-
var position = scheduler.getActionData(e);
|
|
2585
|
-
scheduler.$keyboardNavigation._pasteDate = position.date;
|
|
2586
|
-
scheduler.$keyboardNavigation._pasteSection = position.section;
|
|
2587
|
-
});
|
|
2588
|
-
|
|
2589
|
-
function clear_event_after(ev){
|
|
2590
|
-
delete ev.rec_type; delete ev.rec_pattern;
|
|
2591
|
-
delete ev.event_pid; delete ev.event_length;
|
|
2592
|
-
}
|
|
2593
|
-
|
|
2594
|
-
function copyEvent(ev){
|
|
2595
|
-
return scheduler._lame_copy({}, ev);
|
|
2596
|
-
}
|
|
2597
|
-
|
|
2598
|
-
scheduler._make_pasted_event = function(ev){
|
|
2599
|
-
var date = scheduler.$keyboardNavigation._pasteDate;
|
|
2600
|
-
var section = scheduler.$keyboardNavigation._pasteSection;
|
|
2601
|
-
|
|
2602
|
-
var event_duration = ev.end_date-ev.start_date;
|
|
2603
|
-
|
|
2604
|
-
var copy = copyEvent(ev);
|
|
2605
|
-
clear_event_after(copy);
|
|
2606
|
-
copy.start_date = new Date(date);
|
|
2607
|
-
copy.end_date = new Date(copy.start_date.valueOf() + event_duration);
|
|
2608
|
-
|
|
2609
|
-
if(section){
|
|
2610
|
-
var property = scheduler._get_section_property();
|
|
2611
|
-
|
|
2612
|
-
if(scheduler.config.multisection)
|
|
2613
|
-
copy[property] = ev[property]; // save initial set of resources for multisection view
|
|
2614
|
-
else
|
|
2615
|
-
copy[property] = section;
|
|
2616
|
-
}
|
|
2617
|
-
return copy;
|
|
2618
|
-
};
|
|
2619
|
-
scheduler._do_paste = function(is_copy, modified_ev, original_ev){
|
|
2620
|
-
if(scheduler.callEvent("onBeforeEventPasted", [is_copy, modified_ev, original_ev]) === false){
|
|
2621
|
-
return;
|
|
2622
|
-
}
|
|
2623
|
-
scheduler.addEvent(modified_ev);
|
|
2624
|
-
scheduler.callEvent("onEventPasted", [is_copy, modified_ev, original_ev]);
|
|
2625
|
-
};
|
|
2626
|
-
|
|
2627
|
-
scheduler._is_key_nav_active = function(){
|
|
2628
|
-
if(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){
|
|
2629
|
-
return true;
|
|
2630
|
-
}
|
|
2631
|
-
return false;
|
|
2632
|
-
};
|
|
2633
|
-
|
|
2634
|
-
function getSelectedEvent(){
|
|
2635
|
-
var node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();
|
|
2636
|
-
if(node && node.eventId) return node.eventId;
|
|
2637
|
-
return scheduler._select_id;
|
|
2638
|
-
}
|
|
2639
|
-
|
|
2640
|
-
scheduler.event(document, "keydown", function(e){
|
|
2641
|
-
// compatibility fix - scheduler focus on ctrl+v on mouse hover
|
|
2642
|
-
if(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {
|
|
2643
|
-
scheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();
|
|
2644
|
-
}
|
|
2645
|
-
});
|
|
2646
|
-
|
|
2647
|
-
scheduler._key_nav_copy_paste = function(e){
|
|
2648
|
-
if(!scheduler._is_key_nav_active()) return true;
|
|
2649
|
-
|
|
2650
|
-
e=e||event;
|
|
2651
|
-
|
|
2652
|
-
if (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows
|
|
2653
|
-
e.cancelBubble = true;
|
|
2654
|
-
|
|
2655
|
-
var next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);
|
|
2656
|
-
scheduler.setCurrentView(next);
|
|
2657
|
-
return true;
|
|
2658
|
-
}
|
|
2659
|
-
|
|
2660
|
-
var select_id = getSelectedEvent();
|
|
2661
|
-
if ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C
|
|
2662
|
-
if (select_id) {
|
|
2663
|
-
scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));
|
|
2664
|
-
isCopy = true;
|
|
2665
|
-
scheduler.callEvent("onEventCopied", [scheduler.getEvent(select_id)]);
|
|
2666
|
-
}
|
|
2667
|
-
return true;
|
|
2668
|
-
}
|
|
2669
|
-
if ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X
|
|
2670
|
-
if (select_id) {
|
|
2671
|
-
isCopy = false;
|
|
2672
|
-
var ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));
|
|
2673
|
-
|
|
2674
|
-
scheduler.updateEvent(ev.id);
|
|
2675
|
-
scheduler.callEvent("onEventCut", [ev]);
|
|
2676
|
-
}
|
|
2677
|
-
}
|
|
2678
|
-
|
|
2679
|
-
if ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V
|
|
2680
|
-
var ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;
|
|
2681
|
-
ev = ev || scheduler._buffer_event;
|
|
2682
|
-
|
|
2683
|
-
if (ev) {
|
|
2684
|
-
var new_ev = scheduler._make_pasted_event(ev);
|
|
2685
|
-
if (isCopy) {
|
|
2686
|
-
new_ev.id = scheduler.uid();
|
|
2687
|
-
scheduler._do_paste(isCopy, new_ev, ev);
|
|
2688
|
-
}
|
|
2689
|
-
else { // cut operation
|
|
2690
|
-
var res = scheduler.callEvent("onBeforeEventChanged",[new_ev, e, false, ev]);
|
|
2691
|
-
if (res) {
|
|
2692
|
-
scheduler._do_paste(isCopy, new_ev, ev);
|
|
2693
|
-
isCopy = true; // switch to copy after first paste operation
|
|
2694
|
-
}
|
|
2695
|
-
}
|
|
2696
|
-
|
|
2697
|
-
}
|
|
2698
|
-
return true;
|
|
2699
|
-
}
|
|
2700
|
-
};
|
|
2701
|
-
};
|
|
2702
|
-
scheduler._temp_key_scope();
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
(function(){
|
|
2706
|
-
scheduler.$keyboardNavigation.attachSchedulerHandlers = function(){
|
|
2707
|
-
var dispatcher = scheduler.$keyboardNavigation.dispatcher;
|
|
2708
|
-
|
|
2709
|
-
var keyDownHandler = function(e){
|
|
2710
|
-
if(!scheduler.config.key_nav) return;
|
|
2711
|
-
|
|
2712
|
-
return dispatcher.keyDownHandler(e);
|
|
2713
|
-
};
|
|
2714
|
-
|
|
2715
|
-
var focusHandler = function () {
|
|
2716
|
-
dispatcher.keepScrollPosition(function () {
|
|
2717
|
-
dispatcher.focusGlobalNode();
|
|
2718
|
-
});
|
|
2719
|
-
};
|
|
2720
|
-
|
|
2721
|
-
var waitCall;
|
|
2722
|
-
scheduler.attachEvent("onDataRender", function(){
|
|
2723
|
-
if(!scheduler.config.key_nav) return;
|
|
2724
|
-
if(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;
|
|
2725
|
-
|
|
2726
|
-
clearTimeout(waitCall);
|
|
2727
|
-
waitCall = setTimeout(function(){
|
|
2728
|
-
if(!dispatcher.isEnabled())
|
|
2729
|
-
dispatcher.enable();
|
|
2730
|
-
reFocusActiveNode();
|
|
2731
|
-
});
|
|
2732
|
-
});
|
|
2733
|
-
|
|
2734
|
-
var reFocusActiveNode = function(){
|
|
2735
|
-
if(!dispatcher.isEnabled())
|
|
2736
|
-
return;
|
|
2737
|
-
|
|
2738
|
-
var activeNode = dispatcher.getActiveNode();
|
|
2739
|
-
if(!activeNode)
|
|
2740
|
-
return;
|
|
2741
|
-
|
|
2742
|
-
if(!activeNode.isValid()){
|
|
2743
|
-
activeNode = activeNode.fallback();
|
|
2744
|
-
}
|
|
2745
|
-
|
|
2746
|
-
if(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)
|
|
2747
|
-
return;
|
|
2748
|
-
|
|
2749
|
-
dispatcher.keepScrollPosition(function () {
|
|
2750
|
-
activeNode.focus(true);
|
|
2751
|
-
});
|
|
2752
|
-
};
|
|
2753
|
-
|
|
2754
|
-
scheduler.attachEvent("onSchedulerReady", function(){
|
|
2755
|
-
var container = scheduler.$container;
|
|
2756
|
-
scheduler.eventRemove(document, "keydown", keyDownHandler);
|
|
2757
|
-
scheduler.eventRemove(container, "mousedown", mousedownHandler);
|
|
2758
|
-
scheduler.eventRemove(container, "focus", focusHandler);
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
if(scheduler.config.key_nav){
|
|
2762
|
-
|
|
2763
|
-
scheduler.event(document, "keydown", keyDownHandler);
|
|
2764
|
-
scheduler.event(container, "mousedown", mousedownHandler);
|
|
2765
|
-
scheduler.event(container, "focus", focusHandler);
|
|
2766
|
-
|
|
2767
|
-
container.setAttribute("tabindex", "0");
|
|
2768
|
-
|
|
2769
|
-
}else{
|
|
2770
|
-
container.removeAttribute("tabindex");
|
|
2771
|
-
}
|
|
2772
|
-
});
|
|
2773
|
-
|
|
2774
|
-
function mousedownHandler(e){
|
|
2775
|
-
if(!scheduler.config.key_nav) return true;
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
var dataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(".dhx_cal_data"));
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
var pos = scheduler.getActionData(e);
|
|
2782
|
-
|
|
2783
|
-
var focusNode;
|
|
2784
|
-
if(scheduler._locate_event(e.target || e.srcElement)){
|
|
2785
|
-
focusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));
|
|
2786
|
-
}else if(dataAreaClick){
|
|
2787
|
-
focusNode = new scheduler.$keyboardNavigation.TimeSlot();
|
|
2788
|
-
if(pos.date && dataAreaClick){
|
|
2789
|
-
focusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));
|
|
2790
|
-
}
|
|
2791
|
-
}
|
|
2792
|
-
|
|
2793
|
-
if(focusNode) {
|
|
2794
|
-
if (!dispatcher.isEnabled()) {
|
|
2795
|
-
dispatcher.activeNode = focusNode;
|
|
2796
|
-
|
|
2797
|
-
} else {
|
|
2798
|
-
if (pos.date && dataAreaClick) {
|
|
2799
|
-
dispatcher.delay(function () {
|
|
2800
|
-
dispatcher.setActiveNode(focusNode);
|
|
2801
|
-
});
|
|
2802
|
-
}
|
|
2803
|
-
}
|
|
2804
|
-
}
|
|
2805
|
-
}
|
|
2806
|
-
|
|
2807
|
-
function focusEvent(evNode){
|
|
2808
|
-
if(!scheduler.config.key_nav) return;
|
|
2809
|
-
if(!dispatcher.isEnabled()) return;
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
var prevState = evNode;
|
|
2813
|
-
var focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);
|
|
2814
|
-
if(!focusNode.isValid()){
|
|
2815
|
-
var lastStart = focusNode.start || prevState.start;
|
|
2816
|
-
var lastEnd = focusNode.end || prevState.end;
|
|
2817
|
-
var lastSection = focusNode.section || prevState.section;
|
|
2818
|
-
|
|
2819
|
-
focusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);
|
|
2820
|
-
if(!focusNode.isValid()){
|
|
2821
|
-
focusNode = new scheduler.$keyboardNavigation.TimeSlot();
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
dispatcher.setActiveNode(focusNode);
|
|
2826
|
-
var node = dispatcher.getActiveNode();
|
|
2827
|
-
if(node && node.getNode && document.activeElement != node.getNode()){
|
|
2828
|
-
dispatcher.focusNode(dispatcher.getActiveNode());
|
|
2829
|
-
}
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
var updateEvent = scheduler.updateEvent;
|
|
2834
|
-
scheduler.updateEvent = function(id){
|
|
2835
|
-
var res = updateEvent.apply(this, arguments);
|
|
2836
|
-
if(scheduler.config.key_nav && dispatcher.isEnabled()){
|
|
2837
|
-
if(scheduler.getState().select_id == id){
|
|
2838
|
-
var element = new scheduler.$keyboardNavigation.Event(id);
|
|
2839
|
-
|
|
2840
|
-
if(!scheduler.getState().lightbox_id){
|
|
2841
|
-
focusEvent(element);
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
return res;
|
|
2846
|
-
};
|
|
2847
|
-
|
|
2848
|
-
scheduler.attachEvent("onEventDeleted", function(id) {
|
|
2849
|
-
if(!scheduler.config.key_nav) return true;
|
|
2850
|
-
if(dispatcher.isEnabled()){
|
|
2851
|
-
var activeNode = dispatcher.getActiveNode();
|
|
2852
|
-
if(activeNode.eventId == id){
|
|
2853
|
-
dispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
return true;
|
|
2857
|
-
});
|
|
2858
|
-
|
|
2859
|
-
scheduler.attachEvent("onClearAll", function(){
|
|
2860
|
-
if(!scheduler.config.key_nav) return true;
|
|
2861
|
-
if(dispatcher.isEnabled()){
|
|
2862
|
-
if(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){
|
|
2863
|
-
dispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());
|
|
2864
|
-
}
|
|
2865
|
-
}
|
|
2866
|
-
});
|
|
2867
|
-
|
|
2868
|
-
};
|
|
2869
|
-
scheduler.$keyboardNavigation._minicalendars = [];
|
|
2870
|
-
|
|
2871
|
-
scheduler.$keyboardNavigation.isMinical = function(node){
|
|
2872
|
-
var minicalendars = scheduler.$keyboardNavigation._minicalendars;
|
|
2873
|
-
for(var i = 0; i < minicalendars.length; i++){
|
|
2874
|
-
if(this.isChildOf(node, minicalendars[i]))
|
|
2875
|
-
return true;
|
|
2876
|
-
}
|
|
2877
|
-
return false;
|
|
2878
|
-
};
|
|
2879
|
-
|
|
2880
|
-
scheduler.$keyboardNavigation.isChildOf = function(child, parent){
|
|
2881
|
-
while(child && child !== parent){
|
|
2882
|
-
child = child.parentNode;
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
return !!(child === parent);
|
|
2886
|
-
};
|
|
2887
|
-
|
|
2888
|
-
scheduler.$keyboardNavigation.patchMinicalendar = function(){
|
|
2889
|
-
var dispatcher = scheduler.$keyboardNavigation.dispatcher;
|
|
2890
|
-
|
|
2891
|
-
function focusMinical(e){
|
|
2892
|
-
var target = e.target;
|
|
2893
|
-
|
|
2894
|
-
dispatcher.enable();
|
|
2895
|
-
dispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
|
-
function minicalClick(e){
|
|
2899
|
-
var target = e.target || e.srcElement;
|
|
2900
|
-
|
|
2901
|
-
var prev = scheduler._locate_css(e, "dhx_cal_prev_button", false);
|
|
2902
|
-
var next = scheduler._locate_css(e, "dhx_cal_next_button", false);
|
|
2903
|
-
var cell = scheduler._locate_css(e, "dhx_year_body", false);
|
|
2904
|
-
|
|
2905
|
-
var rowIndex = 0;
|
|
2906
|
-
var cellIndex = 0;
|
|
2907
|
-
if(cell){
|
|
2908
|
-
var tr;
|
|
2909
|
-
var td;
|
|
2910
|
-
var current = target;
|
|
2911
|
-
while(current && current.tagName.toLowerCase() != "td"){
|
|
2912
|
-
current = current.parentNode;
|
|
2913
|
-
}
|
|
2914
|
-
if(current){
|
|
2915
|
-
td = current;
|
|
2916
|
-
tr = td.parentNode;
|
|
2917
|
-
}
|
|
2918
|
-
|
|
2919
|
-
if(tr && td){
|
|
2920
|
-
var rows = tr.parentNode.querySelectorAll("tr");
|
|
2921
|
-
for(var i = 0; i < rows.length; i++){
|
|
2922
|
-
if(rows[i] == tr){
|
|
2923
|
-
rowIndex = i;
|
|
2924
|
-
break;
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
|
-
var cells = tr.querySelectorAll("td");
|
|
2928
|
-
for(var i = 0; i < cells.length; i++){
|
|
2929
|
-
if(cells[i] == td){
|
|
2930
|
-
cellIndex = i;
|
|
2931
|
-
break;
|
|
2932
|
-
}
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
}
|
|
2936
|
-
var root = e.currentTarget;
|
|
2937
|
-
dispatcher.delay(function(){
|
|
2938
|
-
if(prev || next || cell){
|
|
2939
|
-
|
|
2940
|
-
var element;
|
|
2941
|
-
if(prev){
|
|
2942
|
-
element = new scheduler.$keyboardNavigation.MinicalButton(root, 0);
|
|
2943
|
-
dispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));
|
|
2944
|
-
}else if(next){
|
|
2945
|
-
element = new scheduler.$keyboardNavigation.MinicalButton(root, 1);
|
|
2946
|
-
}else if(cell){
|
|
2947
|
-
element = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);
|
|
2948
|
-
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
|
-
if(element){
|
|
2952
|
-
|
|
2953
|
-
dispatcher.enable();
|
|
2954
|
-
if(element.isValid()){
|
|
2955
|
-
dispatcher.activeNode = null;
|
|
2956
|
-
dispatcher.setActiveNode(element);
|
|
2957
|
-
}
|
|
2958
|
-
|
|
2959
|
-
}
|
|
2960
|
-
}
|
|
2961
|
-
|
|
2962
|
-
});
|
|
2963
|
-
}
|
|
2964
|
-
|
|
2965
|
-
if(scheduler.renderCalendar){
|
|
2966
|
-
var renderMinical = scheduler.renderCalendar;
|
|
2967
|
-
scheduler.renderCalendar = function(){
|
|
2968
|
-
var cal = renderMinical.apply(this, arguments);
|
|
2969
|
-
var minicalendars = scheduler.$keyboardNavigation._minicalendars;
|
|
2970
|
-
|
|
2971
|
-
scheduler.eventRemove(cal, "click", minicalClick);
|
|
2972
|
-
scheduler.event(cal, "click", minicalClick);
|
|
2973
|
-
|
|
2974
|
-
scheduler.eventRemove(cal, "focus", focusMinical);
|
|
2975
|
-
scheduler.event(cal, "focus", focusMinical);
|
|
2976
|
-
|
|
2977
|
-
var added = false;
|
|
2978
|
-
for(var i = 0; i < minicalendars.length; i++){
|
|
2979
|
-
if(minicalendars[i] == cal){
|
|
2980
|
-
added = true;
|
|
2981
|
-
break;
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
if(!added)
|
|
2985
|
-
minicalendars.push(cal);
|
|
2986
|
-
|
|
2987
|
-
if(dispatcher.isEnabled()){
|
|
2988
|
-
var node = dispatcher.getActiveNode();
|
|
2989
|
-
if(node && node.container == cal){
|
|
2990
|
-
dispatcher.focusNode(node);
|
|
2991
|
-
}else{
|
|
2992
|
-
cal.setAttribute("tabindex", "0");
|
|
2993
|
-
}
|
|
2994
|
-
}else{
|
|
2995
|
-
cal.setAttribute("tabindex", "0");
|
|
2996
|
-
}
|
|
2997
|
-
return cal;
|
|
2998
|
-
};
|
|
2999
|
-
}
|
|
3000
|
-
|
|
3001
|
-
if(scheduler.destroyCalendar){
|
|
3002
|
-
var destroyMinical = scheduler.destroyCalendar;
|
|
3003
|
-
scheduler.destroyCalendar = function(cal, force){
|
|
3004
|
-
cal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);
|
|
3005
|
-
var res = destroyMinical.apply(this, arguments);
|
|
3006
|
-
|
|
3007
|
-
if(!cal || !cal.parentNode){
|
|
3008
|
-
var minicalendars = scheduler.$keyboardNavigation._minicalendars;
|
|
3009
|
-
for(var i = 0; i < minicalendars.length; i++){
|
|
3010
|
-
if(minicalendars[i] == cal){
|
|
3011
|
-
scheduler.eventRemove(minicalendars[i], "focus", focusMinical);
|
|
3012
|
-
minicalendars.splice(i, 1);
|
|
3013
|
-
i--;
|
|
3014
|
-
}
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
|
|
3018
|
-
return res;
|
|
3019
|
-
};
|
|
3020
|
-
}
|
|
3021
|
-
};
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
var dispatcher = scheduler.$keyboardNavigation.dispatcher;
|
|
3025
|
-
|
|
3026
|
-
scheduler.$keyboardNavigation.attachSchedulerHandlers();
|
|
3027
|
-
|
|
3028
|
-
if(scheduler.renderCalendar){
|
|
3029
|
-
// if minical ext loaded before key nav ext - patch it now
|
|
3030
|
-
scheduler.$keyboardNavigation.patchMinicalendar();
|
|
3031
|
-
}else{
|
|
3032
|
-
// otherwise - wait until everything is loaded and try again
|
|
3033
|
-
var attachOnce = scheduler.attachEvent("onSchedulerReady", function(){
|
|
3034
|
-
scheduler.detachEvent(attachOnce);
|
|
3035
|
-
scheduler.$keyboardNavigation.patchMinicalendar();
|
|
3036
|
-
});
|
|
3037
|
-
}
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
function isSchedulerSelected(){
|
|
3042
|
-
if(!scheduler.config.key_nav) return;
|
|
3043
|
-
|
|
3044
|
-
var enable;
|
|
3045
|
-
var focusElement = document.activeElement;
|
|
3046
|
-
// halt key nav when focus is outside scheduler or in quick info popup
|
|
3047
|
-
if(!focusElement || scheduler._locate_css(focusElement, "dhx_cal_quick_info", false)){
|
|
3048
|
-
enable = false;
|
|
3049
|
-
}else{
|
|
3050
|
-
enable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);
|
|
3051
|
-
}
|
|
3052
|
-
|
|
3053
|
-
return enable;
|
|
3054
|
-
}
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
function changeState(enable){
|
|
3059
|
-
if(enable && !dispatcher.isEnabled()){
|
|
3060
|
-
dispatcher.enable();
|
|
3061
|
-
}else if(!enable && dispatcher.isEnabled()){
|
|
3062
|
-
dispatcher.disable();
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
|
|
3066
|
-
setInterval(function(){
|
|
3067
|
-
if(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){
|
|
3068
|
-
return;
|
|
3069
|
-
}
|
|
3070
|
-
|
|
3071
|
-
var enable = isSchedulerSelected();
|
|
3072
|
-
|
|
3073
|
-
if(enable){
|
|
3074
|
-
changeState(enable);
|
|
3075
|
-
}else if(!enable && dispatcher.isEnabled()){
|
|
3076
|
-
setTimeout(function(){
|
|
3077
|
-
// doublecheck in case checking is done in handler before focus element is repainted
|
|
3078
|
-
if(scheduler.config.key_nav){
|
|
3079
|
-
changeState(isSchedulerSelected());
|
|
3080
|
-
}else{
|
|
3081
|
-
scheduler.$container.removeAttribute("tabindex");
|
|
3082
|
-
}
|
|
3083
|
-
|
|
3084
|
-
}, 100);
|
|
3085
|
-
}
|
|
3086
|
-
}, 500);
|
|
3087
|
-
|
|
3088
|
-
})();
|
|
3089
|
-
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3092
|
-
if(window.Scheduler && window.Scheduler.plugin){
|
|
3093
|
-
window.Scheduler.plugin(setupKeyNav);
|
|
3094
|
-
}else{
|
|
3095
|
-
setupKeyNav(window.scheduler);
|
|
3096
|
-
}
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
})();
|