(scheduler2)
| 19778 | } |
| 19779 | } |
| 19780 | function recurring_legacy(scheduler2) { |
| 19781 | scheduler2.config.occurrence_timestamp_in_utc = false; |
| 19782 | scheduler2.config.recurring_workdays = [1, 2, 3, 4, 5]; |
| 19783 | scheduler2.form_blocks["recurring"] = { _get_node: function(node) { |
| 19784 | if (typeof node == "string") { |
| 19785 | let element = scheduler2._lightbox.querySelector(`#${node}`); |
| 19786 | if (!element) { |
| 19787 | element = document.getElementById(node); |
| 19788 | } |
| 19789 | node = element; |
| 19790 | } |
| 19791 | if (node.style.display == "none") |
| 19792 | node.style.display = ""; |
| 19793 | return node; |
| 19794 | }, _outer_html: function(node) { |
| 19795 | return node.outerHTML || getOuterHTML(node); |
| 19796 | function getOuterHTML(n) { |
| 19797 | var div = document.createElement("div"), h; |
| 19798 | div.appendChild(n.cloneNode(true)); |
| 19799 | h = div.innerHTML; |
| 19800 | div = null; |
| 19801 | return h; |
| 19802 | } |
| 19803 | }, render: function(sns) { |
| 19804 | if (sns.form) { |
| 19805 | var rec = scheduler2.form_blocks["recurring"]; |
| 19806 | var form = rec._get_node(sns.form); |
| 19807 | var html = rec._outer_html(form); |
| 19808 | form.style.display = "none"; |
| 19809 | return html; |
| 19810 | } |
| 19811 | var loc = scheduler2.locale.labels; |
| 19812 | return '<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <div><label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />' + loc.repeat_radio_day + '</label></div> <div><label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>' + loc.repeat_radio_week + '</label></div> <div><label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />' + loc.repeat_radio_month + '</label></div> <div><label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />' + loc.repeat_radio_year + '</label></div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <div><label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>' + loc.repeat_radio_day_type + '</label><label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />' + loc.repeat_text_day_count + '</label></div> <div><label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>' + loc.repeat_radio_day_type2 + '</label></div> </div> <div style="display:none;" id="dhx_repeat_week"><div><label>' + loc.repeat_week + '<input class="dhx_repeat_text" type="text" name="week_count" value="1" /></label><span>' + loc.repeat_text_week_count + '</span></div> <table class="dhx_repeat_days"> <tr> <td><div><label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />' + loc.day_for_recurring[1] + '</label></div> <div><label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />' + loc.day_for_recurring[4] + '</label></div></td> <td><div><label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />' + loc.day_for_recurring[2] + '</label></div> <div><label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />' + loc.day_for_recurring[5] + '</label></div></td> <td><div><label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />' + loc.day_for_recurring[3] + '</label></div> <div><label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />' + loc.day_for_recurring[6] + '</label></div></td> <td><div><label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />' + loc.day_for_recurring[0] + '</label></div> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <div><label class = "dhx_repeat_month_label"><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>' + loc.repeat_radio_month_type + '</label><label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />' + loc.repeat_text_month_day + '</label><label><input class="dhx_repeat_text" type="text" name="month_count" value="1" />' + loc.repeat_text_month_count + '</label></div> <div><label class = "dhx_repeat_month_label"><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>' + loc.repeat_radio_month_start + '</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><label><select name="month_day2"> <option value="1" selected >' + scheduler2.locale.date.day_full[1] + '<option value="2">' + scheduler2.locale.date.day_full[2] + '<option value="3">' + scheduler2.locale.date.day_full[3] + '<option value="4">' + scheduler2.locale.date.day_full[4] + '<option value="5">' + scheduler2.locale.date.day_full[5] + '<option value="6">' + scheduler2.locale.date.day_full[6] + '<option value="0">' + scheduler2.locale.date.day_full[0] + "</select>" + loc.repeat_text_month_count2_before + '</label><label><input class="dhx_repeat_text" type="text" name="month_count2" value="1" />' + loc.repeat_text_month_count2_after + '</label></div> </div> <div style="display:none;" id="dhx_repeat_year"> <div><label class = "dhx_repeat_year_label"><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>' + loc.repeat_radio_day_type + '</label><label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />' + loc.repeat_text_year_day + '</label><label><select name="year_month"><option value="0" selected >' + loc.month_for_recurring[0] + '<option value="1">' + loc.month_for_recurring[1] + '<option value="2">' + loc.month_for_recurring[2] + '<option value="3">' + loc.month_for_recurring[3] + '<option value="4">' + loc.month_for_recurring[4] + '<option value="5">' + loc.month_for_recurring[5] + '<option value="6">' + loc.month_for_recurring[6] + '<option value="7">' + loc.month_for_recurring[7] + '<option value="8">' + loc.month_for_recurring[8] + '<option value="9">' + loc.month_for_recurring[9] + '<option value="10">' + loc.month_for_recurring[10] + '<option value="11">' + loc.month_for_recurring[11] + "</select>" + loc.select_year_month + '</label></div> <div><label class = "dhx_repeat_year_label"><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>' + loc.repeat_year_label + '</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >' + scheduler2.locale.date.day_full[1] + '<option value="2">' + scheduler2.locale.date.day_full[2] + '<option value="3">' + scheduler2.locale.date.day_full[3] + '<option value="4">' + scheduler2.locale.date.day_full[4] + '<option value="5">' + scheduler2.locale.date.day_full[5] + '<option value="6">' + scheduler2.locale.date.day_full[6] + '<option value="7">' + scheduler2.locale.date.day_full[0] + "</select>" + loc.select_year_day2 + '<select name="year_month2"><option value="0" selected >' + loc.month_for_recurring[0] + '<option value="1">' + loc.month_for_recurring[1] + '<option value="2">' + loc.month_for_recurring[2] + '<option value="3">' + loc.month_for_recurring[3] + '<option value="4">' + loc.month_for_recurring[4] + '<option value="5">' + loc.month_for_recurring[5] + '<option value="6">' + loc.month_for_recurring[6] + '<option value="7">' + loc.month_for_recurring[7] + '<option value="8">' + loc.month_for_recurring[8] + '<option value="9">' + loc.month_for_recurring[9] + '<option value="10">' + loc.month_for_recurring[10] + '<option value="11">' + loc.month_for_recurring[11] + '</select></div> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <div><label><input class="dhx_repeat_radio" type="radio" name="end" checked/>' + loc.repeat_radio_end + '</label></div> <div><label><input class="dhx_repeat_radio" type="radio" name="end" />' + loc.repeat_radio_end2 + '</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />' + loc.repeat_text_occurrences_count + '</div> <div><label><input class="dhx_repeat_radio" type="radio" name="end" />' + loc.repeat_radio_end3 + '</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="' + scheduler2.config.repeat_date_of_end + '" /></div> </div> </form> </div> </div>'; |
| 19813 | }, _ds: {}, _get_form_node: function(els, name, value) { |
| 19814 | var col = els[name]; |
| 19815 | if (!col) |
| 19816 | return null; |
| 19817 | if (col.nodeName) |
| 19818 | return col; |
| 19819 | if (col.length) { |
| 19820 | for (var i = 0; i < col.length; i++) { |
| 19821 | if (col[i].value == value) |
| 19822 | return col[i]; |
| 19823 | } |
| 19824 | } |
| 19825 | }, _get_node_value: function(els, name, multiselect2) { |
| 19826 | var col = els[name]; |
| 19827 | if (!col) |
| 19828 | return ""; |
| 19829 | if (col.length) { |
| 19830 | if (multiselect2) { |
| 19831 | var res = []; |
| 19832 | for (var i = 0; i < col.length; i++) |
| 19833 | if (col[i].checked) |
| 19834 | res.push(col[i].value); |
| 19835 | return res; |
| 19836 | } else { |
| 19837 | for (var i = 0; i < col.length; i++) |
nothing calls this directly
no test coverage detected