sonarr-repo-only/NzbDrone.Web/Scripts/2010.2.825/telerik.calendar.min.js

1 line
15 KiB
JavaScript
Raw Normal View History

2010-10-02 19:01:43 +00:00
(function(c){var a=c.telerik;var b=/d{1,4}|M{1,4}|yy(?:yy)?|([Hhmstf])\1*|"[^"]*"|'[^']*'/g;c.extend(a,{calendar:function(e,f){this.element=e;c.extend(this,f);this.currentView=a.calendar.views[0];var d=new a.datetime();this.viewedMonth=a.datetime.firstDayOfMonth(this.selectedDate||(a.calendar.isInRange(d,this.minDate,this.maxDate)?d:this.minDate));c(".t-nav-next:not(.t-state-disabled)",e).live("click",c.proxy(this.navigateToFuture,this));c(".t-nav-prev:not(.t-state-disabled)",e).live("click",c.proxy(this.navigateToPast,this));c(".t-nav-fast:not(.t-state-disabled)",e).live("click",c.proxy(this.navigateUp,this));c(".t-link.t-state-disabled",e).live("click",a.preventDefault);c("td:not(.t-state-disabled):has(.t-link)",e).live("mouseenter",a.hover).live("mouseleave",a.leave).live("click",c.proxy(this.navigateDown,this));a.bind(this,{change:this.onChange,load:this.onLoad})}});c.extend(a.cultureInfo,{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbrDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],abbrMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longTime:"h:mm:ss tt",longDate:"dddd, MMMM dd, yyyy",shortDate:"M/d/yyyy",shortTime:"h:mm tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",generalDateShortTime:"M/d/yyyy h:mm tt",generalDateTime:"M/d/yyyy h:mm:ss tt",sortableDateTime:"yyyy'-'MM'-'ddTHH':'mm':'ss",universalSortableDateTime:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",monthYear:"MMMM, yyyy",monthDay:"MMMM dd",today:"today",tomorrow:"tomorrow",yesterday:"yesterday",next:"next",last:"last",year:"year",month:"month",week:"week",day:"day",am:"AM",pm:"PM",dateSeparator:"/",timeSeparator:":"});a.calendar.prototype={stopAnimation:false,updateSelection:function(){var h=new a.datetime();var f=a.datetime.firstDayOfMonth(this.viewedMonth);var e=new a.datetime(f.value).date(32).date(0);if(this.selectedDate===null||!a.calendar.isInRange(this.selectedDate,f,e)){this.goToView(0,a.datetime.firstDayOfMonth(this.selectedDate||(a.calendar.isInRange(h,this.minDate,this.maxDate)?h:this.minDate)))}var d=this;var g=c(".t-content td:not(.t-other-month)",this.element).removeClass("t-state-selected");if(this.selectedDate!==null){g.filter(function(){return(parseInt(c(this).text(),10)==d.selectedDate.date())}).addClass("t-state-selected")}},value:function(){if(arguments.length==0){return this.selectedDate===null?null:this.selectedDate.toDate()}if(arguments.length==1){this.selectedDate=arguments[0]===null?null:arguments[0].value?arguments[0]:new a.datetime(arguments[0])}else{if(arguments.length>1){this.selectedDate=new a.datetime(arguments[0],arguments[1],arguments[2])}}this.updateSelection();return this},overlay:function(d){if(!d){return c(".t-overlay",this.element).remove()}c("<div/>").addClass("t-overlay").css({opacity:0,width:this.element.offsetWidth,height:this.element.offsetHeight,position:"absolute",top:0,left:0,zIndex:3,backgroundColor:"#fff"}).appendTo(this.element)},goToView:function(d,e){if(d<0||a.calendar.views.length<=d){return}if(typeof e!="undefined"){this.viewedMonth=a.datetime.firstDayOfMonth(e)}this.currentView=a.calendar.views[d];c(".t-nav-prev",this.element).toggleClass("t-state-disabled",this.currentView.compare(e,this.minDate,false)<=0);c(".t-nav-next",this.element).toggleClass("t-state-disabled",this.currentView.compare(e,this.maxDate,true)>=0);c(".t-nav-fast",this.element).html(this.currentView.title(this.viewedMonth)).toggleClass("t-state-disabled",d==a.calendar.views.length-1);c(".t-content",this.element).html(this.currentView.body(this.viewedMonth,this.minDate,this.maxDate,this.selectedDate,this.urlFormat,this.dates)).toggleClass("t-meta-view",d==1||d==2);return this},navigateVertically:function(e,g,h,p){this.viewedMonth=a.datetime.firstDayOfMonth(g);this.currentView=a.calendar.views[e];this.overlay(true);var o=c(".t-content",this.element);var f=o.outerWidth();var m=o.outerHeight();var i=o.css("font-size");var q=o.css("line-height");if(q==="normal"){