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

Function extend$2

codebase/sources/dhtmlxscheduler.js:7691–7738  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

7689 };
7690 }
7691 function extend$2(scheduler2) {
7692 if (typeof window !== "undefined" && window.jQuery) {
7693 (function($) {
7694 var counter = 0;
7695 var methods = [];
7696 $.fn.dhx_scheduler = function(config) {
7697 if (typeof config === "string") {
7698 if (methods[config]) {
7699 return methods[config].apply(this, []);
7700 } else {
7701 $.error("Method " + config + " does not exist on jQuery.dhx_scheduler");
7702 }
7703 } else {
7704 var views = [];
7705 this.each(function() {
7706 if (this && this.getAttribute) {
7707 if (!this.getAttribute("dhxscheduler")) {
7708 var name = "scheduler";
7709 if (counter) {
7710 name = "scheduler" + (counter + 1);
7711 window[name] = Scheduler.getSchedulerInstance();
7712 }
7713 var comp = window[name];
7714 this.setAttribute("dhxscheduler", name);
7715 for (var key in config)
7716 if (key != "data")
7717 comp.config[key] = config[key];
7718 if (!this.getElementsByTagName("div").length) {
7719 this.innerHTML = '<div class="dhx_cal_navline"><div class="dhx_cal_prev_button"></div><div class="dhx_cal_next_button"></div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div><div class="dhx_cal_tab" name="day_tab" data-tab="day" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" data-tab="week" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" data-tab="month" style="right:76px;"></div></div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div>';
7720 this.className += " dhx_cal_container";
7721 }
7722 comp.init(this, comp.config.date, comp.config.mode);
7723 if (config.data)
7724 comp.parse(config.data);
7725 views.push(comp);
7726 counter++;
7727 } else
7728 views.push(window[this.getAttribute("dhxscheduler")]);
7729 }
7730 });
7731 if (views.length === 1)
7732 return views[0];
7733 return views;
7734 }
7735 };
7736 })(window.jQuery);
7737 }
7738 }
7739 function extend$1(scheduler2) {
7740 (function() {
7741 var setCurrentView = scheduler2.setCurrentView, updateView = scheduler2.updateView;

Callers 1

factoryMethodFunction · 0.70

Calls 3

getSchedulerInstanceMethod · 0.65
initMethod · 0.65
parseMethod · 0.65

Tested by

no test coverage detected