(scheduler2)
| 8638 | scheduler2.DataProcessor = DataProcessor; |
| 8639 | } |
| 8640 | function message(scheduler2) { |
| 8641 | var boxAttribute = "data-dhxbox"; |
| 8642 | var _dhx_msg_cfg = null; |
| 8643 | function callback(config, result, event2) { |
| 8644 | var usercall = config.callback; |
| 8645 | if (usercall) |
| 8646 | usercall(result, event2); |
| 8647 | modalBox.hide(config.box); |
| 8648 | _dhx_msg_cfg = config.box = null; |
| 8649 | } |
| 8650 | function modal_key(event2) { |
| 8651 | if (_dhx_msg_cfg) { |
| 8652 | var code = event2.which || event2.keyCode; |
| 8653 | var preventDefault = false; |
| 8654 | if (messageBox.keyboard) { |
| 8655 | if (code == 13 || code == 32) { |
| 8656 | var target = event2.target || event2.srcElement; |
| 8657 | if (dom_helpers.getClassName(target).indexOf("scheduler_popup_button") > -1 && target.click) { |
| 8658 | target.click(); |
| 8659 | } else { |
| 8660 | callback(_dhx_msg_cfg, true); |
| 8661 | preventDefault = true; |
| 8662 | } |
| 8663 | } |
| 8664 | if (code == 27) { |
| 8665 | callback(_dhx_msg_cfg, false); |
| 8666 | preventDefault = true; |
| 8667 | } |
| 8668 | } |
| 8669 | if (preventDefault) { |
| 8670 | if (event2.preventDefault) { |
| 8671 | event2.preventDefault(); |
| 8672 | } |
| 8673 | return !(event2.cancelBubble = true); |
| 8674 | } |
| 8675 | return; |
| 8676 | } |
| 8677 | } |
| 8678 | if (typeof window !== "undefined") { |
| 8679 | scheduler2.event(document, "keydown", modal_key, true); |
| 8680 | } |
| 8681 | function modality(mode) { |
| 8682 | if (!modality.cover) { |
| 8683 | modality.cover = document.createElement("div"); |
| 8684 | scheduler2.event(modality.cover, "keydown", modal_key); |
| 8685 | modality.cover.className = "dhx_modal_cover"; |
| 8686 | document.body.appendChild(modality.cover); |
| 8687 | } |
| 8688 | modality.cover.style.display = mode ? "inline-block" : "none"; |
| 8689 | } |
| 8690 | function button(text, classValue, result) { |
| 8691 | var buttonAriaAttrs = scheduler2._waiAria.messageButtonAttrString(text); |
| 8692 | var name = (classValue || "").toLowerCase().replace(/ /g, "_"); |
| 8693 | var buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; |
| 8694 | return `<div ${buttonAriaAttrs} class='scheduler_popup_button dhtmlx_popup_button ${buttonCss}' data-result='${result}' result='${result}' ><div>${text}</div></div>`; |
| 8695 | } |
| 8696 | function info(text) { |
| 8697 | if (!messageBox.area) { |
no test coverage detected