guoren/public/javascripts/fullcalendar.min.js

17 lines
97 KiB
JavaScript
Raw Permalink Normal View History

2016-12-22 20:00:08 +08:00
/*!
* FullCalendar v1.6.2
* Docs & License: http://arshaw.com/fullcalendar/
* (c) 2013 Adam Shaw
*/
(function(t,e){function n(e){t.extend(!0,ge,e)}function r(n,r,c){function u(t){G?(T(),M(),N(),w(t)):f()}function f(){K=r.theme?"ui":"fc",n.addClass("fc"),r.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),r.theme&&n.addClass("ui-widget"),G=t("<div class='fc-content' style='position:relative'/>").prependTo(n),$=new a(Z,r),Q=$.render(),Q&&n.prepend(Q),y(r.defaultView),t(window).resize(E),m()||v()}function v(){setTimeout(function(){!te.start&&m()&&w()},0)}function h(){t(window).unbind("resize",E),$.destroy(),G.remove(),n.removeClass("fc fc-rtl ui-widget")}function p(){return 0!==se.offsetWidth}function m(){return 0!==t("body")[0].offsetWidth}function y(e){if(!te||e!=te.name){ue++,L();var n,r=te;r?((r.beforeHide||O)(),A(G,G.height()),r.element.hide()):A(G,1),G.css("overflow","hidden"),te=le[e],te?te.element.show():te=le[e]=new ye[e](n=re=t("<div class='fc-view fc-view-"+e+"' style='position:absolute'/>").appendTo(G),Z),r&&$.deactivateButton(r.name),$.activateButton(e),w(),G.css("overflow",""),r&&A(G,1),n||(te.afterShow||O)(),ue--}}function w(t){if(p()){ue++,L(),ne===e&&T();var r=!1;!te.start||t||te.start>fe||fe>=te.end?(te.render(fe,t||0),S(!0),r=!0):te.sizeDirty?(te.clearEvents(),S(),r=!0):te.eventsDirty&&(te.clearEvents(),r=!0),te.sizeDirty=!1,te.eventsDirty=!1,x(r),ee=n.outerWidth(),$.updateTitle(te.title);var a=new Date;a>=te.start&&te.end>a?$.disableButton("today"):$.enableButton("today"),ue--,te.trigger("viewDisplay",se)}}function C(){M(),p()&&(T(),S(),L(),te.clearEvents(),te.renderEvents(de),te.sizeDirty=!1)}function M(){t.each(le,function(t,e){e.sizeDirty=!0})}function T(){ne=r.contentHeight?r.contentHeight:r.height?r.height-(Q?Q.height():0)-F(G):Math.round(G.width()/Math.max(r.aspectRatio,.5))}function S(t){ue++,te.setHeight(ne,t),re&&(re.css("position","relative"),re=null),te.setWidth(G.width(),t),ue--}function E(){if(!ue)if(te.start){var t=++ce;setTimeout(function(){t==ce&&!ue&&p()&&ee!=(ee=n.outerWidth())&&(ue++,C(),te.trigger("windowResize",se),ue--)},200)}else v()}function x(t){!r.lazyFetching||oe(te.visStart,te.visEnd)?k():t&&R()}function k(){ie(te.visStart,te.visEnd)}function H(t){de=t,R()}function z(t){R(t)}function R(t){N(),p()&&(te.clearEvents(),te.renderEvents(de,t),te.eventsDirty=!1)}function N(){t.each(le,function(t,e){e.eventsDirty=!0})}function W(t,n,r){te.select(t,n,r===e?!0:r)}function L(){te&&te.unselect()}function _(){w(-1)}function q(){w(1)}function B(){i(fe,-1),w()}function I(){i(fe,1),w()}function P(){fe=new Date,w()}function j(t,e,n){t instanceof Date?fe=d(t):g(fe,t,e,n),w()}function Y(t,n,r){t!==e&&i(fe,t),n!==e&&s(fe,n),r!==e&&l(fe,r),w()}function J(){return d(fe)}function V(){return te}function X(t,n){return n===e?r[t]:(("height"==t||"contentHeight"==t||"aspectRatio"==t)&&(r[t]=n,C()),e)}function U(t,n){return r[t]?r[t].apply(n||se,Array.prototype.slice.call(arguments,2)):e}var Z=this;Z.options=r,Z.render=u,Z.destroy=h,Z.refetchEvents=k,Z.reportEvents=H,Z.reportEventChange=z,Z.rerenderEvents=R,Z.changeView=y,Z.select=W,Z.unselect=L,Z.prev=_,Z.next=q,Z.prevYear=B,Z.nextYear=I,Z.today=P,Z.gotoDate=j,Z.incrementDate=Y,Z.formatDate=function(t,e){return b(t,e,r)},Z.formatDates=function(t,e,n){return D(t,e,n,r)},Z.getDate=J,Z.getView=V,Z.option=X,Z.trigger=U,o.call(Z,r,c);var $,Q,G,K,te,ee,ne,re,ae,oe=Z.isFetchNeeded,ie=Z.fetchEvents,se=n[0],le={},ce=0,ue=0,fe=new Date,de=[];g(fe,r.year,r.month,r.date),r.droppable&&t(document).bind("dragstart",function(e,n){var a=e.target,o=t(a);if(!o.parents(".fc").length){var i=r.dropAccept;(t.isFunction(i)?i.call(a,o):o.is(i))&&(ae=a,te.dragStart(ae,e,n))}}).bind("dragstop",function(t,e){ae&&(te.dragStop(ae,t,e),ae=null)})}function a(n,r){function a(){v=r.theme?"ui":"fc";var n=r.header;return n?h=t("<table class='fc-header' style='width:100%'/>").append(t("<tr/>").append(i("left")).append(i("center")).append(i("right"))):e}function o(){h.remove()}function i(e){var a=t("<td class='fc-header-"+e+"'/>"),o=r.header[e];return o&&t.each(o.split(" "),function(e){e>0&&a.append("<span class='fc-header-space'/>");var o;t.each(this.split(","),function(e,i){if("title"==i)
}else r(),o=!0;e.draggable("option","revert",o)},n,"drag")},stop:function(n,a){if(u.stop(),ee(),b("eventDragStop",e,t,n,a),o)r(),e.css("filter",""),$(t,e);else{var s=0;c||(s=Math.round((e.offset().top-U().offset().top)/v)*g+p-(60*t.start.getHours()+t.start.getMinutes())),G(this,t,i,s,c,n,a)}}})}function g(t,e,n){function r(e){var r,a=u(d(t.start),e);t.end&&(r=u(d(t.end),e)),n.text(le(a,r,y("timeFormat")))}function a(){f&&(n.css("display",""),e.draggable("option","grid",[p,m]),f=!1)}var o,i,s,c,f=!1,v=W(),g=j(),p=J(),m=V(),D=X();e.draggable({zIndex:9,scroll:!1,grid:[p,m],axis:1==g?"y":!1,opacity:y("dragOpacity"),revertDuration:y("dragRevertDuration"),start:function(r,u){b("eventDragStart",e,t,r,u),Q(t,e),o=e.position(),s=c=0,v.start(function(r,o){if(e.draggable("option","revert",!r),ee(),r){var s=B(0,o.col),c=B(0,r.col);i=h(c,s),y("allDaySlot")&&!r.row?(f||(f=!0,n.hide(),e.draggable("option","grid",null)),te(l(d(t.start),i),l(C(t),i))):a()}},r,"drag")},drag:function(t,e){s=Math.round((e.position.top-o.top)/m)*D,s!=c&&(f||r(s),c=s)},stop:function(n,l){var c=v.stop();ee(),b("eventDragStop",e,t,n,l),c&&(i||s||f)?G(this,t,i,f?0:s,f,n,l):(a(),e.css("filter",""),e.css(o),r(0),$(t,e))}})}function p(t,e,n){var r,a,o=V(),i=X();e.resizable({handles:{s:".ui-resizable-handle"},grid:o,start:function(n,o){r=a=0,Q(t,e),e.css("z-index",9),b("eventResizeStart",this,t,n,o)},resize:function(s,l){r=Math.round((Math.max(o,e.height())-l.originalSize.height)/o),r!=a&&(n.text(le(t.start,r||t.end?u(M(t),i*r):null,y("timeFormat"))),a=r)},stop:function(n,a){b("eventResizeStop",this,t,n,a),r?K(this,t,0,i*r,n,a):(e.css("z-index",8),$(t,e))}})}var m=this;m.renderEvents=n,m.clearEvents=r,m.slotSegHtml=c,ie.call(m);var y=m.opt,b=m.trigger,D=m.isEventDraggable,w=m.isEventResizable,M=m.eventEnd,S=m.reportEvents,k=m.reportEventClear,H=m.eventElementHandlers,z=m.setHeight,R=m.getDaySegmentContainer,N=m.getSlotSegmentContainer,W=m.getHoverListener,A=m.getMaxMinute,O=m.getMinMinute,L=m.timePosition,_=m.colContentLeft,q=m.colContentRight,B=m.cellToDate,P=m.segmentCompare,j=m.getColCnt,J=m.getColWidth,V=m.getSnapHeight,X=m.getSnapMinutes,U=m.getSlotContainer,Z=m.reportEventElement,$=m.showEvents,Q=m.hideEvents,G=m.eventDrop,K=m.eventResize,te=m.renderDayOverlay,ee=m.clearOverlays,ae=m.renderDayEvents,oe=m.calendar,se=oe.formatDate,le=oe.formatDates;m.draggableDayEvent=v}function ne(t){var e,n,r,a,o,i=[],s=t.length;for(e=0;s>e;e++){for(n=t[e],r=0;;){if(a=!1,i[r])for(o=0;i[r].length>o;o++)if(ae(i[r][o],n)){a=!0;break}if(!a)break;r++}i[r]?i[r].push(n):i[r]=[n]}return i}function re(t){var e,n,r,a,o,i;for(e=t.length-1;e>0;e--)for(a=t[e],n=0;a.length>n;n++)for(o=a[n],r=0;t[e-1].length>r;r++)i=t[e-1][r],ae(o,i)&&(i.forward=Math.max(i.forward||0,(o.forward||0)+1))}function ae(t,e){return t.end>e.start&&t.start<e.end}function oe(n,r,a){function o(e,n){var r=Z[e];return t.isPlainObject(r)?B(r,n||a):r}function i(t,e){return r.trigger.apply(r,[t,e||I].concat(Array.prototype.slice.call(arguments,2),[I]))}function s(t){return f(t)&&!o("disableDragging")}function c(t){return f(t)&&!o("disableResizing")}function f(t){return V(t.editable,(t.source||{}).editable,o("editable"))}function v(t){J={};var e,n,r=t.length;for(e=0;r>e;e++)n=t[e],J[n._id]?J[n._id].push(n):J[n._id]=[n]}function g(t){return t.end?d(t.end):P(t)}function p(t,e){X.push(e),U[t._id]?U[t._id].push(e):U[t._id]=[e]}function m(){X=[],U={}}function y(t,n){n.click(function(r){return n.hasClass("ui-draggable-dragging")||n.hasClass("ui-resizable-resizing")?e:i("eventClick",this,t,r)}).hover(function(e){i("eventMouseover",this,t,e)},function(e){i("eventMouseout",this,t,e)})}function b(t,e){w(t,e,"show")}function D(t,e){w(t,e,"hide")}function w(t,e,n){var r,a=U[t._id],o=a.length;for(r=0;o>r;r++)e&&a[r][0]==e[0]||a[r][n]()}function C(t,e,n,r,a,o,s){var l=e.allDay,c=e._id;T(J[c],n,r,a),i("eventDrop",t,e,n,r,a,function(){T(J[c],-n,-r,l),Y(c)},o,s),Y(c)}function M(t,e,n,r,a,o){var s=e._id;S(J[s],n,r),i("eventResize",t,e,n,r,function(){S(J[s],-n,-r),Y(s)},a,o),Y(s)}function T(t,n,r,a){r=r||0;for(var o,i=t.length,s=0;i>s;s++)o
/*! jQuery UI - v1.10.2 - 2013-03-16
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.resizable.js
* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
(function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=