/* * Kendo UI v2011.3.1407 (http://kendoui.com) * Copyright 2012 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at http://kendoui.com/license. * If you do not own a commercial license, this file shall be governed by the * GNU General Public License (GPL) version 3. For GPL requirements, please * review: http://www.gnu.org/copyleft/gpl.html */ (function(a,b){var c=window.kendo,d=c.ui,e=c.support.touch,f=d.Widget,g=c.parseDate,h=c.keys,i=c.template,j="
",k="",l=e?"touchend":"click",m="open",n="close",o="change",p="navigate",q="dateView",r="disabled",s="k-state-default",t="k-state-focused",u="k-state-selected",v="k-state-disabled",w="k-state-hover",x="mouseenter mouseleave",y=e?"touchstart":"mousedown",z="min",A="max",B="month",C="first",D=c.calendar,E=D.viewsEnum,F=D.isInRange,G=D.restrictValue,H=a.proxy,I=Date,J,K=function(b){var c=this,e=document.body;J||(J=new d.Calendar(a(j).hide().appendTo(e))),c.calendar=J,c.options=b=b||{},c.popup=new d.Popup(a(j).addClass("k-calendar-container").appendTo(e),b),c._templates(),c.value(b.value)};K.prototype={_calendar:function(){var a=this,b=a.popup,c=a.options,d=a.calendar,e=d.element;e.data(q)!==a&&(e.appendTo(b.element).data(q,a).bind(l,H(a._click,a)).unbind(y).bind(y,c.clearBlurTimeout).show(),d.unbind(o).unbind(p).bind(p,H(a._navigate,a)).bind(o,c),d.month=a.month,d.options.depth=c.depth,d._today.html(a.footer(new I)),d.min(c.min),d.max(c.max),d.navigate(a._value,c.start),a.value(a._value))},open:function(){var a=this;a._calendar(),setTimeout(function(){a.popup.open()})},close:function(){this.popup.close()},min:function(a){this._option(z,a)},max:function(a){this._option(A,a)},toggle:function(){var a=this;a[a.popup.visible()?n:m]()},move:function(a){var b=this,c=b.options,d=c.min,e=c.max,f=new I(b._current),g=b.calendar,i=g._index,j=g._view,k=a.keyCode,l,m,n,o;if(k==h.ESC)b.close();else{a.altKey&&(k==h.DOWN?(b.open(),n=!0):k==h.UP&&(b.close(),n=!0));if(!b.popup.visible())return;if(a.ctrlKey)k==h.RIGHT?(g.navigateToFuture(),n=!0):k==h.LEFT?(g.navigateToPast(),n=!0):k==h.UP?(g.navigateUp(),n=!0):k==h.DOWN&&(b._navigateDown(),n=!0);else{k==h.RIGHT?(m=1,n=!0):k==h.LEFT?(m=-1,n=!0):k==h.UP?(m=i===0?-7:-4,n=!0):k==h.DOWN?(m=i===0?7:4,n=!0):k==h.ENTER?(b._navigateDown(),n=!0):k==h.HOME||k==h.END?(o=k==h.HOME?C:"last",f=j[o](f),n=!0):k==h.PAGEUP?(n=!0,g.navigateToPast()):k==h.PAGEDOWN&&(n=!0,g.navigateToFuture());if(m||o)o||j.setDate(f,m),b._current=f=G(f,c.min,c.max),g._focus(f)}n&&a.preventDefault()}},value:function(a){var b=this,c=b.calendar,d=b.options;b._value=a,b._current=new I(G(a,d.min,d.max)),c.element.data(q)===b&&(c._focus(b._current),c.value(a))},_click:function(a){a.currentTarget.className.indexOf(u)!==-1&&this.close()},_navigate:function(){var a=this,b=a.calendar;a._current=new I(b._current),b._focus(b._current)},_navigateDown:function(){var a=this,b=a.calendar,d=b._current,e=b._table.find("."+t),f=e.children(":"+C).attr(c.attr("value")).split("/");f=new I(f[0],f[1],f[2]);!e[0]||e.hasClass(u)?a.close():(b._view.setDate(d,f),b.navigateDown(d))},_option:function(a,b){var c=this,d=c.options,e=c.calendar;d[a]=b,e.element.data(q)===c&&e[a](b)},_templates:function(){var a=this,b=a.options,d=b.month||{},e=d.content,f=d.empty;a.month={content:i('