(scheduler2)
| 6419 | }); |
| 6420 | } |
| 6421 | function extend$6(scheduler2) { |
| 6422 | scheduler2._lightbox_controls = {}; |
| 6423 | scheduler2.formSection = function(name) { |
| 6424 | var config = this.config.lightbox.sections; |
| 6425 | var i = 0; |
| 6426 | for (i; i < config.length; i++) { |
| 6427 | if (config[i].name == name) { |
| 6428 | break; |
| 6429 | } |
| 6430 | } |
| 6431 | if (i === config.length) { |
| 6432 | return null; |
| 6433 | } |
| 6434 | var section = config[i]; |
| 6435 | if (!scheduler2._lightbox) { |
| 6436 | scheduler2.getLightbox(); |
| 6437 | } |
| 6438 | var header = scheduler2._lightbox.querySelector(`#${section.id}`); |
| 6439 | var node = header.nextSibling; |
| 6440 | var result = { section, header, node, getValue: function(ev) { |
| 6441 | return scheduler2.form_blocks[section.type].get_value(node, ev || {}, section); |
| 6442 | }, setValue: function(value, ev) { |
| 6443 | return scheduler2.form_blocks[section.type].set_value(node, value, ev || {}, section); |
| 6444 | } }; |
| 6445 | var handler = scheduler2._lightbox_controls["get_" + section.type + "_control"]; |
| 6446 | return handler ? handler(result) : result; |
| 6447 | }; |
| 6448 | scheduler2._lightbox_controls.get_template_control = function(result) { |
| 6449 | result.control = result.node; |
| 6450 | return result; |
| 6451 | }; |
| 6452 | scheduler2._lightbox_controls.get_select_control = function(result) { |
| 6453 | result.control = result.node.getElementsByTagName("select")[0]; |
| 6454 | return result; |
| 6455 | }; |
| 6456 | scheduler2._lightbox_controls.get_textarea_control = function(result) { |
| 6457 | result.control = result.node.getElementsByTagName("textarea")[0]; |
| 6458 | return result; |
| 6459 | }; |
| 6460 | scheduler2._lightbox_controls.get_time_control = function(result) { |
| 6461 | result.control = result.node.getElementsByTagName("select"); |
| 6462 | return result; |
| 6463 | }; |
| 6464 | scheduler2._lightbox_controls.defaults = { template: { height: 30 }, textarea: { height: 200 }, select: { height: 23 }, time: { height: 20 } }; |
| 6465 | scheduler2.form_blocks = { template: { render: function(sns) { |
| 6466 | const sectionHeight = sns.height ? `style='height:${sns.height}px;'` : ""; |
| 6467 | return `<div class='dhx_cal_ltext dhx_cal_template' ${sectionHeight}></div>`; |
| 6468 | }, set_value: function(node, value, ev, config) { |
| 6469 | node.innerHTML = value || ""; |
| 6470 | }, get_value: function(node, ev, config) { |
| 6471 | return node.innerHTML || ""; |
| 6472 | }, focus: function(node) { |
| 6473 | } }, textarea: { render: function(sns) { |
| 6474 | const sectionHeight = sns.height ? `style='height:${sns.height}px;'` : ""; |
| 6475 | const placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : ""; |
| 6476 | return `<div class='dhx_cal_ltext' ${sectionHeight}><textarea ${placeholder}></textarea></div>`; |
| 6477 | }, set_value: function(node, value, ev) { |
| 6478 | scheduler2.form_blocks.textarea._get_input(node).value = value || ""; |
no test coverage detected