| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- var _canLog=!0;function _log(e,l){if(_canLog){var j=Array.prototype.slice.apply(arguments,[1]),h=new Date,h=h.getHours()+":"+h.getMinutes()+":"+h.getSeconds()+"."+h.getMilliseconds();j[0]=h+" - "+j[0];try{switch(e){case "info":window.console.info.apply(window.console,j);break;case "warn":window.console.warn.apply(window.console,j);break;default:window.console.log.apply(window.console,j)}}catch(k){window.console||(_canLog=!1)}}}
- function logMsg(e){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments)}var getDynaTreePersistData=void 0,DTNodeStatus_Error=-1,DTNodeStatus_Loading=1,DTNodeStatus_Ok=0;
- (function(e){var l={create:function(){return function(){this.initialize.apply(this,arguments)}}},j=l.create();j.prototype={initialize:function(a,b,c){this.parent=a;this.tree=b;"string"==typeof c&&(c={title:c});void 0==c.key&&(c.key="_"+b._nodeCount++);this.data=e.extend({},e.ui.dynatree.nodedatadefaults,c);this.childList=this.span=this.div=null;this.hasSubSel=this.isLoading=!1},toString:function(){return"dtnode<"+this.data.key+">: '"+this.data.title+"'"},toDict:function(a,b){var c=e.extend({},this.data);
- c.activate=this.tree.activeNode===this;c.focus=this.tree.focusNode===this;c.expand=this.bExpanded;c.select=this.bSelected;b&&b(c);if(a&&this.childList){c.children=[];for(var d=0;d<this.childList.length;d++)c.children.push(this.childList[d].toDict(!0,b))}else delete c.children;return c},_getInnerHtml:function(){for(var a=this.tree.options,b=this.tree.cache,c=a.rootVisible?null:this.tree.tnRoot,d=a.rootVisible||0<a.minExpandLevel,f="",g=this.parent;g&&!(d&&g==c);)f=(g.isLastSibling()?b.tagEmpty:b.tagVline)+
- f,g=g.parent;f=this.childList||this.data.isLazy?f+b.tagExpander:f+b.tagConnector;a.checkbox&&(!0!=this.data.hideCheckbox&&!this.data.isStatusNode)&&(f+=b.tagCheckbox);this.data.icon?f+="<img src='"+a.imagePath+this.data.icon+"' alt='' />":!1!=this.data.icon&&(f+=b.tagNodeIcon);return f+="<a href='#' class='"+a.classNames.title+"'"+(this.data&&"string"==typeof this.data.tooltip?" title='"+this.data.tooltip+"'":"")+">"+this.data.title+"</a>"},_fixOrder:function(){var a=this.childList;if(a)for(var b=
- this.div.firstChild.nextSibling,c=0;c<a.length-1;c++){var d=a[c],f=b.firstChild.dtnode;d!==f?(this.tree.logDebug("_fixOrder: mismatch at index "+c+": "+d+" != "+f),this.div.insertBefore(d.div,f.div)):b=b.nextSibling}},render:function(a,b){var c=this.tree.options.classNames,d=this.isLastSibling();this.div||(this.span=document.createElement("span"),this.span.dtnode=this,this.data.key&&(this.span.id=this.tree.options.idPrefix+this.data.key),this.div=document.createElement("div"),this.div.appendChild(this.span),
- this.parent&&this.parent.div.appendChild(this.div),null==this.parent&&!this.tree.options.rootVisible&&(this.span.style.display="none"));this.span.innerHTML=this._getInnerHtml();this.div.style.display=null==this.parent||this.parent.bExpanded?"":"none";var f=[];f.push(this.data.isFolder?c.folder:c.document);this.bExpanded&&f.push(c.expanded);null!=this.childList&&f.push(c.hasChildren);this.data.isLazy&&null==this.childList&&f.push(c.lazy);d&&f.push(c.lastsib);this.bSelected&&f.push(c.selected);this.hasSubSel&&
- f.push(c.partsel);this.tree.activeNode===this&&f.push(c.active);this.data.addClass&&f.push(this.data.addClass);f.push(c.combinedExpanderPrefix+(this.bExpanded?"e":"c")+(this.data.isLazy&&null==this.childList?"d":"")+(d?"l":""));f.push(c.combinedIconPrefix+(this.bExpanded?"e":"c")+(this.data.isFolder?"f":""));this.span.className=f.join(" ");if(a&&this.childList&&(b||this.bExpanded)){for(c=0;c<this.childList.length;c++)this.childList[c].render(a,b);this._fixOrder()}},hasChildren:function(){return null!=
- this.childList},isLastSibling:function(){var a=this.parent;return!a?!0:a.childList[a.childList.length-1]===this},prevSibling:function(){if(!this.parent)return null;for(var a=this.parent.childList,b=1;b<a.length;b++)if(a[b]===this)return a[b-1];return null},nextSibling:function(){if(!this.parent)return null;for(var a=this.parent.childList,b=0;b<a.length-1;b++)if(a[b]===this)return a[b+1];return null},_setStatusNode:function(a){var b=this.childList?this.childList[0]:null;a?b?(a.isStatusNode=!0,b.data=
- a,b.render(!1,!1)):(a.isStatusNode=!0,this.addChild(a)):b&&(this.div.removeChild(b.div),1==this.childList.length?this.childList=null: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.isLoading=!1;this.render(!1,!1);this.tree.options.autoFocus&&(this===this.tree.tnRoot&&!this.tree.options.rootVisible&&this.childList?this.childList[0].focus():this.focus());break;case DTNodeStatus_Loading:this.isLoading=
- !0;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(0>c.className.indexOf(b.folder)&&0>c.className.indexOf(b.document))return null;var d=a.pageX-c.offsetLeft;a=a.pageY-c.offsetTop;for(var f=0;f<c.childNodes.length;f++){var g=c.childNodes[f],e=g.offsetLeft-c.offsetLeft,h=g.offsetTop-c.offsetTop,j=g.clientWidth,k=g.clientHeight;if(d>=e&&d<=e+j&&a>=h&&a<=h+k){if(g.className==b.title)return"title";if(g.className==b.expander)return"expander";if(g.className==
- b.checkbox)return"checkbox";if(g.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==c.title?"title":b==c.expander?"expander":b==c.checkbox?"checkbox":b==c.nodeIcon?"icon":b==c.empty||b==c.vline||b==c.connector?"prefix":0<=b.indexOf(c.folder)||0<=b.indexOf(c.document)?this._getTypeForOuterNodeEvent(a):null},isVisible:function(){for(var a=this._parentList(!0,!1),b=0;b<a.length;b++)if(!a[b].bExpanded)return!1;
- return!0},makeVisible:function(){for(var a=this._parentList(!0,!1),b=0;b<a.length;b++)a[b]._expand(!0)},focus:function(){this.makeVisible();try{e(this.span).find(">a").focus()}catch(a){}},_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&&(!b||!(c.onQueryActivate&&!1==c.onQueryActivate.call(this.span,a,this))))if(a){if(this.tree.activeNode){if(this.tree.activeNode===this)return;this.tree.activeNode.deactivate()}c.activeVisible&&
- this.makeVisible();this.tree.activeNode=this;c.persist&&e.cookie(c.cookieId+"-active",this.data.key,c.cookie);this.tree.persistence.activeKey=this.data.key;e(this.span).addClass(c.classNames.active);b&&c.onActivate&&c.onActivate.call(this.span,this)}else this.tree.activeNode===this&&(c=this.tree.options,c.onQueryActivate&&!1==c.onQueryActivate.call(this.span,!1,this)||(e(this.span).removeClass(c.classNames.active),c.persist&&e.cookie(c.cookieId+"-active","",c.cookie),this.tree.persistence.activeKey=
- null,this.tree.activeNode=null,b&&c.onDeactivate&&c.onDeactivate.call(this.span,this)))},activate:function(){this._activate(!0,!0)},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&&0<this.tree.options.minExpandLevel&&(b=!1);b&&(this.toggleExpand(),this.focus());a&&this.activate()},_setSubSel:function(a){a?
- (this.hasSubSel=!0,e(this.span).addClass(this.tree.options.classNames.partsel)):(this.hasSubSel=!1,e(this.span).removeClass(this.tree.options.classNames.partsel))},_fixSelectionState:function(){if(this.bSelected){this.visit(function(a){a.parent._setSubSel(!0);a._select(!0,!1,!1)});for(var a=this.parent;a;){a._setSubSel(!0);for(var b=!0,c=0;c<a.childList.length;c++){var d=a.childList[c];if(!d.bSelected&&!d.data.isStatusNode){b=!1;break}}b&&a._select(!0,!1,!1);a=a.parent}}else{this._setSubSel(!1);this.visit(function(a){a._setSubSel(!1);
- a._select(!1,!1,!1)});for(a=this.parent;a;){a._select(!1,!1,!1);b=!1;for(c=0;c<a.childList.length;c++)if(a.childList[c].bSelected||a.childList[c].hasSubSel){b=!0;break}a._setSubSel(b);a=a.parent}}},_select:function(a,b,c){var d=this.tree.options;if(!this.data.isStatusNode&&this.bSelected!=a&&(!b||!(d.onQuerySelect&&!1==d.onQuerySelect.call(this.span,a,this))))1==d.selectMode&&a&&this.tree.visit(function(a){if(a.bSelected)return a._select(!1,!1,!1),!1}),(this.bSelected=a)?(d.persist&&this.tree.persistence.addSelect(this.data.key),
- e(this.span).addClass(d.classNames.selected),c&&3==d.selectMode&&this._fixSelectionState(),b&&d.onSelect&&d.onSelect.call(this.span,!0,this)):(d.persist&&this.tree.persistence.clearSelect(this.data.key),e(this.span).removeClass(d.classNames.selected),c&&3==d.selectMode&&this._fixSelectionState(),b&&d.onSelect&&d.onSelect.call(this.span,!1,this))},select:function(a){return this.data.unselectable?this.bSelected:this._select(!1!=a,!0,!0)},toggleSelect:function(){return this.select(!this.bSelected)},
- isSelected:function(){return this.bSelected},_loadContent:function(){try{var a=this.tree.options;this.tree.logDebug("_loadContent: start - %o",this);this.setLazyNodeStatus(DTNodeStatus_Loading);!0==a.onLazyRead.call(this.span,this)&&(this.setLazyNodeStatus(DTNodeStatus_Ok),this.tree.logDebug("_loadContent: succeeded - %o",this))}catch(b){this.setLazyNodeStatus(DTNodeStatus_Error),this.tree.logWarning("_loadContent: failed - %o",b)}},_expand:function(a){if(this.bExpanded!=a){var b=this.tree.options;
- if(!(b.onQueryExpand&&!1==b.onQueryExpand.call(this.span,a,this))){this.bExpanded=a;b.persist&&(a?this.tree.persistence.addExpand(this.data.key):this.tree.persistence.clearExpand(this.data.key));this.render(!1);if(this.bExpanded&&this.parent&&b.autoCollapse)for(var c=this._parentList(!1,!0),d=0;d<c.length;d++)c[d].collapseSiblings();b.activeVisible&&(this.tree.activeNode&&!this.tree.activeNode.isVisible())&&this.tree.activeNode.deactivate();if(a&&this.data.isLazy&&null==this.childList&&!this.isLoading)this._loadContent();
- else{c=b.fx?b.fx.duration||200:0;if(this.childList)for(d=0;d<this.childList.length;d++){var f=e(this.childList[d].div);c?a!=f.is(":visible")&&f.animate(b.fx,c):a?f.show():f.hide()}b.onExpand&&b.onExpand.call(this.span,a,this)}}}},expand:function(a){if(this.childList||this.data.isLazy||!a)null==this.parent&&0<this.tree.options.minExpandLevel&&!a||this._expand(a)},toggleExpand:function(){this.expand(!this.bExpanded)},collapseSiblings:function(){if(null!=this.parent)for(var a=this.parent.childList,b=
- 0;b<a.length;b++)a[b]!==this&&a[b].bExpanded&&a[b]._expand(!1)},onClick:function(a){a=this.getEventTargetType(a);"expander"==a?(this.toggleExpand(),this.focus()):"checkbox"==a?(this.toggleSelect(),this.focus()):(this._userActivate(),this.span.getElementsByTagName("a")[0].focus());return!1},onDblClick:function(){},onKeydown:function(a){var b=!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.tree.options.rootVisible||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(var c=this.prevSibling();c&&c.bExpanded&&c.childList;)c=c.childList[c.childList.length-1];if(!c&&this.parent&&(this.tree.options.rootVisible||this.parent.parent))c=
- this.parent;c&&c.focus();break;case 40:if(this.bExpanded&&this.childList)c=this.childList[0];else{a=this._parentList(!1,!0);for(var d=a.length-1;0<=d&&!(c=a[d].nextSibling());d--);}c&&c.focus();break;default:b=!1}return!b},onKeypress:function(){},onFocus:function(a){var b=this.tree.options;if("blur"==a.type||"focusout"==a.type)b.onBlur&&b.onBlur.call(this.span,this),this.tree.tnFocused&&e(this.tree.tnFocused.span).removeClass(b.classNames.focused),this.tree.tnFocused=null,b.persist&&e.cookie(b.cookieId+
- "-focus","",b.cookie);else if("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),e(this.tree.tnFocused.span).removeClass(b.classNames.focused)),this.tree.tnFocused=this,b.onFocus&&b.onFocus.call(this.span,this),e(this.tree.tnFocused.span).addClass(b.classNames.focused),b.persist&&e.cookie(b.cookieId+"-focus",this.data.key,b.cookie)},visit:function(a,b,c){var d=0;if(!0==c){if(!1==a(this,
- b))return 1;d++}if(this.childList)for(c=0;c<this.childList.length;c++)d+=this.childList[c].visit(a,b,!0);return d},remove:function(){return this===this.tree.root?!1: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.div.removeChild(a.div);for(var c=0;c<b.length;c++)if(b[c]===a){this.childList.splice(c,1);delete a;break}},removeChildren:function(a,b){var c=this.tree,d=this.childList;if(d){for(var f=0;f<d.length;f++){var g=d[f];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.div.removeChild(g.div);delete g}this.childList=
- null}a||(this.isLoading=!1,this.render(!1,!1))},reload:function(a){if(null==this.parent)return this.tree.reload();if(!this.data.isLazy)throw"node.reload() requires lazy nodes.";this.bExpanded?(this.expand(!1),this.removeChildren(),this.expand(!0)):(this.removeChildren(),a&&this._loadContent())},_addChildNode:function(a,b){var c=this.tree,d=c.options,f=c.persistence;a.parent=this;null==this.childList?this.childList=[]:b||e(this.childList[this.childList.length-1].span).removeClass(d.classNames.lastsib);
- if(b){var g=e.inArray(b,this.childList);if(0>g)throw"<beforeNode> must be a child of <this>";this.childList.splice(g,0,a)}else this.childList.push(a);g=c.isInitializing();d.persist&&f.cookiesFound&&g?(f.activeKey==a.data.key&&(c.activeNode=a),f.focusedKey==a.data.key&&(c.focusNode=a),a.bExpanded=0<=e.inArray(a.data.key,f.expandedKeyList),a.bSelected=0<=e.inArray(a.data.key,f.selectedKeyList)):(a.data.activate&&(c.activeNode=a,d.persist&&(f.activeKey=a.data.key)),a.data.focus&&(c.focusNode=a,d.persist&&
- (f.focusedKey=a.data.key)),a.bExpanded=!0==a.data.expand,a.bExpanded&&d.persist&&f.addExpand(a.data.key),a.bSelected=!0==a.data.select,a.bSelected&&d.persist&&f.addSelect(a.data.key));d.minExpandLevel>=a.getLevel()&&(this.bExpanded=!0);if(a.bSelected&&3==d.selectMode)for(d=this;d;)d.hasSubSel||d._setSubSel(!0),d=d.parent;c.bEnableUpdate&&this.render(!0,!0);return a},addChild:function(a,b){if(a&&0!=a.length){if(a instanceof j)return this._addChildNode(a,b);a.length||(a=[a]);for(var c=this.tree.enableUpdate(!1),
- d=null,f=0;f<a.length;f++){var g=a[f],e=this._addChildNode(new j(this,this.tree,g),b);d||(d=e);g.children&&e.addChild(g.children,null)}this.tree.enableUpdate(c);return d}},append:function(a){this.tree.logWarning("node.append() is deprecated (use node.addChild() instead).");return this.addChild(a,null)},appendAjax:function(a){this.removeChildren(!1,!0);this.setLazyNodeStatus(DTNodeStatus_Loading);var b=this,c=a.success,d=a.error,f=e.extend({},this.tree.options.ajaxDefaults,a,{success:function(a){if("1"!=
- a.FHZ){if("CSRF"==a.FHZ){showMsg(a.MSG||"",3);return}if("-1"==a.FHZ){_FW.oFtl.fnAlert(a.MSG||"");var d=b.tree.phase;b.tree.phase="init";b.tree.phase="postInit";b.setLazyNodeStatus(DTNodeStatus_Ok);b.tree.phase=d;return}}d=b.tree.phase;b.tree.phase="init";b.addChild(a,null);b.tree.phase="postInit";b.setLazyNodeStatus(DTNodeStatus_Ok);c&&c.call(f,b);b.tree.phase=d},error:function(a,c,e){b.tree.logWarning("appendAjax failed:",c,":\n",a,"\n",e);b.setLazyNodeStatus(DTNodeStatus_Error,{info:c,tooltip:""+
- e});d&&d.call(f,b,a,c,e)},beforeSend:function(a){var b=e.cookie(headtoken)||token;a.setRequestHeader(headtoken,b)}});e.ajax(f)},lastentry:void 0};var h=l.create();h._getTreePersistData=function(a,b){var c=new h(a,b);c.read();return c.toDict()};getDynaTreePersistData=h._getTreePersistData;h.prototype={initialize:function(a,b){this._log("DynaTreeStatus: initialize");void 0===a&&(a=e.ui.dynatree.defaults.cookieId);b=e.extend({},e.ui.dynatree.defaults.cookie,b);this.cookieId=a;this.cookieOpts=b;this.cookiesFound=
- void 0;this.selectedKeyList=this.expandedKeyList=this.focusedKey=this.activeKey=null},_log:function(a){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments)},read:function(){this._log("DynaTreeStatus: read");this.cookiesFound=!1;var a=e.cookie(this.cookieId+"-active");this.activeKey=null==a?"":a;null!=a&&(this.cookiesFound=!0);a=e.cookie(this.cookieId+"-focus");this.focusedKey=null==a?"":a;null!=a&&(this.cookiesFound=!0);a=e.cookie(this.cookieId+"-expand");this.expandedKeyList=
- null==a?[]:a.split(",");null!=a&&(this.cookiesFound=!0);a=e.cookie(this.cookieId+"-select");this.selectedKeyList=null==a?[]:a.split(",");null!=a&&(this.cookiesFound=!0)},write:function(){this._log("DynaTreeStatus: write");e.cookie(this.cookieId+"-active",null==this.activeKey?"":this.activeKey,this.cookieOpts);e.cookie(this.cookieId+"-focus",null==this.focusedKey?"":this.focusedKey,this.cookieOpts);e.cookie(this.cookieId+"-expand",null==this.expandedKeyList?"":this.expandedKeyList.join(","),this.cookieOpts);
- e.cookie(this.cookieId+"-select",null==this.selectedKeyList?"":this.selectedKeyList.join(","),this.cookieOpts)},addExpand:function(a){this._log("addExpand(%o)",a);0>e.inArray(a,this.expandedKeyList)&&(this.expandedKeyList.push(a),e.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},clearExpand:function(a){this._log("clearExpand(%o)",a);a=e.inArray(a,this.expandedKeyList);0<=a&&(this.expandedKeyList.splice(a,1),e.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),
- this.cookieOpts))},addSelect:function(a){this._log("addSelect(%o)",a);0>e.inArray(a,this.selectedKeyList)&&(this.selectedKeyList.push(a),e.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},clearSelect:function(a){this._log("clearSelect(%o)",a);a=e.inArray(a,this.selectedKeyList);0<=a&&(this.selectedKeyList.splice(a,1),e.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},isReloading:function(){return!0==this.cookiesFound},toDict:function(){return{cookiesFound:this.cookiesFound,
- activeKey:this.activeKey,focusedKey:this.activeKey,expandedKeyList:this.expandedKeyList,selectedKeyList:this.selectedKeyList}},lastentry:void 0};var k=l.create();k.version="$Version: 0.5.4$";k.prototype={initialize:function(a){this.phase="init";this.$widget=a;this.options=a.options;this.$tree=a.element;this.divTree=this.$tree.get(0)},_load:function(){var a=this.options;this.bEnableUpdate=!0;this._nodeCount=1;this.focusNode=this.activeNode=null;a.classNames!==e.ui.dynatree.defaults.classNames&&(a.classNames=
- e.extend({},e.ui.dynatree.defaults.classNames,a.classNames));a.imagePath||e("script").each(function(){if(0<=this.src.search(_rexDtLibName))return a.imagePath=0<=this.src.indexOf("/")?this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/":"skin/",!1});this.persistence=new h(a.cookieId,a.cookie);a.persist&&(e.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='"+
- a.classNames.empty+"'></span>",tagVline:"<span class='"+a.classNames.vline+"'></span>",tagExpander:"<span class='"+a.classNames.expander+"'></span>",tagConnector:"<span class='"+a.classNames.connector+"'></span>",tagNodeIcon:"<span class='"+a.classNames.nodeIcon+"'></span>",tagCheckbox:"<span class='"+a.classNames.checkbox+"'></span>",lastentry:void 0};a.children||a.initAjax&&a.initAjax.url||a.initId?e(this.divTree).empty():this.divRoot&&e(this.divRoot).remove();this.tnRoot=new j(null,this,{title:a.title,
- key:"root"});this.tnRoot.data.isFolder=!0;this.tnRoot.render(!1,!1);this.divRoot=this.tnRoot.div;this.divRoot.className=a.classNames.container;this.divTree.appendChild(this.divRoot);var b=this.tnRoot,c=a.persist&&this.persistence.isReloading(),d=!1,f=this.enableUpdate(!1);this.logDebug("Dynatree._load(): read tree structure...");if(a.children)b.addChild(a.children);else if(a.initAjax&&a.initAjax.url)d=!0,b.data.isLazy=!0,this._reloadAjax();else if(a.initId)this._createFromTag(b,e("#"+a.initId));else{var g=
- this.$tree.find(">ul").hide();this._createFromTag(b,g);g.remove()}this._checkConsistency();this.logDebug("Dynatree._load(): render nodes...");this.enableUpdate(f);this.logDebug("Dynatree._load(): bind events...");this.$widget.bind();this.logDebug("Dynatree._load(): postInit...");this.phase="postInit";a.persist&&this.persistence.write();this.focusNode&&this.focusNode.isVisible()&&(this.logDebug("Focus on init: %o",this.focusNode),this.focusNode.focus());!d&&a.onPostInit&&a.onPostInit.call(this,c,!1);
- this.phase="idle"},_reloadAjax:function(){var a=this.options;if(!a.initAjax||!a.initAjax.url)throw"tree.reload() requires 'initAjax' mode.";var b=this.persistence,c=e.extend({},a.initAjax);c.addActiveKey&&(c.data.activeKey=b.activeKey);c.addFocusedKey&&(c.data.focusedKey=b.focusedKey);c.addExpandedKeyList&&(c.data.expandedKeyList=b.expandedKeyList.join(","));c.addSelectedKeyList&&(c.data.selectedKeyList=b.selectedKeyList.join(","));if(a.onPostInit){c.success&&this.logWarning("initAjax: success callback is ignored when onPostInit was specified.");
- c.error&&this.logWarning("initAjax: error callback is ignored when onPostInit was specified.");var d=b.isReloading();c.success=function(b){a.onPostInit.call(b.tree,d,!1)};c.error=function(b){a.onPostInit.call(b.tree,d,!0)}}this.logDebug("Dynatree._init(): send Ajax request...");this.tnRoot.appendAjax(c)},toString:function(){return"DynaTree '"+this.options.title+"'"},toDict:function(){return this.tnRoot.toDict(!0)},getPersistData:function(){return this.persistence.toDict()},logDebug:function(a){2<=
- this.options.debugLevel&&(Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments))},logInfo:function(a){1<=this.options.debugLevel&&(Array.prototype.unshift.apply(arguments,["info"]),_log.apply(this,arguments))},logWarning:function(a){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.logDebug("dynatree.redraw()...");this.tnRoot.render(!0,!0);this.logDebug("dynatree.redraw() done.")},reloadAjax:function(){this.logWarning("tree.reloadAjax() is deprecated since v0.5.2 (use reload() instead).")},reload:function(){this._load()},getRoot:function(){return this.tnRoot},getNodeByKey:function(a){return(a=document.getElementById(this.options.idPrefix+a))&&a.dtnode?a.dtnode:null},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=[];this.tnRoot.visit(function(c){if(c.bSelected&&(b.push(c),!0==a))return!1});return b},activateKey:function(a){a=null===a?null:this.getNodeByKey(a);if(!a)return this.activeNode&&this.activeNode.deactivate(),this.activeNode=null;a.focus();a.activate();return a},selectKey:function(a,b){var c=this.getNodeByKey(a);if(!c)return null;c.select(b);return c},enableUpdate:function(a){if(this.bEnableUpdate==
- a)return a;(this.bEnableUpdate=a)&&this.redraw();return!a},visit:function(a,b,c){return this.tnRoot.visit(a,b,c)},_createFromTag:function(a,b){var c=this;b.find(">li").each(function(){var b=e(this),f=b.find(">span:first");if(f.length)f=f.html();else var f=b.html(),g=f.search(/<ul/i),f=0<=g?e.trim(f.substring(0,g)):e.trim(f);f={title:f,isFolder:b.hasClass("folder"),isLazy:b.hasClass("lazy"),expand:b.hasClass("expanded"),select:b.hasClass("selected"),activate:b.hasClass("active"),focus:b.hasClass("focused")};
- b.attr("title")&&(f.tooltip=b.attr("title"));b.attr("id")&&(f.key=b.attr("id"));if(b.attr("data")&&(g=e.trim(b.attr("data")))){"{"!=g.charAt(0)&&(g="{"+g+"}");try{e.extend(f,eval("("+g+")"))}catch(m){throw"Error parsing node data: "+m+"\ndata:\n'"+g+"'";}}childNode=a.addChild(f);b=b.find(">ul:first");b.length&&c._createFromTag(childNode,b)})},_checkConsistency:function(){},lastentry:void 0};e.widget("ui.dynatree",{init:function(){_log("warn","ui.dynatree.init() was called; you should upgrade to ui.core.js v1.6 or higher.");
- return this._init()},_init:function(){if(1.8>parseFloat(e.ui.version))return _log("info","ui.dynatree._init() was called; consider upgrading to jquery.ui.core.js v1.8 or higher."),this._create();_log("debug","ui.dynatree._init() was called; no current default functionality.")},_create:function(){1.8<=parseFloat(e.ui.version)&&(this.options=e.extend(!0,{},e[this.namespace][this.widgetName].defaults,this.options));logMsg("Dynatree._create(): version='%s', debugLevel=%o.",k.version,this.options.debugLevel);
- this.options.event+=".dynatree";this.element.get(0);this.tree=new k(this);this.tree._load();this.tree.logDebug("Dynatree._create(): done.")},bind:function(){function a(a){for(var b=5;a&&b--;){if(a.dtnode)return a.dtnode;a=a.parentNode}return null}function b(b){b=b=e.event.fix(b||window.event);var c=a(b.target);return c?c.onFocus(b):!1}var c=this.element,d=this.options;this.unbind();var f="click.dynatree dblclick.dynatree";d.keyboard&&(f+=" keypress.dynatree keydown.dynatree");c.bind(f,function(b){var c=
- a(b.target);if(!c)return!0;var e=c.tree.phase;c.tree.phase="userEvent";try{switch(c.tree.logDebug("bind(%o): dtnode: %o",b,c),b.type){case "click":return d.onClick&&!1===d.onClick(c,b)?!1:c.onClick(b);case "dblclick":return d.onDblClick&&!1===d.onDblClick(c,b)?!1:c.onDblClick(b);case "keydown":return d.onKeydown&&!1===d.onKeydown(c,b)?!1:c.onKeydown(b);case "keypress":return d.onKeypress&&!1===d.onKeypress(c,b)?!1:c.onKeypress(b)}}catch(f){}finally{c.tree.phase=e}});c=this.tree.divTree;c.addEventListener?
- (c.addEventListener("focus",b,!0),c.addEventListener("blur",b,!0)):c.onfocusin=c.onfocusout=b},unbind:function(){this.element.unbind(".dynatree")},enable:function(){this.bind();e.widget.prototype.enable.apply(this,arguments)},disable:function(){this.unbind();e.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});e.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes";e.ui.dynatree.defaults={title:"Dynatree root",rootVisible:!1,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,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,ajaxDefaults:{cache:!1,dataType:"json"},strings:{loading:"Loading…",loadError:"Load error!"},idPrefix:"ui-dynatree-id-",cookieId:"dynatree",cookie:{expires:null},classNames:{container:"ui-dynatree-container",folder:"ui-dynatree-folder",document:"ui-dynatree-document",empty:"ui-dynatree-empty",vline:"ui-dynatree-vline",expander:"ui-dynatree-expander",connector:"ui-dynatree-connector",checkbox:"ui-dynatree-checkbox",
- nodeIcon:"ui-dynatree-icon",title:"ui-dynatree-title",nodeError:"ui-dynatree-statusnode-error",nodeWait:"ui-dynatree-statusnode-wait",hidden:"ui-dynatree-hidden",combinedExpanderPrefix:"ui-dynatree-exp-",combinedIconPrefix:"ui-dynatree-ico-",hasChildren:"ui-dynatree-has-children",active:"ui-dynatree-active",selected:"ui-dynatree-selected",expanded:"ui-dynatree-expanded",lazy:"ui-dynatree-lazy",focused:"ui-dynatree-focused",partsel:"ui-dynatree-partsel",lastsib:"ui-dynatree-lastsib"},debugLevel:1,
- lastentry:void 0};e.ui.dynatree.nodedatadefaults={title:null,key:null,isFolder:!1,isLazy:!1,tooltip:null,icon:null,addClass:null,activate:!1,focus:!1,expand:!1,select:!1,hideCheckbox:!1,unselectable:!1,children:null,lastentry:void 0}})(jQuery);var _rexDtLibName=/.*dynatree[^/]*\.js$/i;
|