10 lines
25 KiB
JavaScript
10 lines
25 KiB
JavaScript
/*
|
|
* Kendo UI Complete v2013.3.1119 (http://kendoui.com)
|
|
* Copyright 2013 Telerik AD. All rights reserved.
|
|
*
|
|
* Kendo UI Complete commercial licenses may be obtained at
|
|
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-complete-commercial.aspx
|
|
* If you do not own a commercial license, this file shall be governed by the trial license terms.
|
|
*/
|
|
!function(define){return define(["./kendo.core.min"],function(){!function(t){function e(t,e){function n(t,o){var r,s;if(o=o[e])for(r=i[t]=i[t]||[],s=0;s<o.length;s++)r.push(o[s]),n(t+1,o[s])}var i=[];return n(0,t),i}function n(){return R.support.cssBorderSpacing?"":'cellspacing="0"'}function i(e,i){return e.length?"<table "+n()+' class="'+t.trim("k-scheduler-table "+(i||""))+'">'+"<tr>"+e.join("</tr><tr>")+"</tr>"+"</table>":""}function o(t,e){return t.length?"<div style='position:relative'>"+i(t,e)+"</div>":""}function r(e,n,o){var r,s=[];if(o>0)for(r=0;e>r;r++)s.push("<th></th>");return n&&s.push('<th class="k-scheduler-times-all-day">'+n.text+"</th>"),1>o?t():t('<div class="k-scheduler-times">'+i(s)+"</div>")}function s(e,n,r){var s,l,a,c,u,h,f,d,g,p=[];for(l=0;l<e.length;l++){for(a=e[l],c=[],u=n/a.length,s=0;s<a.length;s++)c.push('<th colspan="'+u+'" class="'+(a[s].className||"")+'">'+a[s].text+"</th>");p.push(c.join(""))}if(h=[],r){for(f=e[e.length-1],d=[],g=r.cellContent,s=0;s<f.length;s++)d.push('<td class="'+(f[s].className||"")+'">'+(g?g(s):" ")+"</th>");h.push(d.join(""))}return t('<div class="k-scheduler-header k-state-default"><div class="k-scheduler-header-wrap">'+i(p)+o(h,"k-scheduler-header-all-day")+"</div>"+"</div>")}function l(e,n){var o,r,s,l,a,c=Array(n).join().split(","),u=[];for(r=0;r<e.length;r++)for(s=e[r],l=n/s.length,o=0;o<s.length;o++)a=s[o].className||"",s[o].allDay&&(a="k-scheduler-times-all-day"),c[l*o]+='<th class="'+a+'" rowspan="'+l+'">'+s[o].text+"</th>";for(o=0;n>o;o++)u.push(c[o]);return 1>n?t():t('<div class="k-scheduler-times">'+i(u)+"</div>")}function a(){return t('<div class="k-scheduler-content"><table '+n()+' class="k-scheduler-table"/>'+"</div>")}function c(){return H=H?H:R.support.scrollbar()}function u(t,e,n){var i,o,r,s,l;for(i=t.length-1;i>=0;i--)o=h(t[i]),r=o.start,l=o.end,s=e>=r&&l>=e,(s||r>=e&&n>=l||r>=e&&n>=r)&&(e>r&&(e=r),l>n&&(n=l));return f(t,e,n)}function h(t){return{start:t.start,end:t.end}}function f(t,e,n){var i,o,r=[];for(i=0;i<t.length;i++)o=h(t[i]),(o.start<e&&o.end>e||o.start>=e&&o.end<=n)&&r.push(t[i]);return r}function d(t){return p(t)}function g(t){return p(t)}function p(t){var e,n,i,o,r,s,l,a=[];for(e=0;e<t.length;e++){for(n=t[e],i=h(n),o=null,r=0,s=a.length;s>r;r++)if(l=i.start>a[r].end,i.start<a[r].start||l){o=a[r],o.end<i.end&&(o.end=i.end);break}o||(o={start:i.start,end:i.end,events:[]},a.push(o)),o.events.push(n)}return a}function v(t,e,n){var i,o,r,s,l=e[0];if(l){for(i=[],o=l.dataSource.view(),r=0;r<o.length;r++)s={text:R.getter(l.dataTextField)(o[r]),className:"k-slot-cell"},s[t]=v(t,e.slice(1),n),i.push(s);return i}return n}function m(e){return function(n){if(t.isArray(n)||n instanceof R.data.ObservableArray){for(var i=0;i<n.length;i++)if(n[i]==e)return!0;return!1}return n==e}}function _(t){t.className=t.className.replace(T,"")+" k-state-selected"}var S,y,C,b,x,w,D,k,H,I,T,R=window.kendo,z=R.ui,L=z.Widget,V=R.keys,G=".kendoSchedulerView",B=Math,E='<div class="k-marquee k-scheduler-marquee"><div class="k-marquee-color"></div><div class="k-marquee-text"><div class="k-label-top"></div><div class="k-label-bottom"></div></div></div>';R.ui.scheduler={},S=R.Class.extend({init:function(t){this._index=t,this._timeSlotCollections=[],this._daySlotCollections=[]},addTimeSlotCollection:function(t,e){return this._addCollection(t,e,this._timeSlotCollections)},addDaySlotCollection:function(t,e){return this._addCollection(t,e,this._daySlotCollections)},_addCollection:function(t,e,n){var i=new x(t,e,this._index,n.length);return n.push(i),i},timeSlotCollectionCount:function(){return this._timeSlotCollections.length},daySlotCollectionCount:function(){return this._daySlotCollections.length},daySlotByPosition:function(t,e){return this._slotByPosition(t,e,this._daySlotCollections)},timeSlotByPosition:function(t,e){return this._slotByPosition(t,e,this._timeSlotCollections)},_slotByPosition:function(t,e,n){var i,o,r,s;for(i=0;i<n.length;i++)for(o=n[i],r=0;r<o.count();r++)if(s=o.at(r),t>=s.offsetLeft&&t<s.offsetLeft+s.clientWidth&&e>=s.offsetTop&&e<s.offsetTop+s.clientHeight)return s},refresh:function(){var t;for(t=0;t<this._daySlotCollections.length;t++)this._daySlotCollections[t].refresh();for(t=0;t<this._timeSlotCollections.length;t++)this._timeSlotCollections[t].refresh()},timeSlotRanges:function(t,e){var n=this._timeSlotCollections,i=this._startSlot(t,n),o=i;return e>t&&(o=this._endSlot(e,n)),this._continuousRange(C,n,i,o)},daySlotRanges:function(t,e,n){var i=this._daySlotCollections,o=this._startSlot(t,i,n),r=o;return e>t&&(r=this._endSlot(e,i,n)),this._continuousRange(b,i,o,r)},_continuousRange:function(t,e,n,i){var o,r,s,l,a,c,u=n.slot,h=i.slot,f=u.collectionIndex,d=h.collectionIndex,g=[];for(o=f;d>=o;o++)r=e[o],s=r.first(),l=r.last(),a=!1,c=!1,o==f&&(c=!n.inRange),o==d&&(a=!i.inRange),s.start<u.start&&(s=u),l.start>h.start&&(l=h),d>f&&(o==f?a=!0:o==d?c=!0:a=c=!0),g.push(new t({start:s,end:l,collection:r,head:a,tail:c}));return g},slotRanges:function(t,e){var n=R.date.toUtcTime(t.start),i=R.date.toUtcTime(t.end);return void 0===e&&(e=t.isMultiDay()),e?this.daySlotRanges(n,i,t.isAllDay):(t.startTime&&(n=R.date.getMilliseconds(t.startTime)+R.date.toUtcTime(R.date.getDate(t.start))),t.endTime&&(i=R.date.getMilliseconds(t.endTime)+R.date.toUtcTime(R.date.getDate(t.end))),this.timeSlotRanges(n,i))},ranges:function(t,e,n,i){return"number"!=typeof t&&(t=R.date.toUtcTime(t)),"number"!=typeof e&&(e=R.date.toUtcTime(e)),n?this.daySlotRanges(t,e,i):this.timeSlotRanges(t,e)},_startCollection:function(t,e){var n,i;for(n=0;n<e.length;n++)if(i=e[n],i.startInRange(t))return i;return null},_endCollection:function(t,e){var n,i;for(n=0;n<e.length;n++)if(i=e[n],i.endInRange(t))return i;return null},_getCollections:function(t){return t?this._daySlotCollections:this._timeSlotCollections},continuousSlot:function(t,e){var n=e?-1:1,i=this._getCollections(t.isDaySlot),o=i[t.collectionIndex+n];return o?o[e?"last":"first"]():void 0},firstSlot:function(){var t=this._getCollections(this.daySlotCollectionCount());return t[0].first()},lastSlot:function(){var t=this._getCollections(this.daySlotCollectionCount());return t[t.length-1].last()},upSlot:function(t,e){var n=this,i=function(t,i,o){var r=0===o;return!e&&!t&&r&&n.daySlotCollectionCount()?n._daySlotCollections[0].at(i):void 0};return this.timeSlotCollectionCount()||(e=!0),this._verticalSlot(t,-1,i)},downSlot:function(t,e){var n=this,i=function(t,i,o){return!e&&t&&n.timeSlotCollectionCount()?n._timeSlotCollections[o].at(0):void 0};return this.timeSlotCollectionCount()||(e=!0),this._verticalSlot(t,1,i)},leftSlot:function(t){return this._horizontalSlot(t,-1)},rightSlot:function(t){return this._horizontalSlot(t,1)},_horizontalSlot:function(t,e){var n,i=t.index,o=t.isDaySlot,r=t.collectionIndex,s=this._getCollections(o);return o?i+=e:r+=e,n=s[r],n?n.at(i):void 0},_verticalSlot:function(t,e,n){var i,o=t.index,r=t.isDaySlot,s=t.collectionIndex,l=this._getCollections(r);return(t=n(r,s,o))?t:(r?s+=e:o+=e,i=l[s],i?i.at(o):void 0)},_collection:function(t,e){var n=e?this._daySlotCollections:this._timeSlotCollections;return n[t]},_startSlot:function(t,e,n){var i,o=this._startCollection(t,e),r=!0;return o||(o=e[0],r=!1),i=o.slotByStartDate(t,n),i||(i=o.first(),r=!1),{slot:i,inRange:r}},_endSlot:function(t,e,n){var i,o=this._endCollection(t,e),r=!0;return o||(o=e[e.length-1],r=!1),i=o.slotByEndDate(t,n),i||(i=o.last(),r=!1),{slot:i,inRange:r}},getSlotCollection:function(t,e){return this[e?"getDaySlotCollection":"getTimeSlotCollection"](t)},getTimeSlotCollection:function(t){return this._timeSlotCollections[t]},getDaySlotCollection:function(t){return this._daySlotCollections[t]}}),y=R.Class.extend({init:function(e){t.extend(this,e)},innerHeight:function(){var t,e=this.collection,n=this.start.index,i=this.end.index,o=0;for(t=n;i>=t;t++)o+=e.at(t).offsetHeight;return o},events:function(){return this.collection.events()},addEvent:function(t){this.events().push(t)},startSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.end:this.start},endSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.start:this.end}}),C=y.extend({innerHeight:function(){var t,e=this.collection,n=this.start.index,i=this.end.index,o=0;for(t=n;i>=t;t++)o+=e.at(t).offsetHeight;return o},outerRect:function(t,e,n){return this._rect("offset",t,e,n)},_rect:function(t,e,n,i){var o,r,s,l,a,c,u=this.start,h=this.end;return"number"!=typeof e&&(e=R.date.toUtcTime(e)),"number"!=typeof n&&(n=R.date.toUtcTime(n)),i?(o=u.offsetTop,r=h.offsetTop+h[t+"Height"]):(s=e-u.start,0>s&&(s=0),l=u.end-u.start,o=u.offsetTop+u[t+"Height"]*s/l,a=h.end-n,0>a&&(a=0),c=h.end-h.start,r=h.offsetTop+h[t+"Height"]-h[t+"Height"]*a/c),{top:o,bottom:r}},innerRect:function(t,e,n){return this._rect("client",t,e,n)}}),b=y.extend({innerWidth:function(){var t,e=this.collection,n=this.start.index,i=this.end.index,o=0,r=n!==i?"offsetWidth":"clientWidth";for(t=n;i>=t;t++)o+=e.at(t)[r];return o}}),x=R.Class.extend({init:function(t,e,n,i){this._slots=[],this._events=[],this._start=R.date.toUtcTime(t),this._end=R.date.toUtcTime(e),this._groupIndex=n,this._collectionIndex=i},refresh:function(){var t,e,n,i,o,r=[];for(t=0;t<this._slots.length;t++)e=this._slots[t],n=e.offsetTop,e.refresh(),r[t]=e.offsetTop-n;for(i=0;i<this._events.length;i++)o=this._events[i],o.element.css({top:o.element[0].offsetTop+r[o.slotIndex]})},startInRange:function(t){return this._start<=t&&t<this._end},endInRange:function(t){return this._start<=t&&t<=this._end},slotByStartDate:function(t){var e,n,i=t;for("number"!=typeof i&&(i=R.date.toUtcTime(t)),e=0;e<this._slots.length;e++)if(n=this._slots[e],n.startInRange(i))return n;return null},slotByEndDate:function(t,e){var n,i,o=t;if("number"!=typeof o&&(o=R.date.toUtcTime(t)),e)return this.slotByStartDate(t,!1);for(n=0;n<this._slots.length;n++)if(i=this._slots[n],i.endInRange(o))return i;return null},count:function(){return this._slots.length},events:function(){return this._events},addTimeSlot:function(t,e,n){var i=new D(t,e,n,this._groupIndex,this._collectionIndex,this._slots.length);this._slots.push(i)},addDaySlot:function(t,e,n,i){var o=new k(t,e,n,this._groupIndex,this._collectionIndex,this._slots.length,i);this._slots.push(o)},first:function(){return this._slots[0]},last:function(){return this._slots[this._slots.length-1]},at:function(t){return this._slots[t]}}),w=R.Class.extend({init:function(t,e,n,i,o,r){this.element=t,this.clientWidth=t.clientWidth,this.clientHeight=t.clientHeight,this.offsetWidth=t.offsetWidth,this.offsetHeight=t.offsetHeight,this.offsetTop=t.offsetTop,this.offsetLeft=t.offsetLeft,this.start=e,this.end=n,this.element=t,this.groupIndex=i,this.collectionIndex=o,this.index=r,this.isDaySlot=!1},startDate:function(){return R.timezone.toLocalDate(this.start)},endDate:function(){return R.timezone.toLocalDate(this.end)},startInRange:function(t){return this.start<=t&&t<this.end},endInRange:function(t){return this.start<t&&t<=this.end},startOffset:function(){return this.start},endOffset:function(){return this.end}}),D=w.extend({refresh:function(){this.offsetTop=this.element.offsetTop},offsetX:function(t,e){return t?this.offsetLeft+e:this.offsetLeft+e},startInRange:function(t){return this.start<=t&&t<this.end},endInRange:function(t){return this.start<t&&t<=this.end},startOffset:function(e,n,i){var o,r,s,l;return i?this.start:(o=t(this.element).offset(),r=n-o.top,s=this.end-this.start,l=Math.floor(s*(r/this.offsetHeight)),this.start+l)},endOffset:function(e,n,i){var o,r,s,l;return i?this.end:(o=t(this.element).offset(),r=n-o.top,s=this.end-this.start,l=Math.floor(s*(r/this.offsetHeight)),this.start+l)}}),k=w.extend({init:function(t,e,n,i,o,r,s){w.fn.init.apply(this,arguments),this.eventCount=s,this.isDaySlot=!0,this.firstChildHeight=this.element.firstChild.offsetHeight+3,this.firstChildTop=this.element.firstChild.offsetTop},refresh:function(){this.clientHeight=this.element.clientHeight,this.offsetTop=this.element.offsetTop},startDate:function(){var t=new Date(this.start);return R.timezone.apply(t,"Etc/UTC")},endDate:function(){var t=new Date(this.end);return R.timezone.apply(t,"Etc/UTC")},startInRange:function(t){return this.start<=t&&t<this.end},endInRange:function(t){return this.start<t&&t<=this.end}}),R.ui.SchedulerView=L.extend({init:function(e,n){L.fn.init.call(this,e,n),this._scrollbar=c(),this._isRtl=R.support.isRtl(e),this._resizeHint=t(),this._moveHint=t(),this._cellId=R.guid(),this._resourcesForGroups(),this._selectedSlots=[]},_isMobile:function(){var t=this.options;return t.mobile===!0&&R.support.mobileOS||"phone"===t.mobile||"tablet"===t.mobile},_isMobilePhoneView:function(){var t=this.options;return t.mobile===!0&&R.support.mobileOS&&!R.support.mobileOS.tablet||"phone"===t.mobile},_addResourceView:function(){var t=new S(this.groups.length);return this.groups.push(t),t},dateForTitle:function(){return R.format(this.options.selectedDateFormat,this.startDate(),this.endDate())},_changeGroup:function(t,e){var n=e?"prevGroupSlot":"nextGroupSlot",i=this[n](t.start,t.groupIndex,t.isAllDay);return i&&(t.groupIndex+=e?-1:1),i},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_horizontalSlots:function(t,e,n,i){var o,r,s=i?"leftSlot":"rightSlot",l=e[0].start,a=e[e.length-1].end,c=this.groups[t.groupIndex];return n||(o=this._normalizeHorizontalSelection(t,e,i),o&&(l=a=o)),l=c[s](l),a=c[s](a),n||this._isVerticallyGrouped()||l&&a||(l=a=this._changeGroup(t,i)),l&&a||(r=this._continuousSlot(t,e,i),r=this._changeGroupContinuously(t,r,n,i),r&&(l=a=r)),{startSlot:l,endSlot:a}},_verticalSlots:function(t,e,n,i){var o,r,s=e[0].start,l=e[e.length-1].end,a=this.groups[t.groupIndex];return n||(o=this._normalizeVerticalSelection(t,e,i),o&&(s=l=o)),r=i?"upSlot":"downSlot",s=a[r](s,n),l=a[r](l,n),n||!this._isVerticallyGrouped()||s&&l||(s=l=this._changeGroup(t,i)),{startSlot:s,endSlot:l}},_normalizeHorizontalSelection:function(){return null},_normalizeVerticalSelection:function(t,e,n){var i;return i=n?e[0].start:e[e.length-1].end},_continuousSlot:function(){return null},constrainSelection:function(t){if(!this.inRange(t)){var e=this.groups[0].firstSlot();t.isAllDay=e.isDaySlot,t.start=e.startDate(),t.end=e.endDate()}},move:function(t,e,n){var i,o,r,s,l,a,c=!1,u=this.groups[t.groupIndex];if(u.timeSlotCollectionCount()||(t.isAllDay=!0),i=u.ranges(t.start,t.end,t.isAllDay,!1),e===V.DOWN||e===V.UP){if(c=!0,s=e===V.UP,this._updateDirection(t,i,n,s,!0),l=this._verticalSlots(t,i,n,s),!l.startSlot&&!n&&this._changeViewPeriod(t,s,!0))return c}else if((e===V.LEFT||e===V.RIGHT)&&(c=!0,s=e===V.LEFT,this._updateDirection(t,i,n,s,!1),l=this._horizontalSlots(t,i,n,s),!l.startSlot&&!n&&this._changeViewPeriod(t,s,!1)))return c;return c&&(o=l.startSlot,r=l.endSlot,n?(a=t.backward,a&&o?t.start=o.startDate():!a&&r&&(t.end=r.endDate())):o&&r&&(t.isAllDay=o.isDaySlot,t.start=o.startDate(),t.end=r.endDate()),t.events=[]),c},moveToEventInGroup:function(e,n,i,o){for(var r,s,l=e._continuousEvents||[],a=o?-1:1,c=l.length,u=o?c-1:0;c>u&&u>-1;){if(s=l[u],(!o&&s.start.startDate()>=n.startDate()||o&&s.start.startDate()<=n.startDate())&&(i.length&&(s=l[u+a]),s&&-1===t.inArray(s.uid,i))){r=!!s;break}u+=a}return s},moveToEvent:function(t,e){for(var n,i=t.groupIndex,o=this.groups[i],r=o.ranges(t.start,t.end,t.isAllDay,!1)[0].start,s=this.groups.length,l=e?-1:1,a=t.events;s>i&&i>-1&&(n=this.moveToEventInGroup(o,r,a,e),i+=l,o=this.groups[i],o&&!n);)a=[],r=e?o.lastSlot():o.firstSlot(!0);return n&&(t.events=[n.uid],t.start=n.start.startDate(),t.end=n.end.endDate(),t.isAllDay=n.start.isDaySlot,t.groupIndex=n.start.groupIndex),!!n},current:function(t){return void 0===t?this._current:(this._current=t,this._scrollTo(t,this.content[0]),void 0)},select:function(t){this.clearSelection(),this._selectEvents(t)||this._selectSlots(t)},_selectSlots:function(t){var e,n,i,o,r,s,l,a=t.isAllDay,c=this.groups[t.groupIndex];for(c.timeSlotCollectionCount()||(a=!0),this._selectedSlots=[],e=c.ranges(t.start,t.end,a,!1),o=0;o<e.length;o++)for(r=e[o],s=r.collection,l=r.start.index;l<=r.end.index;l++)i=s.at(l),n=i.element,n.setAttribute("aria-selected",!0),_(n),this._selectedSlots.push({start:i.startDate(),end:i.endDate(),element:n});t.backward&&(n=e[0].start.element),this.current(n)},_selectEvents:function(e){var n,i,o=!1,r=e.events,s=this.groups[e.groupIndex]._continuousEvents||[],l=s.length;if(!r[0]||!s[0])return o;for(i=t(),n=0;l>n;n++)t.inArray(s[n].uid,r)>-1&&(i=i.add(s[n].element));return i[0]&&(i.addClass("k-state-selected").attr("aria-selected",!0),this.current(i.last()[0]),o=!0),o},inRange:function(t){var e=this.startDate(),n=R.date.addDays(this.endDate(),1),i=t.start,o=t.end;return i>=e&&n>i&&o>e&&n>=o},_scrollbarOffset:function(t,e){return!this._isRtl||e&&!this._isVerticallyGrouped()||!R.support.browser.webkit?t:this._scrollbarWidth+t},_resourceValue:function(t,e){return t.valuePrimitive&&(e=R.getter(t.dataValueField)(e)),e},_resourceBySlot:function(t){var e,n,i,o,r,s=this.groupedResources,l={};if(s.length)for(e=t.groupIndex,n=s.length-1;n>=0;n--)i=s[n],o=this._resourceValue(i,i.dataSource.at(e%i.dataSource.total())),i.multiple&&(o=[o]),r=R.setter(i.field),r(l,o),e=Math.floor(e/i.dataSource.total());return l},_createResizeHint:function(e,n,i,o){return t(E).css({left:e,top:n,width:i,height:o})},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=t()},_removeMoveHint:function(){this._moveHint.remove(),this._moveHint=t()},_scrollTo:function(t,e){var n=t.offsetTop,i=t.offsetHeight,o=e.scrollTop,r=e.clientHeight,s=n+i,l=0;l=o>n?n:s>o+r?r>=i?s-r:n:o,e.scrollTop=l},_shouldInverseResourceColor:function(t){var e=new I(t.color).isDark(),n=this.element.css("color"),i=new I(n).isDark();return e==i},eventResources:function(t){var e,n,i,o,r,s,l,a,c,u,h=[],f=this.options;if(!f.resources)return h;for(e=0;e<f.resources.length;e++)if(n=f.resources[e],i=n.field,o=R.getter(i)(t))for(n.multiple||(o=[o]),r=n.dataSource.view(),s=0;s<o.length;s++){for(l=null,a=o[s],n.valuePrimitive||(a=R.getter(n.dataValueField)(a)),c=0;c<r.length;c++)if(r[c].get(n.dataValueField)==a){l=r[c];break}null!=l&&(u=R.getter(n.dataColorField)(l),h.push({text:R.getter(n.dataTextField)(l),value:a,color:u}))}return h},createLayout:function(i){var o,r,s,l,a,c=-1;for(i.rows||(i.rows=[]),o=0;o<i.rows.length;o++)if(i.rows[o].allDay){c=o;break}r=i.rows[c],c>=0&&i.rows.splice(c,1),s=this.columnLevels=e(i,"columns"),l=this.rowLevels=e(i,"rows"),this.table=t("<table "+n()+' class="k-scheduler-layout k-scheduler-'+this.name+'view"/>'),a=l[l.length-1].length,this.table.append(this._topSection(s,r,a)),this.table.append(this._bottomSection(s,l,a)),this.element.append(this.table),this._scroller()},refreshLayout:function(){var e,n,i,o,r,s,l=this,a=l.element.find(">.k-scheduler-toolbar"),c=l.element.innerHeight(),u=this._scrollbar,h=0,f=this._isRtl?"left":"right";for(e=0;e<a.length;e++)c-=a.eq(e).outerHeight();l.datesHeader&&(h=l.datesHeader.outerHeight()),l.timesHeader&&l.timesHeader.outerHeight()>h&&(h=l.timesHeader.outerHeight()),l.datesHeader&&l.timesHeader&&(n=l.datesHeader.find("table:first tr"),l.timesHeader.find("tr").height(function(e){t(this).height(n.eq(e).height())})),h&&(c-=h),l.footer&&(c-=l.footer.outerHeight()),i=function(t){var e,n;return t[0].style.height?!0:(e=t.height(),t.height("auto"),n=t.height(),e!=n?(t.height(""),!0):(t.height(""),!1))},o=l.content[0],r=R.support.kineticScrollNeeded?0:u,this._scrollbarWidth=0,i(l.element)&&(c>2*u?l.content.height(c):l.content.height(2*u+1),l.times.height(o.clientHeight),s=l.times.find("table"),s.length&&s.height(l.content.find("table")[0].clientHeight)),o.offsetWidth-o.clientWidth>0?(l.table.addClass("k-scrollbar-v"),l.datesHeader.css("padding-"+f,r-parseInt(l.datesHeader.children().css("border-"+f+"-width"),10)),this._scrollbarWidth=r):l.datesHeader.css("padding-"+f,""),o.offsetHeight-o.clientHeight>0||o.clientHeight>l.content.children(".k-scheduler-table").height()?l.table.addClass("k-scrollbar-h"):l.table.removeClass("k-scrollbar-h")},_topSection:function(e,n,i){this.timesHeader=r(e.length,n,i);var o=e[e.length-1].length;return this.datesHeader=s(e,o,n),t("<tr>").append(this.timesHeader.add(this.datesHeader).wrap("<td>").parent())},_bottomSection:function(e,n,i){return this.times=l(n,i),this.content=a(e[e.length-1],n[n.length-1]),t("<tr>").append(this.times.add(this.content).wrap("<td>").parent())},_scroller:function(){var e,n=this;this.content.bind("scroll"+G,function(){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft),n.times.scrollTop(this.scrollTop)}),e=R.touchScroller(this.content,{avoidScrolling:function(e){return t(e.event.target).closest(".k-event.k-event-active").length>0}}),e&&e.movable&&(this._touchScroller=e,this.content=e.scrollElement,e.movable.bind("change",function(t){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-t.sender.x),n.times.scrollTop(-t.sender.y)}))},_resourcesForGroups:function(){var t,e,n,i,o=[],r=this.options.group,s=this.options.resources;if(r=r&&r.resources?r.resources:[],s&&r.length)for(t=0,e=s.length;e>t;t++)for(n=0,i=r.length;i>n;n++)s[t].name===r[n]&&o.push(s[t]);this.groupedResources=o},_createColumnsLayout:function(t,e){return v("columns",t,e)},_groupOrientation:function(){var t=this.options.group;return t&&t.resources?t.orientation:"horizontal"},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_createRowsLayout:function(t,e){return v("rows",t,e)},selectionByElement:function(){return null},clearSelection:function(){this.content.find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},destroy:function(){var t=this;L.fn.destroy.call(this),t.table&&(R.destroy(t.table),t.table.remove())},calendarInfo:function(){return R.getCulture().calendars.standard},prevGroupSlot:function(t,e,n){var i,o=this.groups[e],r=o.ranges(t,t,n,!1)[0].start;if(!(0>=e))return this._isVerticallyGrouped()?o.timeSlotCollectionCount()?(i=o._collection(n?r.index:r.collectionIndex,!1),i.last()):(i=o._collection(o.daySlotCollectionCount()-1,!0),i.at(r.index)):o.timeSlotCollectionCount()?(i=o._collection(n?0:o.timeSlotCollectionCount()-1,n),n?i.last():i.at(r.index)):(i=o._collection(r.collectionIndex,!0),i.last())},nextGroupSlot:function(t,e,n){var i,o=this.groups[e],r=o.ranges(t,t,n,!1)[0].start;if(!(e>=this.groups.length-1))return this._isVerticallyGrouped()?o.timeSlotCollectionCount()?(i=o._collection(0,o.daySlotCollectionCount()),n?i.last():i.at(r.collectionIndex)):(i=o._collection(0,!0),i.at(r.index)):o.timeSlotCollectionCount()?(i=o._collection(0,n),n?i.first():i.at(r.index)):(i=o._collection(r.collectionIndex,!0),i.first())}}),I=function(t){var e,n,i,o,r,s=this,l=I.formats;if(1===arguments.length)for(t=s.resolveColor(t),o=0;o<l.length;o++)e=l[o].re,n=l[o].process,i=e.exec(t),i&&(r=n(i),s.r=r[0],s.g=r[1],s.b=r[2]);else s.r=arguments[0],s.g=arguments[1],s.b=arguments[2];s.r=s.normalizeByte(s.r),s.g=s.normalizeByte(s.g),s.b=s.normalizeByte(s.b)},I.prototype={resolveColor:function(t){return t=t||"#000","#"==t.charAt(0)&&(t=t.substr(1,6)),t=t.replace(/ /g,""),t=t.toLowerCase(),t=I.namedColors[t]||t},normalizeByte:function(t){return 0>t||isNaN(t)?0:t>255?255:t},percBrightness:function(){var t=this;return B.sqrt(.241*t.r*t.r+.691*t.g*t.g+.068*t.b*t.b)},isDark:function(){var t=this,e=t.percBrightness();return 180>e}},I.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(t){return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],I.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},T=/\s*k-state-selected/,t.extend(z.SchedulerView,{createColumns:d,createRows:g,rangeIndex:h,collidingEvents:u,groupEqFilter:m})}(window.kendo.jQuery)})}("function"==typeof define&&define.amd?define:function(t,e){return e()});
|
|
//@ sourceMappingURL=kendo.scheduler.view.min.js.map
|