Файловый менеджер - Редактировать - /home/lmsyaran/public_html/joomla5/plugins/fabrik_visualization/fullcalendar/fullcalendar-min.js
Назад
/*! Fabrik */ define(["jquery", "fab/fabrik", "fullcalendar"], function (m, f, t) { return new Class({ Implements: [Options], options: { canAdd: !1, show_week: !1, show_day: !1, default_view: "dayView", time_format: "", first_week_day: 1, minDuration: 0, greyscaledweekend: !1, calOptions: {}, startOffset: 0, url: { del: "index.php?option=com_fabrik&controller=visualization.fullcalendar&view=visualization&task=deleteEvent&format=raw" }, }, initialize: function (t, e) { var n = this, i = "", a = [], o = ((this.el = m("#" + t)), (this.calendar = this.el.find('*[data-role="calendar"]')), this.setOptions(e), (this.date = new Date()), (this.clickdate = null), (this.ajax = {}), (this.windowopts = { id: "addeventwin", title: "", loadMethod: "xhr", minimizable: !1, evalScripts: !0 }), this.el.find(".addEventButton").on("click", function (t) { t.preventDefault(), n.openAddEvent(t); }), f.addEvent("fabrik.form.submitted", function (t, e) { n.calendar.fullCalendar("refetchEvents"), f.Windows.addeventwin.close(); }), this.options.eventLists.each( function (o, d) { a.push({ events: function (t, e, i, n) { var a = this.options.url.add; a.test(/\?/) ? (a += "&") : (a += "?"), (a = (a = (a = (a += "listid=" + o.value) + "&eventListKey=" + d) + "&startDate=" + t.format()) + "&endDate=" + e.format()), new Request({ url: a, data: this.options.urlfilters, evalScripts: !0, onSuccess: function (t, e) { "null" !== typeOf(e) && this.processEvents(e, n); }.bind(this, n), }).send(); }.bind(this), color: o.colour, }); }.bind(this) ), !1 !== this.options.show_week && (i += "agendaWeek"), !1 !== this.options.show_day && (0 < i.length && (i += ","), (i += "agendaDay")), 0 < i.length && (i = "month," + i), "month"); switch (this.options.default_view) { case "monthView": break; case "weekView": !1 !== this.options.show_week && (o = "agendaWeek"); break; case "dayView": !1 !== this.options.show_day && (o = "agendaDay"); } var d = null, s = null; function l() { (d = s = null), n.calendar.off("mousemove", l); } this.calendar.dblclick(function (t) { d && n.openAddEvent(t, s, d); }), (this.calOptions = { header: { left: "prev,next today", center: "title", right: i }, fixedWeekCount: !1, timeFormat: this.options.time_format, defaultView: o, nextDayThreshold: "00:00:00", firstDay: this.options.first_week_day, eventSources: a, defaultTimedEventDuration: this.options.minDuration, minTime: this.options.open, maxTime: this.options.close, weekends: this.options.showweekends, eventClick: function (t, e, i) { return e.stopPropagation(), e.preventDefault(), n.clickEntry(t), !1; }, dayClick: function (t, e, i) { "touchend" === e.type ? n.openAddEvent(e, i.name, t) : ((d = t), (s = i.name), n.calendar.on("mousemove", l)); }, viewRender: function (t, e) { !0 === n.options.greyscaledweekend && (m("td.fc-sat").css("background", "#f2f2f2"), m("td.fc-sun").css("background", "#f2f2f2")); }, eventRender: function (t, e) { e.find(".fc-title").html(t.title); }, loading: function (t) {}, }), m.extend(!0, this.calOptions, JSON.parse(n.options.calOptions)), this.calendar.fullCalendar(this.calOptions), m(document).on("click", "button[data-task=viewCalEvent], a[data-task=viewCalEvent]", function (t) { t.preventDefault(); var e = m(t.target).closest(".calEventButtonsID"); 0 !== (e = 0 === e.length ? m(t.target).closest(".modal-body").next().find(".calEventButtonsID") : e).length && ((t = (t = e[0].id).replace(/_buttons/, "")), (e = n.calendar.fullCalendar("clientEvents", t)[0]), m("#fabrikEvent_modal").modal("hide"), n.viewEntry(e)); }), m(document).on("click", "button[data-task=editCalEvent], a[data-task=editCalEvent]", function (t) { t.preventDefault(); var e = m(t.target).closest(".calEventButtonsID"); 0 !== (e = 0 === e.length ? m(t.target).closest(".modal-body").next().find(".calEventButtonsID") : e).length && ((t = (t = e[0].id).replace(/_buttons/, "")), (e = n.calendar.fullCalendar("clientEvents", t)[0]), m("#fabrikEvent_modal").modal("hide"), n.editEntry(e)); }), m(document).on("click", "button[data-task=deleteCalEvent], a[data-task=deleteCalEvent]", function (t) { t.preventDefault(); var e = m(t.target).closest(".calEventButtonsID"); 0 !== (e = 0 === e.length ? m(t.target).closest(".modal-body").next().find(".calEventButtonsID") : e).length && ((t = (t = e[0].id).replace(/_buttons/, "")), (e = n.calendar.fullCalendar("clientEvents", t)[0]), m("#fabrikEvent_modal").modal("hide"), n.deleteEntry(e)); }); t = this.options.url.del; function r() { var t = m(this), e = (t.css("display", "block"), t.css("margin-top", Math.max(0, (m(window).height() - t.height()) / 2)), t.width()); t.css("margin-left", "-" + e / 2 + "px!important"); } t.test(/\?/) ? (t += "&") : (t += "?"), (t += "task=deleteEvent"), (this.ajax.deleteEvent = new Request({ url: t, data: { visualizationid: this.options.calendarId }, onComplete: function () { n.calendar.fullCalendar("refetchEvents"); }, })), m(".modal").on("show.bs.modal", r), m(window).on("resize", function () { m(".modal:visible").each(r); }); }, processEvents: function (t, e) { t = $H(JSON.parse(t)); var i, n, a, o, d, s, l, r, c, h = [], u = (u = this.options.time_format.replace("(", "")).replace(")", ""); t.each( function (t) { (d = m(f.jLayouts["fabrik-visualization-fullcalendar-event-popup"])[0]), (s = t._listid + "_" + t.id), (d.id = "fabrikevent_" + s), (l = m(f.jLayouts["fabrik-visualization-fullcalendar-viewevent"])[0]), (r = moment(t.startdate)), (c = moment(t.enddate)), (a = o = ""), (moment(c.format("YYYY-MM-DD")) > moment(r.format("YYYY-MM-DD")) || (!1 === t.startShowTime && !1 === t.endShowTime)) && ((a = r.format("MMM DD") + " "), (o = c.format("MMM DD") + " ")), !(n = i = "") === t.startShowTime && (n = r.format(u)), !0 === t.endShowTime && (i = c.format(u)), (l.getElement("#viewstart").innerHTML = a + n), (l.getElement("#viewend").innerHTML = o + i); var e = m(l).find("[data-role=fabrik-popup-template]"); e && ("" !== t.popupTemplate ? m(e).prepend(t.popupTemplate) : m(e).hide()), m(d).attr("data-bs-content", m(l).prop("outerHTML")), ((r = m(f.jLayouts["fabrik-visualization-fullcalendar-viewbuttons"]))[0].id = "fabrikevent_buttons_" + s), (c = r.find(".popupDelete")), !1 === t._canDelete ? c.remove() : c.attr("title", Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_DELETE")), (a = r.find(".popupEdit")), !1 === t._canEdit ? a.remove() : a.attr("title", Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_EDIT")), (n = r.find(".popupView")), !1 === t._canView ? n.remove() : n.attr("title", Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_VIEW")), m(d).attr("data-buttons", r.prop("outerHTML")), m(d).attr("data-title", t.label), m(d).append(t.label), h.push({ id: d.id, title: m(d).prop("outerHTML"), start: t.startdate, end: t.enddate, url: t.link, viewURL: t.details, editURL: t.link, customURL: t.customLink, className: t.status, allDay: t.allday, listid: t._listid, rowid: t.__pk_val, formid: t._formid, }); }.bind(h) ), e(h); }, addEvForm: function (t) { void 0 !== m && m(this.popOver).popover("hide"), (this.windowopts.id = "addeventwin"); var e, i = this.options.url.addev, n = (i.test(/\?/) ? (i += "&") : (i += "?"), (i = (i = (i = (i = (i = (i += "listid=" + t.listid) + ("&rowid=" + t.rowid)) + ("&fabrik_window_id=" + this.windowopts.id)) + "&task=addEvForm" + ("&Itemid=" + this.options.Itemid)) + ("&editLink=" + encodeURI(t.editURL))) + ("&viewLink-" + encodeURI(t.viewURL))), t.nextView && (i += "&nextview=" + t.nextView), null !== this.clickdate && ((this.clickdate = moment(this.clickdate).add({ h: this.options.startOffset }).format("YYYY-MM-DD HH:mm:ss")), (e = this.calendar.fullCalendar("option", "defaultTimedEventDuration").split(":")), (e = moment(this.clickdate).add({ h: e[0], m: e[1], s: e[2] }).format("YYYY-MM-DD HH:mm:ss")), (i += "&start_date=" + this.clickdate + "&end_date=" + e)), (this.windowopts.type = "window"), (this.windowopts.contentURL = i), (this.windowopts.title = t.title), (this.windowopts.modalId = "fullcalendar_addeventwin"), this.options.filters); (this.windowopts.onContentLoaded = function () { n.each(function (t) { if (document.id(t.key)) switch (document.id(t.key).get("tag")) { case "select": document.id(t.key).selectedIndex = t.val; break; case "input": document.id(t.key).value = t.val; } }), this.fitToContent(!1); }), f.getWindow(this.windowopts); }, viewEntry: function (t) { this.clickdate = null; var e = {}; (e.id = t.formid), (e.rowid = t.rowid), (e.listid = t.listid), (e.nextView = "details"), (e.title = Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_VIEW_EVENT")), this.addEvForm(e); }, editEntry: function (t) { this.clickdate = null; var e = {}; (e.id = t.formid), (e.rowid = t.rowid), (e.listid = t.listid), (e.nextView = "form"), (e.title = Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_EDIT_EVENT")), this.addEvForm(e); }, deleteEntry: function (t) { if (window.confirm(Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_CONF_DELETE"))) { this.ajax.deleteEvent.options.data = { id: t.rowid, listid: t.listid }; var e = f.fireEvent("fabrik.viz.fullcalendar.deleteentry", [this, t]).eventResults; for (i = 0; i < e.length; i++) typeOf("object" === e[i]) && m.extend(this.ajax.deleteEvent.options.data, e[i]); this.ajax.deleteEvent.send(); } }, clickEntry: function (t) { var e = f.fireEvent("fabrik.viz.fullcalendar.clickentry", [this, t]).eventResults; ("null" !== typeOf(e) && 0 !== e.length && e.contains(!1)) || ("" !== t.customURL ? window.open(t.customURL, "_blank") : !1 === this.options.showFullDetails ? ((e = m("#fabrikEvent_modal.modal")).find(".modal-title").html(m("#" + t.id).attr("data-title")), e.find(".modal-body").html(m("#" + t.id).attr("data-bs-content")), e.find(".modal-footer .calEventButtons").html(m("#" + t.id).attr("data-buttons")), e.modal("show")) : this.viewEntry(t)); }, openAddEvent: function (t, e, i) { var n, a, o, d, s; if (!1 !== this.options.canAdd && ("month" !== e || !0 !== this.options.readonlyMonth)) { switch (t.type) { case "dblclick": case "touchend": s = i; break; case "click": s = moment(); break; default: return void window.alert("Unknown event in OpenAddEvent: " + t.type); } "month" === e ? (n = a = "00") : ((n = (n = s.hour()) < 10 ? "0" + n : n), (a = (a = s.minute()) < 10 ? "0" + a : a)), (e = (e = s.date()) < 10 ? "0" + e : e), (o = (o = s.month() + 1) < 10 ? "0" + o : o), (d = s.year()), (this.clickdate = d + "-" + o + "-" + e + " " + n + ":" + a + ":00"), (("dblclick" !== t.type && "touchend" !== t.type) || this.dateInLimits(this.clickdate)) && (1 < this.options.eventLists.length ? this.openChooseEventTypeForm(this.clickdate, void 0) : (((d = { rowid: "", id: "" }).listid = this.options.eventLists[0].value), (d.title = Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_ADD_EVENT")), this.addEvForm(d))); } }, dateInLimits: function (t) { var e = new moment(t); if (f.fireEvent("fabrik.viz.fullcalendar.dateinlimits", [this, t]).eventResults.contains(!1)) return !1; if ("" !== this.options.dateLimits.min) { t = new moment(this.options.dateLimits.min); if (e.isBefore(t)) return window.alert(Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_DATE_ADD_TOO_EARLY")), !1; } if ("" !== this.options.dateLimits.max) { t = new moment(this.options.dateLimits.max); if (e.isAfter(t)) return window.alert(Joomla.JText._("PLG_VISUALIZATION_FULLCALENDAR_DATE_ADD_TOO_LATE")), !1; } return !0; }, openChooseEventTypeForm: function (t, e) { var i = this.options.url.choose; i.test(/\?/) ? (i += "&") : (i += "?"), (i = (i = i + "d=" + t + "&rawd=" + e) + "&renderContext=" + this.el.prop("id").replace(/visualization_/, "")), (this.windowopts.contentURL = i += "&task=chooseAddEvent"), (this.windowopts.id = "chooseeventwin"), (this.windowopts.modalId = "fullcalendar_!chooseeventwin"), f.getWindow(this.windowopts); }, }); });
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка