{"size": 4325, "ext": "js", "max_stars_repo_path": "3.9compact/js/dojo/dojox/calendar/Keyboard.js", "max_stars_repo_name": "NextStand/arcgisdk", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "3.9compact/js/dojo/dojox/calendar/Keyboard.js", "max_issues_repo_name": "NextStand/arcgisdk", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "3.9compact/js/dojo/dojox/calendar/Keyboard.js", "max_forks_repo_name": "NextStand/arcgisdk", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 432.5, "max_line_length": 510, "alphanum_fraction": 0.7699421965}
//>>built
define("dojox/calendar/Keyboard","dojo/_base/array dojo/_base/lang dojo/_base/declare dojo/on dojo/_base/event dojo/keys".split(" "),function(m,l,n,p,k,h){return n("dojox.calendar.Keyboard",null,{keyboardUpDownUnit:"minute",keyboardUpDownSteps:15,keyboardLeftRightUnit:"day",keyboardLeftRightSteps:1,allDayKeyboardUpDownUnit:"day",allDayKeyboardUpDownSteps:7,allDayKeyboardLeftRightUnit:"day",allDayKeyboardLeftRightSteps:1,postCreate:function(){this.inherited(arguments);this._viewHandles.push(p(this.domNode,
"keydown",l.hitch(this,this._onKeyDown)))},resizeModifier:"ctrl",maxScrollAnimationDuration:1E3,tabIndex:"0",focusedItem:null,_isItemFocused:function(b){return null!=this.focusedItem&&this.focusedItem.id==b.id},_setFocusedItemAttr:function(b){if(b!=this.focusedItem){var a=this.focusedItem;this._set("focusedItem",b);this.updateRenderers([a,this.focusedItem],!0);this.onFocusChange({oldValue:a,newValue:b})}null!=b&&(null!=this.owner&&null!=this.owner.get("focusedItem")&&this.owner.set("focusedItem",
null),null!=this._secondarySheet&&null!=this._secondarySheet.set("focusedItem")&&this._secondarySheet.set("focusedItem",null))},onFocusChange:function(b){},showFocus:!1,_focusNextItem:function(b){if(!this.renderData||!this.renderData.items||0==this.renderData.items.length)return null;var a=-1,c=this.renderData.items,d=c.length-1,f=this.get("focusedItem");null==f?a=0<b?0:d:(m.some(c,l.hitch(this,function(b,c){var d=b.id==f.id;d&&(a=c);return d})),a=this._focusNextItemImpl(b,a,d));for(var g=!1,e=-1;e!=
a&&(!g||0!=a);){!g&&0==a&&(g=!0);e=c[a];if(null!=this.itemToRenderer[e.id]){this.set("focusedItem",e);break}e=a;a=this._focusNextItemImpl(b,a,d)}},_focusNextItemImpl:function(b,a,c){if(-1==a)a=0<b?0:c;else{if(0==a&&-1==b||a==c&&1==b)return a;a=0<b?++a:--a}return a},_handlePrevNextKeyCode:function(b,a){this.isLeftToRight()||(a=1==a?-1:1);this.showFocus=!0;this._focusNextItem(a);var c=this.get("focusedItem");!b.ctrlKey&&c&&this.set("selectedItem",c);c&&this.ensureVisibility(c.startTime,c.endTime,"both",
void 0,this.maxScrollAnimationDuration)},_keyboardItemEditing:function(b,a){k.stop(b);var c=this._edProps,d,f;c.editedItem.allDay||this.roundToDay||"label"==c.rendererKind?(d="up"==a||"down"==a?this.allDayKeyboardUpDownUnit:this.allDayKeyboardLeftRightUnit,f="up"==a||"down"==a?this.allDayKeyboardUpDownSteps:this.allDayKeyboardLeftRightSteps):(d="up"==a||"down"==a?this.keyboardUpDownUnit:this.keyboardLeftRightUnit,f="up"==a||"down"==a?this.keyboardUpDownSteps:this.keyboardLeftRightSteps);if("up"==
a||!this.isLeftToRight()&&"right"==a||this.isLeftToRight()&&"left"==a)f=-f;var g=b[this.resizeModifier+"Key"]?"resizeEnd":"move",e="resizeEnd"==g?c.editedItem.endTime:c.editedItem.startTime;d=this.renderData.dateModule.add(e,d,f);this._startItemEditingGesture([e],g,"keyboard",b);this._moveOrResizeItemGesture([d],"keyboard",b);this._endItemEditingGesture(g,"keyboard",b,!1);"move"==g?-1==this.renderData.dateModule.compare(d,e)?this.ensureVisibility(c.editedItem.startTime,c.editedItem.endTime,"start"):
this.ensureVisibility(c.editedItem.startTime,c.editedItem.endTime,"end"):this.ensureVisibility(c.editedItem.startTime,c.editedItem.endTime,"end")},_onKeyDown:function(b){var a=this.get("focusedItem");switch(b.keyCode){case h.ESCAPE:this._isEditing&&(this._editingGesture&&this._endItemEditingGesture("keyboard",b,!0),this._endItemEditing("keyboard",!0),this._edProps=null);break;case h.SPACE:k.stop(b);null!=a&&this.setItemSelected(a,b.ctrlKey?!this.isItemSelected(a):!0);break;case h.ENTER:k.stop(b);
if(null!=a)if(this._isEditing)this._endItemEditing("keyboard",!1);else if((b=this.itemToRenderer[a.id])&&0<b.length&&this.isItemEditable(a,b[0].kind))this._edProps={renderer:b[0],rendererKind:b[0].kind,tempEditedItem:a,liveLayout:this.liveLayout},this.set("selectedItem",a),this._startItemEditing(a,"keyboard");break;case h.LEFT_ARROW:k.stop(b);this._isEditing?this._keyboardItemEditing(b,"left"):this._handlePrevNextKeyCode(b,-1);break;case h.RIGHT_ARROW:k.stop(b);this._isEditing?this._keyboardItemEditing(b,
"right"):this._handlePrevNextKeyCode(b,1);break;case h.UP_ARROW:this._isEditing?this._keyboardItemEditing(b,"up"):this.scrollable&&this.scrollView(-1);break;case h.DOWN_ARROW:this._isEditing?this._keyboardItemEditing(b,"down"):this.scrollable&&this.scrollView(1)}}})});