!function(e){if(void 0===window.hotkeys)throw"jsTree hotkeys: jQuery hotkeys plugin not included.";e.extend(e.tree.plugins,{hotkeys:{bound:[],disabled:!1,defaults:{hover_mode:!1,functions:{up:function(){return e.tree.plugins.hotkeys.get_prev.apply(this),!1},down:function(){return e.tree.plugins.hotkeys.get_next.apply(this),!1},left:function(){return e.tree.plugins.hotkeys.get_left.apply(this),!1},right:function(){return e.tree.plugins.hotkeys.get_right.apply(this),!1},f2:function(){return this.selected&&this.rename(),!1},del:function(){return this.selected&&this.remove(),!1},"ctrl+c":function(){return this.selected&&this.copy(),!1},"ctrl+x":function(){return this.selected&&this.cut(),!1},"ctrl+v":function(){return this.selected&&this.paste(),!1}}},exec:function(t){if(e.tree.plugins.hotkeys.disabled)return!1;var s=e.tree.focused();if(void 0!==s.settings.plugins.hotkeys){var n=e.extend(!0,{},e.tree.plugins.hotkeys.defaults,s.settings.plugins.hotkeys);return"function"==typeof n.functions[t]?n.functions[t].apply(s):void 0}},get_next:function(){var t=e.extend(!0,{},e.tree.plugins.hotkeys.defaults,this.settings.plugins.hotkeys),s=this.hovered||this.selected;return t.hover_mode?this.hover_branch(this.next(s)):this.select_branch(this.next(s))},get_prev:function(){var t=e.extend(!0,{},e.tree.plugins.hotkeys.defaults,this.settings.plugins.hotkeys),s=this.hovered||this.selected;return t.hover_mode?this.hover_branch(this.prev(s)):this.select_branch(this.prev(s))},get_left:function(){var t=e.extend(!0,{},e.tree.plugins.hotkeys.defaults,this.settings.plugins.hotkeys),s=this.hovered||this.selected;if(s){if(!s.hasClass("open"))return t.hover_mode?this.hover_branch(this.parent(s)):this.select_branch(this.parent(s));this.close_branch(s)}},get_right:function(){var t=e.extend(!0,{},e.tree.plugins.hotkeys.defaults,this.settings.plugins.hotkeys),s=this.hovered||this.selected;if(s){if(!s.hasClass("closed"))return t.hover_mode?this.hover_branch(s.find("li:eq(0)")):this.select_branch(s.find("li:eq(0)"));this.open_branch(s)}},callbacks:{oninit:function(t){var s=e.extend(!0,{},e.tree.plugins.hotkeys.defaults,this.settings.plugins.hotkeys);for(var n in s.functions)s.functions.hasOwnProperty(n)&&-1==e.inArray(n,e.tree.plugins.hotkeys.bound)&&(!function(t){e(document).bind("keydown",{combi:t,disableInInput:!0},function(s){return e.tree.plugins.hotkeys.exec(t)})}(n),e.tree.plugins.hotkeys.bound.push(n))}}}})}(jQuery);