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

Function extend$2

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

Source from the content-addressed store, hash-verified

7685 };
7686}
7687function extend$2(scheduler2) {
7688 if (typeof window !== "undefined" && window.jQuery) {
7689 (function($) {
7690 var counter = 0;
7691 var methods = [];
7692 $.fn.dhx_scheduler = function(config) {
7693 if (typeof config === "string") {
7694 if (methods[config]) {
7695 return methods[config].apply(this, []);
7696 } else {
7697 $.error("Method " + config + " does not exist on jQuery.dhx_scheduler");
7698 }
7699 } else {
7700 var views = [];
7701 this.each(function() {
7702 if (this && this.getAttribute) {
7703 if (!this.getAttribute("dhxscheduler")) {
7704 var name = "scheduler";
7705 if (counter) {
7706 name = "scheduler" + (counter + 1);
7707 window[name] = Scheduler.getSchedulerInstance();
7708 }
7709 var comp = window[name];
7710 this.setAttribute("dhxscheduler", name);
7711 for (var key in config)
7712 if (key != "data")
7713 comp.config[key] = config[key];
7714 if (!this.getElementsByTagName("div").length) {
7715 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>';
7716 this.className += " dhx_cal_container";
7717 }
7718 comp.init(this, comp.config.date, comp.config.mode);
7719 if (config.data)
7720 comp.parse(config.data);
7721 views.push(comp);
7722 counter++;
7723 } else
7724 views.push(window[this.getAttribute("dhxscheduler")]);
7725 }
7726 });
7727 if (views.length === 1)
7728 return views[0];
7729 return views;
7730 }
7731 };
7732 })(window.jQuery);
7733 }
7734}
7735function extend$1(scheduler2) {
7736 (function() {
7737 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