diff options
Diffstat (limited to 'extensions/TreeViewPlus/web/js/jquery.dynatree-1.2.8.min.js')
-rw-r--r-- | extensions/TreeViewPlus/web/js/jquery.dynatree-1.2.8.min.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/extensions/TreeViewPlus/web/js/jquery.dynatree-1.2.8.min.js b/extensions/TreeViewPlus/web/js/jquery.dynatree-1.2.8.min.js new file mode 100644 index 000000000..604d90848 --- /dev/null +++ b/extensions/TreeViewPlus/web/js/jquery.dynatree-1.2.8.min.js @@ -0,0 +1,4 @@ +/*! jQuery Dynatree Plugin - v1.2.8 - 2015-07-04
+* https://github.com/mar10/dynatree/
+* Copyright (c) 2015 Martin Wendt; Licensed MIT, GPL */function _log(a){if(_canLog){var b=Array.prototype.slice.apply(arguments,[1]),c=new Date,d=c.getHours()+":"+c.getMinutes()+":"+c.getSeconds()+"."+c.getMilliseconds();b[0]=d+" - "+b[0];try{switch(a){case"info":window.console.info.apply(window.console,b);break;case"warn":window.console.warn.apply(window.console,b);break;default:window.console.log.apply(window.console,b)}}catch(e){window.console?-2146827850===e.number&&window.console.log(b.join(", ")):_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($){function getDtNodeFromElement(a){return alert("getDtNodeFromElement is deprecated"),$.ui.dynatree.getNode(a)}function noop(){}function offsetString(a){return 0===a?"":a>0?"+"+a:""+a}function _checkBrowser(){function a(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}}var b,c;return b=a(navigator.userAgent),c={},b.browser&&(c[b.browser]=!0,c.version=b.version),c.chrome?c.webkit=!0:c.webkit&&(c.safari=!0),c}function versionCompare(a,b){var c,d,e,f=(""+a).split("."),g=(""+b).split("."),h=Math.min(f.length,g.length);for(e=0;h>e;e++)if(c=parseInt(f[e],10),d=parseInt(g[e],10),isNaN(c)&&(c=f[e]),isNaN(d)&&(d=g[e]),c!=d)return c>d?1:d>c?-1:0/0;return f.length===g.length?0:f.length<g.length?-1:1}function _initDragAndDrop(a){var b=a.options.dnd||null;b&&(b.onDragStart||b.onDrop)&&_registerDnd(),b&&b.onDragStart&&a.$tree.draggable({addClasses:!1,appendTo:"body",containment:!1,delay:0,distance:4,revert:b.revert!==!0?!1:function(a){if(logMsg("draggable.revert(), dropped=",a),"boolean"==typeof a)return!a;var b=$.ui.ddmanager&&$.ui.ddmanager.current&&$.ui.ddmanager.current.helper,c=b&&b.hasClass("dynatree-drop-reject");return c},scroll:!0,scrollSpeed:7,scrollSensitivity:10,connectToDynatree:!0,helper:function(a){var b=$.ui.dynatree.getNode(a.target);return b?b.tree._onDragEvent("helper",b,null,a,null,null):"<div></div>"},start:function(a,b){var c=b.helper.data("dtSourceNode");return!!c}}),b&&b.onDrop&&a.$tree.droppable({addClasses:!1,tolerance:"pointer",greedy:!1})}var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}},BROWSER=_checkBrowser(),jquerySupports={positionMyOfs:versionCompare($.ui.version,"1.9")>=0},DynaTreeNode=Class.create();DynaTreeNode.prototype={initialize:function(a,b,c){this.parent=a,this.tree=b,"string"==typeof c&&(c={title:c}),c.key=null==c.key?"_"+b._nodeCount++:""+c.key,this.data=$.extend({},$.ui.dynatree.nodedatadefaults,c),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(a,b){var c,d=$.extend({},this.data);if(d.activate=this.tree.activeNode===this,d.focus=this.tree.focusNode===this,d.expand=this.bExpanded,d.select=this.bSelected,b&&b(d),a&&this.childList){d.children=[];for(var e=0,f=this.childList.length;f>e;e++)c=this.childList[e],c.isStatusNode()||d.children.push(c.toDict(!0,b))}else delete d.children;return d},fromDict:function(a){var b=a.children;return void 0===b?(this.data=$.extend(this.data,a),void this.render()):(a=$.extend({},a),a.children=void 0,this.data=$.extend(this.data,a),this.removeChildren(),void this.addChild(b))},_getInnerHtml:function(){var a,b=this.tree,c=b.options,d=b.cache,e=this.getLevel(),f=this.data,g="";e<c.minExpandLevel?e>1&&(g+=d.tagConnector):g+=this.hasChildren()!==!1?d.tagExpander:d.tagConnector,c.checkbox&&f.hideCheckbox!==!0&&!f.isStatusNode&&(g+=d.tagCheckbox),f.icon?(a="/"===f.icon.charAt(0)?f.icon:c.imagePath+f.icon,g+="<img src='"+a+"' alt='' />"):f.icon===!1||(g+=f.iconClass?"<span class=' "+f.iconClass+"'></span>":d.tagNodeIcon);var h="";if(c.onCustomRender&&(h=c.onCustomRender.call(b,this)||""),!h){var i=f.tooltip?' title="'+f.tooltip.replace(/\"/g,""")+'"':"",j=f.href||"#";h=c.noLink||f.noLink?'<span style="display:inline-block;" class="'+c.classNames.title+'"'+i+">"+f.title+"</span>":'<a href="'+j+'" class="'+c.classNames.title+'"'+i+">"+f.title+"</a>"}return g+=h},_fixOrder:function(){var a=this.childList;if(a&&this.ul)for(var b=this.ul.firstChild,c=0,d=a.length-1;d>c;c++){var e=a[c],f=b.dtnode;e!==f?(this.tree.logDebug("_fixOrder: mismatch at index "+c+": "+e+" != "+f),this.ul.insertBefore(e.li,f.li)):b=b.nextSibling}},render:function(a,b){var c=this.tree,d=this.parent,e=this.data,f=c.options,g=f.classNames,h=this.isLastSibling(),i=!1;if(d||this.ul){if(d){this.li||(i=!0,this.li=document.createElement("li"),this.li.dtnode=this,e.key&&f.generateIds&&(this.li.id=f.idPrefix+e.key),this.span=document.createElement("span"),this.span.className=g.title,this.li.appendChild(this.span),d.ul||(d.ul=document.createElement("ul"),d.ul.style.display="none",d.li.appendChild(d.ul)),d.ul.appendChild(this.li)),this.span.innerHTML=this._getInnerHtml();var j=[];j.push(g.node),e.isFolder&&j.push(g.folder),this.bExpanded&&j.push(g.expanded),this.hasChildren()!==!1&&j.push(g.hasChildren),e.isLazy&&null===this.childList&&j.push(g.lazy),h&&j.push(g.lastsib),this.bSelected&&j.push(g.selected),this.hasSubSel&&j.push(g.partsel),c.activeNode===this&&j.push(g.active),e.addClass&&j.push(e.addClass),j.push(g.combinedExpanderPrefix+(this.bExpanded?"e":"c")+(e.isLazy&&null===this.childList?"d":"")+(h?"l":"")),j.push(g.combinedIconPrefix+(this.bExpanded?"e":"c")+(e.isFolder?"f":"")),this.span.className=j.join(" "),this.li.className=h?g.lastsib:"",i&&f.onCreate&&f.onCreate.call(c,this,this.span),f.onRender&&f.onRender.call(c,this,this.span)}}else this.li=this.span=null,this.ul=document.createElement("ul"),this.ul.className=f.minExpandLevel>1?g.container+" "+g.noConnector:g.container;if((this.bExpanded||b===!0)&&this.childList){for(var k=0,l=this.childList.length;l>k;k++)this.childList[k].render(!1,b);this._fixOrder()}if(this.ul){var m="none"===this.ul.style.display,n=!!this.bExpanded;if(a&&f.fx&&m===n){var o=f.fx.duration||200;$(this.ul).animate(f.fx,o)}else this.ul.style.display=this.bExpanded||!d?"":"none"}},getKeyPath:function(a){var b=[],c=this.tree.options.keyPathSeparator;return this.visitParents(function(a){a.parent&&b.unshift(a.data.key)},!a),c+b.join(c)},getParent:function(){return this.parent},getChildren:function(){return void 0===this.hasChildren()?void 0:this.childList},hasChildren:function(){return this.data.isLazy?null===this.childList||void 0===this.childList?void 0:0===this.childList.length?!1:1===this.childList.length&&this.childList[0].isStatusNode()?void 0:!0:!!this.childList},isFirstSibling:function(){var a=this.parent;return!a||a.childList[0]===this},isLastSibling:function(){var a=this.parent;return!a||a.childList[a.childList.length-1]===this},isLoading:function(){return!!this._isLoading},getPrevSibling:function(){if(!this.parent)return null;for(var a=this.parent.childList,b=1,c=a.length;c>b;b++)if(a[b]===this)return a[b-1];return null},getNextSibling:function(){if(!this.parent)return null;for(var a=this.parent.childList,b=0,c=a.length-1;c>b;b++)if(a[b]===this)return a[b+1];return null},isStatusNode:function(){return this.data.isStatusNode===!0},isChildOf:function(a){return this.parent&&this.parent===a},isDescendantOf:function(a){if(!a)return!1;for(var b=this.parent;b;){if(b===a)return!0;b=b.parent}return!1},countChildren:function(){var a=this.childList;if(!a)return 0;for(var b=a.length,c=0,d=b;d>c;c++){var e=a[c];b+=e.countChildren()}return b},sortChildren:function(a,b){var c=this.childList;if(c){if(a=a||function(a,b){var c=a.data.title.toLowerCase(),d=b.data.title.toLowerCase();return c===d?0:c>d?1:-1},c.sort(a),b)for(var d=0,e=c.length;e>d;d++)c[d].childList&&c[d].sortChildren(a,"$norender$");"$norender$"!==b&&this.render()}},_setStatusNode:function(a){var b=this.childList?this.childList[0]:null;if(a)b?(a.isStatusNode=!0,a.key="_statusNode",b.data=a,b.render()):(a.isStatusNode=!0,a.key="_statusNode",b=this.addChild(a));else if(b&&b.isStatusNode()){try{this.ul&&(this.ul.removeChild(b.li),b.li=null)}catch(c){}1===this.childList.length?this.childList=[]:this.childList.shift()}},setLazyNodeStatus:function(a,b){var c=b&&b.tooltip?b.tooltip:null,d=b&&b.info?" ("+b.info+")":"";switch(a){case DTNodeStatus_Ok:this._setStatusNode(null),$(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,$(this.span).addClass(this.tree.options.classNames.nodeLoading),this.parent||this._setStatusNode({title:this.tree.options.strings.loading+d,tooltip:c,addClass:this.tree.options.classNames.nodeWait});break;case DTNodeStatus_Error:this._isLoading=!1,this._setStatusNode({title:this.tree.options.strings.loadError+d,tooltip:c,addClass:this.tree.options.classNames.nodeError});break;default:throw"Bad LazyNodeStatus: '"+a+"'."}},_parentList:function(a,b){for(var c=[],d=b?this:this.parent;d;)(a||d.parent)&&c.unshift(d),d=d.parent;return c},getLevel:function(){for(var a=0,b=this.parent;b;)a++,b=b.parent;return a},_getTypeForOuterNodeEvent:function(a){var b=this.tree.options.classNames,c=a.target;if(c.className.indexOf(b.node)<0)return null;for(var d=a.pageX-c.offsetLeft,e=a.pageY-c.offsetTop,f=0,g=c.childNodes.length;g>f;f++){var h=c.childNodes[f],i=h.offsetLeft-c.offsetLeft,j=h.offsetTop-c.offsetTop,k=h.clientWidth,l=h.clientHeight;if(d>=i&&i+k>=d&&e>=j&&j+l>=e){if(h.className==b.title)return"title";if(h.className==b.expander)return"expander";if(h.className==b.checkbox||h.className==b.radio)return"checkbox";if(h.className==b.nodeIcon)return"icon"}}return"prefix"},getEventTargetType:function(a){var b=a&&a.target?a.target.className:"",c=this.tree.options.classNames;return b.indexOf(c.title)>=0?"title":b.indexOf(c.expander)>=0?"expander":b.indexOf(c.checkbox)>=0||b.indexOf(c.radio)>=0?"checkbox":b.indexOf(c.nodeIcon)>=0?"icon":b.indexOf(c.empty)>=0||b.indexOf(c.vline)>=0||b.indexOf(c.connector)>=0?"prefix":b.indexOf(c.node)>=0?this._getTypeForOuterNodeEvent(a):null},isVisible:function(){for(var a=this._parentList(!0,!1),b=0,c=a.length;c>b;b++)if(!a[b].bExpanded)return!1;return!0},makeVisible:function(){for(var a=this._parentList(!0,!1),b=0,c=a.length;c>b;b++)a[b]._expand(!0)},focus:function(){this.makeVisible();try{$(this.span).find(">a").focus()}catch(a){}},isFocused:function(){return this.tree.tnFocused===this},_activate:function(a,b){this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o",a,b,this);var c=this.tree.options;if(!this.data.isStatusNode)if(a){if(b&&c.onQueryActivate&&c.onQueryActivate.call(this.tree,a,this)===!1)return;if(this.tree.activeNode){if(this.tree.activeNode===this)return;this.tree.activeNode.deactivate()}c.activeVisible&&this.makeVisible(),this.tree.activeNode=this,c.persist&&$.cookie(c.cookieId+"-active",this.data.key,c.cookie),this.tree.persistence.activeKey=this.data.key,$(this.span).addClass(c.classNames.active),b&&c.onActivate&&c.onActivate.call(this.tree,this)}else if(this.tree.activeNode===this){if(c.onQueryActivate&&c.onQueryActivate.call(this.tree,!1,this)===!1)return;$(this.span).removeClass(c.classNames.active),c.persist&&$.cookie(c.cookieId+"-active","",c.cookie),this.tree.persistence.activeKey=null,this.tree.activeNode=null,b&&c.onDeactivate&&c.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 a=!0,b=!1;if(this.data.isFolder)switch(this.tree.options.clickFolderMode){case 2:a=!1,b=!0;break;case 3:a=b=!0}null===this.parent&&(b=!1),b&&(this.toggleExpand(),this.focus()),a&&this.activate()},_setSubSel:function(a){a?(this.hasSubSel=!0,$(this.span).addClass(this.tree.options.classNames.partsel)):(this.hasSubSel=!1,$(this.span).removeClass(this.tree.options.classNames.partsel))},_updatePartSelectionState:function(){var a;if(!this.hasChildren())return a=this.bSelected&&!this.data.unselectable&&!this.data.isStatusNode,this._setSubSel(!1),a;var b,c,d=this.childList,e=!0,f=!0;for(b=0,c=d.length;c>b;b++){var g=d[b],h=g._updatePartSelectionState();h!==!1&&(f=!1),h!==!0&&(e=!1)}return a=e?!0:f?!1:void 0,this._setSubSel(void 0===a),this.bSelected=a===!0,a},_fixSelectionState:function(){var a,b,c;if(this.bSelected)for(this.visit(function(a){a.parent._setSubSel(!0),a.data.unselectable||a._select(!0,!1,!1)}),a=this.parent;a;){a._setSubSel(!0);var d=!0;for(b=0,c=a.childList.length;c>b;b++){var e=a.childList[b];if(!e.bSelected&&!e.data.isStatusNode&&!e.data.unselectable){d=!1;break}}d&&a._select(!0,!1,!1),a=a.parent}else for(this._setSubSel(!1),this.visit(function(a){a._setSubSel(!1),a._select(!1,!1,!1)}),a=this.parent;a;){a._select(!1,!1,!1);var f=!1;for(b=0,c=a.childList.length;c>b;b++)if(a.childList[b].bSelected||a.childList[b].hasSubSel){f=!0;break}a._setSubSel(f),a=a.parent}},_select:function(a,b,c){var d=this.tree.options;this.data.isStatusNode||this.bSelected!==a&&(b&&d.onQuerySelect&&d.onQuerySelect.call(this.tree,a,this)===!1||(1==d.selectMode&&a&&this.tree.visit(function(a){return a.bSelected?(a._select(!1,!1,!1),!1):void 0}),this.bSelected=a,a?(d.persist&&this.tree.persistence.addSelect(this.data.key),$(this.span).addClass(d.classNames.selected),c&&3===d.selectMode&&this._fixSelectionState(),b&&d.onSelect&&d.onSelect.call(this.tree,!0,this)):(d.persist&&this.tree.persistence.clearSelect(this.data.key),$(this.span).removeClass(d.classNames.selected),c&&3===d.selectMode&&this._fixSelectionState(),b&&d.onSelect&&d.onSelect.call(this.tree,!1,this))))},select:function(a){return this.data.unselectable?this.bSelected:this._select(a!==!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 a=this.tree.options;this.tree.logDebug("_loadContent: start - %o",this),this.setLazyNodeStatus(DTNodeStatus_Loading),!0===a.onLazyRead.call(this.tree,this)&&(this.setLazyNodeStatus(DTNodeStatus_Ok),this.tree.logDebug("_loadContent: succeeded - %o",this))}catch(b){this.tree.logWarning("_loadContent: failed - %o",b),this.setLazyNodeStatus(DTNodeStatus_Error,{tooltip:""+b})}},_expand:function(a,b){if(this.bExpanded===a)return void this.tree.logDebug("dtnode._expand(%o) IGNORED - %o",a,this);this.tree.logDebug("dtnode._expand(%o) - %o",a,this);var c=this.tree.options;if(!a&&this.getLevel()<c.minExpandLevel)return void this.tree.logDebug("dtnode._expand(%o) prevented collapse - %o",a,this);if(!c.onQueryExpand||c.onQueryExpand.call(this.tree,a,this)!==!1){this.bExpanded=a,c.persist&&(a?this.tree.persistence.addExpand(this.data.key):this.tree.persistence.clearExpand(this.data.key));var d=!(this.data.isLazy&&null===this.childList||this._isLoading||b);if(this.render(d),this.bExpanded&&this.parent&&c.autoCollapse)for(var e=this._parentList(!1,!0),f=0,g=e.length;g>f;f++)e[f].collapseSiblings();return c.activeVisible&&this.tree.activeNode&&!this.tree.activeNode.isVisible()&&this.tree.activeNode.deactivate(),a&&this.data.isLazy&&null===this.childList&&!this._isLoading?void this._loadContent():void(c.onExpand&&c.onExpand.call(this.tree,a,this))}},isExpanded:function(){return this.bExpanded},expand:function(a){a=a!==!1,(this.childList||this.data.isLazy||!a)&&(null!==this.parent||a)&&this._expand(a)},scheduleAction:function(a,b){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.logDebug("clearTimeout(%o)",this.tree.timer));var c=this;switch(a){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){c.tree.logDebug("setTimeout: trigger expand"),c.expand(!0)},b);break;case"activate":this.tree.timer=setTimeout(function(){c.tree.logDebug("setTimeout: trigger activate"),c.activate()},b);break;default:throw"Invalid mode "+a}this.tree.logDebug("setTimeout(%s, %s): %s",a,b,this.tree.timer)},toggleExpand:function(){this.expand(!this.bExpanded)},collapseSiblings:function(){if(null!==this.parent)for(var a=this.parent.childList,b=0,c=a.length;c>b;b++)a[b]!==this&&a[b].bExpanded&&a[b]._expand(!1)},_onClick:function(a){var b=this.getEventTargetType(a);if("expander"===b)this.toggleExpand(),this.focus();else if("checkbox"===b)this.toggleSelect(),this.focus();else{this._userActivate();var c=this.span.getElementsByTagName("a");if(!c[0])return!0;BROWSER.msie&&parseInt(BROWSER.version,10)<9||c[0].focus()}a.preventDefault()},_onDblClick:function(){},_onKeydown:function(a){var b,c=!0;switch(a.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.childList&&this.childList[0].focus():(this.toggleExpand(),this.focus());break;case 38:for(b=this.getPrevSibling();b&&b.bExpanded&&b.childList;)b=b.childList[b.childList.length-1];!b&&this.parent&&this.parent.parent&&(b=this.parent),b&&b.focus();break;case 40:if(this.bExpanded&&this.childList)b=this.childList[0];else for(var d=this._parentList(!1,!0),e=d.length-1;e>=0&&!(b=d[e].getNextSibling());e--);b&&b.focus();break;default:c=!1}c&&a.preventDefault()},_onKeypress:function(){},_onFocus:function(a){var b=this.tree.options;"blur"==a.type||"focusout"==a.type?(b.onBlur&&b.onBlur.call(this.tree,this),this.tree.tnFocused&&$(this.tree.tnFocused.span).removeClass(b.classNames.focused),this.tree.tnFocused=null,b.persist&&$.cookie(b.cookieId+"-focus","",b.cookie)):("focus"==a.type||"focusin"==a.type)&&(this.tree.tnFocused&&this.tree.tnFocused!==this&&(this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o",this.tree.tnFocused),$(this.tree.tnFocused.span).removeClass(b.classNames.focused)),this.tree.tnFocused=this,b.onFocus&&b.onFocus.call(this.tree,this),$(this.tree.tnFocused.span).addClass(b.classNames.focused),b.persist&&$.cookie(b.cookieId+"-focus",this.data.key,b.cookie))},visit:function(a,b){var c=!0;if(b===!0&&(c=a(this),c===!1||"skip"===c))return c;if(this.childList)for(var d=0,e=this.childList.length;e>d&&(c=this.childList[d].visit(a,!0),c!==!1);d++);return c},visitParents:function(a,b){if(b&&a(this)===!1)return!1;for(var c=this.parent;c;){if(a(c)===!1)return!1;c=c.parent}return!0},remove:function(){if(this===this.tree.root)throw"Cannot remove system root";return this.parent.removeChild(this)},removeChild:function(a){var b=this.childList;if(1===b.length){if(a!==b[0])throw"removeChild: invalid child";return this.removeChildren()}a===this.tree.activeNode&&a.deactivate(),this.tree.options.persist&&(a.bSelected&&this.tree.persistence.clearSelect(a.data.key),a.bExpanded&&this.tree.persistence.clearExpand(a.data.key)),a.removeChildren(!0),this.ul&&a.li&&this.ul.removeChild(a.li);for(var c=0,d=b.length;d>c;c++)if(b[c]===a){this.childList.splice(c,1);break}},removeChildren:function(a,b){this.tree.logDebug("%s.removeChildren(%o)",this,a);var c=this.tree,d=this.childList;if(d){for(var e=0,f=d.length;f>e;e++){var g=d[e];g!==c.activeNode||b||g.deactivate(),this.tree.options.persist&&!b&&(g.bSelected&&this.tree.persistence.clearSelect(g.data.key),g.bExpanded&&this.tree.persistence.clearExpand(g.data.key)),g.removeChildren(!0,b),this.ul&&g.li&&$("li",$(this.ul)).remove()}this.childList=null}a||(this._isLoading=!1,this.render())},setTitle:function(a){this.fromDict({title:a})},reload:function(){throw"Use reloadChildren() instead"},reloadChildren:function(a){if(null===this.parent)throw"Use tree.reload() instead";if(!this.data.isLazy)throw"node.reloadChildren() requires lazy nodes.";if(a){var b=this,c="nodeLoaded.dynatree."+this.tree.$tree.attr("id")+"."+this.data.key;this.tree.$tree.bind(c,function(d,e,f){if(b.tree.$tree.unbind(c),b.tree.logDebug("loaded %o, %o, %o",d,e,f),e!==b)throw"got invalid load event";a.call(b.tree,e,f)})}this.removeChildren(),this._loadContent()},_loadKeyPath:function(a,b){var c=this.tree;if(c.logDebug("%s._loadKeyPath(%s)",this,a),""===a)throw"Key path must not be empty";var d=a.split(c.options.keyPathSeparator);if(""===d[0])throw"Key path must be relative (don't start with '/')";var e=d.shift();if(this.childList)for(var f=0,g=this.childList.length;g>f;f++){var h=this.childList[f];if(h.data.key===e){if(0===d.length)b.call(c,h,"ok");else if(!h.data.isLazy||null!==h.childList&&void 0!==h.childList)b.call(c,h,"loaded"),h._loadKeyPath(d.join(c.options.keyPathSeparator),b);else{c.logDebug("%s._loadKeyPath(%s) -> reloading %s...",this,a,h);var i=this;h.reloadChildren(function(e,f){f?(c.logDebug("%s._loadKeyPath(%s) -> reloaded %s.",e,a,e),b.call(c,h,"loaded"),e._loadKeyPath(d.join(c.options.keyPathSeparator),b)):(c.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.",i,a),b.call(c,h,"error"))})}return}}b.call(c,void 0,"notfound",e,0===d.length),c.logWarning("Node not found: "+e)},resetLazy:function(){if(null===this.parent)throw"Use tree.reload() instead";if(!this.data.isLazy)throw"node.resetLazy() requires lazy nodes.";this.expand(!1),this.removeChildren()},_addChildNode:function(a,b){var c=this.tree,d=c.options,e=c.persistence;if(a.parent=this,null===this.childList?this.childList=[]:b||this.childList.length>0&&$(this.childList[this.childList.length-1].span).removeClass(d.classNames.lastsib),b){var f=$.inArray(b,this.childList);if(0>f)throw"<beforeNode> must be a child of <this>";this.childList.splice(f,0,a)}else this.childList.push(a);var g=c.isInitializing();if(d.persist&&e.cookiesFound&&g?(e.activeKey===a.data.key&&(c.activeNode=a),e.focusedKey===a.data.key&&(c.focusNode=a),a.bExpanded=$.inArray(a.data.key,e.expandedKeyList)>=0,a.bSelected=$.inArray(a.data.key,e.selectedKeyList)>=0):(a.data.activate&&(c.activeNode=a,d.persist&&(e.activeKey=a.data.key)),a.data.focus&&(c.focusNode=a,d.persist&&(e.focusedKey=a.data.key)),a.bExpanded=a.data.expand===!0,a.bExpanded&&d.persist&&e.addExpand(a.data.key),a.bSelected=a.data.select===!0,a.bSelected&&d.persist&&e.addSelect(a.data.key)),d.minExpandLevel>=a.getLevel()&&(this.bExpanded=!0),a.bSelected&&3==d.selectMode)for(var h=this;h;)h.hasSubSel||h._setSubSel(!0),h=h.parent;return c.bEnableUpdate&&this.render(),a},addChild:function(a,b){if("string"==typeof a)throw"Invalid data type for "+a;if(a&&0!==a.length){if(a instanceof DynaTreeNode)return this._addChildNode(a,b);a.length||(a=[a]);for(var c=this.tree.enableUpdate(!1),d=null,e=0,f=a.length;f>e;e++){var g=a[e],h=this._addChildNode(new DynaTreeNode(this,this.tree,g),b);d||(d=h),g.children&&h.addChild(g.children,null)}return this.tree.enableUpdate(c),d}},append:function(a){return this.tree.logWarning("node.append() is deprecated (use node.addChild() instead)."),this.addChild(a,null)},appendAjax:function(a){var b=this;if(this.removeChildren(!1,!0),this.setLazyNodeStatus(DTNodeStatus_Loading),a.debugLazyDelay){var c=a.debugLazyDelay;return a.debugLazyDelay=0,this.tree.logInfo("appendAjax: waiting for debugLazyDelay "+c),void setTimeout(function(){b.appendAjax(a)},c)}var d=a.success,e=a.error,f="nodeLoaded.dynatree."+this.tree.$tree.attr("id")+"."+this.data.key,g=$.extend({},this.tree.options.ajaxDefaults,a,{success:function(a,c){var e=b.tree.phase,g=b.tree.options;b.tree.phase="init",g.postProcess?a=g.postProcess.call(this,a,this.dataType):a&&a.hasOwnProperty("d")&&(a="string"==typeof a.d?$.parseJSON(a.d):a.d),$.isArray(a)&&0===a.length||b.addChild(a,null),b.tree.phase="postInit",d&&d.call(g,b,a,c),b.tree.logDebug("trigger "+f),b.tree.$tree.trigger(f,[b,!0]),b.tree.phase=e,b.setLazyNodeStatus(DTNodeStatus_Ok),$.isArray(a)&&0===a.length&&(b.childList=[],b.render())},error:function(a,c,d){b.tree.logWarning("appendAjax failed:",c,":\n",a,"\n",d),e&&e.call(g,b,a,c,d),b.tree.$tree.trigger(f,[b,!1]),b.setLazyNodeStatus(DTNodeStatus_Error,{info:c,tooltip:""+d})}});$.ajax(g)},move:function(a,b){var c;if(this!==a){if(!this.parent)throw"Cannot move system root";(void 0===b||"over"==b)&&(b="child");var d=this.parent,e="child"===b?a:a.parent;if(e.isDescendantOf(this))throw"Cannot move a node to it's own descendant";if(1==this.parent.childList.length)this.parent.childList=this.parent.data.isLazy?[]:null,this.parent.bExpanded=!1;else{if(c=$.inArray(this,this.parent.childList),0>c)throw"Internal error";this.parent.childList.splice(c,1)}if(this.parent.ul&&this.li&&this.parent.ul.removeChild(this.li),this.parent=e,e.hasChildren())switch(b){case"child":e.childList.push(this);break;case"before":if(c=$.inArray(a,e.childList),0>c)throw"Internal error";e.childList.splice(c,0,this);break;case"after":if(c=$.inArray(a,e.childList),0>c)throw"Internal error";e.childList.splice(c+1,0,this);break;default:throw"Invalid mode "+b}else e.childList=[this];if(e.ul||(e.ul=document.createElement("ul"),e.ul.style.display="none",e.li&&e.li.appendChild(e.ul)),this.li&&e.ul.appendChild(this.li),this.tree!==a.tree)throw this.visit(function(b){b.tree=a.tree},null,!0),"Not yet implemented.";d.isDescendantOf(e)||d.render(),e.isDescendantOf(d)||e.render()}},lastentry:void 0};var DynaTreeStatus=Class.create();DynaTreeStatus._getTreePersistData=function(a,b){var c=new DynaTreeStatus(a,b);return c.read(),c.toDict()},getDynaTreePersistData=DynaTreeStatus._getTreePersistData,DynaTreeStatus.prototype={initialize:function(a,b){void 0===a&&(a=$.ui.dynatree.prototype.options.cookieId),b=$.extend({},$.ui.dynatree.prototype.options.cookie,b),this.cookieId=a,this.cookieOpts=b,this.cookiesFound=void 0,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 a=$.cookie(this.cookieId+"-active");this.activeKey=a||"",a&&(this.cookiesFound=!0),a=$.cookie(this.cookieId+"-focus"),this.focusedKey=a||"",a&&(this.cookiesFound=!0),a=$.cookie(this.cookieId+"-expand"),this.expandedKeyList=a?a.split(","):[],a&&(this.cookiesFound=!0),a=$.cookie(this.cookieId+"-select"),this.selectedKeyList=a?a.split(","):[],a&&(this.cookiesFound=!0)},write:function(){$.cookie(this.cookieId+"-active",null===this.activeKey?"":this.activeKey,this.cookieOpts),$.cookie(this.cookieId+"-focus",null===this.focusedKey?"":this.focusedKey,this.cookieOpts),$.cookie(this.cookieId+"-expand",null===this.expandedKeyList?"":this.expandedKeyList.join(","),this.cookieOpts),$.cookie(this.cookieId+"-select",null===this.selectedKeyList?"":this.selectedKeyList.join(","),this.cookieOpts)},addExpand:function(a){$.inArray(a,this.expandedKeyList)<0&&(this.expandedKeyList.push(a),$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},clearExpand:function(a){var b=$.inArray(a,this.expandedKeyList);b>=0&&(this.expandedKeyList.splice(b,1),$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},addSelect:function(a){$.inArray(a,this.selectedKeyList)<0&&(this.selectedKeyList.push(a),$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},clearSelect:function(a){var b=$.inArray(a,this.selectedKeyList);b>=0&&(this.selectedKeyList.splice(b,1),$.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:void 0};var DynaTree=Class.create();DynaTree.version="@@Version",DynaTree.prototype={initialize:function(a){this.phase="init",this.$widget=a,this.options=a.options,this.$tree=a.element,this.timer=null,this.divTree=this.$tree.get(0),_initDragAndDrop(this)},_load:function(a){var b=(this.$widget,this.options),c=this;this.bEnableUpdate=!0,this._nodeCount=1,this.activeNode=null,this.focusNode=null,void 0!==b.rootVisible&&this.logWarning("Option 'rootVisible' is no longer supported."),b.minExpandLevel<1&&(this.logWarning("Option 'minExpandLevel' must be >= 1."),b.minExpandLevel=1),b.classNames!==$.ui.dynatree.prototype.options.classNames&&(b.classNames=$.extend({},$.ui.dynatree.prototype.options.classNames,b.classNames)),b.ajaxDefaults!==$.ui.dynatree.prototype.options.ajaxDefaults&&(b.ajaxDefaults=$.extend({},$.ui.dynatree.prototype.options.ajaxDefaults,b.ajaxDefaults)),b.dnd!==$.ui.dynatree.prototype.options.dnd&&(b.dnd=$.extend({},$.ui.dynatree.prototype.options.dnd,b.dnd)),b.imagePath||$("script").each(function(){var a=/.*dynatree[^\/]*\.js$/i;return this.src.search(a)>=0?(b.imagePath=this.src.indexOf("/")>=0?this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/":"skin/",c.logDebug("Guessing imagePath from '%s': '%s'",this.src,b.imagePath),!1):void 0}),this.persistence=new DynaTreeStatus(b.cookieId,b.cookie),b.persist&&($.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='"+b.classNames.empty+"'></span>",tagVline:"<span class='"+b.classNames.vline+"'></span>",tagExpander:"<span class='"+b.classNames.expander+"'></span>",tagConnector:"<span class='"+b.classNames.connector+"'></span>",tagNodeIcon:"<span class='"+b.classNames.nodeIcon+"'></span>",tagCheckbox:"<span class='"+b.classNames.checkbox+"'></span>",lastentry:void 0},(b.children||b.initAjax&&b.initAjax.url||b.initId)&&$(this.divTree).empty();var d=this.$tree.find(">ul:first").hide();this.tnRoot=new DynaTreeNode(null,this,{}),this.tnRoot.bExpanded=!0,this.tnRoot.render(),this.divTree.appendChild(this.tnRoot.ul);var e=this.tnRoot,f=b.persist&&this.persistence.isReloading(),g=!1,h=this.enableUpdate(!1);this.logDebug("Dynatree._load(): read tree structure..."),b.children?e.addChild(b.children):b.initAjax&&b.initAjax.url?(g=!0,e.data.isLazy=!0,this._reloadAjax(a)):b.initId?this._createFromTag(e,$("#"+b.initId)):(this._createFromTag(e,d),d.remove()),this._checkConsistency(),g||3!=b.selectMode||e._updatePartSelectionState(),this.logDebug("Dynatree._load(): render nodes..."),this.enableUpdate(h),this.logDebug("Dynatree._load(): bind events..."),this.$widget.bind(),this.logDebug("Dynatree._load(): postInit..."),this.phase="postInit",b.persist&&this.persistence.write(),this.focusNode&&this.focusNode.isVisible()&&(this.logDebug("Focus on init: %o",this.focusNode),this.focusNode.focus()),g||(b.onPostInit&&b.onPostInit.call(this,f,!1),a&&a.call(this,"ok")),this.phase="idle"},_reloadAjax:function(a){var b=this.options;if(!b.initAjax||!b.initAjax.url)throw"tree.reload() requires 'initAjax' mode.";var c=this.persistence,d=$.extend({},b.initAjax);d.addActiveKey&&(d.data.activeKey=c.activeKey),d.addFocusedKey&&(d.data.focusedKey=c.focusedKey),d.addExpandedKeyList&&(d.data.expandedKeyList=c.expandedKeyList.join(",")),d.addSelectedKeyList&&(d.data.selectedKeyList=c.selectedKeyList.join(",")),d.success&&this.logWarning("initAjax: success callback is ignored; use onPostInit instead."),d.error&&this.logWarning("initAjax: error callback is ignored; use onPostInit instead.");var e=c.isReloading();d.success=function(c){3==b.selectMode&&c.tree.tnRoot._updatePartSelectionState(),b.onPostInit&&b.onPostInit.call(c.tree,e,!1),a&&a.call(c.tree,"ok")},d.error=function(c,d,f,g){b.onPostInit&&b.onPostInit.call(c.tree,e,!0,d,f,g),a&&a.call(c.tree,"error",d,f,g)},this.logDebug("Dynatree._init(): send Ajax request..."),this.tnRoot.appendAjax(d)},toString:function(){return"Dynatree '"+this.$tree.attr("id")+"'"},toDict:function(a){var b=this.tnRoot.toDict(!0);return a?b:b.children},serializeArray:function(a){ +for(var b=this.getSelectedNodes(a),c=this.$tree.attr("name")||this.$tree.attr("id"),d=[],e=0,f=b.length;f>e;e++)d.push({name:c,value:b[e].data.key});return d},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"init"==this.phase||"postInit"==this.phase},isReloading:function(){return("init"==this.phase||"postInit"==this.phase)&&this.options.persist&&this.persistence.cookiesFound},isUserEvent:function(){return"userEvent"==this.phase},redraw:function(){this.tnRoot.render(!1,!1)},renderInvisibleNodes:function(){this.tnRoot.render(!1,!0)},reload:function(a){this._load(a)},getRoot:function(){return this.tnRoot},enable:function(){this.$widget.enable()},disable:function(){this.$widget.disable()},getNodeByKey:function(a){var b=document.getElementById(this.options.idPrefix+a);if(b)return b.dtnode?b.dtnode:null;var c=null;return this.visit(function(b){return b.data.key===a?(c=b,!1):void 0},!0),c},getActiveNode:function(){return this.activeNode},reactivate:function(a){var b=this.activeNode;b&&(this.activeNode=null,b.activate(),a&&b.focus())},getSelectedNodes:function(a){var b=[];return this.tnRoot.visit(function(c){return c.bSelected&&(b.push(c),a===!0)?"skip":void 0}),b},activateKey:function(a){var b=null===a?null:this.getNodeByKey(a);return b?(b.focus(),b.activate(),b):(this.activeNode&&this.activeNode.deactivate(),this.activeNode=null,null)},loadKeyPath:function(a,b){var c=a.split(this.options.keyPathSeparator);return""===c[0]&&c.shift(),c[0]==this.tnRoot.data.key&&(this.logDebug("Removed leading root key."),c.shift()),a=c.join(this.options.keyPathSeparator),this.tnRoot._loadKeyPath(a,b)},selectKey:function(a,b){var c=this.getNodeByKey(a);return c?(c.select(b),c):null},enableUpdate:function(a){return this.bEnableUpdate==a?a:(this.bEnableUpdate=a,a&&this.redraw(),!a)},count:function(){return this.tnRoot.countChildren()},visit:function(a,b){return this.tnRoot.visit(a,b)},_createFromTag:function(parentTreeNode,$ulParent){var self=this;$ulParent.find(">li").each(function(){var $li=$(this),$liSpan=$li.find(">span:first"),$liA=$li.find(">a:first"),title,href=null,target=null,tooltip;if($liSpan.length)title=$liSpan.html();else if($liA.length)title=$liA.html(),href=$liA.attr("href"),target=$liA.attr("target"),tooltip=$liA.attr("title");else{title=$li.html();var iPos=title.search(/<ul/i);title=$.trim(iPos>=0?title.substring(0,iPos):title)}var 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")};if(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")){var dataAttr=$.trim($li.attr("data"));if(dataAttr){"{"!=dataAttr.charAt(0)&&(dataAttr="{"+dataAttr+"}");try{$.extend(data,eval("("+dataAttr+")"))}catch(e){throw"Error parsing node data: "+e+"\ndata:\n'"+dataAttr+"'"}}}var childNode=parentTreeNode.addChild(data),$ul=$li.find(">ul:first");$ul.length&&self._createFromTag(childNode,$ul)})},_checkConsistency:function(){},_setDndStatus:function(a,b,c,d,e){var f,g=a?$(a.span):null,h=$(b.span),i=0,j="center";if(this.$dndMarker||(this.$dndMarker=$("<div id='dynatree-drop-marker'></div>").hide().css({"z-index":1e3}).prependTo($(this.divTree).parent())),"after"===d||"before"===d||"over"===d){switch(d){case"before":this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-before"),j="top";break;case"after":this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-after"),j="bottom";break;default:this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before"),this.$dndMarker.addClass("dynatree-drop-over"),h.addClass("dynatree-drop-target"),i=8}f=jquerySupports.positionMyOfs?{my:"left"+offsetString(i)+" center",at:"left "+j,of:h}:{my:"left center",at:"left "+j,of:h,offset:""+i+" 0"},this.$dndMarker.show().position(f)}else h.removeClass("dynatree-drop-target"),this.$dndMarker.hide();"after"===d?h.addClass("dynatree-drop-after"):h.removeClass("dynatree-drop-after"),"before"===d?h.addClass("dynatree-drop-before"):h.removeClass("dynatree-drop-before"),e===!0?(g&&g.addClass("dynatree-drop-accept"),h.addClass("dynatree-drop-accept"),c.addClass("dynatree-drop-accept")):(g&&g.removeClass("dynatree-drop-accept"),h.removeClass("dynatree-drop-accept"),c.removeClass("dynatree-drop-accept")),e===!1?(g&&g.addClass("dynatree-drop-reject"),h.addClass("dynatree-drop-reject"),c.addClass("dynatree-drop-reject")):(g&&g.removeClass("dynatree-drop-reject"),h.removeClass("dynatree-drop-reject"),c.removeClass("dynatree-drop-reject"))},_onDragEvent:function(a,b,c,d,e,f){var g,h,i,j=this.options.dnd,k=null,l=$(b.span);switch(a){case"helper":var m=$("<div class='dynatree-drag-helper'><span class='dynatree-drag-helper-img' /></div>").append(l.find(".dynatree-title").clone());$("ul.dynatree-container",b.tree.divTree).append(m),m.data("dtSourceNode",b),k=m;break;case"start":b.isStatusNode()?k=!1:j.onDragStart&&(k=j.onDragStart(b)),k===!1?(this.logDebug("tree.onDragStart() cancelled"),e.helper.trigger("mouseup"),e.helper.hide()):l.addClass("dynatree-drag-source");break;case"enter":i=j.onDragEnter?j.onDragEnter(b,c,e,f):null,k=i?$.isArray(i)?{over:$.inArray("over",i)>=0,before:$.inArray("before",i)>=0,after:$.inArray("after",i)>=0}:{over:i===!0||"over"===i,before:i===!0||"before"===i,after:i===!0||"after"===i}:!1,e.helper.data("enterResponse",k);break;case"over":if(h=e.helper.data("enterResponse"),g=null,h===!1);else if("string"==typeof h)g=h;else{var n=l.offset(),o={x:d.pageX-n.left,y:d.pageY-n.top},p={x:o.x/l.width(),y:o.y/l.height()};h.after&&p.y>.75?g="after":!h.over&&h.after&&p.y>.5?g="after":h.before&&p.y<=.25?g="before":!h.over&&h.before&&p.y<=.5?g="before":h.over&&(g="over"),j.preventVoidMoves&&(b===c?g=null:"before"===g&&c&&b===c.getNextSibling()?g=null:"after"===g&&c&&b===c.getPrevSibling()?g=null:"over"===g&&c&&c.parent===b&&c.isLastSibling()&&(g=null)),e.helper.data("hitMode",g)}"over"===g&&j.autoExpandMS&&b.hasChildren()!==!1&&!b.bExpanded&&b.scheduleAction("expand",j.autoExpandMS),g&&j.onDragOver&&(k=j.onDragOver(b,c,g,e,f),("over"===k||"before"===k||"after"===k)&&(g=k)),this._setDndStatus(c,b,e.helper,g,k!==!1&&null!==g);break;case"drop":var q=e.helper.hasClass("dynatree-drop-reject");g=e.helper.data("hitMode"),g&&j.onDrop&&!q&&j.onDrop(b,c,g,e,f);break;case"leave":b.scheduleAction("cancel"),e.helper.data("enterResponse",null),e.helper.data("hitMode",null),this._setDndStatus(c,b,e.helper,"out",void 0),j.onDragLeave&&j.onDragLeave(b,c,e,f);break;case"stop":l.removeClass("dynatree-drag-source"),j.onDragStop&&j.onDragStop(b);break;default:throw"Unsupported drag event: "+a}return k},cancelDrag:function(){var a=$.ui.ddmanager.current;a&&a.cancel()},lastentry:void 0},$.widget("ui.dynatree",{_init:function(){return versionCompare($.ui.version,"1.8")<0?(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()):void(this.options.debugLevel>=2&&_log("debug","ui.dynatree._init() was called; no current default functionality."))},_create:function(){var a=this.options;a.debugLevel>=1&&logMsg("Dynatree._create(): version='%s', debugLevel=%o.",$.ui.dynatree.version,this.options.debugLevel),this.options.event+=".dynatree";this.element.get(0);this.tree=new DynaTree(this),this.tree._load(),this.tree.logDebug("Dynatree._init(): done.")},bind:function(){function a(a){a=$.event.fix(a||window.event);var b=$.ui.dynatree.getNode(a.target);return b?b._onFocus(a):!1}this.unbind();var b="click.dynatree dblclick.dynatree";this.options.keyboard&&(b+=" keypress.dynatree keydown.dynatree"),this.element.bind(b,function(a){var b=$.ui.dynatree.getNode(a.target);if(!b)return!0;var c=b.tree,d=c.options;c.logDebug("event(%s): dtnode: %s",a.type,b);var e=c.phase;c.phase="userEvent";try{switch(a.type){case"click":return d.onClick&&d.onClick.call(c,b,a)===!1?!1:b._onClick(a);case"dblclick":return d.onDblClick&&d.onDblClick.call(c,b,a)===!1?!1:b._onDblClick(a);case"keydown":return d.onKeydown&&d.onKeydown.call(c,b,a)===!1?!1:b._onKeydown(a);case"keypress":return d.onKeypress&&d.onKeypress.call(c,b,a)===!1?!1:b._onKeypress(a)}}catch(f){c.logWarning("bind(%o): dtnode: %o, error: %o",a,b,f)}finally{c.phase=e}});var c=this.tree.divTree;c.addEventListener?(c.addEventListener("focus",a,!0),c.addEventListener("blur",a,!0)):c.onfocusin=c.onfocusout=a},unbind:function(){this.element.unbind(".dynatree")},enable:function(){this.bind(),$.Widget.prototype.enable.apply(this,arguments)},disable:function(){this.unbind(),$.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:void 0}),versionCompare($.ui.version,"1.8")<0&&($.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes"),$.extend($.ui.dynatree,{version:"1.2.8",buildType:"release",_DynaTreeClass:DynaTree,_DynaTreeNodeClass:DynaTreeNode,getNode:function(a){if(a instanceof DynaTreeNode)return a;for(void 0!==a.selector&&(a=a[0]);a;){if(a.dtnode)return a.dtnode;a=a.parentNode}return null},getPersistData:DynaTreeStatus._getTreePersistData}),$.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,revert:!1,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",radio:"dynatree-radio",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:void 0},versionCompare($.ui.version,"1.8")<0&&($.ui.dynatree.defaults=$.ui.dynatree.prototype.options),$.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:void 0};var didRegisterDnd=!1,_registerDnd=function(){didRegisterDnd||($.ui.plugin.add("draggable","connectToDynatree",{start:function(a,b){var c=$(this).data("ui-draggable")||$(this).data("draggable"),d=b.helper.data("dtSourceNode")||null;return d?(c.offset.click.top=-2,c.offset.click.left=16,d.tree._onDragEvent("start",d,null,a,b,c)):void 0},drag:function(a,b){var c=$(this).data("ui-draggable")||$(this).data("draggable"),d=b.helper.data("dtSourceNode")||null,e=b.helper.data("dtTargetNode")||null,f=$.ui.dynatree.getNode(a.target);if(a.target&&!f){var g=$(a.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length>0;if(g)return}b.helper.data("dtTargetNode",f),e&&e!==f&&e.tree._onDragEvent("leave",e,d,a,b,c),f&&f.tree.options.dnd.onDrop&&(f===e?f.tree._onDragEvent("over",f,d,a,b,c):f.tree._onDragEvent("enter",f,d,a,b,c))},stop:function(a,b){var c=$(this).data("ui-draggable")||$(this).data("draggable"),d=b.helper.data("dtSourceNode")||null,e=b.helper.data("dtTargetNode")||null,f=a.type,g="mouseup"==f&&1==a.which;logMsg("draggable-connectToDynatree.stop: targetNode(from event): %s, dtTargetNode: %s",e,b.helper.data("dtTargetNode")),g||logMsg("Drag was cancelled"),e&&(g&&e.tree._onDragEvent("drop",e,d,a,b,c),e.tree._onDragEvent("leave",e,d,a,b,c)),d&&d.tree._onDragEvent("stop",d,null,a,b,c)}}),didRegisterDnd=!0)}}(jQuery);
\ No newline at end of file |