MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / extend$6

Function extend$6

codebase/sources/dhtmlxscheduler.es.js:6417–7141  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

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

Callers 1

factoryMethodFunction · 0.70

Calls 15

handlerFunction · 0.70
_fill_lightbox_selectFunction · 0.70
getLightboxRootFunction · 0.70
getDaysInMonthFunction · 0.70
getLightboxMethod · 0.65
eventMethod · 0.65
date_partMethod · 0.65
time_pickerMethod · 0.65
time_partMethod · 0.65
addMethod · 0.65
getEventMethod · 0.65
callEventMethod · 0.65

Tested by

no test coverage detected