MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / i

Function i

codebase/dhtmlxscheduler.es.js:718–765  ·  view source on GitHub ↗
(n, s)

Source from the content-addressed store, hash-verified

716}
717function Ot(e) {
718 function i(n, s) {
719 switch (n) {
720 case "add-event":
721 (function(a) {
722 if (e.getEvent(a.id))
723 return void console.warn(`Event with ID ${a.id} already exists. Skipping add.`);
724 typeof a.start_date == "string" && (a.start_date = e.templates.parse_date(a.start_date)), typeof a.end_date == "string" && (a.end_date = e.templates.parse_date(a.end_date)), a.original_start && typeof a.original_start == "string" && (a.original_start = e.templates.parse_date(a.original_start)), t(() => {
725 e.addEvent(a);
726 });
727 })(s);
728 break;
729 case "update-event":
730 (function(a) {
731 const o = a.id;
732 if (!e.getEvent(o))
733 return void console.warn(`Event with ID ${o} does not exist. Skipping update.`);
734 const _ = e.getEvent(o);
735 t(() => {
736 for (let r in a)
737 r !== "start_date" && r !== "end_date" && (_[r] = a[r]);
738 typeof a.start_date == "string" && (_.start_date = e.templates.parse_date(a.start_date)), typeof a.end_date == "string" && (_.end_date = e.templates.parse_date(a.end_date)), a.original_start && typeof a.original_start == "string" && (_.original_start = e.templates.parse_date(a.original_start)), e.callEvent("onEventChanged", [o, _]), e.updateEvent(o), o !== a.id && e.changeEventId(o, a.id);
739 });
740 })(s);
741 break;
742 case "delete-event":
743 (function(a) {
744 const o = a.id;
745 if (!e.getEvent(o))
746 return void ((a.event_pid || a.recurring_event_id) && t(() => {
747 e.addEvent(a);
748 }));
749 t(() => {
750 const _ = e.getEvent(o);
751 if (_) {
752 if (_.rec_type || _.rrule) {
753 e._roll_back_dates(_);
754 const r = e._get_rec_markers(o);
755 for (const d in r)
756 e.getEvent(d) && e.deleteEvent(d, !0);
757 }
758 if (e.getState().lightbox_id == o && (this._new_event = this._lightbox_id, a.id = this._lightbox_id, this._events[this._lightbox_id] = a, e.callEvent("onLiveUpdateCollision", [o, null, "delete", a]) === !1))
759 return void e.endLightbox(!1, e._lightbox);
760 e.deleteEvent(o, !0);
761 }
762 });
763 })(s);
764 }
765 }
766 function t(n) {
767 e._dp ? e._dp.ignore(n) : n();
768 }

Callers 13

OtFunction · 0.70
tFunction · 0.70
nFunction · 0.70
sFunction · 0.70
aFunction · 0.70
oFunction · 0.70
_Function · 0.70
rFunction · 0.70
dFunction · 0.70
FtFunction · 0.70
BtFunction · 0.70
ceFunction · 0.70

Calls 15

tFunction · 0.70
oFunction · 0.70
aFunction · 0.70
getEventMethod · 0.65
parse_dateMethod · 0.65
addEventMethod · 0.65
callEventMethod · 0.65
updateEventMethod · 0.65
changeEventIdMethod · 0.65
deleteEventMethod · 0.65
getStateMethod · 0.65
endLightboxMethod · 0.65

Tested by

no test coverage detected