function bindTreeEvent(n,t){var i=t||$("#tree_menu");i.unbind("tree.click").on("tree.click",function(t){var r=t.node;if($(".jqtree-selected").length>0&&$(".jqtree-selected").removeClass("jqtree-selected"),i.tree("toggle",r),r.type==="c")typeof n=="function"&&n(r);else{try{closeNextnode(i,r)}catch(u){}closePrenode(i,r)}})}function closeNextnode(n,t){var i=t.getNextSibling();i&&(n.tree("closeNode",i),closeNextnode(n,i))}function closePrenode(n,t){var i=t.getPreviousSibling();i&&(n.tree("closeNode",i),closePrenode(n,i))}(function e(n,t,i){function r(u,e){var s,h,o;if(!t[u]){if(!n[u]){if(s=typeof require=="function"&&require,!e&&s)return s(u,!0);if(f)return f(u,!0);h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h;}o=t[u]={exports:{}};n[u][0].call(o.exports,function(t){var i=n[u][1][t];return r(i?i:t)},o,o.exports,e,n,t,i)}return t[u].exports}for(var f=typeof require=="function"&&require,u=0;ui.right||t>i.bottom)return null;for(f=0,u=this.hit_areas.length;f>1,r=this.hit_areas[e],tr.bottom)f=e+1;else return r;return null},n.prototype.mustOpenFolderTimer=function(n){var t;return t=n.node,t.isFolder()&&!t.is_open&&n.position===i.INSIDE},n.prototype.updateDropHint=function(){var n;if(this.hovered_area)return this.removeDropHint(),n=this.tree_widget._getNodeElementForNode(this.hovered_area.node),this.previous_ghost=n.addDropHint(this.hovered_area.position)},n.prototype.startOpenFolderTimer=function(n){var t;return t=function(t){return function(){return t.tree_widget._openNode(n,t.tree_widget.options.slide,function(){return t.refresh(),t.updateDropHint()})}}(this),this.stopOpenFolderTimer(),this.open_folder_timer=setTimeout(t,this.tree_widget.options.openFolderDelay)},n.prototype.stopOpenFolderTimer=function(){if(this.open_folder_timer)return clearTimeout(this.open_folder_timer),this.open_folder_timer=null},n.prototype.moveItem=function(n){var u,e,t,r,o,f;if(this.hovered_area&&this.hovered_area.position!==i.NONE&&this.canMoveToArea(this.hovered_area)&&(t=this.current_item.node,f=this.hovered_area.node,r=this.hovered_area.position,o=t.parent,r===i.INSIDE&&(this.hovered_area.node.is_open=!0),u=function(n){return function(){return n.tree_widget.tree.moveNode(t,f,r),n.tree_widget.element.empty(),n.tree_widget._refreshElements()}}(this),e=this.tree_widget._triggerEvent("tree.move",{move_info:{moved_node:t,target_node:f,position:i.getName(r),previous_parent:o,do_move:u,original_event:n.original_event}}),!e.isDefaultPrevented()))return u()},n.prototype.getTreeDimensions=function(){var n;return n=this.tree_widget.element.offset(),{left:n.left,top:n.top,right:n.left+this.tree_widget.element.width(),bottom:n.top+this.tree_widget.element.height()+16}},n}();e=function(){function n(n){this.tree=n}return n.prototype.iterate=function(){var n,t;return t=!0,n=function(i){return function(r,u){var f,a,c,e,o,l,s,h;if(s=(r.is_open||!r.element)&&r.hasChildren(),r.element){if(f=$(r.element),!f.is(":visible"))return;t&&(i.handleFirstNode(r,f),t=!1);r.hasChildren()?r.is_open?i.handleOpenFolder(r,f)||(s=!1):i.handleClosedFolder(r,u,f):i.handleNode(r,u,f)}if(s){for(c=r.children.length,h=r.children,e=o=0,l=h.length;o'+n.name+"<\/span>");this.$element.css("position","absolute");r.append(this.$element)}return n.prototype.move=function(n,t){return this.$element.offset({left:n-this.offset_x,top:t-this.offset_y})},n.prototype.remove=function(){return this.$element.remove()},n}();t.exports=r},{"./node":5}],2:[function(n,t){var i,e,r,u,f;u=n("./node_element");e=u.NodeElement;f=n("./util");r=f.html_escape;i=function(){function n(n){this.tree_widget=n;this.opened_icon_element=this.createButtonElement(n.options.openedIcon);this.closed_icon_element=this.createButtonElement(n.options.closedIcon)}return n.prototype.render=function(n){return n&&n.parent?this.renderFromNode(n):this.renderFromRoot()},n.prototype.renderFromRoot=function(){var n;return n=this.tree_widget.element,n.empty(),this.createDomElements(n[0],this.tree_widget.tree.children,!0,!0)},n.prototype.renderFromNode=function(n){var i,t;return i=$(n.element),t=this.createLi(n),this.attachNodeData(n,t),i.after(t),i.remove(),n.children?this.createDomElements(t,n.children,!1,!1):void 0},n.prototype.createDomElements=function(n,t,i){var r,u,o,f,e;for(e=this.createUl(i),n.appendChild(e),u=0,o=t.length;u1))return t=n.originalEvent.changedTouches[0],this._handleMouseDown(n,this._getPositionInfo(t))},t.prototype._touchMove=function(n){var t;if(!(n.originalEvent.touches.length>1))return t=n.originalEvent.changedTouches[0],this._handleMouseMove(n,this._getPositionInfo(t))},t.prototype._touchEnd=function(n){var t;if(!(n.originalEvent.touches.length>1))return t=n.originalEvent.changedTouches[0],this._handleMouseUp(this._getPositionInfo(t))},t}(r);t.exports=i},{"./simple.widget":10}],5:[function(n,t){var r,i;i={getName:function(n){return i.strings[n-1]},nameToIndex:function(n){for(var t,u=t=1,r=i.strings.length;1<=r?t<=r:t>=r;u=1<=r?++t:--t)if(i.strings[u-1]===n)return u;return 0}};i.BEFORE=1;i.AFTER=2;i.INSIDE=3;i.NONE=4;i.strings=["before","after","inside","none"];r=function(){function n(t,i,r){i==null&&(i=!1);r==null&&(r=n);this.setData(t);this.children=[];this.parent=null;i&&(this.id_mapping={},this.tree=this,this.node_class=r)}return n.prototype.setData=function(n){var t,i;if(typeof n!="object")this.name=n;else for(t in n)i=n[t],t==="label"?this.name=i:this[t]=i;return null},n.prototype.initFromData=function(n){var t,i;return i=function(n){return function(i){return n.setData(i),i.children?t(i.children):void 0}}(this),t=function(n){return function(t){for(var u,r,i=0,f=t.length;i=0?this.parent.children[n]:null):null},n.prototype.getNextSibling=function(){var n;return this.parent?(n=this.parent.getChildIndex(this)+1,n<\/span>');t.append(this.$hint);this.$hint.css({width:i,height:t.outerHeight()-4})}return n.prototype.remove=function(){return this.$hint.remove()},n}();u=function(){function n(n,t,r){this.$element=t;this.node=n;this.$ghost=$('
  • <\/span><\/span><\/li>');r===i.AFTER?this.moveAfter():r===i.BEFORE?this.moveBefore():r===i.INSIDE&&(n.isFolder()&&n.is_open?this.moveInsideOpenFolder():this.moveInside())}return n.prototype.remove=function(){return this.$ghost.remove()},n.prototype.moveAfter=function(){return this.$element.after(this.$ghost)},n.prototype.moveBefore=function(){return this.$element.before(this.$ghost)},n.prototype.moveInsideOpenFolder=function(){return $(this.node.children[0].element).before(this.$ghost)},n.prototype.moveInside=function(){return this.$element.after(this.$ghost),this.$ghost.addClass("jqtree-inside")},n}();t.exports={FolderElement:e,NodeElement:f}},{"./node":5}],7:[function(n,t){var r,f,u,i;i=n("./util");f=i.indexOf;u=i.isInt;r=function(){function n(n){this.tree_widget=n}return n.prototype.saveState=function(){var n;return(n=JSON.stringify(this.getState()),this.tree_widget.options.onSetStateFromStorage)?this.tree_widget.options.onSetStateFromStorage(n):this.supportsLocalStorage()?localStorage.setItem(this.getCookieName(),n):$.cookie?($.cookie.raw=!0,$.cookie(this.getCookieName(),n,{path:"/"})):void 0},n.prototype.getStateFromStorage=function(){var n;return n=this._loadFromStorage(),n?this._parseState(n):null},n.prototype._parseState=function(n){var t;return t=$.parseJSON(n),t&&t.selected_node&&u(t.selected_node)&&(t.selected_node=[t.selected_node]),t},n.prototype._loadFromStorage=function(){return this.tree_widget.options.onGetStateFromStorage?this.tree_widget.options.onGetStateFromStorage():this.supportsLocalStorage()?localStorage.getItem(this.getCookieName()):$.cookie?($.cookie.raw=!0,$.cookie(this.getCookieName())):null},n.prototype.getState=function(){var n,t;return n=function(n){return function(){var t;return t=[],n.tree_widget.tree.iterate(function(n){return n.is_open&&n.id&&n.hasChildren()&&t.push(n.id),!0}),t}}(this),t=function(n){return function(){var t;return function(){var n,u,i,r;for(i=this.tree_widget.getSelectedNodes(),r=[],n=0,u=i.length;n=r},n}();t.exports=i},{}],9:[function(n,t){var i;i=function(){function n(n){this.tree_widget=n;this.clear()}return n.prototype.getSelectedNode=function(){var n;return n=this.getSelectedNodes(),n.length?n[0]:!1},n.prototype.getSelectedNodes=function(){var i,n,t;if(this.selected_single_node)return[this.selected_single_node];t=[];for(i in this.selected_nodes)n=this.tree_widget.getNodeById(i),n&&t.push(n);return t},n.prototype.getSelectedNodesUnder=function(n){var r,t,i;if(this.selected_single_node)return n.isParentOf(this.selected_single_node)?[this.selected_single_node]:[];i=[];for(r in this.selected_nodes)t=this.tree_widget.getNodeById(r),t&&n.isParentOf(t)&&i.push(t);return i},n.prototype.isNodeSelected=function(n){return n.id?this.selected_nodes[n.id]:this.selected_single_node?this.selected_single_node.element===n.element:!1},n.prototype.clear=function(){return this.selected_nodes={},this.selected_single_node=null},n.prototype.removeFromSelection=function(n,t){if(t==null&&(t=!1),n.id){if(delete this.selected_nodes[n.id],t)return n.iterate(function(t){return function(){return delete t.selected_nodes[n.id],!0}}(this))}else if(this.selected_single_node&&n.element===this.selected_single_node.element)return this.selected_single_node=null},n.prototype.addToSelection=function(n){return n.id?this.selected_nodes[n.id]=!0:this.selected_single_node=n},n}();t.exports=i},{}],10:[function(n,t){var i,r=[].slice;i=function(){function n(n,t){this.$el=$(n);this.options=$.extend({},this.defaults,t)}return n.prototype.defaults={},n.prototype.destroy=function(){return this._deinit()},n.prototype._init=function(){return null},n.prototype._deinit=function(){return null},n.register=function(t,i){var e,o,s,u,f;return u=function(){return"simple_widget_"+i},f=function(t,i){var r;return r=$.data(t,i),r&&r instanceof n?r:null},o=function(n,i){var e,r,h,o,c,s;for(e=u(),o=0,c=n.length;o/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};t.exports={_indexOf:i,html_escape:r,indexOf:u,isInt:f}},{}],13:[function(n,t){t.exports="1.0.0"},{}]},{},[11]);var TreeMenu=function(n){this.tree=n||[];this.groups={}};TreeMenu.prototype={init:function(n,t,i,r){return this.group(t),this.getDom(this.groups[n],i,r)},group:function(n){for(var t=0;t