Вход Регистрация
Файл: templates/backend/default/assets/plugins/fullcalendar/fullcalendar.min.js
Строк: 2807
<?php
!function(e,t){function n(t){e.extend(!0,yt,t)}function i(n,i,c){function d(e){ot?g()&&(O(),D(e)):u()}function u(){at=i.theme?"ui":"fc",n.addClass("fc"),i.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),i.theme&&n.addClass("ui-widget"),ot=e("<div class='fc-content' style='position:relative'/>").prependTo(n),nt=new o(tt,i),it=nt.render(),it&&n.prepend(it),T(i.defaultView),i.handleWindowResize&&e(window).resize(_),v()||f()}function f(){setTimeout(function(){!rt.start&&v()&&y()},0)}function p(){rt&&(et("viewDestroy",rt,rt,rt.element),rt.triggerEventDestroy()),e(window).unbind("resize",_),nt.destroy(),ot.remove(),n.removeClass("fc fc-rtl ui-widget")}function g(){return n.is(":visible")}function v(){return e("body").is(":visible")}function T(e){rt&&e==rt.name||b(e)}function b(t){pt++,rt&&(et("viewDestroy",rt,rt,rt.element),H(),rt.triggerEventDestroy(),Y(),rt.element.remove(),nt.deactivateButton(rt.name)),nt.activateButton(t),rt=new Ot[t](e("<div class='fc-view fc-view-"+t+"' style='position:relative'/>").appendTo(ot),tt),y(),X(),pt--}function y(e){(!rt.start||e||mt<rt.start||mt>=rt.end)&&g()&&D(e)}function D(e){pt++,rt.start&&(et("viewDestroy",rt,rt,rt.element),H(),K()),Y(),rt.render(mt,e||0),R(),X(),(rt.afterRender||L)(),F(),$(),et("viewRender",rt,rt,rt.element),rt.trigger("viewDisplay",ht),pt--,N()}function I(){g()&&(H(),K(),O(),R(),k())}function O(){lt=i.contentHeight?i.contentHeight:i.height?i.height-(it?it.height():0)-x(ot):Math.round(ot.width()/Math.max(i.aspectRatio,.5))}function R(){lt===t&&O(),pt++,rt.setHeight(lt),rt.setWidth(ot.width()),pt--,st=n.outerWidth()}function _(){if(!pt)if(rt.start){var e=++ft;setTimeout(function(){e==ft&&!pt&&g()&&st!=(st=n.outerWidth())&&(pt++,I(),rt.trigger("windowResize",ht),pt--)},200)}else f()}function w(){K(),A()}function S(e){K(),k(e)}function k(e){g()&&(rt.setEventData(gt),rt.renderEvents(gt,e),rt.trigger("eventAfterAllRender"))}function K(){rt.triggerEventDestroy(),rt.clearEvents(),rt.clearEventData()}function N(){!i.lazyFetching||dt(rt.visStart,rt.visEnd)?A():k()}function A(){ut(rt.visStart,rt.visEnd)}function M(e){gt=e,k()}function P(e){S(e)}function F(){nt.updateTitle(rt.title)}function $(){var e=new Date;e>=rt.start&&e<rt.end?nt.disableButton("today"):nt.enableButton("today")}function B(e,n,i){rt.select(e,n,i===t?!0:i)}function H(){rt&&rt.unselect()}function z(){y(-1)}function U(){y(1)}function j(){r(mt,-1),y()}function W(){r(mt,1),y()}function V(){mt=new Date,y()}function q(e,t,n){instanceof Date?mt=h(e):m(mt,e,t,n),y()}function G(e,n,i){e!==t&&r(mt,e),n!==t&&s(mt,n),i!==t&&l(mt,i),y()}function J(){return h(mt)}function Y(){ot.css({width:"100%",height:ot.height(),overflow:"hidden"})}function X(){ot.css({width:"",height:"",overflow:""})}function Q(){return rt}function Z(e,n){return n===t?i[e]:(("height"==e||"contentHeight"==e||"aspectRatio"==e)&&(i[e]=n,I()),void 0)}function et(e,t){return i[e]?i[e].apply(t||ht,Array.prototype.slice.call(arguments,2)):void 0}var tt=this;tt.options=i,tt.render=d,tt.destroy=p,tt.refetchEvents=w,tt.reportEvents=M,tt.reportEventChange=P,tt.rerenderEvents=S,tt.changeView=T,tt.select=B,tt.unselect=H,tt.prev=z,tt.next=U,tt.prevYear=j,tt.nextYear=W,tt.today=V,tt.gotoDate=q,tt.incrementDate=G,tt.formatDate=function(e,t){return C(e,t,i)},tt.formatDates=function(e,t,n){return E(e,t,n,i)},tt.getDate=J,tt.getView=Q,tt.option=Z,tt.trigger=et,a.call(tt,i,c);var nt,it,ot,at,rt,st,lt,ct,dt=tt.isFetchNeeded,ut=tt.fetchEvents,ht=n[0],ft=0,pt=0,mt=new Date,gt=[];m(mt,i.year,i.month,i.date),i.droppable&&e(document).bind("dragstart",function(t,n){var o=t.target,a=e(o);if(!a.parents(".fc").length){var r=i.dropAccept;(e.isFunction(r)?r.call(o,a):a.is(r))&&(ct=o,rt.dragStart(ct,t,n))}}).bind("dragstop",function(e,t){ct&&(rt.dragStop(ct,e,t),ct=null)})}function o(t,n){function i(){h=n.theme?"ui":"fc";var t=n.header;return t?f=e("<table class='fc-header' style='width:100%'/>").append(e("<tr/>").append(a("left")).append(a("center")).append(a("right"))):void 0}function o(){f.remove()}function a(i){var o=e("<td class='fc-header-"+i+"'/>"),a=n.header[i];return a&&e.each(a.split(" "),function(i){i>0&&o.append("<span class='fc-header-space'/>");var a;e.each(this.split(","),function(i,r){if("title"==r)o.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>"),a&&a.addClass(h+"-corner-right"),a=null;else{var s;if(t[r]?s=t[r]:Ot[r]&&(s=function(){d.removeClass(h+"-state-hover"),t.changeView(r)}),s){var l=n.theme?$(n.buttonIcons,r):null,c=$(n.buttonText,r),d=e("<span class='fc-button fc-button-"+r+" "+h+"-state-default'>"+(l?"<span class='fc-icon-wrap'><span class='ui-icon ui-icon-"+l+"'/>"+"</span>":c)+"</span>").click(function(){d.hasClass(h+"-state-disabled")||s()}).mousedown(function(){d.not("."+h+"-state-active").not("."+h+"-state-disabled").addClass(h+"-state-down")}).mouseup(function(){d.removeClass(h+"-state-down")}).hover(function(){d.not("."+h+"-state-active").not("."+h+"-state-disabled").addClass(h+"-state-hover")},function(){d.removeClass(h+"-state-hover").removeClass(h+"-state-down")}).appendTo(o);H(d),a||d.addClass(h+"-corner-left"),a=d}}}),a&&a.addClass(h+"-corner-right")}),o}function r(e){f.find("h2").html(e)}function s(e){f.find("span.fc-button-"+e).addClass(h+"-state-active")}function l(e){f.find("span.fc-button-"+e).removeClass(h+"-state-active")}function c(e){f.find("span.fc-button-"+e).addClass(h+"-state-disabled")}function d(e){f.find("span.fc-button-"+e).removeClass(h+"-state-disabled")}var u=this;u.render=i,u.destroy=o,u.updateTitle=r,u.activateButton=s,u.deactivateButton=l,u.disableButton=c,u.enableButton=d;var h,f=e([])}function a(n,i){function o(e,t){return!I||I>e||t>O}function a(e,t){I=e,O=t,A=[];var n=++x,i=k.length;K=i;for(var o=0;i>o;o++)r(k[o],n)}function r(t,i){s(t,function(o){if(i==x){if(o){n.eventDataTransform&&(o=e.map(o,n.eventDataTransform)),t.eventDataTransform&&(o=e.map(o,t.eventDataTransform));for(var a=0;a<o.length;a++)o[a].source=t,C(o[a]);A=A.concat(o)}K--,K||w(A)}})}function s(t,i){var o,a,r=It.sourceFetchers;for(o=0;o<r.length;o++){if(a=r[o](t,I,O,i),a===!0)return;if("object"==typeof a)return s(a,i),void 0}var l=t.events;if(l)e.isFunction(l)?(v(),l(h(I),h(O),function(e){i(e),T()})):e.isArray(l)?i(l):i();else{var c=t.url;if(c){var d,u=t.success,f=t.error,p=t.complete;d=e.isFunction(t.data)?t.data():t.data;var m=e.extend({},d||{}),g=W(t.startParam,n.startParam),C=W(t.endParam,n.endParam);g&&(m[g]=Math.round(+I/1e3)),C&&(m[C]=Math.round(+O/1e3)),v(),e.ajax(e.extend({},Rt,t,{data:m,success:function(t){t=t||[];var n=j(u,this,arguments);e.isArray(n)&&(t=n),i(t)},error:function(){j(f,this,arguments),i()},complete:function(){j(p,this,arguments),T()}}))}else i()}}function l(e){e=c(e),e&&(K++,r(e,x))}function c(t){return e.isFunction(t)||e.isArray(t)?t={events:t}:"string"==typeof t&&(t={url:t}),"object"==typeof t?(E(t),k.push(t),t):void 0}function d(t){k=e.grep(k,function(e){return!b(e,t)}),A=e.grep(A,function(e){return!b(e.source,t)}),w(A)}function u(e){var t,n,i=A.length,o=_().defaultEventEnd,a=e.start-e._start,r=e.end?e.end-(e._end||o(e)):0;for(t=0;i>t;t++)n=A[t],n._id==e._id&&n!=e&&(n.start=new Date(+n.start+a),n.end=e.end?n.end?new Date(+n.end+r):new Date(+o(n)+r):null,n.title=e.title,n.url=e.url,n.allDay=e.allDay,n.className=e.className,n.editable=e.editable,n.color=e.color,n.backgroundColor=e.backgroundColor,n.borderColor=e.borderColor,n.textColor=e.textColor,C(n));C(e),w(A)}function f(e,t){C(e),e.source||(t&&(S.events.push(e),e.source=S),A.push(e)),w(A)}function p(t){if(t){if(!e.isFunction(t)){var n=t+"";t=function(e){return e._id==n}}A=e.grep(A,t,!0);for(var i=0;i<k.length;i++)e.isArray(k[i].events)&&(k[i].events=e.grep(k[i].events,t,!0))}else{A=[];for(var i=0;i<k.length;i++)e.isArray(k[i].events)&&(k[i].events=[])}w(A)}function m(t){return e.isFunction(t)?e.grep(A,t):t?(t+="",e.grep(A,function(e){return e._id==t})):A}function v(){N++||R("loading",null,!0,_())}function T(){--N||R("loading",null,!1,_())}function C(e){var i=e.source||{},o=W(i.ignoreTimezone,n.ignoreTimezone);e._id=e._id||(e.id===t?"_fc"+_t++:e.id+""),e.date&&(e.start||(e.start=e.date),delete e.date),e._start=h(e.start=g(e.start,o)),e.end=g(e.end,o),e.end&&e.end<=e.start&&(e.end=null),e._end=e.end?h(e.end):null,e.allDay===t&&(e.allDay=W(i.allDayDefault,n.allDayDefault)),e.className?"string"==typeof e.className&&(e.className=e.className.split(/s+/)):e.className=[]}function E(e){e.className?"string"==typeof e.className&&(e.className=e.className.split(/s+/)):e.className=[];for(var t=It.sourceNormalizers,n=0;n<t.length;n++)t[n](e)}function b(e,t){return e&&t&&y(e)==y(t)}function y(e){return("object"==typeof e?e.events||e.url:"")||e}var D=this;D.isFetchNeeded=o,D.fetchEvents=a,D.addEventSource=l,D.removeEventSource=d,D.updateEvent=u,D.renderEvent=f,D.removeEvents=p,D.clientEvents=m,D.normalizeEvent=C;for(var I,O,R=D.trigger,_=D.getView,w=D.reportEvents,S={events:[]},k=[S],x=0,K=0,N=0,A=[],L=0;L<i.length;L++)c(i[L])}function r(e,t,n){return e.setFullYear(e.getFullYear()+t),n||u(e),e}function s(e,t,n){if(+e){var i=e.getMonth()+t,o=h(e);for(o.setDate(1),o.setMonth(i),e.setMonth(i),n||u(e);e.getMonth()!=o.getMonth();)e.setDate(e.getDate()+(o>e?1:-1))}return e}function l(e,t,n){if(+e){var i=e.getDate()+t,o=h(e);o.setHours(9),o.setDate(i),e.setDate(i),n||u(e),c(e,o)}return e}function c(e,t){if(+e)for(;e.getDate()!=t.getDate();)e.setTime(+e+(t>e?1:-1)*kt)}function d(e,t){return e.setMinutes(e.getMinutes()+t),e}function u(e){return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function h(e,t){return t?u(new Date(+e)):new Date(+e)}function f(){var e,t=0;do e=new Date(1970,t++,1);while(e.getHours());return e}function p(e,t){return Math.round((h(e,!0)-h(t,!0))/St)}function m(e,n,i,o){n!==t&&n!=e.getFullYear()&&(e.setDate(1),e.setMonth(0),e.setFullYear(n)),i!==t&&i!=e.getMonth()&&(e.setDate(1),e.setMonth(i)),o!==t&&e.setDate(o)}function g(e,n){return"object"==typeof e?e:"number"==typeof e?new Date(1e3*e):"string"==typeof e?e.match(/^d+(.d+)?$/)?new Date(1e3*parseFloat(e)):(n===t&&(n=!0),v(e,n)||(e?new Date(e):null)):null}function v(e,t){var n=e.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([]([0-9]{2}):([0-9]{2})(:([0-9]{2})(.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);if(!n)return null;var i=new Date(n[1],0,1);if(t||!n[13]){var o=new Date(n[1],0,1,9,0);n[3]&&(i.setMonth(n[3]-1),o.setMonth(n[3]-1)),n[5]&&(i.setDate(n[5]),o.setDate(n[5])),c(i,o),n[7]&&i.setHours(n[7]),n[8]&&i.setMinutes(n[8]),n[10]&&i.setSeconds(n[10]),n[12]&&i.setMilliseconds(1e3*Number("0."+n[12])),c(i,o)}else if(i.setUTCFullYear(n[1],n[3]?n[3]-1:0,n[5]||1),i.setUTCHours(n[7]||0,n[8]||0,n[10]||0,n[12]?1e3*Number("0."+n[12]):0),n[14]){var a=60*Number(n[16])+(n[18]?Number(n[18]):0);a*="-"==n[15]?1:-1,i=new Date(+i+1e3*60*a)}return i}function T(e){if("number"==typeof e)return 60*e;if("object"==typeof e)return 60*e.getHours()+e.getMinutes();var t=e.match(/(d+)(?::(d+))?s*(w+)?/);if(t){var n=parseInt(t[1],10);return t[3]&&(n%=12,"p"==t[3].toLowerCase().charAt(0)&&(n+=12)),60*n+(t[2]?parseInt(t[2],10):0)}}function C(e,t,n){return E(e,null,t,n)}function E(e,t,n,i){i=i||yt;var o,a,r,s,l=e,c=t,d=n.length,u="";for(o=0;d>o;o++)if(a=n.charAt(o),"'"==a){for(r=o+1;d>r;r++)if("'"==n.charAt(r)){l&&(u+=r==o+1?"'":n.substring(o+1,r),o=r);break}}else if("("==a){for(r=o+1;d>r;r++)if(")"==n.charAt(r)){var h=C(l,n.substring(o+1,r),i);parseInt(h.replace(/D/,""),10)&&(u+=h),o=r;break}}else if("["==a){for(r=o+1;d>r;r++)if("]"==n.charAt(r)){var f=n.substring(o+1,r),h=C(l,f,i);h!=C(c,f,i)&&(u+=h),o=r;break}}else if("{"==a)l=t,c=e;else if("}"==a)l=e,c=t;else{for(r=d;r>o;r--)if(s=Kt[n.substring(o,r)]){l&&(u+=s(l,i)),o=r-1;break}r==o&&l&&(u+=a)}return u}function b(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1}function y(e){return e.end?D(e.end,e.allDay):l(h(e.start),1)}function D(e,t){return e=h(e),t||e.getHours()||e.getMinutes()?l(e,1):u(e)}function I(n,i,o){n.unbind("mouseover").mouseover(function(n){for(var a,r,s,l=n.target;l!=this;)a=l,l=l.parentNode;(r=a._fci)!==t&&(a._fci=t,s=i[r],o(s.event,s.element,s),e(n.target).trigger(n)),n.stopPropagation()})}function O(t,n,i){for(var o,a=0;a<t.length;a++)o=e(t[a]),o.width(Math.max(0,n-_(o,i)))}function R(t,n,i){for(var o,a=0;a<t.length;a++)o=e(t[a]),o.height(Math.max(0,n-x(o,i)))}function _(e,t){return w(e)+k(e)+(t?S(e):0)}function w(t){return(parseFloat(e.css(t[0],"paddingLeft",!0))||0)+(parseFloat(e.css(t[0],"paddingRight",!0))||0)}function S(t){return(parseFloat(e.css(t[0],"marginLeft",!0))||0)+(parseFloat(e.css(t[0],"marginRight",!0))||0)}function k(t){return(parseFloat(e.css(t[0],"borderLeftWidth",!0))||0)+(parseFloat(e.css(t[0],"borderRightWidth",!0))||0)}function x(e,t){return K(e)+A(e)+(t?N(e):0)}function K(t){return(parseFloat(e.css(t[0],"paddingTop",!0))||0)+(parseFloat(e.css(t[0],"paddingBottom",!0))||0)}function N(t){return(parseFloat(e.css(t[0],"marginTop",!0))||0)+(parseFloat(e.css(t[0],"marginBottom",!0))||0)}function A(t){return(parseFloat(e.css(t[0],"borderTopWidth",!0))||0)+(parseFloat(e.css(t[0],"borderBottomWidth",!0))||0)}function L(){}function M(e,t){return e-t}function P(e){return Math.max.apply(Math,e)}function F(e){return(10>e?"0":"")+e}function $(e,n){if(e[n]!==t)return e[n];for(var i,o=n.split(/(?=[A-Z])/),a=o.length-1;a>=0;a--)if(i=e[o[a].toLowerCase()],i!==t)return i;return e[""]}function B(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/n/g,"<br />")}function H(e){e.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})}function z(e){e.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}function U(e,t){var n=e.source||{},i=e.color,o=n.color,a=t("eventColor"),r=e.backgroundColor||i||n.backgroundColor||o||t("eventBackgroundColor")||a,s=e.borderColor||i||n.borderColor||o||t("eventBorderColor")||a,l=e.textColor||n.textColor||t("eventTextColor"),c=[];return r&&c.push("background-color:"+r),s&&c.push("border-color:"+s),l&&c.push("color:"+l),c.join(";")}function j(t,n,i){if(e.isFunction(t)&&(t=[t]),t){var o,a;for(o=0;o<t.length;o++)a=t[o].apply(n,i)||a;return a}}function W(){for(var e=0;e<arguments.length;e++)if(arguments[e]!==t)return arguments[e]}function V(e,t){function n(e,t){t&&(s(e,t),e.setDate(1));var n=o("firstDay"),u=h(e,!0);u.setDate(1);var f=s(h(u),1),m=h(u);l(m,-((m.getDay()-n+7)%7)),r(m);var g=h(f);l(g,(7-g.getDay()+n)%7),r(g,-1,!0);var v=c(),T=Math.round(p(g,m)/7);"fixed"==o("weekMode")&&(l(g,7*(6-T)),T=6),i.title=d(u,o("titleFormat")),i.start=u,i.end=f,i.visStart=m,i.visEnd=g,a(T,v,!0)}var i=this;i.render=n,J.call(i,e,t,"month");var o=i.opt,a=i.renderBasic,r=i.skipHiddenDays,c=i.getCellsPerWeek,d=t.formatDate}function q(e,t){function n(e,t){t&&l(e,7*t);var n=l(h(e),-((e.getDay()-o("firstDay")+7)%7)),d=l(h(n),7),u=h(n);r(u);var f=h(d);r(f,-1,!0);var p=s();i.start=n,i.end=d,i.visStart=u,i.visEnd=f,i.title=c(u,l(h(f),-1),o("titleFormat")),a(1,p,!1)}var i=this;i.render=n,J.call(i,e,t,"basicWeek");var o=i.opt,a=i.renderBasic,r=i.skipHiddenDays,s=i.getCellsPerWeek,c=t.formatDates}function G(e,t){function n(e,t){t&&l(e,t),r(e,0>t?-1:1);var n=h(e,!0),c=l(h(n),1);i.title=s(e,o("titleFormat")),i.start=i.visStart=n,i.end=i.visEnd=c,a(1,1,!1)}var i=this;i.render=n,J.call(i,e,t,"basicDay");var o=i.opt,a=i.renderBasic,r=i.skipHiddenDays,s=t.formatDate}function J(t,n,i){function o(e,t,n){tt=e,nt=t,it=n,a(),U||r(),s()}function a(){lt=pt("theme")?"ui":"fc",ct=pt("columnFormat"),dt=pt("weekNumbers"),ht=pt("weekNumberTitle"),ft="iso"!=pt("weekNumberCalculation")?"w":"W"}function r(){J=e("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(t)}function s(){var n=c();P&&P.remove(),P=e(n).appendTo(t),F=P.find("thead"),$=F.find(".fc-day-header"),U=P.find("tbody"),j=U.find("tr"),W=U.find(".fc-day"),V=j.find("td:first-child"),q=j.eq(0).find(".fc-day > div"),G=j.eq(0).find(".fc-day-content > div"),z(F.add(F.find("tr"))),z(j),j.eq(0).addClass("fc-first"),j.filter(":last").addClass("fc-last"),W.each(function(t,n){var i=It(Math.floor(t/nt),t%nt);mt("dayRender",M,i,e(n))}),T(W)}function c(){var e="<table class='fc-border-separate' style='width:100%' cellspacing='0'>"+d()+f()+"</table>";return e}function d(){var e,t,n=lt+"-widget-header",i="";for(i+="<thead><tr>",dt&&(i+="<th class='fc-week-number "+n+"'>"+B(ht)+"</th>"),e=0;nt>e;e++)t=It(0,e),i+="<th class='fc-day-header fc-"+wt[t.getDay()]+" "+n+"'>"+B(_t(t,ct))+"</th>";return i+="</tr></thead>"}function f(){var e,t,n,i=lt+"-widget-content",o="";for(o+="<tbody>",e=0;tt>e;e++){for(o+="<tr class='fc-week'>",dt&&(n=It(e,0),o+="<td class='fc-week-number "+i+"'>"+"<div>"+B(_t(n,ft))+"</div>"+"</td>"),t=0;nt>t;t++)n=It(e,t),o+=p(n);o+="</tr>"}return o+="</tbody>"}function p(e){var t=lt+"-widget-content",n=M.start.getMonth(),i=u(new Date),o="",a=["fc-day","fc-"+wt[e.getDay()],t];return e.getMonth()!=n&&a.push("fc-other-month"),+e==+i?a.push("fc-today",lt+"-state-highlight"):i>e?a.push("fc-past"):a.push("fc-future"),o+="<td class='"+a.join(" ")+"'"+" data-date='"+_t(e,"yyyy-MM-dd")+"'"+">"+"<div>",it&&(o+="<div class='fc-day-number'>"+e.getDate()+"</div>"),o+="<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>"}function m(t){Q=t;var n,i,o,a=Q-F.height();"variable"==pt("weekMode")?n=i=Math.floor(a/(1==tt?2:6)):(n=Math.floor(a/tt),i=a-n*(tt-1)),V.each(function(t,a){tt>t&&(o=e(a),o.find("> div").css("min-height",(t==tt-1?i:n)-x(o)))})}function g(e){X=e,rt.clear(),st.clear(),et=0,dt&&(et=F.find("th.fc-week-number").outerWidth()),Z=Math.floor((X-et)/nt),O($.slice(0,-1),Z)}function T(e){e.click(C).mousedown(Dt)}function C(t){if(!pt("selectable")){var n=v(e(this).data("date"));mt("dayClick",this,n,!0,t)}}function E(e,t,n){n&&ot.build();for(var i=Rt(e,t),o=0;o<i.length;o++){var a=i[o];T(b(a.row,a.leftCol,a.row,a.rightCol))}}function b(e,n,i,o){var a=ot.rect(e,n,i,o,t);return Et(a,t)}function y(e){return h(e)}function D(e,t){E(e,l(h(t),1),!0)}function I(){yt()}function R(e,t,n){var i=Ot(e),o=W[i.row*nt+i.col];mt("dayClick",o,e,t,n)}function _(e,t){at.start(function(e){yt(),e&&b(e.row,e.col,e.row,e.col)},t)}function w(e,t,n){var i=at.stop();if(yt(),i){var o=It(i);mt("drop",e,o,!0,t,n)}}function S(e){return h(e.start)}function k(e){return rt.left(e)}function K(e){return rt.right(e)}function N(e){return st.left(e)}function A(e){return st.right(e)}function L(e){return j.eq(e)}var M=this;M.renderBasic=o,M.setHeight=m,M.setWidth=g,M.renderDayOverlay=E,M.defaultSelectionEnd=y,M.renderSelection=D,M.clearSelection=I,M.reportDayClick=R,M.dragStart=_,M.dragStop=w,M.defaultEventEnd=S,M.getHoverListener=function(){return at},M.colLeft=k,M.colRight=K,M.colContentLeft=N,M.colContentRight=A,M.getIsCellAllDay=function(){return!0},M.allDayRow=L,M.getRowCnt=function(){return tt},M.getColCnt=function(){return nt},M.getColWidth=function(){return Z},M.getDaySegmentContainer=function(){return J},ut.call(M,t,n,i),vt.call(M),gt.call(M),Y.call(M);var P,F,$,U,j,W,V,q,G,J,X,Q,Z,et,tt,nt,it,ot,at,rt,st,lt,ct,dt,ht,ft,pt=M.opt,mt=M.trigger,Et=M.renderOverlay,yt=M.clearOverlays,Dt=M.daySelectionMousedown,It=M.cellToDate,Ot=M.dateToCell,Rt=M.rangeToSegments,_t=n.formatDate;H(t.addClass("fc-grid")),ot=new Tt(function(t,n){var i,o,a;$.each(function(t,r){i=e(r),o=i.offset().left,t&&(a[1]=o),a=[o],n[t]=a}),a[1]=o+i.outerWidth(),j.each(function(n,r){tt>n&&(i=e(r),o=i.offset().top,n&&(a[1]=o),a=[o],t[n]=a)}),a[1]=o+i.outerHeight()}),at=new Ct(ot),rt=new bt(function(e){return q.eq(e)}),st=new bt(function(e){return G.eq(e)})}function Y(){function e(e,t){n.renderDayEvents(e,t)}function t(){n.getDaySegmentContainer().empty()}var n=this;n.renderEvents=e,n.clearEvents=t,ht.call(n)}function X(e,t){function n(e,t){t&&l(e,7*t);var n=l(h(e),-((e.getDay()-o("firstDay")+7)%7)),d=l(h(n),7),u=h(n);r(u);var f=h(d);r(f,-1,!0);var p=s();i.title=c(u,l(h(f),-1),o("titleFormat")),i.start=n,i.end=d,i.visStart=u,i.visEnd=f,a(p)}var i=this;i.render=n,Z.call(i,e,t,"agendaWeek");var o=i.opt,a=i.renderAgenda,r=i.skipHiddenDays,s=i.getCellsPerWeek,c=t.formatDates}function Q(e,t){function n(e,t){t&&l(e,t),r(e,0>t?-1:1);var n=h(e,!0),c=l(h(n),1);i.title=s(e,o("titleFormat")),i.start=i.visStart=n,i.end=i.visEnd=c,a(1)}var i=this;i.render=n,Z.call(i,e,t,"agendaDay");var o=i.opt,a=i.renderAgenda,r=i.skipHiddenDays,s=t.formatDate}function Z(n,i,o){function a(e){At=e,r(),Z?c():s()}function r(){Bt=Gt("theme")?"ui":"fc",Ht=Gt("isRTL"),zt=T(Gt("minTime")),Ut=T(Gt("maxTime")),jt=Gt("columnFormat"),Wt=Gt("weekNumbers"),Vt=Gt("weekNumberTitle"),qt="iso"!=Gt("weekNumberCalculation")?"w":"W",xt=Gt("snapMinutes")||Gt("slotMinutes")}function s(){var t,i,o,a,r,s=Bt+"-widget-header",l=Bt+"-widget-content",u=0==Gt("slotMinutes")%15;for(c(),ct=e("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(n),Gt("allDaySlot")?(dt=e("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(ct),t="<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='"+s+" fc-agenda-axis'>"+Gt("allDayText")+"</th>"+"<td>"+"<div class='fc-day-content'><div style='position:relative'/></div>"+"</td>"+"<th class='"+s+" fc-agenda-gutter'>&nbsp;</th>"+"</tr>"+"</table>",ht=e(t).appendTo(ct),ft=ht.find("tr"),y(ft.find("td")),ct.append("<div class='fc-agenda-divider "+s+"'>"+"<div class='fc-agenda-divider-inner'/>"+"</div>")):dt=e([]),pt=e("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(ct),mt=e("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(pt),Et=e("<div class='fc-event-container' style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(mt),t="<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>",i=f(),a=d(h(i),Ut),d(i,zt),Lt=0,o=0;a>i;o++)r=i.getMinutes(),t+="<tr class='fc-slot"+o+" "+(r?"fc-minor":"")+"'>"+"<th class='fc-agenda-axis "+s+"'>"+(u&&r?"&nbsp;":rn(i,Gt("axisFormat")))+"</th>"+"<td class='"+l+"'>"+"<div style='position:relative'>&nbsp;</div>"+"</td>"+"</tr>",d(i,Gt("slotMinutes")),Lt++;t+="</tbody></table>",yt=e(t).appendTo(mt),D(yt.find("td"))}function c(){var t=p();Z&&Z.remove(),Z=e(t).appendTo(n),tt=Z.find("thead"),nt=tt.find("th").slice(1,-1),it=Z.find("tbody"),ot=it.find("td").slice(0,-1),at=ot.find("> div"),rt=ot.find(".fc-day-content > div"),st=ot.eq(0),lt=at.eq(0),z(tt.add(tt.find("tr"))),z(it.add(it.find("tr")))}function p(){var e="<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'>"+m()+g()+"</table>";return e}function m(){var e,t,n,i=Bt+"-widget-header",o="";for(o+="<thead><tr>",Wt?(e=nn(0,0),t=rn(e,qt),Ht?t+=Vt:t=Vt+t,o+="<th class='fc-agenda-axis fc-week-number "+i+"'>"+B(t)+"</th>"):o+="<th class='fc-agenda-axis "+i+"'>&nbsp;</th>",n=0;At>n;n++)e=nn(0,n),o+="<th class='fc-"+wt[e.getDay()]+" fc-col"+n+" "+i+"'>"+B(rn(e,jt))+"</th>";return o+="<th class='fc-agenda-gutter "+i+"'>&nbsp;</th>"+"</tr>"+"</thead>"}function g(){var e,t,n,i,o,a=Bt+"-widget-header",r=Bt+"-widget-content",s=u(new Date),l="";for(l+="<tbody><tr><th class='fc-agenda-axis "+a+"'>&nbsp;</th>",n="",t=0;At>t;t++)e=nn(0,t),o=["fc-col"+t,"fc-"+wt[e.getDay()],r],+e==+s?o.push(Bt+"-state-highlight","fc-today"):s>e?o.push("fc-past"):o.push("fc-future"),i="<td class='"+o.join(" ")+"'>"+"<div>"+"<div class='fc-day-content'>"+"<div style='position:relative'>&nbsp;</div>"+"</div>"+"</div>"+"</td>",n+=i;return l+=n,l+="<td class='fc-agenda-gutter "+r+"'>&nbsp;</td>"+"</tr>"+"</tbody>"}function v(e){e===t&&(e=Ot),Ot=e,sn={};var n=it.position().top,i=pt.position().top,o=Math.min(e-n,yt.height()+i+1);lt.height(o-x(st)),ct.css("top",n),pt.height(o-i-1),kt=yt.find("tr:first").height()+1,Kt=Gt("slotMinutes")/xt,Nt=kt/Kt}function C(t){It=t,Ft.clear(),$t.clear();var n=tt.find("th:first");ht&&(n=n.add(ht.find("th:first"))),n=n.add(yt.find("th:first")),Rt=0,O(n.width("").each(function(t,n){Rt=Math.max(Rt,e(n).outerWidth())}),Rt);var i=Z.find(".fc-agenda-gutter");ht&&(i=i.add(ht.find("th.fc-agenda-gutter")));var o=pt[0].clientWidth;St=pt.width()-o,St?(O(i,St),i.show().prev().removeClass("fc-last")):i.hide().prev().addClass("fc-last"),_t=Math.floor((o-Rt)/At),O(nt.slice(0,-1),_t)}function E(){function e(){pt.scrollTop(i)}var t=f(),n=h(t);n.setHours(Gt("firstHour"));var i=F(t,n)+1;e(),setTimeout(e,0)}function b(){E()}function y(e){e.click(I).mousedown(en)}function D(e){e.click(I).mousedown(G)}function I(e){if(!Gt("selectable")){var t=Math.min(At-1,Math.floor((e.pageX-Z.offset().left-Rt)/_t)),n=nn(0,t),i=this.parentNode.className.match(/fc-slot(d+)/);if(i){var o=parseInt(i[1])*Gt("slotMinutes"),a=Math.floor(o/60);n.setHours(a),n.setMinutes(o%60+zt),Jt("dayClick",ot[t],n,!1,e)}else Jt("dayClick",ot[t],n,!0,e)}}function _(e,t,n){n&&Mt.build();for(var i=an(e,t),o=0;o<i.length;o++){var a=i[o];y(w(a.row,a.leftCol,a.row,a.rightCol))}}function w(e,t,n,i){var o=Mt.rect(e,t,n,i,ct);return Yt(o,ct)}function S(e,t){for(var n=0;At>n;n++){var i=nn(0,n),o=l(h(i),1),a=new Date(Math.max(i,e)),r=new Date(Math.min(o,t));if(r>a){var s=Mt.rect(0,n,0,n,mt),c=F(i,a),d=F(i,r);s.top=c,s.height=d-c,D(Yt(s,mt))}}}function k(e){return Ft.left(e)}function K(e){return $t.left(e)}function N(e){return Ft.right(e)}function A(e){return $t.right(e)}function L(e){return Gt("allDaySlot")&&!e.row}function P(e){var t=nn(0,e.col),n=e.row;return Gt("allDaySlot")&&n--,n>=0&&d(t,zt+n*xt),t}function F(e,n){if(e=h(e,!0),n<d(h(e),zt))return 0;if(n>=d(h(e),Ut))return yt.height();var i=Gt("slotMinutes"),o=60*n.getHours()+n.getMinutes()-zt,a=Math.floor(o/i),r=sn[a];return r===t&&(r=sn[a]=yt.find("tr").eq(a).find("td div")[0].offsetTop),Math.max(0,Math.round(r-1+kt*(o%i/i)))}function $(){return ft}function U(e){var t=h(e.start);return e.allDay?t:d(t,Gt("defaultEventMinutes"))}function j(e,t){return t?h(e):d(h(e),Gt("slotMinutes"))}function W(e,t,n){n?Gt("allDaySlot")&&_(e,l(h(t),1),!0):V(e,t)}function V(t,n){var i=Gt("selectHelper");if(Mt.build(),i){var o=on(t).col;if(o>=0&&At>o){var a=Mt.rect(0,o,0,o,mt),r=F(t,t),s=F(t,n);if(s>r){if(a.top=r,a.height=s-r,a.left+=2,a.width-=5,e.isFunction(i)){var l=i(t,n);l&&(a.position="absolute",Dt=e(l).css(a).appendTo(mt))}else a.isStart=!0,a.isEnd=!0,Dt=e(tn({title:"",start:t,end:n,className:["fc-select-helper"],editable:!1},a)),Dt.css("opacity",Gt("dragOpacity"));Dt&&(D(Dt),mt.append(Dt),O(Dt,a.width,!0),R(Dt,a.height,!0))}}}else S(t,n)}function q(){Xt(),Dt&&(Dt.remove(),Dt=null)}function G(t){if(1==t.which&&Gt("selectable")){Zt(t);var n;Pt.start(function(e,t){if(q(),e&&e.col==t.col&&!L(e)){var i=P(t),o=P(e);n=[i,d(h(i),xt),o,d(h(o),xt)].sort(M),V(n[0],n[3])}else n=null},t),e(document).one("mouseup",function(e){Pt.stop(),n&&(+n[0]==+n[1]&&J(n[0],!1,e),Qt(n[0],n[3],!1,e))})}}function J(e,t,n){Jt("dayClick",ot[on(e).col],e,t,n)}function Y(e,t){Pt.start(function(e){if(Xt(),e)if(L(e))w(e.row,e.col,e.row,e.col);else{var t=P(e),n=d(h(t),Gt("defaultEventMinutes"));S(t,n)}},t)}function X(e,t,n){var i=Pt.stop();Xt(),i&&Jt("drop",e,P(i),L(i),t,n)}var Q=this;Q.renderAgenda=a,Q.setWidth=C,Q.setHeight=v,Q.afterRender=b,Q.defaultEventEnd=U,Q.timePosition=F,Q.getIsCellAllDay=L,Q.allDayRow=$,Q.getCoordinateGrid=function(){return Mt},Q.getHoverListener=function(){return Pt},Q.colLeft=k,Q.colRight=N,Q.colContentLeft=K,Q.colContentRight=A,Q.getDaySegmentContainer=function(){return dt},Q.getSlotSegmentContainer=function(){return Et},Q.getMinMinute=function(){return zt},Q.getMaxMinute=function(){return Ut},Q.getSlotContainer=function(){return mt},Q.getRowCnt=function(){return 1},Q.getColCnt=function(){return At},Q.getColWidth=function(){return _t},Q.getSnapHeight=function(){return Nt},Q.getSnapMinutes=function(){return xt},Q.defaultSelectionEnd=j,Q.renderDayOverlay=_,Q.renderSelection=W,Q.clearSelection=q,Q.reportDayClick=J,Q.dragStart=Y,Q.dragStop=X,ut.call(Q,n,i,o),vt.call(Q),gt.call(Q),et.call(Q);var Z,tt,nt,it,ot,at,rt,st,lt,ct,dt,ht,ft,pt,mt,Et,yt,Dt,It,Ot,Rt,_t,St,kt,xt,Kt,Nt,At,Lt,Mt,Pt,Ft,$t,Bt,Ht,zt,Ut,jt,Wt,Vt,qt,Gt=Q.opt,Jt=Q.trigger,Yt=Q.renderOverlay,Xt=Q.clearOverlays,Qt=Q.reportSelection,Zt=Q.unselect,en=Q.daySelectionMousedown,tn=Q.slotSegHtml,nn=Q.cellToDate,on=Q.dateToCell,an=Q.rangeToSegments,rn=i.formatDate,sn={};H(n.addClass("fc-agenda")),Mt=new Tt(function(t,n){function i(e){return Math.max(l,Math.min(c,e))}var o,a,r;nt.each(function(t,i){o=e(i),a=o.offset().left,t&&(r[1]=a),r=[a],n[t]=r}),r[1]=a+o.outerWidth(),Gt("allDaySlot")&&(o=ft,a=o.offset().top,t[0]=[a,a+o.outerHeight()]);for(var s=mt.offset().top,l=pt.offset().top,c=l+pt.outerHeight(),d=0;Lt*Kt>d;d++)t.push([i(s+Nt*d),i(s+Nt*(d+1))])}),Pt=new Ct(Mt),Ft=new bt(function(e){return at.eq(e)}),$t=new bt(function(e){return rt.eq(e)})}function et(){function n(e,t){var n,i=e.length,a=[],r=[];for(n=0;i>n;n++)e[n].allDay?a.push(e[n]):r.push(e[n]);T("allDaySlot")&&(et(a,t),w()),s(o(r),t)}function i(){S().empty(),k().empty()}function o(t){var n,i,o,s,l,c=H(),u=A(),f=N(),p=e.map(t,r),m=[];for(i=0;c>i;i++)for(n=$(0,i),d(n,u),l=a(t,p,n,d(h(n),f-u)),l=tt(l),o=0;o<l.length;o++)s=l[o],s.col=i,m.push(s);return m}function a(e,t,n,i){var o,a,r,s,l,c,d,u,f=[],p=e.length;for(o=0;p>o;o++)a=e[o],r=a.start,s=t[o],s>n&&i>r&&(n>r?(l=h(n),d=!1):(l=r,d=!0),s>i?(c=h(i),u=!1):(c=s,u=!0),f.push({event:a,start:l,end:c,isStart:d,isEnd:u}));return f.sort(dt)}function r(e){return e.end?h(e.end):d(h(e.start),T("defaultEventMinutes"))}function s(n,i){var o,a,r,s,l,d,h,f,p,m,g,v,E,b,y,D,O=n.length,R="",w=k(),S=T("isRTL");for(o=0;O>o;o++)a=n[o],r=a.event,s=L(a.start,a.start),l=L(a.start,a.end),d=P(a.col),h=F(a.col),f=h-d,h-=.025*f,f=h-d,p=f*(a.forwardCoord-a.backwardCoord),T("slotEventOverlap")&&(p=Math.max(2*(p-10),p)),S?(g=h-a.backwardCoord*f,m=g-p):(m=d+a.backwardCoord*f,g=m+p),m=Math.max(m,d),g=Math.min(g,h),p=g-m,a.top=s,a.left=m,a.outerWidth=p,a.outerHeight=l-s,R+=c(r,a);for(w[0].innerHTML=R,v=w.children(),o=0;O>o;o++)a=n[o],r=a.event,E=e(v[o]),b=C("eventRender",r,r,E),b===!1?E.remove():(b&&b!==!0&&(E.remove(),E=e(b).css({position:"absolute",top:a.top,left:a.left}).appendTo(w)),a.element=E,r._id===i?u(r,E,a):E[0]._fci=o,q(r,E));for(I(w,n,u),o=0;O>o;o++)a=n[o],(E=a.element)&&(a.vsides=x(E,!0),a.hsides=_(E,!0),y=E.find(".fc-event-title"),y.length&&(a.contentTop=y[0].offsetTop));for(o=0;O>o;o++)a=n[o],(E=a.element)&&(E[0].style.width=Math.max(0,a.outerWidth-a.hsides)+"px",D=Math.max(0,a.outerHeight-a.vsides),E[0].style.height=D+"px",r=a.event,a.contentTop!==t&&D-a.contentTop<10&&(E.find("div.fc-event-time").text(it(r.start,T("timeFormat"))+" - "+r.title),E.find("div.fc-event-title").remove()),C("eventAfterRender",r,r,E))}function c(e,t){var n="<",i=e.url,o=U(e,T),a=["fc-event","fc-event-vert"];return E(e)&&a.push("fc-event-draggable"),t.isStart&&a.push("fc-event-start"),t.isEnd&&a.push("fc-event-end"),a=a.concat(e.className),e.source&&(a=a.concat(e.source.className||[])),n+=i?"a href='"+B(e.url)+"'":"div",n+=" class='"+a.join(" ")+"'"+" style="+"'"+"position:absolute;"+"top:"+t.top+"px;"+"left:"+t.left+"px;"+o+"'"+">"+"<div class='fc-event-inner'>"+"<div class='fc-event-time'>"+B(ot(e.start,e.end,T("timeFormat")))+"</div>"+"<div class='fc-event-title'>"+B(e.title||"")+"</div>"+"</div>"+"<div class='fc-event-bg'></div>",t.isEnd&&b(e)&&(n+="<div class='ui-resizable-handle ui-resizable-s'>=</div>"),n+="</"+(i?"a":"div")+">"}function u(e,t,n){var i=t.find("div.fc-event-time");E(e)&&m(e,t,i),n.isEnd&&b(e)&&g(e,t,i),O(e,t)}function f(e,t,n){function i(){c||(t.width(o).height("").draggable("option","grid",null),c=!0)}var o,a,r,s=n.isStart,c=!0,d=K(),u=z(),f=j(),m=W(),g=A();t.draggable({opacity:T("dragOpacity","month"),revertDuration:T("dragRevertDuration"),start:function(n,g){C("eventDragStart",t,e,n,g),J(e,t),o=t.width(),d.start(function(n,o){if(Z(),n){a=!1;var d=$(0,o.col),g=$(0,n.col);r=p(g,d),n.row?s?c&&(t.width(u-10),R(t,f*Math.round((e.end?(e.end-e.start)/xt:T("defaultEventMinutes"))/m)),t.draggable("option","grid",[u,1]),c=!1):a=!0:(Q(l(h(e.start),r),l(y(e),r)),i()),a=a||c&&!r
}else i(),a=!0;t.draggable("option","revert",a)},n,"drag")},stop:function(n,o){if(d.stop(),Z(),C("eventDragStop",t,e,n,o),a)i(),t.css("filter",""),G(e,t);else{var s=0;c||(s=Math.round((t.offset().top-V().offset().top)/f)*m+g-(60*e.start.getHours()+e.start.getMinutes())),Y(this,e,r,s,c,n,o)}}})}function m(e,t,n){function i(){Z(),s&&(u?(n.hide(),t.draggable("option","grid",null),Q(l(h(e.start),E),l(y(e),E))):(o(b),n.css("display",""),t.draggable("option","grid",[R,_])))}function o(t){var i,o=d(h(e.start),t);e.end&&(i=d(h(e.end),t)),n.text(ot(o,i,T("timeFormat")))}var a,r,s,c,u,f,m,g,E,b,D,I=v.getCoordinateGrid(),O=H(),R=z(),_=j(),w=W();t.draggable({scroll:!1,grid:[R,_],axis:1==O?"y":!1,opacity:T("dragOpacity"),revertDuration:T("dragRevertDuration"),start:function(n,i){C("eventDragStart",t,e,n,i),J(e,t),I.build(),a=t.position(),r=I.cell(n.pageX,n.pageY),s=c=!0,u=f=M(r),m=g=0,E=0,b=D=0},drag:function(e,n){var o=I.cell(e.pageX,e.pageY);if(s=!!o){if(u=M(o),m=Math.round((n.position.left-a.left)/R),m!=g){var l=$(0,r.col),d=r.col+m;d=Math.max(0,d),d=Math.min(O-1,d);var h=$(0,d);E=p(h,l)}u||(b=Math.round((n.position.top-a.top)/_)*w)}(s!=c||u!=f||m!=g||b!=D)&&(i(),c=s,f=u,g=m,D=b),t.draggable("option","revert",!s)},stop:function(n,o){Z(),C("eventDragStop",t,e,n,o),s&&(u||E||b)?Y(this,e,E,u?0:b,u,n,o):(s=!0,u=!1,m=0,E=0,b=0,i(),t.css("filter",""),t.css(a),G(e,t))}})}function g(e,t,n){var i,o,a=j(),r=W();t.resizable({handles:{s:".ui-resizable-handle"},grid:a,start:function(n,a){i=o=0,J(e,t),C("eventResizeStart",this,e,n,a)},resize:function(s,l){i=Math.round((Math.max(a,t.height())-l.originalSize.height)/a),i!=o&&(n.text(ot(e.start,i||e.end?d(D(e),r*i):null,T("timeFormat"))),o=i)},stop:function(n,o){C("eventResizeStop",this,e,n,o),i?X(this,e,0,r*i,n,o):G(e,t)}})}var v=this;v.renderEvents=n,v.clearEvents=i,v.slotSegHtml=c,ht.call(v);var T=v.opt,C=v.trigger,E=v.isEventDraggable,b=v.isEventResizable,D=v.eventEnd,O=v.eventElementHandlers,w=v.setHeight,S=v.getDaySegmentContainer,k=v.getSlotSegmentContainer,K=v.getHoverListener,N=v.getMaxMinute,A=v.getMinMinute,L=v.timePosition,M=v.getIsCellAllDay,P=v.colContentLeft,F=v.colContentRight,$=v.cellToDate,H=v.getColCnt,z=v.getColWidth,j=v.getSnapHeight,W=v.getSnapMinutes,V=v.getSlotContainer,q=v.reportEventElement,G=v.showEvents,J=v.hideEvents,Y=v.eventDrop,X=v.eventResize,Q=v.renderDayOverlay,Z=v.clearOverlays,et=v.renderDayEvents,nt=v.calendar,it=nt.formatDate,ot=nt.formatDates;v.draggableDayEvent=f}function tt(e){var t,n=nt(e),i=n[0];if(it(n),i){for(t=0;t<i.length;t++)ot(i[t]);for(t=0;t<i.length;t++)at(i[t],0,0)}return rt(n)}function nt(e){var t,n,i,o=[];for(t=0;t<e.length;t++){for(n=e[t],i=0;i<o.length&&st(n,o[i]).length;i++);(o[i]||(o[i]=[])).push(n)}return o}function it(e){var t,n,i,o,a;for(t=0;t<e.length;t++)for(n=e[t],i=0;i<n.length;i++)for(o=n[i],o.forwardSegs=[],a=t+1;a<e.length;a++)st(o,e[a],o.forwardSegs)}function ot(e){var n,i,o=e.forwardSegs,a=0;if(e.forwardPressure===t){for(n=0;n<o.length;n++)i=o[n],ot(i),a=Math.max(a,1+i.forwardPressure);e.forwardPressure=a}}function at(e,n,i){var o,a=e.forwardSegs;if(e.forwardCoord===t)for(a.length?(a.sort(ct),at(a[0],n+1,i),e.forwardCoord=a[0].backwardCoord):e.forwardCoord=1,e.backwardCoord=e.forwardCoord-(e.forwardCoord-i)/(n+1),o=0;o<a.length;o++)at(a[o],0,e.forwardCoord)}function rt(e){var t,n,i,o=[];for(t=0;t<e.length;t++)for(n=e[t],i=0;i<n.length;i++)o.push(n[i]);return o}function st(e,t,n){n=n||[];for(var i=0;i<t.length;i++)lt(e,t[i])&&n.push(t[i]);return n}function lt(e,t){return e.end>t.start&&e.start<t.end}function ct(e,t){return t.forwardPressure-e.forwardPressure||(e.backwardCoord||0)-(t.backwardCoord||0)||dt(e,t)}function dt(e,t){return e.start-t.start||t.end-t.start-(e.end-e.start)||(e.event.title||"").localeCompare(t.event.title)}function ut(n,i,o){function a(t,n){var i=q[t];return e.isPlainObject(i)?$(i,n||o):i}function r(e,t){return i.trigger.apply(i,[e,t||F].concat(Array.prototype.slice.call(arguments,2),[F]))}function s(e){var t=e.source||{};return W(e.startEditable,t.startEditable,a("eventStartEditable"),e.editable,t.editable,a("editable"))&&!a("disableDragging")}function c(e){var t=e.source||{};return W(e.durationEditable,t.durationEditable,a("eventDurationEditable"),e.editable,t.editable,a("editable"))&&!a("disableResizing")}function u(e){U={};var t,n,i=e.length;for(t=0;i>t;t++)n=e[t],U[n._id]?U[n._id].push(n):U[n._id]=[n]}function f(){U={},j={},V=[]}function m(e){return e.end?h(e.end):B(e)}function g(e,t){V.push({event:e,element:t}),j[e._id]?j[e._id].push(t):j[e._id]=[t]}function v(){e.each(V,function(e,t){F.trigger("eventDestroy",t.event,t.event,t.element)})}function T(e,t){t.click(function(n){return t.hasClass("ui-draggable-dragging")||t.hasClass("ui-resizable-resizing")?void 0:r("eventClick",this,e,n)}).hover(function(t){r("eventMouseover",this,e,t)},function(t){r("eventMouseout",this,e,t)})}function C(e,t){b(e,t,"show")}function E(e,t){b(e,t,"hide")}function b(e,t,n){var i,o=j[e._id],a=o.length;for(i=0;a>i;i++)t&&o[i][0]==t[0]||o[i][n]()}function y(e,t,n,i,o,a,s){var l=t.allDay,c=t._id;I(U[c],n,i,o),r("eventDrop",e,t,n,i,o,function(){I(U[c],-n,-i,l),z(c)},a,s),z(c)}function D(e,t,n,i,o,a){var s=t._id;O(U[s],n,i),r("eventResize",e,t,n,i,function(){O(U[s],-n,-i),z(s)},o,a),z(s)}function I(e,n,i,o){i=i||0;for(var a,r=e.length,s=0;r>s;s++)a=e[s],o!==t&&(a.allDay=o),d(l(a.start,n,!0),i),a.end&&(a.end=d(l(a.end,n,!0),i)),H(a,q)}function O(e,t,n){n=n||0;for(var i,o=e.length,a=0;o>a;a++)i=e[a],i.end=d(l(m(i),t,!0),n),H(i,q)}function R(e){return"object"==typeof e&&(e=e.getDay()),Y[e]}function _(){return G}function w(e,t,n){for(t=t||1;Y[(e.getDay()+(n?t:0)+7)%7];)l(e,t)}function S(){var e=k.apply(null,arguments),t=x(e),n=K(t);return n}function k(e,t){var n=F.getColCnt(),i=Z?-1:1,o=Z?n-1:0;"object"==typeof e&&(t=e.col,e=e.row);var a=e*n+(t*i+o);return a}function x(e){var t=F.visStart.getDay();return e+=X[t],7*Math.floor(e/G)+Q[(e%G+G)%G]-t}function K(e){var t=h(F.visStart);return l(t,e),t}function N(e){var t=A(e),n=L(t),i=M(n);return i}function A(e){return p(e,F.visStart)}function L(e){var t=F.visStart.getDay();return e+=t,Math.floor(e/7)*G+X[(e%7+7)%7]-X[t]}function M(e){var t=F.getColCnt(),n=Z?-1:1,i=Z?t-1:0,o=Math.floor(e/t),a=(e%t+t)%t*n+i;return{row:o,col:a}}function P(e,t){for(var n=F.getRowCnt(),i=F.getColCnt(),o=[],a=A(e),r=A(t),s=L(a),l=L(r)-1,c=0;n>c;c++){var d=c*i,u=d+i-1,h=Math.max(s,d),f=Math.min(l,u);if(f>=h){var p=M(h),m=M(f),g=[p.col,m.col].sort(),v=x(h)==a,T=x(f)+1==r;o.push({row:c,leftCol:g[0],rightCol:g[1],isStart:v,isEnd:T})}}return o}var F=this;F.element=n,F.calendar=i,F.name=o,F.opt=a,F.trigger=r,F.isEventDraggable=s,F.isEventResizable=c,F.setEventData=u,F.clearEventData=f,F.eventEnd=m,F.reportEventElement=g,F.triggerEventDestroy=v,F.eventElementHandlers=T,F.showEvents=C,F.hideEvents=E,F.eventDrop=y,F.eventResize=D;var B=F.defaultEventEnd,H=i.normalizeEvent,z=i.reportEventChange,U={},j={},V=[],q=i.options;F.isHiddenDay=R,F.skipHiddenDays=w,F.getCellsPerWeek=_,F.dateToCell=N,F.dateToDayOffset=A,F.dayOffsetToCellOffset=L,F.cellOffsetToCell=M,F.cellToDate=S,F.cellToCellOffset=k,F.cellOffsetToDayOffset=x,F.dayOffsetToDate=K,F.rangeToSegments=P;var G,J=a("hiddenDays")||[],Y=[],X=[],Q=[],Z=a("isRTL");!function(){a("weekends")===!1&&J.push(0,6);for(var t=0,n=0;7>t;t++)X[t]=n,Y[t]=-1!=e.inArray(t,J),Y[t]||(Q[n]=t,n++);if(G=n,!G)throw"invalid hiddenDays"}()}function ht(){function t(e,t){var n=i(e,!1,!0);pt(n,function(e,t){K(e.event,t)}),C(n,t),pt(n,function(e,t){w("eventAfterRender",e.event,e.event,t)})}function n(e,t,n){var o=i([e],!0,!1),a=[];return pt(o,function(e,i){e.row===t&&i.css("top",n),a.push(i[0])}),a}function i(t,n,i){var a,l,c=J(),h=n?e("<div/>"):c,f=o(t);return r(f),a=s(f),h[0].innerHTML=a,l=h.children(),n&&c.append(l),d(f,l),pt(f,function(e,t){e.hsides=_(t,!0)}),pt(f,function(e,t){t.width(Math.max(0,e.outerWidth-e.hsides))}),pt(f,function(e,t){e.outerHeight=t.outerHeight(!0)}),u(f,i),f}function o(e){for(var t=[],n=0;n<e.length;n++){var i=a(e[n]);t.push.apply(t,i)}return t}function a(e){for(var t=e.start,n=y(e),i=tt(t,n),o=0;o<i.length;o++)i[o].event=e;return i}function r(e){for(var t=R("isRTL"),n=0;n<e.length;n++){var i=e[n],o=(t?i.isEnd:i.isStart)?q:W,a=(t?i.isStart:i.isEnd)?G:V,r=o(i.leftCol),s=a(i.rightCol);i.left=r,i.outerWidth=s-r}}function s(e){for(var t="",n=0;n<e.length;n++)t+=c(e[n]);return t}function c(e){var t="",n=R("isRTL"),i=e.event,o=i.url,a=["fc-event","fc-event-hori"];S(i)&&a.push("fc-event-draggable"),e.isStart&&a.push("fc-event-start"),e.isEnd&&a.push("fc-event-end"),a=a.concat(i.className),i.source&&(a=a.concat(i.source.className||[]));var r=U(i,R);return t+=o?"<a href='"+B(o)+"'":"<div",t+=" class='"+a.join(" ")+"'"+" style="+"'"+"
position:absolute;"+"left:"+e.left+"px;"+r+"'"+">"+"<div class='fc-event-inner'>",!i.allDay&&e.isStart&&(t+="<span class='fc-event-time'>"+B(Y(i.start,i.end,R("timeFormat")))+"</span>"),t+="<span class='fc-event-title'>"+B(i.title||"")+"</span>"+"</div>",e.isEnd&&k(i)&&(t+="<div class='ui-resizable-handle ui-resizable-"+(n?"w":"e")+"'>"+"&nbsp;&nbsp;&nbsp;"+"</div>"),t+="</"+(o?"a":"div")+">"}function d(t,n){for(var i=0;i<t.length;i++){var o=t[i],a=o.event,r=n.eq(i),s=w("eventRender",a,a,r);s===!1?r.remove():(s&&s!==!0&&(s=e(s).css({position:"absolute",left:o.left}),r.replaceWith(s),r=s),o.element=r)}}function u(e,t){var n=f(e),i=T(),o=[];if(t)for(var a=0;a<i.length;a++)i[a].height(n[a]);for(var a=0;a<i.length;a++)o.push(i[a].position().top);pt(e,function(e,t){t.css("top",o[e.row]+e.top)})}function f(e){for(var t=$(),n=z(),i=[],o=m(e),a=0;t>a;a++){for(var r=o[a],s=[],l=0;n>l;l++)s.push(0);for(var c=0;c<r.length;c++){var d=r[c];d.top=P(s.slice(d.leftCol,d.rightCol+1));for(var l=d.leftCol;l<=d.rightCol;l++)s[l]=d.top+d.outerHeight}i.push(P(s))}return i}function m(e){var t,n,i,o=$(),a=[];for(t=0;t<e.length;t++)n=e[t],i=n.row,n.element&&(a[i]?a[i].push(n):a[i]=[n]);for(i=0;o>i;i++)a[i]=g(a[i]||[]);return a}function g(e){for(var t=[],n=v(e),i=0;i<n.length;i++)t.push.apply(t,n[i]);return t}function v(e){e.sort(mt);for(var t=[],n=0;n<e.length;n++){for(var i=e[n],o=0;o<t.length&&ft(i,t[o]);o++);t[o]?t[o].push(i):t[o]=[i]}return t}function T(){var e,t=$(),n=[];for(e=0;t>e;e++)n[e]=j(e).find("div.fc-day-content > div");return n}function C(e,t){var n=J();pt(e,function(e,n,i){var o=e.event;o._id===t?E(o,n,e):n[0]._fci=i}),I(n,e,E)}function E(e,t,n){S(e)&&O.draggableDayEvent(e,t,n),n.isEnd&&k(e)&&O.resizableDayEvent(e,t,n),N(e,t)}function b(e,t){var n,i=et();t.draggable({delay:50,opacity:R("dragOpacity"),revertDuration:R("dragRevertDuration"),start:function(o,a){w("eventDragStart",t,e,o,a),L(e,t),i.start(function(i,o,a,r){if(t.draggable("option","revert",!i||!a&&!r),Q(),i){var s=nt(o),c=nt(i);n=p(c,s),X(l(h(e.start),n),l(y(e),n))}else n=0},o,"drag")},stop:function(o,a){i.stop(),Q(),w("eventDragStop",t,e,o,a),n?M(this,e,n,0,e.allDay,o,a):(t.css("filter",""),A(e,t))}})}function D(t,i,o){var a=R("isRTL"),r=a?"w":"e",s=i.find(".ui-resizable-"+r),c=!1;H(i),i.mousedown(function(e){e.preventDefault()}).click(function(e){c&&(e.preventDefault(),e.stopImmediatePropagation())}),s.mousedown(function(a){function s(n){w("eventResizeStop",this,t,n),e("body").css("cursor",""),d.stop(),Q(),u&&F(this,t,u,0,n),setTimeout(function(){c=!1},0)}if(1==a.which){c=!0;var d=et();$(),z();var u,h,f=i.css("top"),p=e.extend({},t),m=rt(at(t.start));Z(),e("body").css("cursor",r+"-resize").one("mouseup",s),w("eventResizeStart",this,t,a),d.start(function(i,a){if(i){var s=it(a),c=it(i);if(c=Math.max(c,m),u=ot(c)-ot(s)){p.end=l(x(t),u,!0);var d=h;h=n(p,o.row,f),h=e(h),h.find("*").css("cursor",r+"-resize"),d&&d.remove(),L(t)}else h&&(A(t),h.remove(),h=null);Q(),X(t.start,l(y(t),u))}},a)}})}var O=this;O.renderDayEvents=t,O.draggableDayEvent=b,O.resizableDayEvent=D;var R=O.opt,w=O.trigger,S=O.isEventDraggable,k=O.isEventResizable,x=O.eventEnd,K=O.reportEventElement,N=O.eventElementHandlers,A=O.showEvents,L=O.hideEvents,M=O.eventDrop,F=O.eventResize,$=O.getRowCnt,z=O.getColCnt;O.getColWidth;var j=O.allDayRow,W=O.colLeft,V=O.colRight,q=O.colContentLeft,G=O.colContentRight;O.dateToCell;var J=O.getDaySegmentContainer,Y=O.calendar.formatDates,X=O.renderDayOverlay,Q=O.clearOverlays,Z=O.clearSelection,et=O.getHoverListener,tt=O.rangeToSegments,nt=O.cellToDate,it=O.cellToCellOffset,ot=O.cellOffsetToDayOffset,at=O.dateToDayOffset,rt=O.dayOffsetToCellOffset}function ft(e,t){for(var n=0;n<t.length;n++){var i=t[n];if(i.leftCol<=e.rightCol&&i.rightCol>=e.leftCol)return!0}return!1}function pt(e,t){for(var n=0;n<e.length;n++){var i=e[n],o=i.element;o&&t(i,o,n)}}function mt(e,t){return t.rightCol-t.leftCol-(e.rightCol-e.leftCol)||t.event.allDay-e.event.allDay||e.event.start-t.event.start||(e.event.title||"").localeCompare(t.event.title)}function gt(){function t(e,t,o){n(),t||(t=l(e,o)),c(e,t,o),i(e,t,o)}function n(e){u&&(u=!1,d(),s("unselect",null,e))}function i(e,t,n,i){u=!0,s("select",null,e,t,n,i)}function o(t){var o=a.cellToDate,s=a.getIsCellAllDay,l=a.getHoverListener(),u=a.reportDayClick;if(1==t.which&&r("selectable")){n(t);var h;l.start(function(e,t){d(),e&&s(e)?(h=[o(t),o(e)].sort(M),c(h[0],h[1],!0)):h=null},t),e(document).one("mouseup",function(e){l.stop(),h&&(+h[0]==+h[1]&&u(h[0],!0,e),i(h[0],h[1],!0,e))})}}var a=this;a.select=t,a.unselect=n,a.reportSelection=i,a.daySelectionMousedown=o;var r=a.opt,s=a.trigger,l=a.defaultSelectionEnd,c=a.renderSelection,d=a.clearSelection,u=!1;r("selectable")&&r("unselectAuto")&&e(document).mousedown(function(t){var i=r("unselectCancel");i&&e(t.target).parents(i).length||n(t)})}function vt(){function t(t,n){var i=a.shift();return i||(i=e("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>")),i[0].parentNode!=n[0]&&i.appendTo(n),o.push(i.css(t).show()),i}function n(){for(var e;e=o.shift();)a.push(e.hide().unbind())}var i=this;i.renderOverlay=t,i.clearOverlays=n;var o=[],a=[]}function Tt(e){var t,n,i=this;i.build=function(){t=[],n=[],e(t,n)},i.cell=function(e,i){var o,a=t.length,r=n.length,s=-1,l=-1;for(o=0;a>o;o++)if(i>=t[o][0]&&i<t[o][1]){s=o;break}for(o=0;r>o;o++)if(e>=n[o][0]&&e<n[o][1]){l=o;break}return s>=0&&l>=0?{row:s,col:l}:null},i.rect=function(e,i,o,a,r){var s=r.offset();return{top:t[e][0]-s.top,left:n[i][0]-s.left,width:n[a][1]-n[i][0],height:t[o][1]-t[e][0]}}}function Ct(t){function n(e){Et(e);var n=t.cell(e.pageX,e.pageY);(!n!=!r||n&&(n.row!=r.row||n.col!=r.col))&&(n?(a||(a=n),o(n,a,n.row-a.row,n.col-a.col)):o(n,a),r=n)}var i,o,a,r,s=this;s.start=function(s,l,c){o=s,a=r=null,t.build(),n(l),i=c||"mousemove",e(document).bind(i,n)},s.stop=function(){return e(document).unbind(i,n),r}}function Et(e){e.pageX===t&&(e.pageX=e.originalEvent.pageX,e.pageY=e.originalEvent.pageY)}function bt(e){function n(t){return o[t]=o[t]||e(t)}var i=this,o={},a={},r={};i.left=function(e){return a[e]=a[e]===t?n(e).position().left:a[e]},i.right=function(e){return r[e]=r[e]===t?i.left(e)+n(e).width():r[e]},i.clear=function(){o={},a={},r={}}}var yt={defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"iso",weekNumberTitle:"W",allDayDefault:!0,ignoreTimezone:!0,lazyFetching:!0,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:!1,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"<span class='fc-text-arrow'>&lsaquo;</span>",next:"<span class='fc-text-arrow'>&rsaquo;</span>",prevYear:"<span class='fc-text-arrow'>&laquo;</span>",nextYear:"<span class='fc-text-arrow'>&raquo;</span>",today:"today",month:"month",week:"week",day:"day"},theme:!1,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:!0,dropAccept:"*",handleWindowResize:!0},Dt={header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"<span class='fc-text-arrow'>&rsaquo;</span>",next:"<span class='fc-text-arrow'>&lsaquo;</span>",prevYear:"<span class='fc-text-arrow'>&raquo;</span>",nextYear:"<span class='fc-text-arrow'>&laquo;</span>"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},It=e.fullCalendar={version:"1.6.4"},Ot=It.views={};e.fn.fullCalendar=function(n){if("string"==typeof n){var o,a=Array.prototype.slice.call(arguments,1);return this.each(function(){var i=e.data(this,"fullCalendar");if(i&&e.isFunction(i[n])){var r=i[n].apply(i,a);o===t&&(o=r),"destroy"==n&&e.removeData(this,"fullCalendar")}}),o!==t?o:this}n=n||{};var r=n.eventSources||[];return delete n.eventSources,n.events&&(r.push(n.events),delete n.events),n=e.extend(!0,{},yt,n.isRTL||n.isRTL===t&&yt.isRTL?Dt:{},n),this.each(function(t,o){var a=e(o),s=new i(a,n,r);a.data("fullCalendar",s),s.render()}),this},It.sourceNormalizers=[],It.sourceFetchers=[];var Rt={dataType:"json",cache:!1},_t=1;It.addDays=l,It.cloneDate=h,It.parseDate=g,It.parseISO8601=v,It.parseTime=T,It.formatDate=C,It.formatDates=E;var wt=["sun","mon","tue","wed","thu","fri","sat"],St=864e5,kt=36e5,xt=6e4,Kt={s:function(e){return e.getSeconds()},ss:function(e){return F(e.getSeconds())},m:function(e){return e.getMinutes()},mm:function(e){return F(e.getMinutes())},h:function(e){return e.getHours()%12||12},hh:function(e){return F(e.getHours()%12||12)},H:function(e){return e.getHours()},HH:function(e){return F(e.getHours())},d:function(e){return e.getDate()},dd:function(e){return F(e.getDate())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return e.getMonth()+1},MM:function(e){return F(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},yy:function(e){return(e.getFullYear()+"").substring(2)},yyyy:function(e){return e.getFullYear()},t:function(e){return e.getHours()<12?"a":"p"},tt:function(e){return e.getHours()<12?"am":"pm"},T:function(e){return e.getHours()<12?"A":"P"},TT:function(e){return e.getHours()<12?"AM":"PM"},u:function(e){return C(e,"yyyy-MM-dd'T'HH:mm:ss'Z'")},S:function(e){var t=e.getDate();return t>10&&20>t?"th":["st","nd","rd"][t%10-1]||"th"},w:function(e,t){return t.weekNumberCalculation(e)},W:function(e){return b(e)}};It.dateFormatters=Kt,It.applyAll=j,Ot.month=V,Ot.basicWeek=q,Ot.basicDay=G,n({weekMode:"fixed"}),Ot.agendaWeek=X,Ot.agendaDay=Q,n({allDaySlot:!0,allDayText:"all-day",firstHour:6,slotMinutes:30,defaultEventMinutes:120,axisFormat:"h(:mm)tt",timeFormat:{agenda:"h:mm{ - h:mm}"},dragOpacity:{agenda:.5},minTime:0,maxTime:24,slotEventOverlap:!0})}(jQuery);
?>
Онлайн: 1
Реклама