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||(_canLog=!1)}}}function logMsg(){Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments)}var _canLog=!0,getDynaTreePersistData=void 0,DTNodeStatus_Error=-1,DTNodeStatus_Loading=1,DTNodeStatus_Ok=0;!function($){var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}},DynaTreeNode=Class.create();DynaTreeNode.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=$.extend({},$.ui.dynatree.nodedatadefaults,c),this.div=null,this.span=null,this.childList=null,this.isLoading=!1,this.hasSubSel=!1},toString:function(){return"dtnode<"+this.data.key+">: '"+this.data.title+"'"},toDict:function(a,b){var c=$.extend({},this.data);if(c.activate=this.tree.activeNode===this,c.focus=this.tree.focusNode===this,c.expand=this.bExpanded,c.select=this.bSelected,b&&b(c),a&&this.childList){c.children=[];for(var d=0;d0||a.minExpandLevel>1,e=a.rootVisible||a.minExpandLevel>0,f="",g=this.parent;g&&(!e||g!=c);)f=(g.isLastSibling()?b.tagEmpty:b.tagVline)+f,g=g.parent;d&&this.parent==c||(f+=this.childList||this.data.isLazy?b.tagExpander:b.tagConnector),a.checkbox&&1!=this.data.hideCheckbox&&!this.data.isStatusNode&&(f+=b.tagCheckbox),this.data.icon?f+="":0==this.data.icon||(f+=b.tagNodeIcon);var h=this.data&&"string"==typeof this.data.tooltip?" title='"+this.data.tooltip+"'":"";return f+=""+this.data.title+""},_fixOrder:function(){var a=this.childList;if(a)for(var b=this.div.firstChild.nextSibling,c=0;c=h&&h+j>=d&&e>=i&&i+k>=e){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":b.indexOf(c.folder)>=0||b.indexOf(c.document)>=0?this._getTypeForOuterNodeEvent(a):null},isVisible:function(){for(var a=this._parentList(!0,!1),b=0;ba").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&&0==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&&$.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.span,this)}else if(this.tree.activeNode===this){var c=this.tree.options;if(c.onQueryActivate&&0==c.onQueryActivate.call(this.span,!1,this))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.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&&this.tree.options.minExpandLevel>0&&(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))},_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;c0&&!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=0&&!(c=d[e].nextSibling());e--);c&&c.focus();break;default:b=!1}return!b},onKeypress:function(){},onFocus:function(a){var b=this.tree.options;"blur"==a.type||"focusout"==a.type?(b.onBlur&&b.onBlur.call(this.span,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.span,this),$(this.tree.tnFocused.span).addClass(b.classNames.focused),b.persist&&$.cookie(b.cookieId+"-focus",this.data.key,b.cookie))},visit:function(a,b,c){var d=0;if(1==c){if(0==a(this,b))return 1;d++}if(this.childList)for(var e=0;ef)throw" must be a child of ";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=1==a.data.expand,a.bExpanded&&d.persist&&e.addExpand(a.data.key),a.bSelected=1==a.data.select,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(!0,!0),a},addChild:function(a,b){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;e=0&&(this.expandedKeyList.splice(b,1),$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},addSelect:function(a){this._log("addSelect(%o)",a),$.inArray(a,this.selectedKeyList)<0&&(this.selectedKeyList.push(a),$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},clearSelect:function(a){this._log("clearSelect(%o)",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 1==this.cookiesFound},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: 0.5.4$",DynaTree.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.$widget,this.options);this.bEnableUpdate=!0,this._nodeCount=1,this.activeNode=null,this.focusNode=null,a.classNames!==$.ui.dynatree.defaults.classNames&&(a.classNames=$.extend({},$.ui.dynatree.defaults.classNames,a.classNames)),a.imagePath||$("script").each(function(){return this.src.search(_rexDtLibName)>=0?(a.imagePath=this.src.indexOf("/")>=0?this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/":"skin/",!1):void 0}),this.persistence=new DynaTreeStatus(a.cookieId,a.cookie),a.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:"",tagVline:"",tagExpander:"",tagConnector:"",tagNodeIcon:"",tagCheckbox:"",lastentry:void 0},a.children||a.initAjax&&a.initAjax.url||a.initId?$(this.divTree).empty():this.divRoot&&$(this.divRoot).remove(),this.tnRoot=new DynaTreeNode(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,e=this.enableUpdate(!1);if(this.logDebug("Dynatree._load(): read tree structure..."),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,$("#"+a.initId));else{var f=this.$tree.find(">ul").hide();this._createFromTag(b,f),f.remove()}this._checkConsistency(),this.logDebug("Dynatree._load(): render nodes..."),this.enableUpdate(e),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=$.extend({},a.initAjax);if(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(",")),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(){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.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){var b=document.getElementById(this.options.idPrefix+a);return b&&b.dtnode?b.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=[];return this.tnRoot.visit(function(c){return c.bSelected&&(b.push(c),1==a)?!1: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)},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)},visit:function(a,b,c){return this.tnRoot.visit(a,b,c)},_createFromTag:function(parentTreeNode,$ulParent){var self=this;$ulParent.find(">li").each(function(){var $li=$(this),$liSpan=$li.find(">span:first"),title;if($liSpan.length)title=$liSpan.html();else{title=$li.html();var iPos=title.search(/
    =0?title.substring(0,iPos):title)}var data={title:title,isFolder:$li.hasClass("folder"),isLazy:$li.hasClass("lazy"),expand:$li.hasClass("expanded"),select:$li.hasClass("selected"),activate:$li.hasClass("active"),focus:$li.hasClass("focused")};if($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+"'"}}}childNode=parentTreeNode.addChild(data);var $ul=$li.find(">ul:first");$ul.length&&self._createFromTag(childNode,$ul)})},_checkConsistency:function(){},lastentry:void 0},$.widget("ui.dynatree",{init:function(){return _log("warn","ui.dynatree.init() was called; you should upgrade to ui.core.js v1.6 or higher."),this._init()},_init:function(){return parseFloat($.ui.version)<1.8?(_log("info","ui.dynatree._init() was called; consider upgrading to jquery.ui.core.js v1.8 or higher."),this._create()):void _log("debug","ui.dynatree._init() was called; no current default functionality.")},_create:function(){parseFloat($.ui.version)>=1.8&&(this.options=$.extend(!0,{},$[this.namespace][this.widgetName].defaults,this.options)),logMsg("Dynatree._create(): version='%s', debugLevel=%o.",DynaTree.version,this.options.debugLevel);this.options;this.options.event+=".dynatree";this.element.get(0);this.tree=new DynaTree(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=arguments[0]=$.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 e="click.dynatree dblclick.dynatree";d.keyboard&&(e+=" keypress.dynatree keydown.dynatree"),c.bind(e,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&&d.onClick(c,b)===!1?!1:c.onClick(b);case"dblclick":return d.onDblClick&&d.onDblClick(c,b)===!1?!1:c.onDblClick(b);case"keydown":return d.onKeydown&&d.onKeydown(c,b)===!1?!1:c.onKeydown(b);case"keypress":return d.onKeypress&&d.onKeypress(c,b)===!1?!1:c.onKeypress(b)}}catch(f){}finally{c.tree.phase=e}});var f=this.tree.divTree;f.addEventListener?(f.addEventListener("focus",b,!0),f.addEventListener("blur",b,!0)):f.onfocusin=f.onfocusout=b},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}),$.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes",$.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},$.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; //# sourceMappingURL=../../../maps/libs/jquery/jquery.dynatree.js.map