Files
Disco/Disco.Web/ClientSource/Scripts/Modules/jQueryUI-DynaTree.min.js
T
Gary Sharp 9baca7f633 Javascript bundling updated
Using VS extension: 'Bundler & Minifier'
2016-09-29 18:34:06 +10:00

1 line
42 KiB
JavaScript

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><\/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;u<f;u++)r.children.push(this.childList[u].toDict(!0,i));else delete r.children;return r},fromDict:function(t){var i=t.children;if(i===undefined){this.data=n.extend(this.data,t);this.render();return}t=n.extend({},t);t.children=undefined;this.data=n.extend(this.data,t);this.removeChildren();this.addChild(i)},_getInnerHtml:function(){var f=this.tree,t=f.options,r=f.cache,s=this.getLevel(),n=this.data,i="",u,o,h;return s<t.minExpandLevel?s>1&&(i+=r.tagConnector):i+=this.hasChildren()!==!1?r.tagExpander:r.tagConnector,t.checkbox&&n.hideCheckbox!==!0&&!n.isStatusNode&&(i+=r.tagCheckbox),n.icon?i+="<img src='"+t.imagePath+n.icon+"' alt='' />":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,"&quot;")+'"':"",h=n.href||"#",u=t.noLink||n.noLink?'<span style="display:inline-block;" class="'+t.classNames.title+'"'+o+">"+n.title+"<\/span>":'<a href="'+h+'" class="'+t.classNames.title+'"'+o+">"+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;n<f;n++)i=u[n],r=t.dtnode,i!==r?(this.tree.logDebug("_fixOrder: mismatch at index "+n+": "+i+" != "+r),this.ul.insertBefore(i.li,r.li)):t=t.nextSibling},render:function(t,i){var s=this.tree,e=this.parent,o=this.data,f=s.options,r=f.classNames,c=this.isLastSibling(),l=!1,u,h,a,v,y,p;if(e||this.ul?e&&(this.li||(l=!0,this.li=document.createElement("li"),this.li.dtnode=this,o.key&&f.generateIds&&(this.li.id=f.idPrefix+o.key),this.span=document.createElement("span"),this.span.className=r.title,this.li.appendChild(this.span),e.ul||(e.ul=document.createElement("ul"),e.ul.style.display="none",e.li.appendChild(e.ul)),e.ul.appendChild(this.li)),this.span.innerHTML=this._getInnerHtml(),u=[],u.push(r.node),o.isFolder&&u.push(r.folder),this.bExpanded&&u.push(r.expanded),this.hasChildren()!==!1&&u.push(r.hasChildren),o.isLazy&&this.childList===null&&u.push(r.lazy),c&&u.push(r.lastsib),this.bSelected&&u.push(r.selected),this.hasSubSel&&u.push(r.partsel),s.activeNode===this&&u.push(r.active),o.addClass&&u.push(o.addClass),u.push(r.combinedExpanderPrefix+(this.bExpanded?"e":"c")+(o.isLazy&&this.childList===null?"d":"")+(c?"l":"")),u.push(r.combinedIconPrefix+(this.bExpanded?"e":"c")+(o.isFolder?"f":"")),this.span.className=u.join(" "),this.li.className=c?r.lastsib:"",l&&f.onCreate&&f.onCreate.call(s,this,this.span),f.onRender&&f.onRender.call(s,this,this.span)):(this.li=this.span=null,this.ul=document.createElement("ul"),this.ul.className=f.minExpandLevel>1?r.container+" "+r.noConnector:r.container),(this.bExpanded||i===!0)&&this.childList){for(h=0,a=this.childList.length;h<a;h++)this.childList[h].render(!1,i);this._fixOrder()}this.ul&&(v=this.ul.style.display==="none",y=!!this.bExpanded,t&&f.fx&&v===y?(p=f.fx.duration||200,n(this.ul).animate(f.fx,p)):this.ul.style.display=this.bExpanded||!e?"":"none")},getKeyPath:function(n){var t=[];return this.visitParents(function(n){n.parent&&t.unshift(n.data.key)},!n),"/"+t.join(this.tree.options.keyPathSeparator)},getParent:function(){return this.parent},getChildren:function(){return this.hasChildren()===undefined?undefined:this.childList},hasChildren:function(){return this.data.isLazy?this.childList===null||this.childList===undefined?undefined:this.childList.length===0?!1:this.childList.length===1&&this.childList[0].isStatusNode()?undefined:!0:!!this.childList},isFirstSibling:function(){var n=this.parent;return!n||n.childList[0]===this},isLastSibling:function(){var n=this.parent;return!n||n.childList[n.childList.length-1]===this},isLoading:function(){return!!this._isLoading},getPrevSibling:function(){var t,n,i;if(!this.parent)return null;for(t=this.parent.childList,n=1,i=t.length;n<i;n++)if(t[n]===this)return t[n-1];return null},getNextSibling:function(){var t,n,i;if(!this.parent)return null;for(t=this.parent.childList,n=0,i=t.length-1;n<i;n++)if(t[n]===this)return t[n+1];return null},isStatusNode:function(){return this.data.isStatusNode===!0},isChildOf:function(n){return this.parent&&this.parent===n},isDescendantOf:function(n){if(!n)return!1;for(var t=this.parent;t;){if(t===n)return!0;t=t.parent}return!1},countChildren:function(){var i=this.childList,n,t,r,u;if(!i)return 0;for(n=i.length,t=0,r=n;t<r;t++)u=i[t],n+=u.countChildren();return n},sortChildren:function(n,t){var i=this.childList,r,u;if(i){if(n=n||function(n,t){var i=n.data.title.toLowerCase(),r=t.data.title.toLowerCase();return i===r?0:i>r?1:-1},i.sort(n),t)for(r=0,u=i.length;r<u;r++)i[r].childList&&i[r].sortChildren(n,"$norender$");t!=="$norender$"&&this.render()}},_setStatusNode:function(n){var t=this.childList?this.childList[0]:null;if(n)t?(n.isStatusNode=!0,n.key="_statusNode",t.data=n,t.render()):(n.isStatusNode=!0,n.key="_statusNode",t=this.addChild(n));else if(t&&t.isStatusNode()){try{this.ul&&(this.ul.removeChild(t.li),t.li=null)}catch(i){}this.childList.length===1?this.childList=[]:this.childList.shift()}},setLazyNodeStatus:function(t,i){var r=i&&i.tooltip?i.tooltip:null,u=i&&i.info?" ("+i.info+")":"";switch(t){case DTNodeStatus_Ok:this._setStatusNode(null);n(this.span).removeClass(this.tree.options.classNames.nodeLoading);this._isLoading=!1;this.tree.options.autoFocus&&(this===this.tree.tnRoot&&this.childList&&this.childList.length>0?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<o;u++){var t=i.childNodes[u],s=t.offsetLeft-i.offsetLeft,h=t.offsetTop-i.offsetTop,c=t.clientWidth,l=t.clientHeight;if(f>=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;n<i;n++)if(!t[n].bExpanded)return!1;return!0},makeVisible:function(){for(var t=this._parentList(!0,!1),n=0,i=t.length;n<i;n++)t[n]._expand(!0)},focus:function(){this.makeVisible();try{n(this.span).find(">a").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<r;t++)o=u[t],i=o._updatePartSelectionState(),i!==!1&&(e=!1),i!==!0&&(f=!1);return n=f?!0:e?!1:undefined,this._setSubSel(n===undefined),this.bSelected=n===!0,n},_fixSelectionState:function(){var n,t,i,u,r,f;if(this.bSelected)for(this.visit(function(n){n.parent._setSubSel(!0);n.data.unselectable||n._select(!0,!1,!1)}),n=this.parent;n;){for(n._setSubSel(!0),u=!0,t=0,i=n.childList.length;t<i;t++)if(r=n.childList[t],!r.bSelected&&!r.data.isStatusNode&&!r.data.unselectable){u=!1;break}u&&n._select(!0,!1,!1);n=n.parent}else for(this._setSubSel(!1),this.visit(function(n){n._setSubSel(!1);n._select(!1,!1,!1)}),n=this.parent;n;){for(n._select(!1,!1,!1),f=!1,t=0,i=n.childList.length;t<i;t++)if(n.childList[t].bSelected||n.childList[t].hasSubSel){f=!0;break}n._setSubSel(f);n=n.parent}},_select:function(t,i,r){var u=this.tree.options;this.data.isStatusNode||this.bSelected!==t&&(i&&u.onQuerySelect&&u.onQuerySelect.call(this.tree,t,this)===!1||(u.selectMode==1&&t&&this.tree.visit(function(n){if(n.bSelected)return n._select(!1,!1,!1),!1}),this.bSelected=t,t?(u.persist&&this.tree.persistence.addSelect(this.data.key),n(this.span).addClass(u.classNames.selected),r&&u.selectMode===3&&this._fixSelectionState(),i&&u.onSelect&&u.onSelect.call(this.tree,!0,this)):(u.persist&&this.tree.persistence.clearSelect(this.data.key),n(this.span).removeClass(u.classNames.selected),r&&u.selectMode===3&&this._fixSelectionState(),i&&u.onSelect&&u.onSelect.call(this.tree,!1,this))))},select:function(n){return this.data.unselectable?this.bSelected:this._select(n!==!1,!0,!0)},toggleSelect:function(){return this.select(!this.bSelected)},isSelected:function(){return this.bSelected},isLazy:function(){return!!this.data.isLazy},_loadContent:function(){try{var t=this.tree.options;this.tree.logDebug("_loadContent: start - %o",this);this.setLazyNodeStatus(DTNodeStatus_Loading);!0===t.onLazyRead.call(this.tree,this)&&(this.setLazyNodeStatus(DTNodeStatus_Ok),this.tree.logDebug("_loadContent: succeeded - %o",this))}catch(n){this.tree.logWarning("_loadContent: failed - %o",n);this.setLazyNodeStatus(DTNodeStatus_Error,{tooltip:""+n})}},_expand:function(n,t){var i,f,u,r,e;if(this.bExpanded===n){this.tree.logDebug("dtnode._expand(%o) IGNORED - %o",n,this);return}if(this.tree.logDebug("dtnode._expand(%o) - %o",n,this),i=this.tree.options,!n&&this.getLevel()<i.minExpandLevel){this.tree.logDebug("dtnode._expand(%o) prevented collapse - %o",n,this);return}if(!i.onQueryExpand||i.onQueryExpand.call(this.tree,n,this)!==!1){if(this.bExpanded=n,i.persist&&(n?this.tree.persistence.addExpand(this.data.key):this.tree.persistence.clearExpand(this.data.key)),f=!(this.data.isLazy&&this.childList===null)&&!this._isLoading&&!t,this.render(f),this.bExpanded&&this.parent&&i.autoCollapse)for(u=this._parentList(!1,!0),r=0,e=u.length;r<e;r++)u[r].collapseSiblings();if(i.activeVisible&&this.tree.activeNode&&!this.tree.activeNode.isVisible()&&this.tree.activeNode.deactivate(),n&&this.data.isLazy&&this.childList===null&&!this._isLoading){this._loadContent();return}i.onExpand&&i.onExpand.call(this.tree,n,this)}},isExpanded:function(){return this.bExpanded},expand:function(n){if(n=n!==!1,this.childList||this.data.isLazy||!n){if(this.parent===null&&!n)return}else return;this._expand(n)},scheduleAction:function(n,t){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.logDebug("clearTimeout(%o)",this.tree.timer));var i=this;switch(n){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){i.tree.logDebug("setTimeout: trigger expand");i.expand(!0)},t);break;case"activate":this.tree.timer=setTimeout(function(){i.tree.logDebug("setTimeout: trigger activate");i.activate()},t);break;default:throw"Invalid mode "+n;}this.tree.logDebug("setTimeout(%s, %s): %s",n,t,this.tree.timer)},toggleExpand:function(){this.expand(!this.bExpanded)},collapseSiblings:function(){var t,n,i;if(this.parent!==null)for(t=this.parent.childList,n=0,i=t.length;n<i;n++)t[n]!==this&&t[n].bExpanded&&t[n]._expand(!1)},_onClick:function(t){var r=this.getEventTargetType(t),i;if(r==="expander")this.toggleExpand(),this.focus();else if(r==="checkbox")this.toggleSelect(),this.focus();else if(this._userActivate(),i=this.span.getElementsByTagName("a"),i[0])n.browser.msie&&parseInt(n.browser.version,10)<9||i[0].focus();else return!0;t.preventDefault()},_onDblClick:function(){},_onKeydown:function(n){var u=!0,t,r,i;switch(n.which){case 107:case 187:this.bExpanded||this.toggleExpand();break;case 109:case 189:this.bExpanded&&this.toggleExpand();break;case 32:this._userActivate();break;case 8:this.parent&&this.parent.focus();break;case 37:this.bExpanded?(this.toggleExpand(),this.focus()):this.parent&&this.parent.parent&&this.parent.focus();break;case 39:!this.bExpanded&&(this.childList||this.data.isLazy)?(this.toggleExpand(),this.focus()):this.childList&&this.childList[0].focus();break;case 38:for(t=this.getPrevSibling();t&&t.bExpanded&&t.childList;)t=t.childList[t.childList.length-1];!t&&this.parent&&this.parent.parent&&(t=this.parent);t&&t.focus();break;case 40:if(this.bExpanded&&this.childList)t=this.childList[0];else for(r=this._parentList(!1,!0),i=r.length-1;i>=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<u;r++)if(i=this.childList[r].visit(n,!0),i===!1)break;return i},visitParents:function(n,t){if(t&&n(this)===!1)return!1;for(var i=this.parent;i;){if(n(i)===!1)return!1;i=i.parent}return!0},remove:function(){if(this===this.tree.root)throw"Cannot remove system root";return this.parent.removeChild(this)},removeChild:function(n){var i=this.childList,t,r;if(i.length==1){if(n!==i[0])throw"removeChild: invalid child";return this.removeChildren()}for(n===this.tree.activeNode&&n.deactivate(),this.tree.options.persist&&(n.bSelected&&this.tree.persistence.clearSelect(n.data.key),n.bExpanded&&this.tree.persistence.clearExpand(n.data.key)),n.removeChildren(!0),this.ul.removeChild(n.li),t=0,r=i.length;t<r;t++)if(i[t]===n){this.childList.splice(t,1);break}},removeChildren:function(t,i){var e,u,f,o,r;if(this.tree.logDebug("%s.removeChildren(%o)",this,t),e=this.tree,u=this.childList,u){for(f=0,o=u.length;f<o;f++)r=u[f],r!==e.activeNode||i||r.deactivate(),this.tree.options.persist&&!i&&(r.bSelected&&this.tree.persistence.clearSelect(r.data.key),r.bExpanded&&this.tree.persistence.clearExpand(r.data.key)),r.removeChildren(!0,i),this.ul&&n("li",n(this.ul)).remove();this.childList=null}t||(this._isLoading=!1,this.render())},setTitle:function(n){this.fromDict({title:n})},reload:function(){throw"Use reloadChildren() instead";},reloadChildren:function(n){if(this.parent===null)throw"Use tree.reload() instead";else if(!this.data.isLazy)throw"node.reloadChildren() requires lazy nodes.";if(n){var t=this,i="nodeLoaded.dynatree."+this.tree.$tree.attr("id")+"."+this.data.key;this.tree.$tree.bind(i,function(r,u,f){if(t.tree.$tree.unbind(i),t.tree.logDebug("loaded %o, %o, %o",r,u,f),u!==t)throw"got invalid load event";n.call(t.tree,u,f)})}this.removeChildren();this._loadContent()},_loadKeyPath:function(n,t){var i=this.tree,u,f,e,o,r,s;if(i.logDebug("%s._loadKeyPath(%s)",this,n),n==="")throw"Key path must not be empty";if(u=n.split(i.options.keyPathSeparator),u[0]==="")throw"Key path must be relative (don't start with '/')";if(f=u.shift(),this.childList)for(e=0,o=this.childList.length;e<o;e++)if(r=this.childList[e],r.data.key===f){u.length===0?t.call(i,r,"ok"):r.data.isLazy&&(r.childList===null||r.childList===undefined)?(i.logDebug("%s._loadKeyPath(%s) -> 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"<beforeNode> must be a child of <this>";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<s;u++)f=n[u],e=this._addChildNode(new i(this,this.tree,f),t),r||(r=e),f.children&&e.addChild(f.children,null);return this.tree.enableUpdate(o),r},append:function(n){return this.tree.logWarning("node.append() is deprecated (use node.addChild() instead)."),this.addChild(n,null)},appendAjax:function(t){var i=this,u;if(this.removeChildren(!1,!0),this.setLazyNodeStatus(DTNodeStatus_Loading),t.debugLazyDelay){u=t.debugLazyDelay;t.debugLazyDelay=0;this.tree.logInfo("appendAjax: waiting for debugLazyDelay "+u);setTimeout(function(){i.appendAjax(t)},u);return}var e=t.success,o=t.error,f="nodeLoaded.dynatree."+this.tree.$tree.attr("id")+"."+this.data.key,r=n.extend({},this.tree.options.ajaxDefaults,t,{success:function(t,u){var o=i.tree.phase;i.tree.phase="init";r.postProcess?t=r.postProcess.call(this,t,this.dataType):t&&t.hasOwnProperty("d")&&(t=typeof t.d=="string"?n.parseJSON(t.d):t.d);n.isArray(t)&&t.length===0||i.addChild(t,null);i.tree.phase="postInit";e&&e.call(r,i,t,u);i.tree.logDebug("trigger "+f);i.tree.$tree.trigger(f,[i,!0]);i.tree.phase=o;i.setLazyNodeStatus(DTNodeStatus_Ok);n.isArray(t)&&t.length===0&&(i.childList=[],i.render())},error:function(n,t,u){i.tree.logWarning("appendAjax failed:",t,":\n",n,"\n",u);o&&o.call(r,i,n,t,u);i.tree.$tree.trigger(f,[i,!1]);i.setLazyNodeStatus(DTNodeStatus_Error,{info:t,tooltip:""+u})}});n.ajax(r)},move:function(t,i){var u,f,r;if(this!==t){if(!this.parent)throw"Cannot move system root";if((i===undefined||i=="over")&&(i="child"),f=this.parent,r=i==="child"?t:t.parent,r.isDescendantOf(this))throw"Cannot move a node to it's own descendant";if(this.parent.childList.length==1)this.parent.childList=this.parent.data.isLazy?[]:null,this.parent.bExpanded=!1;else{if(u=n.inArray(this,this.parent.childList),u<0)throw"Internal error";this.parent.childList.splice(u,1)}if(this.parent.ul&&this.parent.ul.removeChild(this.li),this.parent=r,r.hasChildren())switch(i){case"child":r.childList.push(this);break;case"before":if(u=n.inArray(t,r.childList),u<0)throw"Internal error";r.childList.splice(u,0,this);break;case"after":if(u=n.inArray(t,r.childList),u<0)throw"Internal error";r.childList.splice(u+1,0,this);break;default:throw"Invalid mode "+i;}else r.childList=[this];if(r.ul||(r.ul=document.createElement("ul"),r.ul.style.display="none",r.li.appendChild(r.ul)),this.li&&r.ul.appendChild(this.li),this.tree!==t.tree){this.visit(function(n){n.tree=t.tree},null,!0);throw"Not yet implemented.";}f.isDescendantOf(r)||f.render();r.isDescendantOf(f)||r.render()}},lastentry:undefined};t=u.create();t._getTreePersistData=function(n,i){var r=new t(n,i);return r.read(),r.toDict()};getDynaTreePersistData=t._getTreePersistData;t.prototype={initialize:function(t,i){t===undefined&&(t=n.ui.dynatree.prototype.options.cookieId);i=n.extend({},n.ui.dynatree.prototype.options.cookie,i);this.cookieId=t;this.cookieOpts=i;this.cookiesFound=undefined;this.activeKey=null;this.focusedKey=null;this.expandedKeyList=null;this.selectedKeyList=null},_log:function(){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments)},read:function(){this.cookiesFound=!1;var t=n.cookie(this.cookieId+"-active");this.activeKey=t===null?"":t;t!==null&&(this.cookiesFound=!0);t=n.cookie(this.cookieId+"-focus");this.focusedKey=t===null?"":t;t!==null&&(this.cookiesFound=!0);t=n.cookie(this.cookieId+"-expand");this.expandedKeyList=t===null?[]:t.split(",");t!==null&&(this.cookiesFound=!0);t=n.cookie(this.cookieId+"-select");this.selectedKeyList=t===null?[]:t.split(",");t!==null&&(this.cookiesFound=!0)},write:function(){n.cookie(this.cookieId+"-active",this.activeKey===null?"":this.activeKey,this.cookieOpts);n.cookie(this.cookieId+"-focus",this.focusedKey===null?"":this.focusedKey,this.cookieOpts);n.cookie(this.cookieId+"-expand",this.expandedKeyList===null?"":this.expandedKeyList.join(","),this.cookieOpts);n.cookie(this.cookieId+"-select",this.selectedKeyList===null?"":this.selectedKeyList.join(","),this.cookieOpts)},addExpand:function(t){n.inArray(t,this.expandedKeyList)<0&&(this.expandedKeyList.push(t),n.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},clearExpand:function(t){var i=n.inArray(t,this.expandedKeyList);i>=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 class='"+u.classNames.empty+"'><\/span>",tagVline:"<span class='"+u.classNames.vline+"'><\/span>",tagExpander:"<span class='"+u.classNames.expander+"'><\/span>",tagConnector:"<span class='"+u.classNames.connector+"'><\/span>",tagNodeIcon:"<span class='"+u.classNames.nodeIcon+"'><\/span>",tagCheckbox:"<span class='"+u.classNames.checkbox+"'><\/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),u=this.$tree.attr("name")||this.$tree.attr("id"),r=[],t=0,f=i.length;t<f;t++)r.push({name:u,value:i[t].data.key});return r},getPersistData:function(){return this.persistence.toDict()},logDebug:function(){this.options.debugLevel>=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 i=n(this),l=i.find(">span:first"),o=i.find(">a:first"),u,s=null,a=null,v,h,f,e,y,c;if(l.length?u=l.html():o.length?(u=o.html(),s=o.attr("href"),a=o.attr("target"),v=o.attr("title")):(u=i.html(),h=u.search(/<ul/i),u=h>=0?n.trim(u.substring(0,h)):n.trim(u)),f={title:u,tooltip:v,isFolder:i.hasClass("folder"),isLazy:i.hasClass("lazy"),expand:i.hasClass("expanded"),select:i.hasClass("selected"),activate:i.hasClass("active"),focus:i.hasClass("focused"),noLink:i.hasClass("noLink")},s&&(f.href=s,f.target=a),i.attr("title")&&(f.tooltip=i.attr("title")),i.attr("id")&&(f.key=i.attr("id")),i.attr("data")&&(e=n.trim(i.attr("data")),e)){e.charAt(0)!="{"&&(e="{"+e+"}");try{n.extend(f,eval("("+e+")"))}catch(p){throw"Error parsing node data: "+p+"\ndata:\n'"+e+"'";}}y=t.addChild(f);c=i.find(">ul:first");c.length&&r._createFromTag(y,c)})},_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 id='dynatree-drop-marker'><\/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 class='dynatree-drag-helper'><span class='dynatree-drag-helper-img' /><\/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&#8230;",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);