Type.registerNamespace("Telerik.Web.UI.Scheduler.Rendering"); (function(a,d){var e=d.Scheduler,f=e.Rendering,b=e.DateTime,c=Telerik.Web.StringBuilder,n=60000,m=n*60,l=m*24,h=7,k,g="yyyy-MM-dd"; f.RendererBase=function(o){this._model=o; this._owner=o._owner; this._ownerElement=this._owner.get_element(); this._resizableAllDays=false; this._shouldAddAllDayWraps=true; this._showAllDayInsertArea=false; this._isLightweight=this._owner.get_renderMode()===d.RenderMode.Lite; this._isClassic=this._owner.get_renderMode()===d.RenderMode.Classic; this._isMobile=this._owner.get_renderMode()===d.RenderMode.Mobile; k=this._isLightweight?2:4; }; f.RendererBase.prototype={refreshView:function(){this._activateView(); this._updateHeaders(); this._updateColumnHeaders(); this._updateViewTabs(); this._updateFooter(); this._updateShowFullTimeStatus(); this._updateTables(); },renderAppointment:function(o){var p=this._getAppointmentParts(o),q=this; o._domElements=[]; o._domElement=null; o._parts=p; a.each(p,function(){q._model.addToBlocks(this); q._addAllDayAppointmentPart(this,o); }); },removeAppointment:function(o){var q=this; var p=function(r){q._model.removeFromBlock(r); }; this._removeAppointment(o,p); },clearAppointments:function(p){var o=this._shouldAddAllDayWraps; this._shouldAddAllDayWraps=false; for(var r=0,q=p.get_count(); r"); if(!s){r.append("
").append("
").append("
"); }r.append("
").append(this._getRecurrenceIconHtml(o)).append(this._getReminderIconHtml(o)).append(o.get_subject()); if(!t.get_readOnlyResolved()){if(s){r.append("
").append(u?"":""); }else{r.append("
").append(u?"
":""); }}else{if(!s){r.append("
"); }}r.append(""); if(!s){r.append(""); }return r.toString(); },getWrapperHtml:function(){var o=[]; o[o.length]="
"; return o.join(""); },_removeAppointment:function(o,p){var q=this; if(!o._parts){return; }a.each(o._parts,function(){if(this.isAllDay&&q._shouldAddAllDayWraps){q._removeAllDayWraps(this); }if(this.element){var r=this.element.parentNode; if(r){r.removeChild(this.element); }}if(p){p(this); }}); a(o._domElements).each(function(s,r){a(r).remove(); }); o._domElements=[]; o._domElement="heyo"; },_activateView:function(){var r=this._getContentElement(); if(a(r).parent().is(".rsTopWrap")){return; }var o=a(this._ownerElement),q=o.find("div.rsHiddenViews"),t=a("div.rsTopWrap",o),s=a("div.rsContent",t),p=a("div.rsHeader, div.rsToolbar",t); if(p.length>0){p.after(r); }else{t.prepend(r); }q.append(s); },_updateHeaders:function(){var o=this._getHeaderDateText(); if(this._owner._renderMode===d.RenderMode.Lite){a(this._ownerElement).find(".rsCurrent").contents().each(function(p,q){if(q.nodeType===3){q.nodeValue=o; return false; }}); }else{a("div.rsTopWrap div.rsHeader h2, div.rsTopWrap div.rsToolbar .rsCurrent",this._ownerElement).text(o); }},_updateViewTabs:function(){var o=a(this._ownerElement); if(o.find("div.rsToolbar").length>0){var t=a(this._getViewTabElement()).text(); o.find("div.rsToolbar .rsViewToggle .rsText").text(t); return; }var v=o.find(".rsHeader ul li.rsSelected"); if(v.length==0){return; }var s=a(this._getViewTabElement()); if(s.is(".rsSelected")){return; }v.removeClass("rsSelected"); s.addClass("rsSelected"); if(this._isLightweight){return; }var p=a("em",v),q=a("a",s),r=q.find("span"),u=p[0].className; p[0].className=q[0].className; q[0].className=u; var w=p.text(); p.text(r.text()); r.text(w); v.append(q.clone()); s.append(p); q.remove(); },_getViewTabElement:function(){var o=a(this._ownerElement),p=this._getViewTabClassName(); if(o.find("div.rsToolbar").length>0){return o.find("div.rsToolbar ul ."+p)[0]; }return o.find(".rsHeader ul ."+p).parent()[0]; },_updateFooter:function(){a("div.rsFooter",this._ownerElement).css("display","none"); },_getHeaderDateFormat:function(){return this._model.get_headerDateFormat(); },_getFormattedDateText:function(o,q){var p=o.getDate(),r=o.getMonth()+1,s=o.getFullYear(); if(Sys.CultureInfo.CurrentCulture&&Sys.CultureInfo.CurrentCulture.name=="en-US"){switch(q){case"dd":return p; case"d":return String.format("{0}/{1}/{2}",r,p,s); }}return o.localeFormat(q); },_getClassName:function(o){var p=[],s=this,q=o.get_cssClass(); p.push("rsApt"); if(q){p.push(q); }o.get_resources().forEach(function(v){var u=o.get_owner(); s._addUniqueClassName(p,v.get_cssClass()); if(u){a.each(u.get_resourceStyles().getMatchingClasses(v),function(){s._addUniqueClassName(p,this); }); var w=u.get_resources().getResourceByTypeAndKey(v.get_type(),v.get_key()); if(w){s._addUniqueClassName(p,w.get_cssClass()); }}}); if(!this._isLightweight){var t=this._owner.get_appointmentStyleMode(),r=this._appointmentHasCustomColor(o); if(t==d.AppointmentStyleMode.Simple||(t==d.AppointmentStyleMode.Auto&&r)){p.push("rsAptSimple"); }if(t==d.AppointmentStyleMode.Default&&this._appointmentHasBackground(o)){p.push("rsAptColor"); }}else{if(this._appointmentHasBackground(o)){p.push("rsAptColor"); }}return p.join(" "); },_addUniqueClassName:function(o,p){if(p&&Array.indexOf(o,p)==-1){o.push(p); }},_getRecurrenceIconHtml:function(o){var q=o.get_recurrenceState(); var p=this._isClassic; if(q!=d.RecurrenceState.NotRecurring){if(q==d.RecurrenceState.Exception){return p?'
':''; }return p?'
':''; }return""; },_getReminderIconHtml:function(o){if(o.get_reminders&&o.get_reminders().get_count()>0){return this._isClassic?'
':''; }return""; },_getUniqueID:function(){return Math.abs((new Date()).getTime()^Math.floor(Math.random()*100000000)).toString(); },_removeStartResizeGrip:function(o){a(o).find(".rsAptResizeStart").remove(); },_removeEndResizeGrip:function(o){a(o).find(".rsAptResizeEnd").remove(); },_addArrow:function(o,r){var p; if(this._isLightweight){p=String.format('',r,r.toLowerCase()); a(o).append(p); return; }var q=a(o).find("div.rsAptIn"); p=String.format('{1}',r,r.toLowerCase()); q.append(p); q.addClass(String.format("rsWArrow{0}",r)); },_addAllDayWraps:function(s,r){var o=r.children(".rsWrap"),q=o.length,t=(s+1)-q; o.last().removeClass("rsLastSpacingWrapper"); for(var p=0; pr.end){this._removeEndResizeGrip(p); this._addArrow(p,"Right"); }q.append(p); this._addInsertArea(s,q,r); },_addToAppointmentElements:function(p,o){if(!o._domElement){o._domElement=p; }Array.add(o._domElements,p); },_addInsertArea:function(r,p,q){if(this._shouldAddAllDayWraps&&this._showAllDayInsertArea){var o=a(this.getWrapperHtml()); a(r.get_domElement()).append(o); o.addClass("rsLastSpacingWrapper"); p.removeClass("rsLastSpacingWrapper"); }},_createAllDayAppointmentElement:function(s,o){var q=b.subtract(s.end,s.start),t=(Math.ceil((q/l))*100),r=(parseInt(this._owner._rowHeight,10)-k)+"px",p=this._buildAptStyles(o); p.rsApt.push("width: ",t,"%;"); return a(this.getAppointmentHtml(o,this._resizableAllDays,r,p)); },_mergeAllDayParts:function(p){var o=[]; a.each(p,function(q){if(q==0){Array.add(o,this); return; }var r=o[o.length-1]; if(this.isAllDay&&r.isAllDay){r.end=this.end; }else{Array.add(o,this); }}); return o; },_removeAllDayWraps:function(v){var t=v.element.parentNode&&v.element.parentNode.parentNode; if(!t){return; }var s=a(t),u=s.parent().children().index(s),r=v.end-v.start,q=Math.ceil(r/l),o=s.parent().children().slice(u,u+q),w=v.rowIndex,p=o.children("div:nth-child("+(w+1)+")"); p.not(":only-child").remove(); },_clearAllDayWraps:function(){a(this._getContentElement()).find(".rsAllDayTable .rsWrap").not(".rsLastSpacingWrapper").remove(); },_getOffsetFromSlotStart:function(t,q){var r=t._durationInMinutes,s=t.get_startTime(),p=Math.round(b.subtract(q,s)/n),o=p%r; return o/r; },_buildAptStyles:function(o){var v=this._owner.get_appointmentStyleMode(),u=this._appointmentHasCustomColor(o),t=this._appointmentHasBorder(o),w={rsApt:[],rsAptContent:[],rsAptOut:[],rsAptIn:[],rsAptMid:[]},q=this._getEffectiveBackColor(o),s=this._getEffectiveBorderColor(o),p=q?["background-color:",q,";"].join(""):"",r=s?["border-color:",s,";"].join(""):""; if(this._isLightweight){w.rsAptContent.push(p); if(r){w.rsAptContent.push(r); }if(t){this._mapAppointmentStyles(o,w.rsAptContent,{"border-width":"_borderWidth","border-style":"_borderStyle"}); }return w; }if(v==d.AppointmentStyleMode.Default||(v==d.AppointmentStyleMode.Auto&&!u)){if(r||p){w.rsAptMid.push(p,r); w.rsAptIn.push(p,r); w.rsAptContent.push(p,r); }}else{w.rsApt.push(p); }if(t&&(v==d.AppointmentStyleMode.Simple||v==d.AppointmentStyleMode.Auto)){this._mapAppointmentStyles(o,w.rsApt,{"border-top-width":"_borderWidth","border-bottom-width":"_borderWidth","border-top-style":"_borderStyle","border-bottom-style":"_borderStyle"}); w.rsApt.push("border-top-color:",s,";"); w.rsApt.push("border-bottom-color:",s,";"); this._mapAppointmentStyles(o,w.rsAptOut,{"border-left-width":"_borderWidth","border-right-width":"_borderWidth","border-left-style":"_borderStyle","border-right-style":"_borderStyle"}); w.rsAptOut.push("border-left-color:",s,";"); w.rsAptOut.push("border-right-color:",s,";"); }return w; },_mapAppointmentStyles:function(o,q,p){a.each(p,function(s,r){var t=o[r]; if(t){q.push([s,": ",t,";"].join("")); }}); },_appointmentHasBorder:function(o){return this._getEffectiveBorderColor(o)||o.get_borderWidth(); },_appointmentHasBackground:function(o){return this._getEffectiveBackColor(o); },_getEffectiveBackColor:function(o){var p=""; if(o.get_backColor()){return o.get_backColor(); }o.get_resources().forEach(function(r){var q=o.get_owner(); if(q){p=p||q.get_resourceStyles().getMatchingBackColor(r); }}); return p; },_getEffectiveBorderColor:function(o){var p=""; if(o.get_borderColor()){return o.get_borderColor(); }o.get_resources().forEach(function(r){var q=o.get_owner(); if(q){p=p||q.get_resourceStyles().getMatchingBorderColor(r); }}); return p; },_appointmentHasCustomColor:function(o){return this._appointmentHasBackground(o)||this._appointmentHasBorder(o); },_updateColumnHeaders:function(){},_updateShowFullTimeStatus:function(){},_updateTables:function(){},_getAppointmentParts:function(o){},_getContentElement:function(){},_getHeaderDateText:function(){},_getViewTabClassName:function(){},_getViewSettings:function(){}}; f.RendererBase.registerClass("Telerik.Web.UI.Scheduler.Rendering.RendererBase"); f.WeekViewRenderer=function(o){f.WeekViewRenderer.initializeBase(this,[o]); this._showAllDayInsertArea=(this._getViewSettings().showAllDayInsertArea===false)?false:true; this._showInsertArea=(this._getViewSettings().showInsertArea===false)?false:true; this._owner.add_propertyChanged(Function.createDelegate(this,this._onSchedulerPropertyChanged)); }; f.WeekViewRenderer.prototype={renderAppointment:function(o){var p=this._getAppointmentParts(o); var q=this; o._domElements=[]; o._domElement=null; o._parts=p; a.each(p,function(){q._model.addToBlocks(this); if(this.isAllDay){q._addAllDayAppointmentPart(this,o); }else{q._addAppointmentPart(this,o); }}); if(!this._owner._batchRendering){this._recalcAppointmentsStyles(); }},refreshIndicatorState:function(){var o=this._model._settings; if(o&&o.hiddenAptsIndicator===false){return; }if(!this._owner.get_showFullTime()){this._updateIndicators(); }else{this._clearIndicators(); }},_updateFooter:function(){a("div.rsFooter",this._ownerElement).css("display",""); },_updateIndicators:function(){var p=this._owner,q=[],o=[]; this._getIndicators(q,o); p._updateHiddenAppointmentsIndicator(q,"top"); p._updateHiddenAppointmentsIndicator(o,"bottom"); },_getIndicators:function(p,o){this._model._getHiddenAppointmentIndicators(this._owner.get_appointments(),p,o,0); },_clearIndicators:function(){this._owner._removeIndicatorsTable("rsTopIndicator"); this._owner._removeIndicatorsTable("rsBottomIndicator"); },_updateShowFullTimeStatus:function(){var p=a("div.rsTopWrap table.rsContentTable",this._ownerElement)[0],o=p.rows.length,s=this._model.get_effectiveDayEndTime()-this._model.get_effectiveDayStartTime(),r=this._owner.get_minutesPerRow()*n,q=s/r; if(o!=q){if(this._owner.get_showFullTime()){this.showFullTime(); }else{this.showBusinessTime(); }}},_updateTables:function(){var q=this._ownerElement; var o=a(q).find("div.rsTopWrap table.rsContentTable"); var p=this._model.get_visibleRangeStart().getDay(); o.find("td").each(function(t,r){var s=((p+this.cellIndex)%7); a(this).toggleClass("rsSatCol",s==d.DayOfWeek.Saturday).toggleClass("rsSunCol",s==d.DayOfWeek.Sunday); }); },_getViewTabClassName:function(){return"rsHeaderWeek"; },showBusinessTime:function(){var q=this._ownerElement,o=a("div.rsTopWrap table.rsContentTable",q),p=a("div.rsTopWrap table.rsVerticalHeaderTable",q); this._removePrependedRows(o,p); this._removeAppendedRows(o,p); this._refreshRowHeaders(); this._refreshRows(); var r=this._owner.get_localization().Show24Hours; a("div.rsFooter .rsFullTime",q).contents().last().replaceWith(r); },_removeAppendedRows:function(q,r){var o=this._getNumberOfRowsToAppend(),p=a(q[0].rows),s=p.length-o-1; p.filter(":gt("+(s)+")").remove(); r.find("tr:gt("+(s)+")").remove(); },_removePrependedRows:function(p,q){var r=this._getNumberOfRowsToPrepend(),o=a(p[0].rows); o.filter(":lt("+(r)+")").remove(); q.find("tr:lt("+(r)+")").remove(); },showFullTime:function(){var q=this._ownerElement,o=a("div.rsTopWrap table.rsContentTable",q),p=a("div.rsTopWrap table.rsVerticalHeaderTable",q),r=this._owner.get_rowHeight(),t=o[0].rows[0].cells.length,s=this._owner.get_localization().ShowBusinessHours; this._addRows(o,p,r,t,true); this._addRows(o,p,r,t); this._refreshRowHeaders(); this._refreshRows(); a("div.rsFooter .rsFullTime",q).contents().last().replaceWith(s); if($telerik.isSafari){o.appendTo(o.parent()); p.appendTo(p.parent()); }},_refreshRows:function(){var o=a("div.rsTopWrap table.rsContentTable",this._ownerElement); var p=this._owner.get_timeLabelRowSpan(); if(this._owner._renderMode==d.RenderMode.Lite){this._setTableHeight(o); }o.find("tr").each(function(q){a(this).toggleClass("rsAlt",(q%p==p-1)); }); },_refreshRowHeaders:function(){var o=a("div.rsTopWrap table.rsVerticalHeaderTable",this._ownerElement); var q=this._owner.get_timeLabelRowSpan(); var p=this; if(this._owner._renderMode==d.RenderMode.Lite){this._setTableHeight(o); }o.find("tr").each(function(t){var r=a(this),s=(t%q==0)?p._getRowHeaderText(t):""; r.find("div").html(s); r.toggleClass("rsAlt",(t%q==q-1)); }); },_setTableHeight:function(r){var q=this._owner.get_rowHeight(); var p=r.find("tr").length; var s=p*parseFloat(q); var o=/[.,0-9]+/g; r.height(q.replace(o,s)); },_getRowHeaderText:function(q){var o=new Date(0); o.setHours(0); o.setMinutes(0); o=b.add(o,this._model.get_effectiveDayStartTime()); var r=this._owner.get_minutesPerRow()*n,p=b.add(o,r*q),s=this._owner.get_hoursPanelTimeFormat().replace("tt","''tt''"); return this._getFormattedDateText(p,s); },_onSchedulerPropertyChanged:function(p,o){if(o.get_propertyName()=="timeLabelRowSpan"){this._refreshRowHeaders(); this._refreshRows(); }},_addRows:function(p,r,z,B,x){var w=0; var v=0; var t=this._owner._renderMode===d.RenderMode.Lite; if(x){w=this._getNumberOfRowsToPrepend(); v=this._getNumberOfNonWorkRowsToPrepend(); }else{w=this._getNumberOfRowsToAppend(); v=this._getNumberOfNonWorkRowsToAppend(); }for(var s=0; s"); if(!t){y.css("height",z); }var q=y.clone(); var A=[]; A[A.length]="
"; A[A.length]="
"; if(x){q.prependTo(r); }else{q.appendTo(r); }q.append(A.join("")); for(var u=0; u=w-v){o[o.length]=' class="rsNonWorkHour"'; }o[o.length]=t?">":"> "; y.append(a(o.join(""))); }if(x){p.prepend(y); }else{p.append(y); }}},_getNumberOfRowsToAppend:function(){return Math.floor((l-this._model.get_dayEndTime())/(this._owner.get_minutesPerRow()*n)); },_getNumberOfRowsToPrepend:function(){return Math.floor(this._model.get_dayStartTime()/(this._owner.get_minutesPerRow()*n)); },_getNumberOfNonWorkRowsToAppend:function(){return Math.floor((l-this._model.get_workDayEndTime())/(this._owner.get_minutesPerRow()*n)); },_getNumberOfNonWorkRowsToPrepend:function(){return Math.floor(this._model.get_workDayStartTime()/(this._owner.get_minutesPerRow()*n)); },_getContentElement:function(){return a(".rsContent.rsWeekView:not(.rsMultiDayView)",this._ownerElement)[0]; },_getHeaderDateText:function(){var q=this._getHeaderDateFormat(),r=this._model.get_visibleRangeStart(),o=this._model.get_visibleRangeEnd(),s=this._getFormattedDateText(r,q),p; if(this._owner.get_showAllDayRow()||this._owner.get_showFullTime()||b.getTimeOfDay(o)===0){o=b.add(o,-l); }p=this._getFormattedDateText(o,q); return String.format("{0} - {1}",s,p); },_updateColumnHeaders:function(){var o=this._model.get_columnHeaderDateFormat(),p=this._model.get_visibleRangeStart(),q=a("div.rsTopWrap table.rsHorizontalHeaderTable",this._ownerElement); if(q.length>0){a.each(q[0].rows[0].cells,function(){a(this).html(""+p.localeFormat(o)+""); p=b.add(p,l); }); }},_recalcAppointmentsStyles:function(){var o=this; this._model._blockCollection.forEach(function(p){a(p.element).css({width:o._getWidthPercent(p)+"%",left:o._getLeftPercent(p)+"%"}); }); },_getAppointmentElementHeight:function(p){var r=this._owner,q=(p>0)?p/(r.get_minutesPerRow()*n):1,o; if(!this._model._settings.enableExactTimeRendering){q=Math.ceil(q); }o=(q*parseInt(r.get_rowHeight(),10))-k; return Math.round(o); },_addAppointmentPart:function(u,o){var v=u.start,t=u.end,s=b.subtract(t,v),w=this._model._getTimeSlotForAppointmentPart(u),x=a(w.get_domElement()),r=this._buildAptStyles(o),q,p; if(x.children().length==0){x.html("
"); }if(this._model._settings.enableExactTimeRendering){var y=this._getTopOffset(u); if(y>0){r.rsApt.push("top: ",y,"px;"); }}q=this._getAppointmentElementHeight(s)+"px"; p=a(this.getAppointmentHtml(o,true,q,r))[0]; u.element=p; Array.add(o._domElements,p); if(o.get_start()t){this._removeEndResizeGrip(p); this._addArrow(p,"Bottom"); }x.children()[0].appendChild(p); },_getTopOffset:function(o){var r=this._model._getTimeSlotForAppointmentPart(o),p=this._getOffsetFromSlotStart(r,o.start),q=parseInt(this._owner.get_rowHeight(),10),s=Math.round(p*q); return s; },_getLeftPercent:function(p){var o=p.column,q=this._owner.get_readOnly()||this._model._settings.readOnly||!this._showInsertArea; if(!o){return 0; }return o.get_left(q); },_getWidthPercent:function(p){var o=p.column,q=this._owner.get_readOnly()||this._model._settings.readOnly||!this._showInsertArea; if(!o){return 100; }return o.get_width(q); },_getAppointmentParts:function(o){var w=[],t=this._model,s=t._owner.get_showAllDayRow(),y=b.getDate(t.get_visibleRangeStart()); for(var q=0,u=t.get_numberOfDays(); qo.get_start())?w.start:o.get_start(),p=(w.end0){u+=x; }}if(u>0){r.rsApt.push("left: ",u,"%;"); }if(v>0){r.rsApt.push("margin-left: ",v,"px;"); }r.rsApt.push("width: ",y,";"); return a(this.getAppointmentHtml(o,this._resizableAllDays,t,r)); },_getLeftOffset:function(o){var q=this._model.getTimeSlotForAppointment(o),p=this._getOffsetFromSlotStart(q,o.get_start()); return p*100; },_updateColumnHeaders:function(){this._updateDateColumnHeaders(a("div.rsTopWrap table.rsHorizontalHeaderTable th",this._ownerElement)); },_updateDateColumnHeaders:function(p){var q=this._model,s=q._getSlotDuration(),o=q.get_visibleRangeStart(),t=q._getTimeLabelSpan(),r=this; p.each(function(){var u=r._getColumnHeaderText(o); a(this).text(u); o=new b(o).add(s*t).toDate(); }); },_getColumnHeaderText:function(o){return this._getFormattedDateText(o,this._model.get_columnHeaderDateFormat()); },_getContentElement:function(){return a(".rsContent.rsTimelineView",this._ownerElement)[0]; },_getViewTabClassName:function(){return"rsHeaderTimeline"; },_getHeaderDateText:function(){var r=this._model; var q=this._getHeaderDateFormat(); var u=r.get_visibleRangeStart(); var s=r.get_visibleRangeEnd(); var t=r._getSlotDuration(); var v=this._getFormattedDateText(u,q); var o; var p; if(b.areEqual(b.getDate(s),s)&&((t/l)%1)===0){o=b.add(s,-l); }else{o=b.add(s,-t); }p=this._getFormattedDateText(o,q); return String.format("{0} - {1}",v,p); },_removeAllDayWraps:function(r){var p=r.element.parentNode&&r.element.parentNode.parentNode; if(!p){return; }var o=a(p); var s=r.rowIndex; var q=o.children("div:nth-child("+(s+1)+")"); if(q.children().length===1){q.not(":only-child").remove(); }}}; f.TimelineViewRenderer.registerClass("Telerik.Web.UI.Scheduler.Rendering.TimelineViewRenderer",f.RendererBase); f.MonthViewRenderer=function(o){f.MonthViewRenderer.initializeBase(this,[o]); this._showAllDayInsertArea=(this._getViewSettings().showAllDayInsertArea===false)?false:true; this._weekLength=this._model.get_weekLength(); this._resizableAllDays=true; this._shouldAddAllDayWraps=false; this._contentElement=a(".rsContent.rsMonthView",this._ownerElement)[0]; this._contentTables=a("table tr td.rsContentWrapper table.rsContentTable",this._contentElement); this._dayAppoitnments={}; }; f.MonthViewRenderer.prototype={refreshView:function(){var p=this._model,r=b.subtract(p.get_visibleRangeEnd(),p.get_visibleRangeStart()),q=Math.ceil(r/l),s=Math.ceil(q/h),o; this._dayAppoitnments={}; o=a("table.rsContentTable:first tr",this._getContentElement()).length; if(os){this._removeContentRows(o-s); }}a("div.rsShowMore",this._contentElement).removeClass("rsShowMore").html(""); f.MonthViewRenderer.callBaseMethod(this,"refreshView"); if(p._initializeContentTables){p._initializeContentTables(); }a(this._contentElement).find(".rsTodayCell").removeClass("rsTodayCell"); p._addTodayCellClass(); },_getTargetWrapper:function(p,o){return f.MonthViewRenderer.callBaseMethod(this,"_getTargetWrapper",[p,o+1]); },_updateColumnHeaders:function(){var r=this,p=this._model.get_dayHeaderDateFormat(),q=this._model.get_firstDayHeaderDateFormat(),o=r._owner.get_selectedDate().getMonth(),s=r._model.get_visibleRangeStart(); a.each(this._contentTables,function(){var t=a("td div.rsDateWrap div.rsDateBox a",this),u=s,v=0,w=new Date(u.getTime()); t.each(function(){var z=b.subtract(u,s)==0&&u.getMonth()==o; var x; if(r._owner._renderMode==d.RenderMode.Mobile){x=u.getDate().toString(); }else{if(u.getDate()==1||z){x=u.localeFormat(q); }else{x=r._getFormattedDateText(u,p); }}this.href="#"+u.format(g); this.innerHTML=x; this.title=u.localeFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortDatePattern); var A=o!=u.getMonth(),y=this.parentNode.parentNode.parentNode; a(y).toggleClass("rsOtherMonth",A); if(v==r._weekLength-1){w=b.add(w,7*l); u=new Date(w.getTime()); v=0; }else{u=b.add(u,l); v++; }r._clearExtraWraps(y); }); }); },_getAppointmentParts:function(p){var A=[],y=this._model,v=7,E=this._weekLength,C=b.subtract(y.get_visibleRangeEnd(),y.get_visibleRangeStart())/l,x=y.get_visibleAppointmentsPerDay(),w=false; for(var D=0,z=C/v; Dx){this._renderShowMore(t); w=true; }else{this._ensureWraps(t,o+1); Array.add(F,{isAllDay:true,start:u,end:r,appointment:p}); }}}F=this._mergeAllDayParts(F); Array.addRange(A,F); }return A; },_unregisterAppointmentParts:function(o){var v=this._model; var u=7; var A=this._weekLength; var y=b.subtract(v.get_visibleRangeEnd(),v.get_visibleRangeStart())/l; for(var z=0,w=y/u; z"+p+""); o.removeClass("rsLastWrap").after(r); }},_ensureWraps:function(r,q){var s=r.get_domElement(),o=a("div.rsWrap",s).length,u=q-o,t; if(u<=0){return; }for(var p=0; p"); a("div.rsLastWrap",s).removeClass("rsLastWrap").after(t); t.addClass("rsLastWrap"); }},_clearExtraWraps:function(o){var q=4,r=a("div.rsWrap",o).length-q; if(r>0){for(var p=0; p"; }o[o.length]=""; }o[o.length]=""; }o[o.length]=""; return o.join(""); },_getContentElement:function(){return this._contentElement; },_getHeaderDateText:function(){var o=this._getHeaderDateFormat(),p=this._owner.get_selectedDate(); return p.localeFormat(o); },_getViewTabClassName:function(){return"rsHeaderMonth"; },_getViewSettings:function(){return this._owner.get_monthViewSettings(); }}; f.MonthViewRenderer.registerClass("Telerik.Web.UI.Scheduler.Rendering.MonthViewRenderer",f.RendererBase); f.YearViewRenderer=function(o){f.YearViewRenderer.initializeBase(this,[o]); }; f.YearViewRenderer.prototype={refreshView:function(){f.YearViewRenderer.callBaseMethod(this,"refreshView"); if(this._model._initializeContentElements){this._model._initializeContentElements(); }this._updateMonthHeaders(); this._updateContentTables(); this._updateTodayCell(); },renderAppointment:function(o){var p=this._getOccupiedSlots(o,this._model); a(p).each(function(){a(this.get_domElement()).addClass("rsOccupiedSlot"); }); o._visible=false; },clearAppointments:function(){a(this._getContentElement()).find(".rsYearMonthsWrap td.rsOccupiedSlot").removeClass("rsOccupiedSlot"); },removeAppointment:function(){},_updateMonthHeaders:function(){if(!this._model.get_showMonthHeaders()){return; }var o=this._model.get_visibleRangeStart(); a(this._getContentElement()).find(".rsYearMonthsWrap").each(function(){var p=o; a(this).find("table").each(function(){var q=a(this).find("tr .rsMonthHeader"); q.attr("href","#"+p.format(g)); p=new Date(p.getFullYear(),p.getMonth()+1,1); }); }); },_updateContentTables:function(){var q=this; var p=this._model.get_visibleRangeStart(); var o=this._owner.get_firstDayOfWeek(); var r=this._model.get_weekLength(); a(this._getContentElement()).find(".rsYearMonthsWrap").each(function(){var s=p; a(this).find("table").each(function(){var u=e.DateHelper.getStartOfWeek(s,o); var t=new Date(u.getTime()); a(this).find("td").each(function(v){var w=s.getMonth()!==t.getMonth(); a(this).html(w?"":q._getDateHeaderHtml(t)); a(this).toggleClass("rsOtherMonth",w); if((v+1)%r===0){u=b.add(u,7*l); t=new Date(u.getTime()); }else{t=b.add(t,l); }}); s=new Date(s.getFullYear(),s.getMonth()+1,1); }); }); },_updateTodayCell:function(){var o=this._model; var p=e.DateTime.getDate(new Date()); a(this._getContentElement()).find(".rsYearMonthsWrap td.rsTodayCell").removeClass("rsTodayCell"); if(p=o.get_visibleRangeEnd()){return; }this._addTodayCellClass(p); },_addTodayCellClass:function(o){var p=this._model._getTimeSlotFromStartTime(o); if(p){a(p.get_domElement()).addClass("rsTodayCell"); }},_getOccupiedSlots:function(o,p){var r=[]; var s=e.DateTime.getDate(o.get_start()); var q; while(s").append(this._getFormattedDateText(o,this._model.get_dayHeaderDateFormat())).append(""); return p.toString(); },_getContentElement:function(){return a(this._ownerElement).find(".rsContent.rsYearView")[0]; },_getHeaderDateText:function(){var o=this._getHeaderDateFormat(); var p=this._owner.get_selectedDate(); return p.localeFormat(o); },_getViewTabClassName:function(){return"rsHeaderYear"; }}; f.YearViewRenderer.registerClass("Telerik.Web.UI.Scheduler.Rendering.YearViewRenderer",f.RendererBase); f.AgendaViewRenderer=function(o){f.AgendaViewRenderer.initializeBase(this,[o]); }; f.AgendaViewRenderer.prototype={refreshView:function(){f.AgendaViewRenderer.callBaseMethod(this,"refreshView"); this._model.initialize(); this._initializeContentTables(); },_initializeContentTables:function(){var o=this._getContentTables(); o.each(function(){a(this).find("tbody").html(""); }); a(this._getContentElement()).find(".rsSubHeader").hide(); },renderAppointment:function(o){var p=this._getAppointmentParts(o),q=this; o._domElements=[]; o._domElement=null; o._parts=p; a.each(p,function(){q._addAppointmentPart(this,o); }); },removeAppointment:function(o){var p=this; if(!o._parts){return; }a.each(o._parts,function(){if(this.element){var q=a(this.element).parents("tr").first(); p._resolveHeaders(q); q.remove(); Array.remove(this.slot.get_domElements(),q[0]); }}); o._domElements=[]; o._domElement="booya"; },clearAppointments:function(o){for(var q=0,p=o.get_count(); q').append("
").append(this._getResourceMarkerIcon(o)).append(this._getRecurrenceIconHtml(o)).append(this._getReminderIconHtml(o)).append(o.get_subject()); if(!q.get_readOnlyResolved()){if(this._isLightweight){p.append("
"); }else{p.append(""); }}else{if(!this._isLightweight){p.append(""); }}p.append(""); return p.toString(); },_getAppointmentParts:function(o){return this._getModelAppointmentParts(o,this._model); },_getModelAppointmentParts:function(o,u){var v=[],x=u._timeSlots,r,q=o.get_start(),p=o.get_end(),y,w; for(var s=0,t=x.length; sw),isAllDay:(q<=y&&p>=w)}); }}return v; },_addAppointmentPart:function(q,o){var r=this._createAppointmentElement(o),p; q.element=r; this._addToAppointmentElements(r,o); p=this._createAppointmentRow(q,r); this._addToContentTable(q,p); this._model._addToSlots(q,p); },_createAppointmentElement:function(o){var p=this.getAppointmentHtml(o); return a(p)[0]; },_createAppointmentRow:function(p,o){var q=document.createElement("tr"); q.style.height=this._owner.get_rowHeight(); q.className="rsAgendaRow"; this._addRowContents(q,p,o); return q; },_addToContentTable:function(r,p){var q=this._model,s=q._getPrevRowForAppointmentPart(r),o; if(s){a(s).after(p); }else{o=this._getTableForAppointmentPart(r); if(q._isVertical&&this._getShowVerticalHeader()){o.prev().html(this._getVerticalHeaderHtml(r)).show(); }o.find("tbody").prepend(p); }},_addRowContents:function(q,p,o){this._addDateCell(q,p.slot); this._addTimeCell(q,p); this._addAppointmentCell(q,o); },_addDateCell:function(p,q){if(!this._model._getShowDateHeadersResolved()){return; }if(q.get_domElements().length>0){a(q.get_domElements()[0]).find("th").last()[0].rowSpan+=1; return; }var o=this._getDateCellHtml(q); a(p).append(o); },_addTimeCell:function(q,p){var o=this._getTimeCellHtml(p); a(q).append(o); },_addAppointmentCell:function(q,o){var p=document.createElement("td"); p.appendChild(o); a(q).append(p); },_getDateCellHtml:function(p){var q=p.get_startTime(),o=[]; o[o.length]=""; o[o.length]=q.getDate(); o[o.length]=""; o[o.length]=this._getFormattedDateText(q,"dddd"); o[o.length]=""; o[o.length]=this._getFormattedDateText(q,"MMMM, yyyy"); o[o.length]=""; return o.join(""); },_getTimeCellHtml:function(r){var q=[],s=this._getFormattedDateText(r.start,"t"),o=this._getFormattedDateText(r.end,"t"),p=this._getTimeCellFormatString(r); q[q.length]=""; q[q.length]=String.format(p,s,o); q[q.length]=""; return q.join(""); },_getTimeCellFormatString:function(p){var o=""; if(p.isAllDay){o+=p.startsEarlier?"» ":""; o+=this._owner.get_localization().AllDay; o+=p.endsLater?" »":""; return o; }else{if(p.startsEarlier){return"» {1}"; }else{if(p.endsLater){return"{0} »"; }}return"{0} - {1}"; }},_getResourceMarkerIcon:function(o){var r=this._getViewSettings().resourceMarkerType,q=o.get_resources().get_count()>0,p; if(r!==d.ResourceMarkerType.None&&q){p="rsResourceMarker "; p+=(r==d.ResourceMarkerType.Bar)?"rsMarkerBar":"rsMarkerBlock"; return""; }return""; },_getTableForAppointmentPart:function(o){var p=this._getTableIndex(o); return this._getContentTables().eq(p); },_getTableIndex:function(o){return this._model._isVertical?o.slot.get_index():0; },_getShowVerticalHeader:function(){return this._model._settings.showDateHeaders!==false; },_getVerticalHeaderHtml:function(o){return o.slot._startTime.format("dddd, MMM dd, yyyy"); },_getContentElement:function(){return a(".rsContent.rsAgendaView",this._ownerElement)[0]; },_getContentTables:function(){return a(this._getContentElement()).find("table.rsAgendaTable"); },_getViewTabClassName:function(){return"rsHeaderAgenda"; },_getViewSettings:function(){return this._owner.get_agendaViewSettings(); },_getHeaderDateText:function(){var r=this._model,q=this._getHeaderDateFormat(),s=r.get_visibleRangeStart(),t=this._getFormattedDateText(s,q),o=b.add(r.get_visibleRangeEnd(),-l),p=this._getFormattedDateText(o,q); return String.format("{0} - {1}",t,p); },_resolveHeaders:function(o){var p=this._model; if(p._getShowDateHeaders()){if(p._isVertical){this._resolveTableHeaders(o); }else{this._resolveHeaderByClassName(o,"rsAgendaDateHeader"); }}},_resolveHeaderByClassName:function(p,q){var r="th."+q,o=p.find(r); if(o.length===0){if(p.prevAll().find(r).last()[0]){p.prevAll().find(r).last()[0].rowSpan-=1; }}else{if(o[0].rowSpan>1){o[0].rowSpan-=1; p.next().prepend(o); }}},_resolveTableHeaders:function(o){if(o.siblings().length==0){o.parents(".rsAgendaTable").prev().hide(); }}}; f.AgendaViewRenderer.registerClass("Telerik.Web.UI.Scheduler.Rendering.AgendaViewRenderer",f.RendererBase); f.ResourceGroupedWeekViewRenderer=function(o){f.ResourceGroupedWeekViewRenderer.initializeBase(this,[o]); }; f.ResourceGroupedWeekViewRenderer.prototype={_getIndicators:function(p,o){i.call(this,p,o); },_getAppointmentParts:function(o){var p=f.ResourceGroupedWeekViewRenderer.getBaseMethod(this,"_getAppointmentParts"); var q=function(){return p.apply(this,arguments); }; return j.call(this,o,q); },_recalcAppointmentsStyles:function(){var o=this; a.each(this._model._weekModels,function(){this._blockCollection.forEach(function(p){a(p.element).css({width:o._getWidthPercent(p)+"%",left:o._getLeftPercent(p)+"%"}); }); }); },_updateShowFullTimeStatus:function(){if(!this._model._isVertical){f.ResourceGroupedWeekViewRenderer.callBaseMethod(this,"_updateShowFullTimeStatus",[]); }},_updateColumnHeaders:function(){if(this._model._isVertical){f.ResourceGroupedWeekViewRenderer.callBaseMethod(this,"_updateColumnHeaders",[]); return; }var o=this._model.get_columnHeaderDateFormat(),t=a("div.rsTopWrap table.rsHorizontalHeaderTable",this._ownerElement),u=this._model.get_numberOfDays(),v=this._model.get_visibleRangeStart(),p=v; if(t.length>0){var s=t[0].rows,q=s[s.length-1],r=0; a.each(q.cells,function(){var w=new c().append("").append(p.localeFormat(o)).append(""); this.innerHTML=w.toString(); p=b.add(p,l); if(r++==u-1){p=v; r=0; }}); }}}; f.ResourceGroupedWeekViewRenderer.registerClass("Telerik.Web.UI.Scheduler.Rendering.ResourceGroupedWeekViewRenderer",f.WeekViewRenderer); f.ResourceGroupedDayViewRenderer=function(o){f.ResourceGroupedDayViewRenderer.initializeBase(this,[o]); }; f.ResourceGroupedDayViewRenderer.prototype={_getIndicators:function(p,o){i.call(this,p,o); },_getAppointmentParts:function(o){var p=f.ResourceGroupedDayViewRenderer.getBaseMethod(this,"_getAppointmentParts"); var q=function(){return p.apply(this,arguments); }; return j.call(this,o,q); },_recalcAppointmentsStyles:function(){var o=this; a.each(this._model._weekModels,function(){this._blockCollection.forEach(function(p){a(p.element).css({width:o._getWidthPercent(p)+"%",left:o._getLeftPercent(p)+"%"}); }); }); },_updateShowFullTimeStatus:function(){if(!this._model._isVertical){f.ResourceGroupedDayViewRenderer.callBaseMethod(this,"_updateShowFullTimeStatus",[]); }}}; f.ResourceGroupedDayViewRenderer.registerClass("Telerik.Web.UI.Scheduler.Rendering.ResourceGroupedDayViewRenderer",f.DayViewRenderer); f.ResourceGroupedMultiDayViewRenderer=function(o){f.ResourceGroupedMultiDayViewRenderer.initializeBase(this,[o]); }; f.ResourceGroupedMultiDayViewRenderer.prototype={_getContentElement:function(){return a(".rsContent.rsMultiDayView",this._ownerElement)[0]; },_getViewTabClassName:function(){return"rsHeaderMultiDay"; },_getViewSettings:function(){return this._owner.get_multiDayViewSettings(); }}; f.ResourceGroupedMultiDayViewRenderer.registerClass("Telerik.Web.UI.Scheduler.Rendering.ResourceGroupedMultiDayViewRenderer",f.ResourceGroupedWeekViewRenderer); f.ResourceGroupedTimelineViewRenderer=function(o){f.ResourceGroupedTimelineViewRenderer.initializeBase(this,[o]); }; f.ResourceGroupedTimelineViewRenderer.prototype={renderAppointment:function(o){f.ResourceGroupedTimelineViewRenderer.callBaseMethod(this,"renderAppointment",[o]); if(this._model._isVertical){var p=a(o.get_element()).parents("tr:first")[0].rowIndex; this._updateRowHeaderHeight(p); }},_getAppointmentParts:function(o){var p=f.ResourceGroupedTimelineViewRenderer.getBaseMethod(this,"_getAppointmentParts"); var q=function(){return p.apply(this,arguments); }; return j.call(this,o,q); },removeAppointment:function(o){if(!o._parts){return; }var p=a(o.get_element()).parents("tr:first")[0]; f.ResourceGroupedTimelineViewRenderer.callBaseMethod(this,"removeAppointment",[o]); if(!p){return; }var q=p.rowIndex; if(this._model._isVertical){this._updateRowHeaderHeight(q); }},refreshView:function(){f.ResourceGroupedTimelineViewRenderer.callBaseMethod(this,"refreshView",[]); if(this._model._isVertical){for(var o=0; o=q)?s:q; s--; u.rows[t].cells[0].style.height=s+"px"; },_updateColumnHeaders:function(){if(this._model._isVertical){f.ResourceGroupedTimelineViewRenderer.callBaseMethod(this,"_updateColumnHeaders"); return; }var r=this._model._getNumberOfSlots(),o=a("div.rsTopWrap table.rsHorizontalHeaderTable tr:eq(1) th",this._ownerElement); for(var p=0,q=o.length; p