%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/intranet.vacivitta.com.br/assets/c06fb3e9/
Upload File :
Create Path :
Current File : /home/vacivi36/intranet.vacivitta.com.br/assets/c06fb3e9/humhub.calendar.Calendar.min.js

humhub.module("calendar.Calendar",function(a,t,i){var e=t("ui.widget").Widget,r=t("client"),n=t("util").string,o=t("ui.loader"),l=t("ui.view"),s=t("ui.modal"),d=e.extend();d.prototype.init=function(){var n=this;this.options.events=function(t,e,o){i.ajax({url:n.options.loadUrl,type:"GET",data:{start:moment(t.start.valueOf()).format("YYYY-MM-DD"),end:moment(t.end.valueOf()).format("YYYY-MM-DD"),selectors:n.options.selectors,filters:n.options.filters,types:n.options.types},success:function(t){e(t)}})},a.log.debug("Init calendar: ",this.options),this.initCalendarFilter(),this.updateCalendarFilters()},d.prototype.initCalendarFilter=function(){var t=this;i(".selectorCheckbox").click(function(){t.updateCalendarFilters(!0)}),i(".filterCheckbox").click(function(){"3"==i(this).val()&&i(":checkbox[value=4][name='filter']").attr("checked",!1),"4"==i(this).val()&&i(":checkbox[value=3][name='filter']").attr("checked",!1),t.updateCalendarFilters(!0)}),i('select[name="filterType[]"]').on("change.select2",function(){t.updateCalendarFilters(!0)})},d.prototype.updateCalendarFilters=function(t){var e=this;this.options.selectors=[],this.options.filters=[],this.options.types=[],i(".selectorCheckbox").each(function(){i(this).prop("checked")&&e.options.selectors.push(i(this).val())}),i(".filterCheckbox").each(function(){i(this).prop("checked")&&e.options.filters.push(i(this).val())}),e.options.types=i('select[name="filterType[]"]').val(),this.initFullCalendar(t)},d.prototype.initFullCalendar=function(t){this.fullCalendar&&t?(this.fullCalendar.removeAllEventSources(),this.fullCalendar.addEventSource(this.options.events)):(this.fullCalendar=new FullCalendar.Calendar(this.$[0],this.options),this.fullCalendar.render())},d.prototype.getDefaultOptions=function(){var t={};"today"!==a.text("button.today")&&(t.today=a.text("button.today")),"month"!==a.text("button.month")&&(t.month=a.text("button.month")),"week"!==a.text("button.week")&&(t.week=a.text("button.week")),"day"!==a.text("button.day")&&(t.day=a.text("button.day")),"list"!==a.text("button.list")&&(t.list=a.text("button.list"));var e={header:{left:"prev,next today",center:"title",right:"dayGridMonth,timeGridWeek,timeGridDay,listWeek"},buttonText:t,plugins:["dayGrid","timeGrid","list","interaction","bootstrap","moment","momentTimezone"],defaultView:"dayGridMonth",canCreate:!0,selectable:!0,select:i.proxy(this.select,this),eventAllow:function(){return!0},themeSystem:"bootstrap",loading:i.proxy(this.loader,this),eventResize:i.proxy(this.updateEvent,this),eventDrop:i.proxy(this.updateEvent,this),eventClick:i.proxy(this.clickEvent,this),eventRender:i.proxy(this.renderEvent,this)};return l.isSmall()&&(e.header={left:"prev,next",center:"title",right:"today"},e.footer={center:"dayGridMonth,timeGridWeek,timeGridDay,listWeek"}),e},d.prototype.renderEvent=function(t,e){var o=i(e);o.attr({title:o.text()}),t.icon&&n.startsWith(t.icon,"fa-")&&o.find(".fc-content").prepend(i('<i class="fa '+t.icon+'"></i>'))},d.prototype.toJsonDateFormat=function(t,e){return e?FullCalendarMoment.toMoment(t,this.fullCalendar).format("YYYY-MM-DD"):FullCalendarMoment.toMoment(t,this.fullCalendar).format()},d.prototype.select=function(t){var e=this,o={data:{start:this.toJsonDateFormat(t.start,!1),end:this.toJsonDateFormat(t.end,!1),cal:1}};"dayGridMonth"===t.view.type&&(o.data.view="month");var n=this.options.global?this.options.globalCreateUrl:this.options.editUrl;s.global.load(n,o).then(function(){s.global.$.one("hidden.bs.modal submitted",function(){e.fetch()})}).catch(function(t){s.global.close(),a.log.error(t,!0)}),this.fullCalendar.unselect()},d.prototype.fetch=function(){this.fullCalendar.refetchEvents()},d.prototype.updateEvent=function(e){var o=this,t=e.event,n=t.extendedProps,i={data:{id:t.id,start:this.toJsonDateFormat(t.start,t.allDay),end:this.toJsonDateFormat(t.end,t.allDay)}};this.loader(),r.post(n.updateUrl,i).then(function(t){t.success?a.log.success("saved"):a.log.error(t,!0),n.refreshAfterUpdate&&o.fetch()}).catch(function(t){a.log.error(t,!0),e.revert()}).finally(function(){o.loader(!1)})},d.prototype.clickEvent=function(t){var e=t.event.extendedProps;if(e.viewUrl){var o=this;"modal"===e.viewMode?s.global.load(e.viewUrl,{viewContext:"fullCalendar"}).then(function(){s.global.set({backdrop:!0}),s.global.$.one("hidden.bs.modal",function(){o.fetch()})}).catch(function(t){a.log.error(t,!0),s.global.close()}):r.pjax.redirect(e.viewUrl)}},d.prototype.loader=function(t){!1===t?o.reset(i("#calendar-overview-loader")):o.set(i("#calendar-overview-loader"),{size:"8px",css:{padding:"2px ",width:"60px"}})},a.export=d});

Zerion Mini Shell 1.0