/* * Kendo UI v2015.3.1111 (http://www.telerik.com/kendo-ui) * Copyright 2015 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define(["./kendo.dom.min","./kendo.touch.min","./kendo.draganddrop.min"],e)}(function(){return function(e){function t(e){return delete e.name,delete e.prefix,delete e.views,e}function n(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}function i(){var t=kendo._activeElement();"body"!==t.nodeName.toLowerCase()&&e(t).blur()}var o,r,s=kendo.ui.Widget,a=kendo.dom.element,l=kendo.dom.text,c=kendo.dom.html,h=e.isPlainObject,u=e.extend,d=e.proxy,f=kendo.support.browser,p=!1,g=kendo.keys,m=kendo.data.Query,v="string",_=".kendoGanttTimeline",w="click",y="dblclick",b="mousemove",x="mouseenter",k="mouseleave",C="keydown",S=".",T=kendo.template("#=kendo.toString(start, 't')#"),D=kendo.template("#=kendo.toString(start, 'ddd M/dd')#"),A=kendo.template("#=kendo.toString(start, 'ddd M/dd')# - #=kendo.toString(kendo.date.addDays(end, -1), 'ddd M/dd')#"),M=kendo.template("#=kendo.toString(start, 'MMM')#"),E=kendo.template("#=kendo.toString(start, 'yyyy')#"),P=kendo.template('
'),I=kendo.template('
#=messages.start#: #=kendo.toString(start, format)#
#=messages.end#: #=kendo.toString(end, format)#
'),R=kendo.template('
#=text#%
'),B=kendo.template('
#=task.title#
#=kendo.toString(task.percentComplete, "p0")#
'),z="
 
",L={day:{type:"kendo.ui.GanttDayView"},week:{type:"kendo.ui.GanttWeekView"},month:{type:"kendo.ui.GanttMonthView"},year:{type:"kendo.ui.GanttYearView"}},F={alt:"k-alt",reset:"k-reset",nonWorking:"k-nonwork-hour",header:"k-header",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",tasksWrapper:"k-gantt-tables",rowsTable:"k-gantt-rows",columnsTable:"k-gantt-columns",tasksTable:"k-gantt-tasks",dependenciesWrapper:"k-gantt-dependencies",resource:"k-resource",resourceAlt:"k-resource k-alt",task:"k-task",taskSingle:"k-task-single",taskMilestone:"k-task-milestone",taskSummary:"k-task-summary",taskWrap:"k-task-wrap",taskMilestoneWrap:"k-milestone-wrap",resourcesWrap:"k-resources-wrap",taskDot:"k-task-dot",taskDotStart:"k-task-start",taskDotEnd:"k-task-end",taskDragHandle:"k-task-draghandle",taskContent:"k-task-content",taskTemplate:"k-task-template",taskActions:"k-task-actions",taskDelete:"k-task-delete",taskComplete:"k-task-complete",taskDetails:"k-task-details",taskDetailsPercent:"k-task-pct",link:"k-link",icon:"k-icon",iconDelete:"k-si-close",taskResizeHandle:"k-resize-handle",taskResizeHandleWest:"k-resize-w",taskResizeHandleEast:"k-resize-e",taskSummaryProgress:"k-task-summary-progress",taskSummaryComplete:"k-task-summary-complete",line:"k-line",lineHorizontal:"k-line-h",lineVertical:"k-line-v",arrowWest:"k-arrow-w",arrowEast:"k-arrow-e",dragHint:"k-drag-hint",dependencyHint:"k-dependency-hint",tooltipWrapper:"k-widget k-tooltip k-popup k-group k-reset",tooltipContent:"k-tooltip-content",tooltipCallout:"k-callout k-callout-s",callout:"k-callout",marquee:"k-marquee k-gantt-marquee",marqueeColor:"k-marquee-color"},O=kendo.ui.GanttView=s.extend({init:function(e,t){s.fn.init.call(this,e,t),this.title=this.options.title||this.options.name,this.header=this.element.find(S+O.styles.gridHeader),this.content=this.element.find(S+O.styles.gridContent),this.contentWidth=this.content.width(),this._workDays=n(this.options),this._headerTree=t.headerTree,this._taskTree=t.taskTree,this._taskTemplate=t.taskTemplate?kendo.template(t.taskTemplate,u({},kendo.Template,t.templateSettings)):null,this._dependencyTree=t.dependencyTree,this._taskCoordinates={},this._currentTime()},destroy:function(){s.fn.destroy.call(this),clearTimeout(this._tooltipTimeout),this.headerRow=null,this.header=null,this.content=null,this._dragHint=null,this._resizeHint=null,this._resizeTooltip=null,this._taskTooltip=null,this._percentCompleteResizeTooltip=null,this._headerTree=null,this._taskTree=null,this._dependencyTree=null},options:{showWorkHours:!1,showWorkDays:!1,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,hourSpan:1,slotSize:100,currentTimeMarker:{updateInterval:1e4}},renderLayout:function(){this._slots=this._createSlots(),this._tableWidth=this._calculateTableWidth(),this.createLayout(this._layout()),this._slotDimensions(),this._adjustHeight(),this.content.find(S+O.styles.dependenciesWrapper).width(this._tableWidth)},_adjustHeight:function(){this.content.height(this.element.height()-this.header.outerHeight())},createLayout:function(e){var t=this._headers(e),n=this._colgroup(),i=this._headerTree,o=a("thead",null,t),r=a("table",{style:{width:this._tableWidth+"px"}},[n,o]);i.render([r]),this.headerRow=this.header.find("table:first tr").last()},_slotDimensions:function(){var e,t,n,i,o=this.headerRow[0].children,r=this._timeSlots();for(n=0,i=o.length;i>n;n++)t=o[n],e=r[n],e.offsetLeft=t.offsetLeft,e.offsetWidth=t.offsetWidth},render:function(e){var t,n,i=e.length,o=O.styles,r=this._rowsTable(i),s=this._columnsTable(i),a=this._tasksTable(e),l=this.options.currentTimeMarker,c=this.options.calculatedSize;this._taskTree.render([r,s,a]),t=this.content.find(S+o.rowsTable),c&&(n=c.row*e.length,this.content.find(S+o.tasksTable).height(n),t.height(n)),this._contentHeight=t.height(),this._rowHeight=c?c.row:this._contentHeight/t.find("tr").length,this.content.find(S+o.columnsTable).height(this._contentHeight),l!==!1&&void 0!==l.updateInterval&&this._renderCurrentTime()},_rowsTable:function(e){var t,n,i=[],o=O.styles,r=[null,{className:o.alt}];for(n=0;e>n;n++)t=a("tr",r[n%2],[a("td",null,[l(" ")])]),i.push(t);return this._createTable(1,i,{className:o.rowsTable})},_columnsTable:function(){var e,t,n,i,o,r=[],s=O.styles,c=this._timeSlots(),h=c.length,u=0;for(o=0;h>o;o++)t=c[o],i={},n=t.span,u+=n,1!==n&&(i.colspan=n),t.isNonWorking&&(i.className=s.nonWorking),r.push(a("td",i,[l(" ")]));return e=a("tr",null,r),this._createTable(u,[e],{className:s.columnsTable})},_tasksTable:function(e){var t,n,i,o,r,s,l,c,h=[],u=O.styles,d=this._taskCoordinates={},f=this._calculateMilestoneWidth(),g=Math.round(f.width),m=this.options.resourcesField,v=[u.resource,u.resourceAlt],_=this.options.calculatedSize,w=this._calculateResourcesMargin(),y=this._calculateTaskBorderWidth(),b=function(e){var t=i.left,n=t+i.width;o.isMilestone()&&(t-=g/2,n=t+g),d[o.id]={start:t,end:n,rowIndex:e}};for(l=0,c=e.length;c>l;l++)o=e[l],i=this._taskPosition(o),i.borderWidth=y,t=a("tr",null),n=a("td",null,[this._renderTask(e[l],i)]),o[m]&&o[m].length&&(r=p?this._tableWidth-i.left:Math.max(i.width||f.clientWidth,0)+i.left,s={width:this._tableWidth-(r+w)+"px"},s[p?"right":"left"]=r+"px",_&&(s.height=_.cell+"px"),n.children.push(a("div",{className:u.resourcesWrap,style:s},this._renderResources(o[m],v[l%2])))),t.children.push(n),h.push(t),b(l);return this._createTable(1,h,{className:O.styles.tasksTable})},_createTable:function(e,t,n){var i,o,r,s=[];for(r=0;e>r;r++)s.push(a("col"));return i=a("colgroup",null,s),o=a("tbody",null,t),n.style||(n.style={}),n.style.width=this._tableWidth+"px",a("table",n,[i,o])},_calculateTableWidth:function(){var e,t,n,i,o=this._timeSlots(),r=0,s=0;for(n=0,i=o.length;i>n;n++)e=o[n].span,s+=e,e>r&&(r=e);return t=Math.round(s*this.options.slotSize/r)},_calculateMilestoneWidth:function(){var t,n,i=O.styles.task+" "+O.styles.taskMilestone,o=e("