Source code of Leftypol imageboard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
101 KiB

/*!
FullCalendar Scheduler v1.6.2
Docs & License: https://fullcalendar.io/scheduler/
(c) 2017 Adam Shaw
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery","moment","fullcalendar"],e):"object"==typeof exports?module.exports=e(require("jquery"),require("moment"),require("fullcalendar")):e(jQuery,moment)}(function(e,t){var r,o,s,n,i,l,u,h,c,a,p,d,f,g,y,v,R,w,m,S,b,C,E,H,T,_,I,D,x,G,B,F,W,M,L,z,k,P,O,A,q,N,V,U,j,Y,Q,X,$,K,J,Z,ee,te,re,oe,se,ne,ie,le,ue,he,ce,ae,pe,de,fe,ge,ye,ve,Re,we,me,Se,be,Ce,Ee,He,Te,_e,Ie,De,xe,Ge,Be,Fe,We,Me,Le,ze,ke,Pe,Oe,Ae,qe,Ne,Ve,Ue=function(e,t){function r(){this.constructor=e}for(var o in t)je.call(t,o)&&(e[o]=t[o]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},je={}.hasOwnProperty,Ye=[].indexOf||function(e){for(var t=0,r=this.length;t<r;t++)if(t in this&&this[t]===e)return t;return-1},Qe=[].slice;return d=e.fullCalendar,d.schedulerVersion="1.6.2",9!==d.internalApiVersion?void d.warn("v"+d.schedulerVersion+" of FullCalendar Scheduler is incompatible with v"+d.version+" of the core.\nPlease see http://fullcalendar.io/support/ for more information."):(o=d.Calendar,n=d.Class,K=d.View,f=d.Grid,be=d.intersectRanges,ue=d.debounce,He=d.isInt,we=d.getScrollbarWidths,h=d.DragListener,Se=d.htmlEscape,re=d.computeGreatestUnit,ke=d.proxy,ee=d.capitaliseFirstLetter,Z=d.applyAll,c=d.EmitterMixin,v=d.ListenerMixin,pe=d.durationHasTime,ae=d.divideRangeByDuration,ce=d.divideDurationByDuration,Ie=d.multiplyDuration,Le=d.parseFieldSpecs,te=d.compareByFieldSpecs,de=d.flexibleCompare,Ce=d.intersectRects,l=d.CoordCache,fe=d.getContentRect,ge=d.getOuterRect,ie=d.createObject,C=d.Promise,U=d.TaskQueue,ye=function(e){return e.find("> td").filter(function(e,t){return t.rowSpan<=1})},a=function(t){function r(){r.__super__.constructor.apply(this,arguments),this.requestMovingEnd=ue(this.reportMovingEnd,500)}var o,s;return Ue(r,t),r.mixin(c),r.mixin(v),r.prototype.canvas=null,r.prototype.isScrolling=!1,r.prototype.isTouching=!1,r.prototype.isTouchedEver=!1,r.prototype.isMoving=!1,r.prototype.isTouchScrollEnabled=!0,r.prototype.preventTouchScrollHandler=null,r.prototype.render=function(){return r.__super__.render.apply(this,arguments),this.canvas&&(this.canvas.render(),this.canvas.el.appendTo(this.scrollEl)),this.bindHandlers()},r.prototype.destroy=function(){return r.__super__.destroy.apply(this,arguments),this.unbindHandlers()},r.prototype.disableTouchScroll=function(){return this.isTouchScrollEnabled=!1,this.bindPreventTouchScroll()},r.prototype.enableTouchScroll=function(){if(this.isTouchScrollEnabled=!0,!this.isTouching)return this.unbindPreventTouchScroll()},r.prototype.bindPreventTouchScroll=function(){if(!this.preventTouchScrollHandler)return this.scrollEl.on("touchmove",this.preventTouchScrollHandler=d.preventDefault)},r.prototype.unbindPreventTouchScroll=function(){if(this.preventTouchScrollHandler)return this.scrollEl.off("touchmove",this.preventTouchScrollHandler),this.preventTouchScrollHandler=null},r.prototype.bindHandlers=function(){return this.listenTo(this.scrollEl,{scroll:this.reportScroll,touchstart:this.reportTouchStart,touchend:this.reportTouchEnd})},r.prototype.unbindHandlers=function(){return this.stopListeningTo(this.scrollEl)},r.prototype.reportScroll=function(){return this.isScrolling||this.reportScrollStart(),this.trigger("scroll"),this.isMoving=!0,this.requestMovingEnd()},r.prototype.reportScrollStart=function(){if(!this.isScrolling)return this.isScrolling=!0,this.trigger("scrollStart",this.isTouching)},r.prototype.requestMovingEnd=null,r.prototype.reportMovingEnd=function(){if(this.isMoving=!1,!this.isTouching)return this.reportScrollEnd()},r.prototype.reportScrollEnd=function(){if(this.isScrolling)return this.trigger("scrollEnd"),this.isScrolling=!1},r.prototype.reportTouchStart=function(){return this.isTouching=!0,this.isTouchedEver=!0},r.prototype.reportTouchEnd=function(){if(this.isTouching&&(this.isTouching=!1,this.isTouchScrollEnabled&&this.unbindPreventTouchScroll(),!this.isMoving))return this.reportScrollEnd()},r.prototype.getScrollLeft=function(){var e,t,r;if(e=this.scrollEl.css("direction"),t=this.scrollEl[0],r=t.scrollLeft,"rtl"===e)switch(
this.isResourcesRendered=!0,this.trigger("resourcesRendered")},executeResourcesUnrender:function(){return this.trigger("before:resourcesUnrendered"),this.unrenderResources(),this.isResourcesRendered=!1},executeResourceRender:function(e){return this.renderResource(e)},executeResourceUnrender:function(e){return this.unrenderResource(e)},renderResources:function(e){},unrenderResources:function(){},renderResource:function(e){},unrenderResource:function(e){},isEventDraggable:function(e){return this.isEventResourceEditable(e)||K.prototype.isEventDraggable.call(this,e)},isEventResourceEditable:function(e){var t,r,o;return null!=(t=null!=(r=null!=(o=e.resourceEditable)?o:(e.source||{}).resourceEditable)?r:this.opt("eventResourceEditable"))?t:this.isEventGenerallyEditable(e)},getResourceText:function(e){return this.getResourceTextFunc()(e)},getResourceTextFunc:function(){var e;return this.resourceTextFunc?this.resourceTextFunc:(e=this.opt("resourceText"),"function"!=typeof e&&(e=function(e){return e.title||e.id}),this.resourceTextFunc=e)},triggerDayClick:function(e,t,r){var o;return o=this.calendar.resourceManager,this.publiclyTrigger("dayClick",t,this.calendar.applyTimezone(e.start),r,this,o.getResourceById(e.resourceId))},triggerSelect:function(e,t){var r;return r=this.calendar.resourceManager,this.publiclyTrigger("select",null,this.calendar.applyTimezone(e.start),this.calendar.applyTimezone(e.end),t,this,r.getResourceById(e.resourceId))},triggerExternalDrop:function(e,t,r,o,s){if(this.publiclyTrigger("drop",r[0],t.start,o,s,t.resourceId),e)return this.publiclyTrigger("eventReceive",null,e)},reportExternalDrop:function(){var e,t,r,o;return t=arguments[0],e=arguments[1],r=3<=arguments.length?Qe.call(arguments,2):[],e=this.normalizeDropLocation(e),(o=K.prototype.reportExternalDrop).call.apply(o,[this,t,e].concat(Qe.call(r)))},normalizeDropLocation:function(t){var r;return r=e.extend({},t),delete r.resourceId,this.calendar.setEventResourceId(r,t.resourceId),r}},$=e.extend({},L,{setElement:function(){var e,t,r;return L.setElement.apply(this,arguments),t=!1,e=!1,r=!1,this.watch("dateProfileOnly",["dateProfile"],function(e){return function(){return r=!0}}(this)),this.watch("displayingDatesOnly",["dateProfile","?currentResources"],function(e){return function(o){if(!o.currentResources&&!e.isDestroying)return t=!0,e.renderQueue.queue(function(){return e.executeDateRender(o.dateProfile,!r),r=!1},"date","init")}}(this),function(e){return function(){if(t)return t=!1,e.renderQueue.queue(function(){return e.executeDateUnrender()},"date","destroy")}}(this)),this.watch("displayingDates",["dateProfile","currentResources"],function(t){return function(o){if(!t.isDestroying)return e=!0,t.renderQueue.queue(function(){return t.setResourcesOnGrids(o.currentResources),t.executeDateRender(o.dateProfile,!r),r=!1,t.trigger("resourcesRendered")},"resource","init")}}(this),function(t){return function(){if(e)return e=!1,t.renderQueue.queue(function(){return t.trigger("before:resourcesUnrendered"),t.unsetResourcesOnGrids(),t.executeDateUnrender()},"resource","destroy")}}(this)),this.watch("displayingResources",["displayingDates"],function(e){return function(){return!0}}(this))},setResourcesOnGrids:function(e){},unsetResourcesOnGrids:function(){}}),D={allowCrossResource:!0,eventRangeToSpans:function(t,r){var o,s,n,i,l;if(i=this.view.calendar.getEventResourceIds(r),i.length){for(l=[],o=0,s=i.length;o<s;o++)n=i[o],l.push(e.extend({},t,{resourceId:n}));return l}return d.isBgEvent(r)?f.prototype.eventRangeToSpans.apply(this,arguments):[]},fabricateHelperEvent:function(e,t){var r;return r=f.prototype.fabricateHelperEvent.apply(this,arguments),this.view.calendar.setEventResourceId(r,e.resourceId),r},computeEventDrop:function(e,t,r){var o;return o=this.view.isEventStartEditable(r)?f.prototype.computeEventDrop.apply(this,arguments):d.pluckEventDateProps(r),o&&(this.view.isEventResourceEditable(r)?o.resourceId=t.resourceId:o.resourceId=e.resourceId),o},computeExternalDrop:function(e,t){var r;return r=f.prototype.computeExternalDrop.apply(this,arguments),r&&(r.resourc
}),h.el.appendTo(n);return this.elsByFill[t]?this.elsByFill[t]=this.elsByFill[t].add(n):this.elsByFill[t]=n}},r.prototype.renderDrag=function(e,t){var r,o,s,n;if(t)return this.renderEventLocationHelper(e,t);for(o=this.eventToSpans(e),s=0,n=o.length;s<n;s++)r=o[s],this.renderHighlight(r);return null},r.prototype.unrenderDrag=function(){return this.unrenderHelper(),this.unrenderHighlight()},r}(f),se=function(e){var t,r,o,s;for(o=0,t=0,r=e.length;t<r;t++)s=e[t],o=Math.max(o,oe(s));return o},oe=function(e){return null==e.top&&(e.top=se(e.above)),e.top+e.height},Ne=function(e,t){return e.left<t.right&&e.right>t.left},S=18,w=6,R=200,m=1e3,u={months:1},P=[{years:1},{months:1},{days:1},{hours:1},{minutes:30},{minutes:15},{minutes:10},{minutes:5},{minutes:1},{seconds:30},{seconds:15},{seconds:10},{seconds:5},{seconds:1},{milliseconds:500},{milliseconds:100},{milliseconds:10},{milliseconds:1}],j.prototype.initScaleProps=function(){var r,o,s;return this.labelInterval=this.queryDurationOption("slotLabelInterval"),this.slotDuration=this.queryDurationOption("slotDuration"),this.validateLabelAndSlot(),this.ensureLabelInterval(),this.ensureSlotDuration(),r=this.opt("slotLabelFormat"),s=e.type(r),this.headerFormats="array"===s?r:"string"===s?[r]:this.computeHeaderFormats(),this.isTimeScale=pe(this.slotDuration),this.largeUnit=this.isTimeScale?void 0:(o=re(this.slotDuration),/year|month|week/.test(o)?o:void 0),this.emphasizeWeeks=1===this.slotDuration.as("days")&&this.view.currentRangeAs("weeks")>=2&&!this.opt("businessHours"),this.snapDuration=(r=this.opt("snapDuration"))?t.duration(r):this.slotDuration,this.minResizeDuration=this.snapDuration,this.snapsPerSlot=ce(this.slotDuration,this.snapDuration)},j.prototype.queryDurationOption=function(e){var r,o;if(o=this.opt(e),null!=o&&(r=t.duration(o),+r))return r},j.prototype.validateLabelAndSlot=function(){var e,t,r,o;if(e=this.view.currentRange,this.labelInterval&&(t=ae(e.start,e.end,this.labelInterval),t>m&&(d.warn("slotLabelInterval results in too many cells"),this.labelInterval=null)),this.slotDuration&&(r=ae(e.start,e.end,this.slotDuration),r>m&&(d.warn("slotDuration results in too many cells"),this.slotDuration=null)),this.labelInterval&&this.slotDuration&&(o=ce(this.labelInterval,this.slotDuration),!He(o)||o<1))return d.warn("slotLabelInterval must be a multiple of slotDuration"),this.slotDuration=null},j.prototype.computeFallbackDuration=function(){var e,r,o,s,n;if(e=null,this.labelInterval||this.slotDuration)for(n=this.ensureLabelInterval(),o=P.length-1;o>=0&&(r=P[o],e=t.duration(r),s=ce(e,n),!(s>=S));o+=-1);else e=t.duration(u);return e},j.prototype.ensureLabelInterval=function(){var e,r,o,s,n,i,l,u,h,c;if(e=this.view.currentRange,i=this.labelInterval,!i){if(this.slotDuration){for(o=0,l=P.length;o<l;o++)if(r=P[o],c=t.duration(r),h=ce(c,this.slotDuration),He(h)&&h<=w){i=c;break}i||(i=this.slotDuration)}else for(s=0,u=P.length;s<u&&(r=P[s],i=t.duration(r),n=ae(e.start,e.end,i),!(n>=S));s++);this.labelInterval=i}return i},j.prototype.ensureSlotDuration=function(){var e,r,o,s,n,i,l,u,h;if(e=this.view.currentRange,l=this.slotDuration,!l){for(s=this.ensureLabelInterval(),o=0,n=P.length;o<n;o++)if(r=P[o],h=t.duration(r),u=ce(s,h),He(u)&&u>1&&u<=w){l=h;break}l&&(i=ae(e.start,e.end,l),i>R&&(l=null)),l||(l=s),this.slotDuration=l}return l},j.prototype.computeHeaderFormats=function(){var e,t,r,o,s,n,i;switch(n=this.view,o=this.labelInterval,s=re(o),i=this.opt("weekNumbers"),e=t=r=null,"week"!==s||i||(s="day"),s){case"year":e="YYYY";break;case"month":n.currentRangeAs("years")>1&&(e="YYYY"),t="MMM";break;case"week":n.currentRangeAs("years")>1&&(e="YYYY"),t=this.opt("shortWeekFormat");break;case"day":n.currentRangeAs("years")>1?e=this.opt("monthYearFormat"):n.currentRangeAs("months")>1&&(e="MMMM"),i&&(t=this.opt("weekFormat")),r="dd D";break;case"hour":i&&(e=this.opt("weekFormat")),n.currentRangeAs("days")>1&&(t=this.opt("dayOfMonthFormat")),r=this.opt("smallTimeFormat");break;case"minute":o.asMinutes()/60>=w?(e=this.opt("hourFormat"),t="[:]mm"):e=this.opt("mediumTimeFormat");break;case"second":o
t=this.groupSpec.text,"function"==typeof t&&(r=t(r)||r),e('<span class="fc-cell-text" />').text(r)},r}(k),g=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return Ue(r,t),r.prototype.hasOwnRow=!0,r.prototype.renderSpreadsheetContent=function(t){var r;return r=this.renderGroupContentEl(),r.prepend('<span class="fc-expander"><span class="fc-icon"></span></span>'),e('<td class="fc-divider" />').attr("colspan",this.view.colSpecs.length).append(e("<div/>").append(r)).appendTo(t)},r.prototype.renderEventContent=function(e){return e.append('<td class="fc-divider"> <div/> </td>')},r}(z),X=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return Ue(r,t),r.prototype.rowspan=0,r.prototype.leadingTr=null,r.prototype.groupTd=null,r.prototype.rowShown=function(e){return this.rowspan+=1,this.renderRowspan(),r.__super__.rowShown.apply(this,arguments)},r.prototype.rowHidden=function(e){return this.rowspan-=1,this.renderRowspan(),r.__super__.rowHidden.apply(this,arguments)},r.prototype.renderRowspan=function(){var t;return this.rowspan?(this.groupTd||(this.groupTd=e('<td class="'+this.view.widgetContentClass+'"/>').append(this.renderGroupContentEl())),this.groupTd.attr("rowspan",this.rowspan),t=this.getLeadingRow().getTr("spreadsheet"),t!==this.leadingTr?(t&&t.prepend(this.groupTd),this.leadingTr=t):void 0):(this.groupTd&&(this.groupTd.remove(),this.groupTd=null),this.leadingTr=null)},r}(z),p=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Ue(t,e),t.prototype.hasOwnRow=!0,t.prototype.segContainerEl=null,t.prototype.segContainerHeight=null,t.prototype.innerEl=null,t.prototype.bgSegContainerEl=null,t.prototype.isSegsRendered=!1,t.prototype.isBusinessHourSegsRendered=!1,t.prototype.businessHourSegs=null,t.prototype.bgSegs=null,t.prototype.fgSegs=null,t.prototype.renderEventContent=function(e){return e.html('<td class="'+this.view.widgetContentClass+'"> <div> <div class="fc-event-container" /> </div> </td>'),this.segContainerEl=e.find(".fc-event-container"),this.innerEl=this.bgSegContainerEl=e.find("td > div"),this.ensureSegsRendered()},t.prototype.ensureSegsRendered=function(){if(!this.isSegsRendered)return this.ensureBusinessHourSegsRendered(),this.bgSegs&&this.view.timeGrid.renderFillInContainer("bgEvent",this,this.bgSegs),this.fgSegs&&this.view.timeGrid.renderFgSegsInContainers([[this,this.fgSegs]]),this.isSegsRendered=!0},t.prototype.ensureBusinessHourSegsRendered=function(){if(this.businessHourSegs&&!this.isBusinessHourSegsRendered)return this.view.timeGrid.renderFillInContainer("businessHours",this,this.businessHourSegs,"bgevent"),this.isBusinessHourSegsRendered=!0},t.prototype.unrenderEventContent=function(){return this.clearBusinessHourSegs(),this.bgSegs=null,this.fgSegs=null,this.isSegsRendered=!1},t.prototype.clearBusinessHourSegs=function(){var e,t,r,o;if(this.businessHourSegs){for(r=this.businessHourSegs,e=0,t=r.length;e<t;e++)o=r[e],o.el&&o.el.remove();this.businessHourSegs=null}return this.isBusinessHourSegsRendered=!1},t}(k),B=function(t){function r(e,t){this.resource=t,r.__super__.constructor.apply(this,arguments)}return Ue(r,t),r.prototype.resource=null,r.prototype.rowAdded=function(e){if(r.__super__.rowAdded.apply(this,arguments),e!==this&&this.isRendered&&1===this.children.length)return this.enableExpanding(),this.isExpanded?this.indicateExpanded():this.indicateCollapsed()},r.prototype.rowRemoved=function(e){if(r.__super__.rowRemoved.apply(this,arguments),e!==this&&this.isRendered&&!this.children.length)return this.disableExpanding()},r.prototype.render=function(){return r.__super__.render.apply(this,arguments),this.children.length>0?this.enableExpanding():this.disableExpanding(),this.view.publiclyTrigger("resourceRender",this.resource,this.resource,this.getTr("spreadsheet").find("> td"),this.getTr("event").find("> td"))},r.prototype.renderEventContent=function(e){return r.__super__.renderEventContent.apply(this,arguments),e.attr("data-resource-id",this.resource.id)},r.prototype.renderSpreadsheetContent=function(t){var r,o,s,n,i