/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.core.min"],function(){!function(e){function t(e,t){function r(e,s){var i,o;if(s=s[t])for(i=n[e]=n[e]||[],o=0;o'+""+t.join("")+""+"":""}function s(t,r,s){var i,o=[];if(s>0)for(i=0;t>i;i++)o.push("");return r&&o.push(''+r.text+""),1>s?e():e('
'+n(o)+"
")}function i(t,r,s){var i,o,l,a,c,h,u,d,f=[];for(o=0;o'+l[i].text+"");f.push(a.join(""))}if(h=[],s){for(u=t[t.length-1],d=[],i=0;i ');h.push(d.join(""))}return e('
'+n(f)+n(h,"k-scheduler-header-all-day")+"
"+"
")}function o(t,r){var s,i,o,l,a,c=Array(r).join().split(","),h=[];for(i=0;i'+o[s].text+"";for(s=0;r>s;s++)h.push(c[s]);return 1>r?e():e('
'+n(h)+"
")}function l(){return e('
'+"")}function a(e,t,r){return c(e,t,r,!0)}function c(e,t,r,n){var s,i,o,l,a;for(s=e.length-1;s>=0;s--)i=h(e[s]),o=i.start,a=i.end,l=n?t>=o&&a>=t:t>o&&a>t,(l||o>=t&&r>=a||o>=t&&r>=o)&&(t>o&&(t=o),a>r&&(r=a));return u(e,t,r)}function h(e){return{start:e.start,end:e.end}}function u(e,t,r){var n,s,i=[];for(n=0;nt||s.start>=t&&s.end<=r)&&i.push(e[n]);return i}function d(e){return g(e)}function f(e){return g(e,!0)}function g(e,t){var r,n,s,i,o,l,a,c=[];for(r=0;ro;o++)if(a=t?s.start>c[o].end:s.start>=c[o].end,s.start
';H.ui.SchedulerView=k.extend({init:function(t,r){k.fn.init.call(this,t,r),this._scrollbar=H.support.scrollbar(),m=H.support.isRtl(t),this._resizeHint=e(),this._moveHint=e(),this._cellId=H.guid(),this._resourcesForGroups()},dateForTitle:function(){return H.format(this.options.selectedDateFormat,this.startDate(),this.endDate())},move:function(){return!1},moveToEvent:function(){return!1},isInRange:function(e){return this.startDate()<=e&&e<=this.endDate()},_createResizeHint:function(t,r,n,s){return e(w).css({left:t,top:r,width:n,height:s})},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=e()},_removeMoveHint:function(){this._moveHint.remove(),this._moveHint=e()},_scrollTo:function(e,t){var r=e.offsetTop,n=e.offsetHeight,s=t.scrollTop,i=t.clientHeight,o=r+n,l=0;l=s>r?r:o>s+i?i>=n?o-i:r:s,t.scrollTop=l},eventResources:function(e){var t,r,n,s,i,o,l,a,c,h=[],u=this.options;if(!u.resources)return h;for(t=0;t=0&&n.rows.splice(c,1),o=this.columnLevels=t(n,"columns"),l=this.rowLevels=t(n,"rows"),this.table=e("
'),a=l[l.length-1].length,this.table.append(this._topSection(o,i,a)),this.table.append(this._bottomSection(o,l,a)),this.element.append(this.table),this._scroller()},refreshLayout:function(){var t,r,n,s,i,o=this,l=o.element.find(">.k-scheduler-toolbar"),a=o.element.innerHeight(),c=this._scrollbar,h=0,u=m?"left":"right";l.length&&(a-=l.outerHeight()),o.datesHeader&&(h=o.datesHeader.outerHeight()),o.timesHeader&&o.timesHeader.outerHeight()>h&&(h=o.timesHeader.outerHeight()),o.datesHeader&&o.timesHeader&&(t=o.datesHeader.find("table:first tr"),o.timesHeader.find("tr").height(function(r){e(this).height(t.eq(r).height())})),h&&(a-=h),o.footer&&(a-=o.footer.outerHeight()),r=function(e){var t,r;return e[0].style.height?!0:(t=e.height(),e.height("auto"),r=e.height(),t!=r?(e.height(""),!0):(e.height(""),!1))},n=o.content[0],s=H.support.kineticScrollNeeded?0:c,r(o.element)&&(a>2*c?o.content.height(a):o.content.height(2*c+1),o.times.height(n.clientHeight),i=o.times.find("table"),i.length&&i.height(o.content.find("table")[0].clientHeight)),n.offsetWidth-n.clientWidth>0&&(o.table.addClass("k-scrollbar-v"),o.datesHeader.css("padding-"+u,s-parseInt(o.datesHeader.children().css("border-"+u+"-width"),10))),(n.offsetHeight-n.clientHeight>0||n.clientHeight>o.content.children(".k-scheduler-table").height())&&o.table.addClass("k-scrollbar-h")},_topSection:function(t,r,n){this.timesHeader=s(t.length,r,n);var o=t[t.length-1].length;return this.datesHeader=i(t,o,r),e("").append(this.timesHeader.add(this.datesHeader).wrap("").append(this.times.add(this.content).wrap("
").parent())},_bottomSection:function(t,r,n){return this.times=o(r,n),this.content=l(t[t.length-1],r[r.length-1]),e("
").parent())},_scroller:function(){var t,r=this;this.content.bind("scroll"+_,function(){r.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft),r.times.scrollTop(this.scrollTop)}),t=H.touchScroller(this.content,{avoidScrolling:function(t){return e(t.event.target).closest(".k-event.k-state-selected").length>0}}),t&&t.movable&&(this._touchScroller=t,this.content=t.scrollElement,t.movable.bind("change",function(e){r.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-e.sender.x),r.times.scrollTop(-e.sender.y)}))},_resourcesForGroups:function(){var e,t,r,n,s=[],i=this.options.group,o=this.options.resources;if(i=i&&i.resources?i.resources:[],o&&i.length)for(e=0,t=o.length;t>e;e++)for(r=0,n=i.length;n>r;r++)o[e].name===i[r]&&s.push(o[e]);this.groupedResources=s},_isGroupedByDate:function(){var t=this.options.group;return t=t&&t.resources?t.resources:[],e.inArray("date",t)>-1},_createColumnsLayout:function(e,t){if(this._isGroupedByDate()){for(var r=0,n=t.length;n>r;r++)t[r].columns=p("columns",e);return t}return p("columns",e,t)},_groupOrientation:function(){var e=this.options.group;return e&&e.resources?e.orientation:"horizontal"},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_createRowsLayout:function(e,t){return p("rows",e,t)},selectionByElement:function(){return null},clearSelection:function(){this.content.find(".k-state-selected").removeClass("k-state-selected")},select:function(){},destroy:function(){var e=this;k.fn.destroy.call(this),e.table&&(H.destroy(e.table),e.table.remove())}}),e.extend(b.SchedulerView,{createColumns:d,createRows:f,rangeIndex:h,collidingEvents:c,collidingHorizontallyEvents:a,groupEqFilter:v})}(window.kendo.jQuery)});