function _log(n){if(_canLog){var t=Array.prototype.slice.apply(arguments,[1]),i=new Date,r=i.getHours()+":"+i.getMinutes()+":"+i.getSeconds()+"."+i.getMilliseconds();t[0]=r+" - "+t[0];try{switch(n){case"info":window.console.info.apply(window.console,t);break;case"warn":window.console.warn.apply(window.console,t);break;default:window.console.log.apply(window.console,t)}}catch(u){window.console||(_canLog=!1)}}}function logMsg(){Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments)}var _canLog=!0,getDynaTreePersistData=null,DTNodeStatus_Error=-1,DTNodeStatus_Loading=1,DTNodeStatus_Ok=0;(function(n){function e(){}function s(t){var i=t.options.dnd||null;i&&(i.onDragStart||i.onDrop)&&o(),i&&i.onDragStart&&t.$tree.draggable({addClasses:!1,appendTo:"body",containment:!1,delay:0,distance:4,revert:!1,scroll:!0,scrollSpeed:7,scrollSensitivity:10,connectToDynatree:!0,helper:function(t){var i=n.ui.dynatree.getNode(t.target);return i?i.tree._onDragEvent("helper",i,null,t,null,null):"
<\/div>"},start:function(n,t){var i=t.helper.data("dtSourceNode");return!!i},_last:null}),i&&i.onDrop&&t.$tree.droppable({addClasses:!1,tolerance:"intersect",greedy:!1,_last:null})}var u={create:function(){return function(){this.initialize.apply(this,arguments)}}},i=u.create(),t,r,f,o;i.prototype={initialize:function(t,i,r){this.parent=t,this.tree=i,typeof r=="string"&&(r={title:r}),r.key===undefined&&(r.key="_"+i._nodeCount++),this.data=n.extend({},n.ui.dynatree.nodedatadefaults,r),this.li=null,this.span=null,this.ul=null,this.childList=null,this._isLoading=!1,this.hasSubSel=!1,this.bExpanded=!1,this.bSelected=!1},toString:function(){return"DynaTreeNode<"+this.data.key+">: '"+this.data.title+"'"},toDict:function(t,i){var r=n.extend({},this.data),u,f;if(r.activate=this.tree.activeNode===this,r.focus=this.tree.focusNode===this,r.expand=this.bExpanded,r.select=this.bSelected,i&&i(r),t&&this.childList)for(r.children=[],u=0,f=this.childList.length;u1&&(i+=r.tagConnector):i+=this.hasChildren()!==!1?r.tagExpander:r.tagConnector,t.checkbox&&n.hideCheckbox!==!0&&!n.isStatusNode&&(i+=r.tagCheckbox),n.icon?i+="":n.icon===!1?e():i+=r.tagNodeIcon,u="",t.onCustomRender&&(u=t.onCustomRender.call(f,this)||""),u||(o=n.tooltip?' title="'+n.tooltip.replace(/\"/g,""")+'"':"",h=n.href||"#",u=t.noLink||n.noLink?'"+n.title+"<\/span>":'"+n.title+"<\/a>"),i+u},_fixOrder:function(){var u=this.childList,t,n,f,i,r;if(u&&this.ul)for(t=this.ul.firstChild,n=0,f=u.length-1;n1?r.container+" "+r.noConnector:r.container),(this.bExpanded||i===!0)&&this.childList){for(h=0,a=this.childList.length;hr?1:-1},i.sort(n),t)for(r=0,u=i.length;r0?this.childList[0].focus():this.focus());break;case DTNodeStatus_Loading:this._isLoading=!0,n(this.span).addClass(this.tree.options.classNames.nodeLoading),this.parent||this._setStatusNode({title:this.tree.options.strings.loading+u,tooltip:r,addClass:this.tree.options.classNames.nodeWait});break;case DTNodeStatus_Error:this._isLoading=!1,this._setStatusNode({title:this.tree.options.strings.loadError+u,tooltip:r,addClass:this.tree.options.classNames.nodeError});break;default:throw"Bad LazyNodeStatus: '"+t+"'.";}},_parentList:function(n,t){for(var r=[],i=t?this:this.parent;i;)(n||i.parent)&&r.unshift(i),i=i.parent;return r},getLevel:function(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t},_getTypeForOuterNodeEvent:function(n){var r=this.tree.options.classNames,i=n.target,f,e,u,o;if(i.className.indexOf(r.node)<0)return null;for(f=n.pageX-i.offsetLeft,e=n.pageY-i.offsetTop,u=0,o=i.childNodes.length;u=s&&f<=s+c&&e>=h&&e<=h+l){if(t.className==r.title)return"title";if(t.className==r.expander)return"expander";if(t.className==r.checkbox)return"checkbox";if(t.className==r.nodeIcon)return"icon"}}return"prefix"},getEventTargetType:function(n){var t=n&&n.target?n.target.className:"",i=this.tree.options.classNames;return t===i.title?"title":t===i.expander?"expander":t===i.checkbox?"checkbox":t===i.nodeIcon?"icon":t===i.empty||t===i.vline||t===i.connector?"prefix":t.indexOf(i.node)>=0?this._getTypeForOuterNodeEvent(n):null},isVisible:function(){for(var t=this._parentList(!0,!1),n=0,i=t.length;na").focus()}catch(t){}},isFocused:function(){return this.tree.tnFocused===this},_activate:function(t,i){this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o",t,i,this);var r=this.tree.options;if(!this.data.isStatusNode&&(!i||!r.onQueryActivate||r.onQueryActivate.call(this.tree,t,this)!==!1))if(t){if(this.tree.activeNode){if(this.tree.activeNode===this)return;this.tree.activeNode.deactivate()}r.activeVisible&&this.makeVisible(),this.tree.activeNode=this,r.persist&&n.cookie(r.cookieId+"-active",this.data.key,r.cookie),this.tree.persistence.activeKey=this.data.key,n(this.span).addClass(r.classNames.active),i&&r.onActivate&&r.onActivate.call(this.tree,this)}else if(this.tree.activeNode===this){if(r.onQueryActivate&&r.onQueryActivate.call(this.tree,!1,this)===!1)return;n(this.span).removeClass(r.classNames.active),r.persist&&n.cookie(r.cookieId+"-active","",r.cookie),this.tree.persistence.activeKey=null,this.tree.activeNode=null,i&&r.onDeactivate&&r.onDeactivate.call(this.tree,this)}},activate:function(){this._activate(!0,!0)},activateSilently:function(){this._activate(!0,!1)},deactivate:function(){this._activate(!1,!0)},isActive:function(){return this.tree.activeNode===this},_userActivate:function(){var t=!0,n=!1;if(this.data.isFolder)switch(this.tree.options.clickFolderMode){case 2:t=!1,n=!0;break;case 3:t=n=!0}this.parent===null&&(n=!1),n&&(this.toggleExpand(),this.focus()),t&&this.activate()},_setSubSel:function(t){t?(this.hasSubSel=!0,n(this.span).addClass(this.tree.options.classNames.partsel)):(this.hasSubSel=!1,n(this.span).removeClass(this.tree.options.classNames.partsel))},_updatePartSelectionState:function(){var n,o,i;if(!this.hasChildren())return n=this.bSelected&&!this.data.unselectable&&!this.data.isStatusNode,this._setSubSel(!1),n;for(var u=this.childList,f=!0,e=!0,t=0,r=u.length;t=0;i--)if(t=r[i].getNextSibling(),t)break;t&&t.focus();break;default:u=!1}u&&n.preventDefault()},_onKeypress:function(){},_onFocus:function(t){var i=this.tree.options;t.type=="blur"||t.type=="focusout"?(i.onBlur&&i.onBlur.call(this.tree,this),this.tree.tnFocused&&n(this.tree.tnFocused.span).removeClass(i.classNames.focused),this.tree.tnFocused=null,i.persist&&n.cookie(i.cookieId+"-focus","",i.cookie)):(t.type=="focus"||t.type=="focusin")&&(this.tree.tnFocused&&this.tree.tnFocused!==this&&(this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o",this.tree.tnFocused),n(this.tree.tnFocused.span).removeClass(i.classNames.focused)),this.tree.tnFocused=this,i.onFocus&&i.onFocus.call(this.tree,this),n(this.tree.tnFocused.span).addClass(i.classNames.focused),i.persist&&n.cookie(i.cookieId+"-focus",this.data.key,i.cookie))},visit:function(n,t){var i=!0,r,u;if(t===!0&&(i=n(this),i===!1||i=="skip"))return i;if(this.childList)for(r=0,u=this.childList.length;r reloading %s...",this,n,r),s=this,r.reloadChildren(function(f,e){e?(i.logDebug("%s._loadKeyPath(%s) -> reloaded %s.",f,n,f),t.call(i,r,"loaded"),f._loadKeyPath(u.join(i.options.keyPathSeparator),t)):(i.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.",s,n),t.call(i,r,"error"))})):(t.call(i,r,"loaded"),r._loadKeyPath(u.join(i.options.keyPathSeparator),t));return}t.call(i,undefined,"notfound",f,u.length===0),i.logWarning("Node not found: "+f);return},resetLazy:function(){if(this.parent===null)throw"Use tree.reload() instead";else if(!this.data.isLazy)throw"node.resetLazy() requires lazy nodes.";this.expand(!1),this.removeChildren()},_addChildNode:function(t,i){var u=this.tree,f=u.options,r=u.persistence,o,s,e;if(t.parent=this,this.childList===null?this.childList=[]:i||this.childList.length>0&&n(this.childList[this.childList.length-1].span).removeClass(f.classNames.lastsib),i){if(o=n.inArray(i,this.childList),o<0)throw" must be a child of ";this.childList.splice(o,0,t)}else this.childList.push(t);if(s=u.isInitializing(),f.persist&&r.cookiesFound&&s?(r.activeKey===t.data.key&&(u.activeNode=t),r.focusedKey===t.data.key&&(u.focusNode=t),t.bExpanded=n.inArray(t.data.key,r.expandedKeyList)>=0,t.bSelected=n.inArray(t.data.key,r.selectedKeyList)>=0):(t.data.activate&&(u.activeNode=t,f.persist&&(r.activeKey=t.data.key)),t.data.focus&&(u.focusNode=t,f.persist&&(r.focusedKey=t.data.key)),t.bExpanded=t.data.expand===!0,t.bExpanded&&f.persist&&r.addExpand(t.data.key),t.bSelected=t.data.select===!0,t.bSelected&&f.persist&&r.addSelect(t.data.key)),f.minExpandLevel>=t.getLevel()&&(this.bExpanded=!0),t.bSelected&&f.selectMode==3)for(e=this;e;)e.hasSubSel||e._setSubSel(!0),e=e.parent;return u.bEnableUpdate&&this.render(),t},addChild:function(n,t){var o,r,u,s,f,e;if(typeof n=="string")throw"Invalid data type for "+n;else if(n&&n.length!==0){if(n instanceof i)return this._addChildNode(n,t)}else return;for(n.length||(n=[n]),o=this.tree.enableUpdate(!1),r=null,u=0,s=n.length;u=0&&(this.expandedKeyList.splice(i,1),n.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},addSelect:function(t){n.inArray(t,this.selectedKeyList)<0&&(this.selectedKeyList.push(t),n.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},clearSelect:function(t){var i=n.inArray(t,this.selectedKeyList);i>=0&&(this.selectedKeyList.splice(i,1),n.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},isReloading:function(){return this.cookiesFound===!0},toDict:function(){return{cookiesFound:this.cookiesFound,activeKey:this.activeKey,focusedKey:this.activeKey,expandedKeyList:this.expandedKeyList,selectedKeyList:this.selectedKeyList}},lastentry:undefined},r=u.create(),r.version="$Version: 1.2.1$",r.prototype={initialize:function(n){this.phase="init",this.$widget=n,this.options=n.options,this.$tree=n.element,this.timer=null,this.divTree=this.$tree.get(0),s(this)},_load:function(r){var l=this.$widget,u=this.options,s=this,e;this.bEnableUpdate=!0,this._nodeCount=1,this.activeNode=null,this.focusNode=null,u.rootVisible!==undefined&&this.logWarning("Option 'rootVisible' is no longer supported."),u.minExpandLevel<1&&(this.logWarning("Option 'minExpandLevel' must be >= 1."),u.minExpandLevel=1),u.classNames!==n.ui.dynatree.prototype.options.classNames&&(u.classNames=n.extend({},n.ui.dynatree.prototype.options.classNames,u.classNames)),u.ajaxDefaults!==n.ui.dynatree.prototype.options.ajaxDefaults&&(u.ajaxDefaults=n.extend({},n.ui.dynatree.prototype.options.ajaxDefaults,u.ajaxDefaults)),u.dnd!==n.ui.dynatree.prototype.options.dnd&&(u.dnd=n.extend({},n.ui.dynatree.prototype.options.dnd,u.dnd)),u.imagePath||n("script").each(function(){if(this.src.search(/.*dynatree[^\/]*\.js$/i)>=0)return u.imagePath=this.src.indexOf("/")>=0?this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/":"skin/",s.logDebug("Guessing imagePath from '%s': '%s'",this.src,u.imagePath),!1}),this.persistence=new t(u.cookieId,u.cookie),u.persist&&(n.cookie||_log("warn","Please include jquery.cookie.js to use persistence."),this.persistence.read()),this.logDebug("DynaTree.persistence: %o",this.persistence.toDict()),this.cache={tagEmpty:"<\/span>",tagVline:"<\/span>",tagExpander:"<\/span>",tagConnector:"<\/span>",tagNodeIcon:"<\/span>",tagCheckbox:"<\/span>",lastentry:undefined},(u.children||u.initAjax&&u.initAjax.url||u.initId)&&n(this.divTree).empty(),e=this.$tree.find(">ul:first").hide(),this.tnRoot=new i(null,this,{}),this.tnRoot.bExpanded=!0,this.tnRoot.render(),this.divTree.appendChild(this.tnRoot.ul);var f=this.tnRoot,h=u.persist&&this.persistence.isReloading(),o=!1,c=this.enableUpdate(!1);this.logDebug("Dynatree._load(): read tree structure..."),u.children?f.addChild(u.children):u.initAjax&&u.initAjax.url?(o=!0,f.data.isLazy=!0,this._reloadAjax(r)):u.initId?this._createFromTag(f,n("#"+u.initId)):(this._createFromTag(f,e),e.remove()),this._checkConsistency(),o||u.selectMode!=3||f._updatePartSelectionState(),this.logDebug("Dynatree._load(): render nodes..."),this.enableUpdate(c),this.logDebug("Dynatree._load(): bind events..."),this.$widget.bind(),this.logDebug("Dynatree._load(): postInit..."),this.phase="postInit",u.persist&&this.persistence.write(),this.focusNode&&this.focusNode.isVisible()&&(this.logDebug("Focus on init: %o",this.focusNode),this.focusNode.focus()),o||(u.onPostInit&&u.onPostInit.call(this,h,!1),r&&r.call(this,"ok")),this.phase="idle"},_reloadAjax:function(t){var r=this.options,u,i,f;if(!r.initAjax||!r.initAjax.url)throw"tree.reload() requires 'initAjax' mode.";u=this.persistence,i=n.extend({},r.initAjax),i.addActiveKey&&(i.data.activeKey=u.activeKey),i.addFocusedKey&&(i.data.focusedKey=u.focusedKey),i.addExpandedKeyList&&(i.data.expandedKeyList=u.expandedKeyList.join(",")),i.addSelectedKeyList&&(i.data.selectedKeyList=u.selectedKeyList.join(",")),i.success&&this.logWarning("initAjax: success callback is ignored; use onPostInit instead."),i.error&&this.logWarning("initAjax: error callback is ignored; use onPostInit instead."),f=u.isReloading(),i.success=function(n){r.selectMode==3&&n.tree.tnRoot._updatePartSelectionState(),r.onPostInit&&r.onPostInit.call(n.tree,f,!1),t&&t.call(n.tree,"ok")},i.error=function(n,i,u,e){r.onPostInit&&r.onPostInit.call(n.tree,f,!0,i,u,e),t&&t.call(n.tree,"error",i,u,e)},this.logDebug("Dynatree._init(): send Ajax request..."),this.tnRoot.appendAjax(i)},toString:function(){return"Dynatree '"+this.$tree.attr("id")+"'"},toDict:function(){return this.tnRoot.toDict(!0)},serializeArray:function(n){for(var i=this.getSelectedNodes(n),f=this.$tree.attr("name")||this.$tree.attr("id"),r=[],t=0,u=i.length;t=2&&(Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments))},logInfo:function(){this.options.debugLevel>=1&&(Array.prototype.unshift.apply(arguments,["info"]),_log.apply(this,arguments))},logWarning:function(){Array.prototype.unshift.apply(arguments,["warn"]),_log.apply(this,arguments)},isInitializing:function(){return this.phase=="init"||this.phase=="postInit"},isReloading:function(){return(this.phase=="init"||this.phase=="postInit")&&this.options.persist&&this.persistence.cookiesFound},isUserEvent:function(){return this.phase=="userEvent"},redraw:function(){this.tnRoot.render(!1,!1)},renderInvisibleNodes:function(){this.tnRoot.render(!1,!0)},reload:function(n){this._load(n)},getRoot:function(){return this.tnRoot},enable:function(){this.$widget.enable()},disable:function(){this.$widget.disable()},getNodeByKey:function(n){var t=document.getElementById(this.options.idPrefix+n),i;return t?t.dtnode?t.dtnode:null:(i=null,this.visit(function(t){if(t.data.key==n)return i=t,!1},!0),i)},getActiveNode:function(){return this.activeNode},reactivate:function(n){var t=this.activeNode;t&&(this.activeNode=null,t.activate(),n&&t.focus())},getSelectedNodes:function(n){var t=[];return this.tnRoot.visit(function(i){if(i.bSelected&&(t.push(i),n===!0))return"skip"}),t},activateKey:function(n){var t=n===null?null:this.getNodeByKey(n);return t?(t.focus(),t.activate(),t):(this.activeNode&&this.activeNode.deactivate(),this.activeNode=null,null)},loadKeyPath:function(n,t){var i=n.split(this.options.keyPathSeparator);return i[0]===""&&i.shift(),i[0]==this.tnRoot.data.key&&(this.logDebug("Removed leading root key."),i.shift()),n=i.join(this.options.keyPathSeparator),this.tnRoot._loadKeyPath(n,t)},selectKey:function(n,t){var i=this.getNodeByKey(n);return i?(i.select(t),i):null},enableUpdate:function(n){return this.bEnableUpdate==n?n:(this.bEnableUpdate=n,n&&this.redraw(),!n)},count:function(){return this.tnRoot.countChildren()},visit:function(n,t){return this.tnRoot.visit(n,t)},_createFromTag:function(t,i){var r=this;i.find(">li").each(function(){var $li=n(this),$liSpan=$li.find(">span:first"),$liA=$li.find(">a:first"),title,href=null,target=null,tooltip,iPos,data,dataAttr,childNode,$ul;if($liSpan.length?title=$liSpan.html():$liA.length?(title=$liA.html(),href=$liA.attr("href"),target=$liA.attr("target"),tooltip=$liA.attr("title")):(title=$li.html(),iPos=title.search(/
    =0?n.trim(title.substring(0,iPos)):n.trim(title)),data={title:title,tooltip:tooltip,isFolder:$li.hasClass("folder"),isLazy:$li.hasClass("lazy"),expand:$li.hasClass("expanded"),select:$li.hasClass("selected"),activate:$li.hasClass("active"),focus:$li.hasClass("focused"),noLink:$li.hasClass("noLink")},href&&(data.href=href,data.target=target),$li.attr("title")&&(data.tooltip=$li.attr("title")),$li.attr("id")&&(data.key=$li.attr("id")),$li.attr("data")&&(dataAttr=n.trim($li.attr("data")),dataAttr)){dataAttr.charAt(0)!="{"&&(dataAttr="{"+dataAttr+"}");try{n.extend(data,eval("("+dataAttr+")"))}catch(e){throw"Error parsing node data: "+e+"\ndata:\n'"+dataAttr+"'";}}childNode=t.addChild(data),$ul=$li.find(">ul:first"),$ul.length&&r._createFromTag(childNode,$ul)})},_checkConsistency:function(){},_setDndStatus:function(t,i,r,u,f){var o=t?n(t.span):null,e=n(i.span),s;if(this.$dndMarker||(this.$dndMarker=n("
    <\/div>").hide().prependTo(n(this.divTree).parent())),u==="after"||u==="before"||u==="over"){s=e.offset();switch(u){case"before":this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-before"),s.top-=8;break;case"after":this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-after"),s.top+=8;break;default:this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before"),this.$dndMarker.addClass("dynatree-drop-over"),e.addClass("dynatree-drop-target"),s.left+=8}this.$dndMarker.css({left:s.left,top:s.top,"z-index":1e3}).show()}else e.removeClass("dynatree-drop-target"),this.$dndMarker.hide();u==="after"?e.addClass("dynatree-drop-after"):e.removeClass("dynatree-drop-after"),u==="before"?e.addClass("dynatree-drop-before"):e.removeClass("dynatree-drop-before"),f===!0?(o&&o.addClass("dynatree-drop-accept"),e.addClass("dynatree-drop-accept"),r.addClass("dynatree-drop-accept")):(o&&o.removeClass("dynatree-drop-accept"),e.removeClass("dynatree-drop-accept"),r.removeClass("dynatree-drop-accept")),f===!1?(o&&o.addClass("dynatree-drop-reject"),e.addClass("dynatree-drop-reject"),r.addClass("dynatree-drop-reject")):(o&&o.removeClass("dynatree-drop-reject"),e.removeClass("dynatree-drop-reject"),r.removeClass("dynatree-drop-reject"))},_onDragEvent:function(t,i,r,u,f,e){var b=this.options,h=this.options.dnd,o=null,l=n(i.span),s,c,a,w;switch(t){case"helper":a=n("
    <\/div>").append(n(u.target).closest("a").clone()),n("ul.dynatree-container",i.tree.divTree).append(a),a.data("dtSourceNode",i),o=a;break;case"start":i.isStatusNode()?o=!1:h.onDragStart&&(o=h.onDragStart(i)),o===!1?(this.logDebug("tree.onDragStart() cancelled"),f.helper.trigger("mouseup"),f.helper.hide()):l.addClass("dynatree-drag-source");break;case"enter":o=h.onDragEnter?h.onDragEnter(i,r):null,o={over:o!==!1&&(o===!0||o==="over"||n.inArray("over",o)>=0),before:o!==!1&&(o===!0||o==="before"||n.inArray("before",o)>=0),after:o!==!1&&(o===!0||o==="after"||n.inArray("after",o)>=0)},f.helper.data("enterResponse",o);break;case"over":if(c=f.helper.data("enterResponse"),s=null,c===!1)break;else if(typeof c=="string")s=c;else{var y=l.offset(),p={x:u.pageX-y.left,y:u.pageY-y.top},v={x:p.x/l.width(),y:p.y/l.height()};c.after&&v.y>.75?s="after":!c.over&&c.after&&v.y>.5?s="after":c.before&&v.y<=.25?s="before":!c.over&&c.before&&v.y<=.5?s="before":c.over&&(s="over"),h.preventVoidMoves&&(i===r?s=null:s==="before"&&r&&i===r.getNextSibling()?s=null:s==="after"&&r&&i===r.getPrevSibling()?s=null:s==="over"&&r&&r.parent===i&&r.isLastSibling()&&(s=null)),f.helper.data("hitMode",s)}s==="over"&&h.autoExpandMS&&i.hasChildren()!==!1&&!i.bExpanded&&i.scheduleAction("expand",h.autoExpandMS),s&&h.onDragOver&&(o=h.onDragOver(i,r,s)),this._setDndStatus(r,i,f.helper,s,o!==!1);break;case"drop":if(w=f.helper.hasClass("dynatree-drop-reject"),s=f.helper.data("hitMode"),s&&h.onDrop&&!w)h.onDrop(i,r,s,f,e);break;case"leave":if(i.scheduleAction("cancel"),f.helper.data("enterResponse",null),f.helper.data("hitMode",null),this._setDndStatus(r,i,f.helper,"out",undefined),h.onDragLeave)h.onDragLeave(i,r);break;case"stop":if(l.removeClass("dynatree-drag-source"),h.onDragStop)h.onDragStop(i);break;default:throw"Unsupported drag event: "+t;}return o},cancelDrag:function(){var t=n.ui.ddmanager.current;t&&t.cancel()},lastentry:undefined},n.widget("ui.dynatree",{_init:function(){if(parseFloat(n.ui.version)<1.8)return this.options.debugLevel>=0&&_log("warn","ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."),this._create();this.options.debugLevel>=2&&_log("debug","ui.dynatree._init() was called; no current default functionality.")},_create:function(){var t=this.options,i;t.debugLevel>=1&&logMsg("Dynatree._create(): version='%s', debugLevel=%o.",n.ui.dynatree.version,this.options.debugLevel),this.options.event+=".dynatree",i=this.element.get(0),this.tree=new r(this),this.tree._load(),this.tree.logDebug("Dynatree._init(): done.")},bind:function(){function r(t){t=n.event.fix(t||window.event);var i=n.ui.dynatree.getNode(t.target);return i?i._onFocus(t):!1}var i,t;this.unbind(),i="click.dynatree dblclick.dynatree",this.options.keyboard&&(i+=" keypress.dynatree keydown.dynatree"),this.element.bind(i,function(t){var i=n.ui.dynatree.getNode(t.target),r,u,f,o;if(!i)return!0;r=i.tree,u=r.options,r.logDebug("event(%s): dtnode: %s",t.type,i),f=r.phase,r.phase="userEvent";try{switch(t.type){case"click":return u.onClick&&u.onClick.call(r,i,t)===!1?!1:i._onClick(t);case"dblclick":return u.onDblClick&&u.onDblClick.call(r,i,t)===!1?!1:i._onDblClick(t);case"keydown":return u.onKeydown&&u.onKeydown.call(r,i,t)===!1?!1:i._onKeydown(t);case"keypress":return u.onKeypress&&u.onKeypress.call(r,i,t)===!1?!1:i._onKeypress(t)}}catch(e){o=null,r.logWarning("bind(%o): dtnode: %o, error: %o",t,i,e)}finally{r.phase=f}}),t=this.tree.divTree,t.addEventListener?(t.addEventListener("focus",r,!0),t.addEventListener("blur",r,!0)):t.onfocusin=t.onfocusout=r},unbind:function(){this.element.unbind(".dynatree")},enable:function(){this.bind(),n.Widget.prototype.enable.apply(this,arguments)},disable:function(){this.unbind(),n.Widget.prototype.disable.apply(this,arguments)},getTree:function(){return this.tree},getRoot:function(){return this.tree.getRoot()},getActiveNode:function(){return this.tree.getActiveNode()},getSelectedNodes:function(){return this.tree.getSelectedNodes()},lastentry:undefined}),parseFloat(n.ui.version)<1.8&&(n.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes"),n.ui.dynatree.version="$Version: 1.2.1$",n.ui.dynatree.getNode=function(n){if(n instanceof i)return n;for(n.selector!==undefined&&(n=n[0]);n;){if(n.dtnode)return n.dtnode;n=n.parentNode}return null},n.ui.dynatree.getPersistData=t._getTreePersistData,n.ui.dynatree.prototype.options={title:"Dynatree",minExpandLevel:1,imagePath:null,children:null,initId:null,initAjax:null,autoFocus:!0,keyboard:!0,persist:!1,autoCollapse:!1,clickFolderMode:3,activeVisible:!0,checkbox:!1,selectMode:2,fx:null,noLink:!1,onClick:null,onDblClick:null,onKeydown:null,onKeypress:null,onFocus:null,onBlur:null,onQueryActivate:null,onQuerySelect:null,onQueryExpand:null,onPostInit:null,onActivate:null,onDeactivate:null,onSelect:null,onExpand:null,onLazyRead:null,onCustomRender:null,onCreate:null,onRender:null,postProcess:null,dnd:{onDragStart:null,onDragStop:null,autoExpandMS:1e3,preventVoidMoves:!0,onDragEnter:null,onDragOver:null,onDrop:null,onDragLeave:null},ajaxDefaults:{cache:!1,timeout:0,dataType:"json"},strings:{loading:"Loading…",loadError:"Load error!"},generateIds:!1,idPrefix:"dynatree-id-",keyPathSeparator:"/",cookieId:"dynatree",cookie:{expires:null},classNames:{container:"dynatree-container",node:"dynatree-node",folder:"dynatree-folder",empty:"dynatree-empty",vline:"dynatree-vline",expander:"dynatree-expander",connector:"dynatree-connector",checkbox:"dynatree-checkbox",nodeIcon:"dynatree-icon",title:"dynatree-title",noConnector:"dynatree-no-connector",nodeError:"dynatree-statusnode-error",nodeWait:"dynatree-statusnode-wait",hidden:"dynatree-hidden",combinedExpanderPrefix:"dynatree-exp-",combinedIconPrefix:"dynatree-ico-",nodeLoading:"dynatree-loading",hasChildren:"dynatree-has-children",active:"dynatree-active",selected:"dynatree-selected",expanded:"dynatree-expanded",lazy:"dynatree-lazy",focused:"dynatree-focused",partsel:"dynatree-partsel",lastsib:"dynatree-lastsib"},debugLevel:1,lastentry:undefined},parseFloat(n.ui.version)<1.8&&(n.ui.dynatree.defaults=n.ui.dynatree.prototype.options),n.ui.dynatree.nodedatadefaults={title:null,key:null,isFolder:!1,isLazy:!1,tooltip:null,href:null,icon:null,addClass:null,noLink:!1,activate:!1,focus:!1,expand:!1,select:!1,hideCheckbox:!1,unselectable:!1,children:null,lastentry:undefined},f=!1,o=function(){f||(n.ui.plugin.add("draggable","connectToDynatree",{start:function(t,i){var r=n(this).data("draggable"),u=i.helper.data("dtSourceNode")||null;if(u)return r.offset.click.top=-2,r.offset.click.left=16,u.tree._onDragEvent("start",u,null,t,i,r)},drag:function(t,i){var f=n(this).data("draggable"),o=i.helper.data("dtSourceNode")||null,u=i.helper.data("dtTargetNode")||null,r=n.ui.dynatree.getNode(t.target),s;t.target&&!r&&(s=n(t.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length>0,s)||(i.helper.data("dtTargetNode",r),u&&u!==r&&u.tree._onDragEvent("leave",u,o,t,i,f),r&&(r.tree.options.dnd.onDrop?r===u?r.tree._onDragEvent("over",r,o,t,i,f):r.tree._onDragEvent("enter",r,o,t,i,f):e()))},stop:function(t,i){var f=n(this).data("draggable"),r=i.helper.data("dtSourceNode")||null,u=i.helper.data("dtTargetNode")||null,s=f._mouseDownEvent,o=t.type,e=o=="mouseup"&&t.which==1;e||logMsg("Drag was cancelled"),u&&(e&&u.tree._onDragEvent("drop",u,r,t,i,f),u.tree._onDragEvent("leave",u,r,t,i,f)),r&&r.tree._onDragEvent("stop",r,null,t,i,f)}}),f=!0)}})(jQuery); //@ sourceMappingURL=jQueryUI-DynaTree.min.js.map