/* * 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'+""+e.join("")+""+"":""}function o(t,e){return t.length?"
"+i(t,e)+"
":""}function r(e,n,o){var r,s=[];if(o>0)for(r=0;e>r;r++)s.push("");return n&&s.push(''+n.text+""),1>o?t():t('
'+i(s)+"
")}function s(e,n,r){var s,l,a,c,u,h,f,d,g,p=[];for(l=0;l'+a[s].text+"");p.push(c.join(""))}if(h=[],r){for(f=e[e.length-1],d=[],g=r.cellContent,s=0;s'+(g?g(s):" ")+"");h.push(d.join(""))}return t('
'+i(p)+o(h,"k-scheduler-header-all-day")+"
"+"
")}function l(e,n){var o,r,s,l,a,c=Array(n).join().split(","),u=[];for(r=0;r'+s[o].text+"";for(o=0;n>o;o++)u.push(c[o]);return 1>n?t():t('
'+i(u)+"
")}function a(){return t('
'+"")}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;ie||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;er;r++)if(l=i.start>a[r].end,i.start
';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=s.offsetLeft&&t=s.offsetTop&&et&&(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.starth.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=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;tu&&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;on;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=0&&i.rows.splice(c,1),s=this.columnLevels=e(i,"columns"),l=this.rowLevels=e(i,"rows"),this.table=t("
'),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;eh&&(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("").append(this.timesHeader.add(this.datesHeader).wrap("").append(this.times.add(this.content).wrap("
").parent())},_bottomSection:function(e,n,i){return this.times=l(n,i),this.content=a(e[e.length-1],n[n.length-1]),t("
").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;ot||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