From 58aa9b26f5a07d05297dcb3ea99bdd0de7837773 Mon Sep 17 00:00:00 2001 From: "Martin@MBP" Date: Tue, 29 Apr 2014 19:55:13 +0200 Subject: [PATCH] Tagging the 2.0.0-12 release. --- dist/jquery.fancytree-all.js | 241 +++++++--------------- dist/jquery.fancytree-custom.min.js | 14 +- dist/jquery.fancytree.js | 6 +- dist/jquery.fancytree.min.js | 6 +- dist/src/jquery.fancytree.childcounter.js | 4 +- dist/src/jquery.fancytree.clones.js | 4 +- dist/src/jquery.fancytree.columnview.js | 4 +- dist/src/jquery.fancytree.debug.js | 4 +- dist/src/jquery.fancytree.dnd.js | 52 ++--- dist/src/jquery.fancytree.edit.js | 10 +- dist/src/jquery.fancytree.filter.js | 60 +----- dist/src/jquery.fancytree.glyph.js | 15 +- dist/src/jquery.fancytree.gridnav.js | 4 +- dist/src/jquery.fancytree.js | 6 +- dist/src/jquery.fancytree.menu.js | 4 +- dist/src/jquery.fancytree.persist.js | 75 +++---- dist/src/jquery.fancytree.table.js | 4 +- dist/src/jquery.fancytree.themeroller.js | 9 +- 18 files changed, 162 insertions(+), 360 deletions(-) diff --git a/dist/jquery.fancytree-all.js b/dist/jquery.fancytree-all.js index d16669c0..db4e8654 100644 --- a/dist/jquery.fancytree-all.js +++ b/dist/jquery.fancytree-all.js @@ -7,8 +7,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ /** Core Fancytree module. @@ -3772,7 +3772,7 @@ $.extend($.ui.fancytree, /** @lends Fancytree_Static# */ { /** @type {string} */ - version: "2.0.0-11", // Set to semver by 'grunt release' + version: "2.0.0-12", // Set to semver by 'grunt release' /** @type {string} */ buildType: "production", // Set to 'production' by 'grunt build' /** @type {int} */ @@ -4047,8 +4047,8 @@ $.extend($.ui.fancytree, * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ // To keep the global namespace clean, we wrap everything in a closure @@ -4223,8 +4223,8 @@ $.ui.fancytree.registerExtension({ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -4287,8 +4287,7 @@ function _initDragAndDrop(tree) { addClasses: false, tolerance: "intersect", greedy: false - /* - , +/* activate: function(event, ui) { logMsg("droppable - activate", event, ui, this); }, @@ -4326,18 +4325,11 @@ function _registerDnd() { // 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10 var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), sourceNode = ui.helper.data("ftSourceNode") || null; -// logMsg("draggable-connectToFancytree.start, %s", sourceNode); -// logMsg(" this: %o", this); -// logMsg(" event: %o", event); -// logMsg(" draggable: %o", draggable); -// logMsg(" ui: %o", ui); if(sourceNode) { // Adjust helper offset, so cursor is slightly outside top/left corner draggable.offset.click.top = -2; draggable.offset.click.left = + 16; -// logMsg(" draggable2: %o", draggable); -// logMsg(" draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top); // Trigger dragStart event // TODO: when called as connectTo..., the return value is ignored(?) return sourceNode.tree.ext.dnd._onDragEvent("start", sourceNode, null, event, ui, draggable); @@ -4350,8 +4342,7 @@ function _registerDnd() { sourceNode = ui.helper.data("ftSourceNode") || null, prevTargetNode = ui.helper.data("ftTargetNode") || null, targetNode = $.ui.fancytree.getNode(event.target); -// logMsg("$.ui.fancytree.getNode(%o): %s", event.target, targetNode); -// logMsg("connectToFancytree.drag: helper: %o", ui.helper[0]); + if(event.target && !targetNode){ // We got a drag event, but the targetNode could not be found // at the event location. This may happen, @@ -4364,7 +4355,6 @@ function _registerDnd() { return; } } -// logMsg("draggable-connectToFancytree.drag: targetNode(from event): %s, ftTargetNode: %s", targetNode, ui.helper.data("ftTargetNode")); ui.helper.data("ftTargetNode", targetNode); // Leaving a tree node if(prevTargetNode && prevTargetNode !== targetNode ) { @@ -4391,10 +4381,7 @@ function _registerDnd() { // mouseDownEvent = draggable._mouseDownEvent, eventType = event.type, dropped = (eventType === "mouseup" && event.which === 1); -// logMsg("draggable-connectToFancytree.stop: targetNode(from event): %s, ftTargetNode: %s", targetNode, ui.helper.data("ftTargetNode")); -// logMsg("draggable-connectToFancytree.stop, %s", sourceNode); -// logMsg(" type: %o, downEvent: %o, upEvent: %o", eventType, mouseDownEvent, event); -// logMsg(" targetNode: %o", targetNode); + if(!dropped){ logMsg("Drag was cancelled"); } @@ -4418,8 +4405,7 @@ function _registerDnd() { * */ -$.ui.fancytree.registerExtension( - { +$.ui.fancytree.registerExtension({ name: "dnd", version: "0.1.0", // Default options for this extension. @@ -4440,9 +4426,7 @@ $.ui.fancytree.registerExtension( draggable: null, // Additional options passed to jQuery draggable droppable: null // Additional options passed to jQuery droppable }, - // Override virtual methods for this extension. - // `this` : Fancytree instance - // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) + treeInit: function(ctx){ var tree = ctx.tree; this._super(ctx); @@ -4471,15 +4455,7 @@ $.ui.fancytree.registerExtension( .css({"z-index": 1000}) .prependTo($(this.$div).parent()); // .prependTo("body"); -// logMsg("Creating marker: %o", this.$dropMarker); - } -/* - if(hitMode === "start"){ } - if(hitMode === "stop"){ -// sourceNode.removeClass("fancytree-drop-target"); - } -*/ // this.$dropMarker.attr("class", hitMode); if(hitMode === "after" || hitMode === "before" || hitMode === "over"){ // $source && $source.addClass("fancytree-drag-source"); @@ -4600,9 +4576,8 @@ $.ui.fancytree.registerExtension( case "helper": // Only event and node argument is available $helper = $("
") - // .append($(event.target).closest("span.fancytree-node").find("span.fancytree-title").clone()); .append(nodeTag.find("span.fancytree-title").clone()); - // issue 244: helper should be child of scrollParent + // DT issue 244: helper should be child of scrollParent $("ul.fancytree-container", node.tree.$div).append($helper); // Attach node reference to helper object $helper.data("ftSourceNode", node); @@ -4610,6 +4585,7 @@ $.ui.fancytree.registerExtension( // logMsg("helper.sourceNode=%o", $helper.data("ftSourceNode")); res = $helper; break; + case "start": if( node.isStatusNode() ) { res = false; @@ -4627,6 +4603,7 @@ $.ui.fancytree.registerExtension( nodeTag.addClass("fancytree-drag-source"); } break; + case "enter": if(dnd.preventRecursiveMoves && node.isDescendantOf(otherNode)){ r = false; @@ -4653,6 +4630,7 @@ $.ui.fancytree.registerExtension( ui.helper.data("enterResponse", res); logMsg("helper.enterResponse: %o", res); break; + case "over": enterResponse = ui.helper.data("enterResponse"); hitMode = null; @@ -4710,10 +4688,11 @@ $.ui.fancytree.registerExtension( ctx.hitMode = hitMode; res = dnd.dragOver(node, ctx); } - // issue 332 + // DT issue 332 // this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false); this._local._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false && hitMode !== null); break; + case "drop": hitMode = ui.helper.data("hitMode"); if(hitMode && dnd.dragDrop){ @@ -4721,6 +4700,7 @@ $.ui.fancytree.registerExtension( dnd.dragDrop(node, ctx); } break; + case "leave": // Cancel pending expand request node.scheduleAction("cancel"); @@ -4731,14 +4711,16 @@ $.ui.fancytree.registerExtension( dnd.dragLeave(node, ctx); } break; + case "stop": nodeTag.removeClass("fancytree-drag-source"); if(dnd.dragStop){ dnd.dragStop(node, ctx); } break; + default: - throw "Unsupported drag event: " + eventName; + $.error("Unsupported drag event: " + eventName); } return res; }, @@ -4763,8 +4745,8 @@ $.ui.fancytree.registerExtension( * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -5027,10 +5009,6 @@ $.ui.fancytree.registerExtension({ // Local attributes currentNode: null, - // Override virtual methods for this extension. - // `this` : the Fancytree instance - // `this._local`: the namespace that contains extension attributes and private methods (same as this.ext.EXTNAME) - // `this._super`: the virtual function that was overridden (member of previous extension or Fancytree) treeInit: function(ctx){ this._super(ctx); this.$container.addClass("fancytree-ext-edit"); @@ -5042,7 +5020,7 @@ $.ui.fancytree.registerExtension({ return false; } } - this._super(ctx); + return this._super(ctx); }, nodeDblclick: function(ctx) { if( $.inArray("dblclick", ctx.options.edit.triggerStart) >= 0 ){ @@ -5082,8 +5060,8 @@ $.ui.fancytree.registerExtension({ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -5100,20 +5078,6 @@ function _escapeRegex(str){ return (str + "").replace(/([.?*+\^\$\[\]\\(){}|-])/g, "\\$1"); } -/* EXT-TABLE: Show/hide all rows that are structural descendants of `parent`. */ -// function setChildRowVisibility(parent, flag) { -// parent.visit(function(node){ -// var tr = node.tr; -// if(tr){ -// tr.style.display = flag ? "" : "none"; -// } -// node.debug(flag ? "SHOW" : "HIDE"); -// if(!node.expanded){ -// return "skip"; -// } -// }); -// } - /** * [ext-filter] Dimm or hide nodes. * @@ -5146,7 +5110,6 @@ $.ui.fancytree._FancytreeClass.prototype.applyFilter = function(filter){ } // Reset current filter this.visit(function(node){ -// node.hide = hideMode && true; delete node.match; delete node.subMatch; }); @@ -5154,10 +5117,8 @@ $.ui.fancytree._FancytreeClass.prototype.applyFilter = function(filter){ this.visit(function(node){ if ((!leavesOnly || node.children == null) && filter(node)) { count++; -// node.hide = false; node.match = true; node.visitParents(function(p){ -// p.hide = false; p.subMatch = true; }); } @@ -5175,7 +5136,6 @@ $.ui.fancytree._FancytreeClass.prototype.applyFilter = function(filter){ */ $.ui.fancytree._FancytreeClass.prototype.clearFilter = function(){ this.visit(function(node){ -// delete node.hide; delete node.match; delete node.subMatch; }); @@ -5190,22 +5150,14 @@ $.ui.fancytree._FancytreeClass.prototype.clearFilter = function(){ */ $.ui.fancytree.registerExtension({ name: "filter", - version: "0.0.2", + version: "0.1.0", // Default options for this extension. options: { mode: "dimm", leavesOnly: false }, - // Override virtual methods for this extension. - // `this` : is this extension object - // `this._base` : the Fancytree instance - // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) treeInit: function(ctx){ this._super(ctx); - // ctx.tree.filter = false; - }, - treeDestroy: function(ctx){ - this._super(ctx); }, nodeRenderStatus: function(ctx) { // Set classes for current status @@ -5215,31 +5167,15 @@ $.ui.fancytree.registerExtension({ $span = $(node[tree.statusClassPropName]); res = this._super(ctx); - - if(!$span.length){ - return res; // nothing to do, if node was not yet rendered - } - if(!tree.enableFilter){ + // nothing to do, if node was not yet rendered + if( !$span.length || !tree.enableFilter ) { return res; } - $span.toggleClass("fancytree-match", !!node.match); - $span.toggleClass("fancytree-submatch", !!node.subMatch); - $span.toggleClass("fancytree-hide", !(node.match || node.subMatch)); - - // if(opts.filter.mode === "hide"){ - // // visible = !!(node.match || node.subMatch); - // visible = !node.hide; - // node.debug(node.title + ": visible=" + visible); - // if( node.li ) { - // $(node.li).toggle(visible); - // } else if( node.tr ) { - // // Show/hide all rows that are structural descendants of `parent` - // $(node.tr).toggle(visible); - // // if( !visible ) { - // // setChildRowVisibility(node, visible); - // // } - // } - // } + $span + .toggleClass("fancytree-match", !!node.match) + .toggleClass("fancytree-submatch", !!node.subMatch) + .toggleClass("fancytree-hide", !(node.match || node.subMatch)); + return res; } }); @@ -5256,8 +5192,8 @@ $.ui.fancytree.registerExtension({ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -5274,7 +5210,7 @@ function _getIcon(opts, type){ $.ui.fancytree.registerExtension({ name: "glyph", - version: "0.0.2", + version: "0.1.0", // Default options for this extension. options: { prefix: "icon-", @@ -5288,19 +5224,15 @@ $.ui.fancytree.registerExtension({ error: "icon-exclamation-sign", expanderClosed: "icon-caret-right", expanderLazy: "icon-angle-right", - // expanderLazy: "icon-refresh icon-spin", expanderOpen: "icon-caret-down", folder: "icon-folder-close-alt", folderOpen: "icon-folder-open-alt", loading: "icon-refresh icon-spin", - // loading: "icon-spinner icon-spin" noExpander: "" }, icon: null // TODO: allow callback here }, - // Overide virtual methods for this extension. - // `this` : is this extension object - // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) + treeInit: function(ctx){ var tree = ctx.tree; this._super(ctx); @@ -5364,7 +5296,8 @@ $.ui.fancytree.registerExtension({ if(node.parent){ span = $("span.fancytree-expander", node.span).get(0); }else{ - span = $(".fancytree-statusnode-wait, .fancytree-statusnode-error", node[this.nodeContainerAttrName]).find("span.fancytree-expander").get(0); + span = $(".fancytree-statusnode-wait, .fancytree-statusnode-error", node[this.nodeContainerAttrName]) + .find("span.fancytree-expander").get(0); } if( status === "loading"){ // $("span.fancytree-expander", ctx.node.span).addClass(_getIcon(opts, "loading")); @@ -5387,8 +5320,8 @@ $.ui.fancytree.registerExtension({ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -5589,8 +5522,8 @@ $.ui.fancytree.registerExtension({ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -5621,11 +5554,9 @@ function _loadLazyNodes(tree, instData, keyList, mode, dfd) { var i, key, l, node, foundOne = false, deferredList = [], - // lazyNodeList = [], - missingKeyList = []; //keyList.slice(0), + missingKeyList = []; keyList = keyList || []; - // expand = expand !== false; dfd = dfd || $.Deferred(); for( i=0, l=keyList.length; i= 0){ - // $.cookie(cookiePrefix + ACTIVE, null); $.removeCookie(cookiePrefix + ACTIVE); } if(types.indexOf(EXPANDED) >= 0){ - // $.cookie(cookiePrefix + EXPANDED, null); $.removeCookie(cookiePrefix + EXPANDED); } if(types.indexOf(FOCUS) >= 0){ - // $.cookie(cookiePrefix + FOCUS, null); $.removeCookie(cookiePrefix + FOCUS); } if(types.indexOf(SELECTED) >= 0){ - // $.cookie(cookiePrefix + SELECTED, null); $.removeCookie(cookiePrefix + SELECTED); } }; @@ -5737,7 +5660,6 @@ $.ui.fancytree.registerExtension({ version: "0.2.0", // Default options for this extension. options: { -// appendRequestInfo: false, cookieDelimiter: "~", cookiePrefix: undefined, // 'fancytree--' by default cookie: { @@ -5771,9 +5693,7 @@ $.ui.fancytree.registerExtension({ } $.cookie(cookieName, cookieList.join(instOpts.cookieDelimiter), instOpts.cookie); }, - // Overide virtual methods for this extension. - // `this` : is this Fancytree object - // `this._super`: the virtual function that was overridden (member of prev. extension or Fancytree) + treeInit: function(ctx){ var tree = ctx.tree, opts = ctx.options, @@ -5808,26 +5728,6 @@ $.ui.fancytree.registerExtension({ } dfd.done(function(){ - // alert("persistent expand done"); - // if(instData.storeExpanded){ - // cookie = $.cookie(instData.cookiePrefix + EXPANDED); - // if(cookie){ - // keyList = cookie.split(instOpts.cookieDelimiter); - // for(i=0; ie;return!0}function i(a,b,c,d,e){var f=function(){var c=b[a],f=d[a],g=b.ext[e],h=function(){return c.apply(b,arguments)};return function(){var a=b._local,c=b._super;try{return b._local=g,b._super=h,f.apply(b,arguments)}finally{b._local=a,b._super=c}}}();return f}function j(b,c,d,e){for(var f in d)"function"==typeof d[f]?"function"==typeof b[f]?b[f]=i(f,b,c,d,e):"_"===f.charAt(0)?b.ext[e][f]=i(f,b,c,d,e):a.error("Could not override tree."+f+". Use prefix '_' to create tree."+e+"._"+f):"options"!==f&&(b.ext[e][f]=d[f])}function k(b,c){return b===d?a.Deferred(function(){this.resolve()}).promise():a.Deferred(function(){this.resolveWith(b,c)}).promise()}function l(b,c){return b===d?a.Deferred(function(){this.reject()}).promise():a.Deferred(function(){this.rejectWith(b,c)}).promise()}function m(a,b){return function(){a.resolveWith(b)}}function n(b){var c=a.extend({},b.data()),d=c.json;return delete c.fancytree,d&&(delete c.json,c=a.extend(c,d)),c}function o(a){return a=a.toLowerCase(),function(b){return b.title.toLowerCase().indexOf(a)>=0}}function p(b,c){var d,e,g,h;for(this.parent=b,this.tree=b.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},d=0,e=w.length;e>d;d++)g=w[d],this[g]=c[g];c.data&&a.extend(this.data,c.data);for(g in c)x[g]||a.isFunction(c[g])||y[g]||(this.data[g]=c[g]);null==this.key&&(this.tree.options.defaultKey?(this.key=this.tree.options.defaultKey(this),f(this.key,"defaultKey() must return a unique key")):this.key="_"+s._nextNodeKey++),c.active&&(f(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),c.selected&&(this.tree.lastSelectedNode=this),this.children=null,h=c.children,h&&h.length&&this._setChildren(h),this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function q(b){this.widget=b,this.$div=b.element,this.options=b.options,this.options&&a.isFunction(this.options.lazyload)&&(a.isFunction(this.options.lazyLoad)||(this.options.lazyLoad=function(){s.warn("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),b.options.lazyload.apply(this,arguments)})),this.ext={},this.data=n(this.$div),this._id=a.ui.fancytree._nextId++,this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this.lastSelectedNode=null,this.systemFocusElement=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var c,d={tree:this};this.rootNode=new p(d,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,c=a("
    ",{"class":"ui-fancytree fancytree-container"}).appendTo(this.$div),this.$container=c,this.rootNode.ul=c[0],null==this.options.debugLevel&&(this.options.debugLevel=s.debugLevel),this.$container.attr("tabindex",this.options.tabbable?"0":"-1"),this.options.aria&&this.$container.attr("role","tree").attr("aria-multiselectable",!0)}if(a.ui.fancytree&&a.ui.fancytree.version)return void a.ui.fancytree.warn("Fancytree: ignored duplicate include");var r,s=null,t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},u="active expanded focus folder hideCheckbox lazy selected unselectable".split(" "),v={},w="expanded extraClasses folder hideCheckbox key lazy refKey selected title tooltip unselectable".split(" "),x={},y={active:!0,children:!0,data:!0,focus:!0};for(r=0;rb;b++)if(d[b].key===a)return d[b]}else{if("number"==typeof a)return this.children[a];if(a.parent===this)return a}return null},_setChildren:function(a){f(a&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var b=0,c=a.length;c>b;b++)this.children.push(new p(this,a[b]))},addChildren:function(b,c){var d,e,g,h=null,i=[];for(a.isPlainObject(b)&&(b=[b]),this.children||(this.children=[]),d=0,e=b.length;e>d;d++)i.push(new p(this,b[d]));return h=i[0],null==c?this.children=this.children.concat(i):(c=this._findDirectChild(c),g=a.inArray(c,this.children),f(g>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[g,0].concat(i))),(!this.parent||this.parent.ul||this.tr)&&this.render(),3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),h},addNode:function(a,b){switch((b===d||"over"===b)&&(b="child"),b){case"after":return this.getParent().addChildren(a,this.getNextSibling());case"before":return this.getParent().addChildren(a,this);case"child":case"over":return this.addChildren(a)}f(!1,"Invalid mode: "+b)},appendSibling:function(a){return this.addNode(a,"after")},applyPatch:function(b){if(null===b)return this.remove(),k(this);var c,d,e,f={children:!0,expanded:!0,parent:!0};for(c in b)e=b[c],f[c]||a.isFunction(e)||(x[c]?this[c]=e:this.data[c]=e);return b.hasOwnProperty("children")&&(this.removeChildren(),b.children&&this._setChildren(b.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),d=b.hasOwnProperty("expanded")?this.setExpanded(b.expanded):k(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(a,b,c){return a.addNode(this.toDict(!0,c),b)},countChildren:function(a){var b,c,d,e=this.children;if(!e)return 0;if(d=e.length,a!==!1)for(b=0,c=d;c>b;b++)d+=e[b].countChildren();return d},debug:function(){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),g("debug",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},findAll:function(b){b=a.isFunction(b)?b:o(b);var c=[];return this.visit(function(a){b(a)&&c.push(a)}),c},findFirst:function(b){b=a.isFunction(b)?b:o(b);var c=null;return this.visit(function(a){return b(a)?(c=a,!1):void 0}),c},_changeSelectStatusAttrs:function(a){var b=!1;switch(a){case!1:b=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:b=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case d:b=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:f(!1,"invalid state: "+a)}return b&&this.renderStatus(),b},fixSelection3AfterClick:function(){var a=this.isSelected();this.visit(function(b){b._changeSelectStatusAttrs(a)}),this.fixSelection3FromEndNodes()},fixSelection3FromEndNodes:function(){function a(b){var c,e,f,g,h,i,j,k=b.children;if(k){for(i=!0,j=!1,c=0,e=k.length;e>c;c++)f=k[c],g=a(f),g!==!1&&(j=!0),g!==!0&&(i=!1);h=i?!0:j?d:!1}else h=!!b.selected;return b._changeSelectStatusAttrs(h),h}f(3===this.tree.options.selectMode,"expected selectMode 3"),a(this),this.visitParents(function(a){var b,c,e,f,g=a.children,h=!0,i=!1;for(b=0,c=g.length;c>b;b++)e=g[b],(e.selected||e.partsel)&&(i=!0),e.unselectable||e.selected||(h=!1);f=h?!0:i?d:!1,a._changeSelectStatusAttrs(f)})},fromDict:function(b){for(var c in b)x[c]?this[c]=b[c]:"data"===c?a.extend(this.data,b.data):a.isFunction(b[c])||y[c]||(this.data[c]=b[c]);b.children?(this.removeChildren(),this.addChildren(b.children)):this.renderTitle()},getChildren:function(){return this.hasChildren()===d?d:this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return a.inArray(this,this.parent.children)},getIndexHier:function(b){b=b||".";var c=[];return a.each(this.getParentList(!1,!0),function(a,b){c.push(b.getIndex()+1)}),c.join(b)},getKeyPath:function(a){var b=[],c=this.tree.options.keyPathSeparator;return this.visitParents(function(a){a.parent&&b.unshift(a.key)},!a),c+b.join(c)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var a=0,b=this.parent;b;)a++,b=b.parent;return a},getNextSibling:function(){if(this.parent){var a,b,c=this.parent.children;for(a=0,b=c.length-1;b>a;a++)if(c[a]===this)return c[a+1]}return null},getParent:function(){return this.parent},getParentList:function(a,b){for(var c=[],d=b?this:this.parent;d;)(a||d.parent)&&c.unshift(d),d=d.parent;return c},getPrevSibling:function(){if(this.parent){var a,b,c=this.parent.children;for(a=1,b=c.length;b>a;a++)if(c[a]===this)return c[a-1]}return null},hasChildren:function(){return this.lazy?null==this.children?d:0===this.children.length?!1:1===this.children.length&&this.children[0].isStatusNode()?d:!0:!!this.children},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},isActive:function(){return this.tree.activeNode===this},isChildOf:function(a){return this.parent&&this.parent===a},isDescendantOf:function(a){if(!a||a.tree!==this.tree)return!1;for(var b=this.parent;b;){if(b===a)return!0;b=b.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var a=this.parent;return!a||a.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var a=this.parent;return!a||a.children[a.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||this.hasChildren()!==d},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isUndefined:function(){return this.hasChildren()===d},isVisible:function(){var a,b,c=this.getParentList(!1,!1);for(a=0,b=c.length;b>a;a++)if(!c[a].expanded)return!1;return!0},lazyLoad:function(a){return this.warn("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."),this.load(a)},load:function(a){var b,c,d=this;return f(this.isLazy(),"load() requires a lazy node"),f(a||this.isUndefined(),"Pass forceReload=true to re-load a lazy node"),this.isLoaded()&&this.resetLazy(),c=this.tree._triggerNodeEvent("lazyLoad",this),c===!1?k(this):(f("boolean"!=typeof c,"lazyLoad event must return source in data.result"),b=this.tree._callHook("nodeLoadChildren",this,c),this.expanded&&b.always(function(){d.render()}),b)},makeVisible:function(b){var c,d=this,e=[],f=new a.Deferred,g=this.getParentList(!1,!1),h=g.length,i=!(b&&b.noAnimation===!0),j=!(b&&b.scrollIntoView===!1);for(c=h-1;c>=0;c--)e.push(g[c].setExpanded(!0,b));return a.when.apply(a,e).done(function(){j?d.scrollIntoView(i).done(function(){f.resolve()}):f.resolve()}),f.promise()},moveTo:function(b,c,e){(c===d||"over"===c)&&(c="child");var g,h=this.parent,i="child"===c?b:b.parent;if(this!==b){if(!this.parent)throw"Cannot move system root";if(i.isDescendantOf(this))throw"Cannot move a node to its own descendant";if(1===this.parent.children.length?(this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1):(g=a.inArray(this,this.parent.children),f(g>=0),this.parent.children.splice(g,1)),this.parent=i,i.hasChildren())switch(c){case"child":i.children.push(this);break;case"before":g=a.inArray(b,i.children),f(g>=0),i.children.splice(g,0,this);break;case"after":g=a.inArray(b,i.children),f(g>=0),i.children.splice(g+1,0,this);break;default:throw"Invalid mode "+c}else i.children=[this];e&&b.visit(e,!0),this.tree!==b.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(a){a.tree=b.tree},!0)),h.isDescendantOf(i)||h.render(),i.isDescendantOf(h)||i===h||i.render()}},navigate:function(b,c){function d(d){return d?(d.makeVisible(),a(d.span).is(":visible")?c===!1?d.setFocus():d.setActive():(d.debug("Navigate: skipping hidden node"),void d.navigate(b,c))):void 0}var e,f,g=!0,h=a.ui.keyCode,i=null;switch(b){case h.BACKSPACE:this.parent&&this.parent.parent&&d(this.parent);break;case h.LEFT:this.expanded?(this.setExpanded(!1),d(this)):this.parent&&this.parent.parent&&d(this.parent);break;case h.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&d(this.children[0]):(this.setExpanded(),d(this));break;case h.UP:for(i=this.getPrevSibling();i&&i.expanded&&i.children&&i.children.length;)i=i.children[i.children.length-1];!i&&this.parent&&this.parent.parent&&(i=this.parent),d(i);break;case h.DOWN:if(this.expanded&&this.children&&this.children.length)i=this.children[0];else for(f=this.getParentList(!1,!0),e=f.length-1;e>=0&&!(i=f[e].getNextSibling());e--);d(i);break;default:g=!1}},remove:function(){return this.parent.removeChild(this)},removeChild:function(a){return this.tree._callHook("nodeRemoveChild",this,a)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},render:function(a,b){return this.tree._callHook("nodeRender",this,a,b)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=d,this.renderStatus()},scheduleAction:function(a,b){this.tree.timer&&clearTimeout(this.tree.timer),this.tree.timer=null;var c=this;switch(a){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){c.tree.debug("setTimeout: trigger expand"),c.setExpanded(!0)},b);break;case"activate":this.tree.timer=setTimeout(function(){c.tree.debug("setTimeout: trigger activate"),c.setActive(!0)},b);break;default:throw"Invalid mode "+a}},scrollIntoView:function(b,c){b=b===!0?{duration:200,queue:!1}:b;var d,e=new a.Deferred,f=this,g=a(this.span).position().top,h=a(this.span).height(),i=this.tree.$container,j=i[0].scrollTop,k=Math.max(0,i.innerHeight()-i[0].clientHeight),l=i.height()-k,m=null;return 0>g?m=j+g:g+h>l&&(m=j+g-l+h,c&&(d=c?a(c.span).position().top:0,g-d>l&&(m=j+d))),null!==m?b?(b.complete=function(){e.resolveWith(f)},i.animate({scrollTop:m},b)):(i[0].scrollTop=m,e.resolveWith(this)):e.resolveWith(this),e.promise()},setActive:function(a,b){return this.tree._callHook("nodeSetActive",this,a,b)},setExpanded:function(a,b){return this.tree._callHook("nodeSetExpanded",this,a,b)},setFocus:function(a){return this.tree._callHook("nodeSetFocus",this,a)},setSelected:function(a){return this.tree._callHook("nodeSetSelected",this,a)},setTitle:function(a){this.title=a,this.renderTitle()},sortChildren:function(a,b){var c,d,e=this.children;if(e){if(a=a||function(a,b){var c=a.title.toLowerCase(),d=b.title.toLowerCase();return c===d?0:c>d?1:-1},e.sort(a),b)for(c=0,d=e.length;d>c;c++)e[c].children&&e[c].sortChildren(a,"$norender$");"$norender$"!==b&&this.render()}},toDict:function(b,c){var d,e,f,g={},h=this;if(a.each(w,function(a,b){(h[b]||h[b]===!1)&&(g[b]=h[b])}),a.isEmptyObject(this.data)||(g.data=a.extend({},this.data),a.isEmptyObject(g.data)&&delete g.data),c&&c(g),b&&this.hasChildren())for(g.children=[],d=0,e=this.children.length;e>d;d++)f=this.children[d],f.isStatusNode()||g.children.push(f.toDict(!0,c));return g},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return""},visit:function(a,b){var c,d,e=!0,f=this.children;if(b===!0&&(e=a(this),e===!1||"skip"===e))return e;if(f)for(c=0,d=f.length;d>c&&(e=f[c].visit(a,!0),e!==!1);c++);return e},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},warn:function(){Array.prototype.unshift.call(arguments,this.toString()),g("warn",arguments)}},q.prototype={_makeHookContext:function(b,c,e){var f,g;return b.node!==d?(c&&b.originalEvent!==c&&a.error("invalid args"),f=b):b.tree?(g=b.tree,f={node:b,tree:g,widget:g.widget,options:g.widget.options,originalEvent:c}):b.widget?f={node:null,tree:b,widget:b.widget,options:b.widget.options,originalEvent:c}:a.error("invalid args"),e&&a.extend(f,e),f},_callHook:function(b,c){var d=this._makeHookContext(c),e=this[b],f=Array.prototype.slice.call(arguments,2);return a.isFunction(e)||a.error("_callHook('"+b+"') is not a function"),f.unshift(d),e.apply(this,f)},_requireExtension:function(b,c,d,e){d=!!d;var g=this._local.name,h=this.options.extensions,i=a.inArray(b,h)d;d++)e=b[d],f(2===e.length,"patchList must be an array of length-2-arrays"),g=e[0],h=e[1],i=null===g?this.rootNode:this.getNodeByKey(g),i?(c=new a.Deferred,k.push(c),i.applyPatch(h).always(m(c,i))):this.warn("could not find node with key '"+g+"'");return a.when.apply(a,k).promise()},count:function(){return this.rootNode.countChildren()},debug:function(){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),g("debug",arguments))},generateFormElements:function(b,c){var d,e=b!==!1?"ft_"+this._id:b,f=c!==!1?"ft_"+this._id+"_active":c,g="fancytree_result_"+this._id,h=this.$container.find("div#"+g);h.length?h.empty():h=a("
    ",{id:g}).hide().appendTo(this.$container),e&&(d=this.getSelectedNodes(3===this.options.selectMode),a.each(d,function(b,c){h.append(a("",{type:"checkbox",name:e,value:c.key,checked:!0}))})),f&&this.activeNode&&h.append(a("",{type:"radio",name:f,value:this.activeNode.key,checked:!0}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getNodeByKey:function(a,b){var d,e;return!b&&(d=c.getElementById(this.options.idPrefix+a))?d.ftnode?d.ftnode:null:(b=b||this.rootNode,e=null,b.visit(function(b){return b.key===a?(e=b,!1):void 0},!0),e)},getSelectedNodes:function(a){var b=[];return this.rootNode.visit(function(c){return c.selected&&(b.push(c),a===!0)?"skip":void 0}),b},hasFocus:function(){return!!this._hasFocus},info:function(){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),g("info",arguments))},loadKeyPath:function(b,c,e){function f(a,b,d){c.call(r,b,"loading"),b.load().done(function(){r.loadKeyPath.call(r,l[a],c,b).always(m(d,r))}).fail(function(){r.warn("loadKeyPath: error loading: "+a+" (parent: "+p+")"),c.call(r,b,"error"),d.reject()})}var g,h,i,j,k,l,n,o,p=e||this.rootNode,q=this.options.keyPathSeparator,r=this;for(a.isArray(b)||(b=[b]),l={},i=0;i"},_triggerNodeEvent:function(a,b,c,e){var f=this._makeHookContext(b,c,e),g=this.widget._trigger(a,c,f);return g!==!1&&f.result!==d?f.result:g},_triggerTreeEvent:function(a,b){var c=this._makeHookContext(this,b),e=this.widget._trigger(a,b,c);return e!==!1&&c.result!==d?c.result:e},visit:function(a){return this.rootNode.visit(a,!1)},warn:function(){Array.prototype.unshift.call(arguments,this.toString()),g("warn",arguments)}},a.extend(q.prototype,{nodeClick:function(a){var b,c,d=a.originalEvent,e=a.targetType,f=a.node;if("expander"===e)this._callHook("nodeToggleExpanded",a);else if("checkbox"===e)this._callHook("nodeToggleSelected",a),this._callHook("nodeSetFocus",a,!0);else{if(c=!1,b=!0,f.folder)switch(a.options.clickFolderMode){case 2:c=!0,b=!1;break;case 3:b=!0,c=!0}b&&(this.nodeSetFocus(a),this._callHook("nodeSetActive",a,!0)),c&&this._callHook("nodeToggleExpanded",a)}"a"===d.target.localName&&"fancytree-title"===d.target.className&&d.preventDefault()},nodeCollapseSiblings:function(a,b){var c,d,e,f=a.node;if(f.parent)for(c=f.parent.children,d=0,e=c.length;e>d;d++)c[d]!==f&&c[d].expanded&&this._callHook("nodeSetExpanded",c[d],!1,b)},nodeDblclick:function(a){"title"===a.targetType&&4===a.options.clickFolderMode&&this._callHook("nodeToggleExpanded",a),"title"===a.targetType&&a.originalEvent.preventDefault()},nodeKeydown:function(b){var c,d=b.originalEvent,e=b.node,f=b.tree,g=b.options,h=!0,i=!(d.ctrlKey||!g.autoActivate),j=a.ui.keyCode;switch(e||(this.rootNode.getFirstChild().setFocus(),e=b.node=this.focusNode,e.debug("Keydown force focus on first node")),d.which){case j.NUMPAD_ADD:case 187:f.nodeSetExpanded(b,!0);break;case j.NUMPAD_SUBTRACT:case 189:f.nodeSetExpanded(b,!1);break;case j.SPACE:g.checkbox?f.nodeToggleSelected(b):f.nodeSetActive(b,!0);break;case j.ENTER:f.nodeSetActive(b,!0);break;case j.BACKSPACE:case j.LEFT:case j.RIGHT:case j.UP:case j.DOWN:c=e.navigate(d.which,i);break;default:h=!1}h&&d.preventDefault()},nodeLoadChildren:function(b,c){var d,e,g=b.tree,h=b.node;return a.isFunction(c)&&(c=c()),c.url&&(d=a.extend({},b.options.ajax,c),d.debugDelay?(e=d.debugDelay,a.isArray(e)&&(e=e[0]+Math.random()*(e[1]-e[0])),h.debug("nodeLoadChildren waiting debug delay "+Math.round(e)+"ms"),d.debugDelay=!1,c=a.Deferred(function(b){setTimeout(function(){a.ajax(d).done(function(){b.resolveWith(this,arguments)}).fail(function(){b.rejectWith(this,arguments)})},e)})):c=a.ajax(d),c=c.pipe(function(c){var d;return"string"==typeof c&&a.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),b.options.postProcess?(d=g._triggerNodeEvent("postProcess",b,b.originalEvent,{response:c,dataType:this.dataType}),c=a.isArray(d)?d:c):c&&c.hasOwnProperty("d")&&b.options.enableAspx&&(c="string"==typeof c.d?a.parseJSON(c.d):c.d),c},function(a,b,c){return g._makeHookContext(h,null,{error:a,args:Array.prototype.slice.call(arguments),message:c,details:a.status+": "+c})})),a.isFunction(c.promise)&&(f(!h.isLoading()),g.nodeSetStatus(b,"loading"),c.done(function(){g.nodeSetStatus(b,"ok")}).fail(function(a){var c;c=a.node&&a.error&&a.message?a:g._makeHookContext(h,null,{error:a,args:Array.prototype.slice.call(arguments),message:a?a.message||a.toString():""}),g._triggerNodeEvent("loaderror",c,null),g.nodeSetStatus(b,"error",c.message,c.details)})),a.when(c).done(function(b){var c;a.isPlainObject(b)&&(f(a.isArray(b.children),"source must contain (or be) an array of children"),f(h.isRoot(),"source may only be an object for root nodes"),c=b,b=b.children,delete c.children,a.extend(g.data,c)),f(a.isArray(b),"expected array of children"),h._setChildren(b),g._triggerNodeEvent("loadChildren",h)})},nodeLoadKeyPath:function(){},nodeRemoveChild:function(b,c){var d,e=b.node,g=b.options,h=a.extend({},b,{node:c}),i=e.children;return 1===i.length?(f(c===i[0]),this.nodeRemoveChildren(b)):(this.activeNode&&(c===this.activeNode||this.activeNode.isDescendantOf(c))&&this.activeNode.setActive(!1),this.focusNode&&(c===this.focusNode||this.focusNode.isDescendantOf(c))&&(this.focusNode=null),this.nodeRemoveMarkup(h),this.nodeRemoveChildren(h),d=a.inArray(c,i),f(d>=0),c.visit(function(a){a.parent=null},!0),this._callHook("treeRegisterNode",this,!1,c),g.removeNode&&g.removeNode.call(b.tree,{type:"removeNode"},h),void i.splice(d,1))},nodeRemoveChildMarkup:function(b){var c=b.node;c.ul&&(c.isRoot()?a(c.ul).empty():(a(c.ul).remove(),c.ul=null),c.visit(function(a){a.li=a.ul=null}))},nodeRemoveChildren:function(b){var c,d=b.tree,e=b.node,f=e.children,g=b.options;f&&(this.activeNode&&this.activeNode.isDescendantOf(e)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(e)&&(this.focusNode=null),this.nodeRemoveChildMarkup(b),c=a.extend({},b),e.visit(function(a){a.parent=null,d._callHook("treeRegisterNode",d,!1,a),g.removeNode&&(c.node=a,g.removeNode.call(b.tree,{type:"removeNode"},c))}),e.children=e.lazy?[]:null,this.nodeRenderStatus(b))},nodeRemoveMarkup:function(b){var c=b.node;c.li&&(a(c.li).remove(),c.li=null),this.nodeRemoveChildMarkup(b)},nodeRender:function(b,d,e,g,h){var i,j,k,l,m,n,o,p=b.node,q=b.tree,r=b.options,s=r.aria,t=!1,u=p.parent,v=!u,w=p.children;if(v||u.ul){if(f(v||u.ul,"parent UL must exist"),v||(p.li&&(d||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode!==p.parent.ul&&this.warn("unlink "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(b)),p.li?this.nodeRenderStatus(b):(t=!0,p.li=c.createElement("li"),p.li.ftnode=p,p.key&&r.generateIds&&(p.li.id=r.idPrefix+p.key),p.span=c.createElement("span"),p.span.className="fancytree-node",s&&a(p.span).attr("aria-labelledby","ftal_"+p.key),p.li.appendChild(p.span),this.nodeRenderTitle(b),r.createNode&&r.createNode.call(q,{type:"createNode"},b)),r.renderNode&&r.renderNode.call(q,{type:"renderNode"},b)),w){if(v||p.expanded||e===!0){for(p.ul||(p.ul=c.createElement("ul"),(g===!0&&!h||!p.expanded)&&(p.ul.style.display="none"),s&&a(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),l=0,m=w.length;m>l;l++)o=a.extend({},b,{node:w[l]}),this.nodeRender(o,d,e,!1,!0);for(i=p.ul.firstChild;i;)k=i.ftnode,k&&k.parent!==p?(p.debug("_fixParent: remove missing "+k,i),n=i.nextSibling,i.parentNode.removeChild(i),i=n):i=i.nextSibling;for(i=p.ul.firstChild,l=0,m=w.length-1;m>l;l++)j=w[l],k=i.ftnode,j!==k?p.ul.insertBefore(j.li,k.li):i=i.nextSibling}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(b));v||t&&u.ul.appendChild(p.li)}},nodeRenderTitle:function(a,b){var c,e,f,g,h,i,j=a.node,k=a.tree,l=a.options,m=l.aria,n=j.getLevel(),o=[],p=j.data.icon;b!==d&&(j.title=b),j.span&&(n1&&o.push(m?"":""):o.push(m?"":""),l.checkbox&&j.hideCheckbox!==!0&&!j.isStatusNode()&&o.push(m?"":""),g=m?" role='img'":"",p&&"string"==typeof p?(e="/"===p.charAt(0)?p:l.imagePath+p,o.push("")):j.data.iconclass?o.push(""):(p===!0||p!==!1&&l.icons!==!1)&&o.push(""),f="",l.renderTitle&&(f=l.renderTitle.call(k,{type:"renderTitle"},a)||""),f||(i=j.tooltip?" title='"+s.escapeHtml(j.tooltip)+"'":"",c=m?" id='ftal_"+j.key+"'":"",g=m?" role='treeitem'":"",h=l.titlesTabbable?" tabindex='0'":"",f=""+j.title+""),o.push(f),j.span.innerHTML=o.join(""),this.nodeRenderStatus(a))},nodeRenderStatus:function(b){var c=b.node,d=b.tree,e=b.options,f=c.hasChildren(),g=c.isLastSibling(),h=e.aria,i=a(c.span).find(".fancytree-title"),j=e._classNames,k=[],l=c[d.statusClassPropName];l&&(k.push(j.node),d.activeNode===c&&k.push(j.active),d.focusNode===c?(k.push(j.focused),h&&i.attr("aria-activedescendant",!0)):h&&i.removeAttr("aria-activedescendant"),c.expanded?(k.push(j.expanded),h&&i.attr("aria-expanded",!0)):h&&i.removeAttr("aria-expanded"),c.folder&&k.push(j.folder),f!==!1&&k.push(j.hasChildren),g&&k.push(j.lastsib),c.lazy&&null==c.children&&k.push(j.lazy),c.partsel&&k.push(j.partsel),c._isLoading&&k.push(j.loading),c._error&&k.push(j.error),c.selected?(k.push(j.selected),h&&i.attr("aria-selected",!0)):h&&i.attr("aria-selected",!1),c.extraClasses&&k.push(c.extraClasses),k.push(f===!1?j.combinedExpanderPrefix+"n"+(g?"l":""):j.combinedExpanderPrefix+(c.expanded?"e":"c")+(c.lazy&&null==c.children?"d":"")+(g?"l":"")),k.push(j.combinedIconPrefix+(c.expanded?"e":"c")+(c.folder?"f":"")),l.className=k.join(" "),c.li&&(c.li.className=g?j.lastsib:""))},nodeSetActive:function(b,c,d){d=d||{};var e,g=b.node,h=b.tree,i=b.options,j=d.noEvents===!0,m=g===h.activeNode;return c=c!==!1,m===c?k(g):c&&!j&&this._triggerNodeEvent("beforeActivate",g,b.originalEvent)===!1?l(g,["rejected"]):void(c?(h.activeNode&&(f(h.activeNode!==g,"node was active (inconsistency)"),e=a.extend({},b,{node:h.activeNode}),h.nodeSetActive(e,!1),f(null===h.activeNode,"deactivate was out of sync?")),i.activeVisible&&g.makeVisible(),h.activeNode=g,h.nodeRenderStatus(b),h.nodeSetFocus(b),j||h._triggerNodeEvent("activate",g,b.originalEvent)):(f(h.activeNode===g,"node was not active (inconsistency)"),h.activeNode=null,this.nodeRenderStatus(b),j||b.tree._triggerNodeEvent("deactivate",g,b.originalEvent)))},nodeSetExpanded:function(b,c,e){e=e||{};var f,g,h,i,j,m,n=b.node,o=b.tree,p=b.options,q=e.noAnimation===!0,r=e.noEvents===!0;if(c=c!==!1,n.expanded&&c||!n.expanded&&!c)return k(n);if(c&&!n.lazy&&!n.hasChildren())return k(n);if(!c&&n.getLevel()h;h++)this._callHook("nodeCollapseSiblings",j[h],e)}finally{p.autoCollapse=m}}return g.done(function(){p.autoScroll&&!q?n.getLastChild().scrollIntoView(!0,n).always(function(){r||b.tree._triggerNodeEvent(c?"expand":"collapse",b)}):r||b.tree._triggerNodeEvent(c?"expand":"collapse",b)}),f=function(d){var e,f,g,h;if(n.expanded=c,o._callHook("nodeRender",b,!1,!1,!0),n.ul)if(g="none"!==n.ul.style.display,h=!!n.expanded,g===h)n.warn("nodeSetExpanded: UL.style.display already set");else{if(p.fx&&!q)return e=p.fx.duration||200,f=p.fx.easing,void a(n.ul).animate(p.fx,e,f,function(){d()});n.ul.style.display=n.expanded||!parent?"":"none"}d()},c&&n.lazy&&n.hasChildren()===d?n.load().done(function(){g.notifyWith&&g.notifyWith(n,["loaded"]),f(function(){g.resolveWith(n)})}).fail(function(a){f(function(){g.rejectWith(n,["load failed ("+a+")"])})}):f(function(){g.resolveWith(n)}),g.promise()},nodeSetFocus:function(b,c){var d,e=b.tree,f=b.node;if(c=c!==!1,e.focusNode){if(e.focusNode===f&&c)return;d=a.extend({},b,{node:e.focusNode}),e.focusNode=null,this._triggerNodeEvent("blur",d),this._callHook("nodeRenderStatus",d)}c&&(this.hasFocus()||(f.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",b,!0,!0)),f.makeVisible(),e.focusNode=f,this._triggerNodeEvent("focus",b),b.options.autoScroll&&f.scrollIntoView(),this._callHook("nodeRenderStatus",b))},nodeSetSelected:function(a,b){var c=a.node,d=a.tree,e=a.options;if(b=b!==!1,c.debug("nodeSetSelected("+b+")",a),!c.unselectable){if(c.selected&&b||!c.selected&&!b)return!!c.selected;if(this._triggerNodeEvent("beforeSelect",c,a.originalEvent)===!1)return!!c.selected;b&&1===e.selectMode?d.lastSelectedNode&&d.lastSelectedNode.setSelected(!1):3===e.selectMode&&(c.selected=b,c.fixSelection3AfterClick()),c.selected=b,this.nodeRenderStatus(a),d.lastSelectedNode=b?c:null,d._triggerNodeEvent("select",a)}},nodeSetStatus:function(b,c,d,e){function f(){var a=h.children?h.children[0]:null;if(a&&a.isStatusNode()){try{h.ul&&(h.ul.removeChild(a.li),a.li=null) -}catch(b){}1===h.children.length?h.children=[]:h.children.shift()}}function g(b,c){var d=h.children?h.children[0]:null;return d&&d.isStatusNode()?(a.extend(d,b),i._callHook("nodeRender",d)):(b.key="_statusNode",h._setChildren([b]),h.children[0].statusNodeType=c,i.render()),h.children[0]}var h=b.node,i=b.tree;switch(c){case"ok":f(),h._isLoading=!1,h._error=null,h.renderStatus();break;case"loading":h.parent||g({title:i.options.strings.loading+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-wait"},c),h._isLoading=!0,h._error=null,h.renderStatus();break;case"error":g({title:i.options.strings.loadError+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-error"},c),h._isLoading=!1,h._error={message:d,details:e},h.renderStatus();break;default:a.error("invalid node status "+c)}},nodeToggleExpanded:function(a){return this.nodeSetExpanded(a,!a.node.expanded)},nodeToggleSelected:function(a){return this.nodeSetSelected(a,!a.node.selected)},treeClear:function(a){var b=a.tree;b.activeNode=null,b.focusNode=null,b.$div.find(">ul.fancytree-container").empty(),b.rootNode.children=null},treeCreate:function(){},treeDestroy:function(){},treeInit:function(a){this.treeLoad(a)},treeLoad:function(b,c){var d,f,g,h=b.tree,i=b.widget.element,j=a.extend({},b,{node:this.rootNode});if(h.rootNode.children&&this.treeClear(b),c=c||this.options.source)"string"==typeof c&&e();else switch(d=i.data("type")||"html"){case"html":f=i.find(">ul:first"),f.addClass("ui-fancytree-source ui-helper-hidden"),c=a.ui.fancytree.parseHtml(f),this.data=a.extend(this.data,n(f));break;case"json":c=a.parseJSON(i.text()),c.children&&(c.title&&(h.title=c.title),c=c.children);break;default:a.error("Invalid data-type: "+d)}return g=this.nodeLoadChildren(j,c).done(function(){h.render(),3===b.options.selectMode&&h.rootNode.fixSelection3FromEndNodes(),h._triggerTreeEvent("init",!0)}).fail(function(){h.render(),h._triggerTreeEvent("init",!1)})},treeRegisterNode:function(){},treeSetFocus:function(a,b){b=b!==!1,b!==this.hasFocus()&&(this._hasFocus=b,this.$container.toggleClass("fancytree-treefocus",b),this._triggerTreeEvent(b?"focusTree":"blurTree"))}}),a.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!1,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,extensions:[],fx:{height:"toggle",duration:200},generateIds:!1,icons:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,selectMode:2,strings:{loading:"Loading…",loadError:"Load error!"},tabbable:!0,titlesTabbable:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partsel:"fancytree-partsel",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new q(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var b,c,e,g=this.options.extensions,h=this.tree;for(e=0;e"),d&&a.Widget.prototype._setOption.apply(this,arguments),e&&this.tree.render(!0,!1)},destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree),this.tree.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden"),a.Widget.prototype.destroy.call(this)},_unbind:function(){var b=this.tree._ns;this.element.unbind(b),this.tree.$container.unbind(b),a(c).unbind(b)},_bind:function(){var a=this,b=this.options,c=this.tree,d=c._ns;this._unbind(),c.$container.on("focusin"+d+" focusout"+d,function(a){var b=s.getNode(a),d="focusin"===a.type;b?c._callHook("nodeSetFocus",b,d):c._callHook("treeSetFocus",c,d)}).on("selectstart"+d,"span.fancytree-title",function(a){a.preventDefault()}).on("keydown"+d,function(a){if(b.disabled||b.keyboard===!1)return!0;var d,e=c.focusNode,f=c._makeHookContext(e||c,a),g=c.phase;try{return c.phase="userEvent",d=e?c._triggerNodeEvent("keydown",e,a):c._triggerTreeEvent("keydown",a),"preventNav"===d?d=!0:d!==!1&&(d=c._callHook("nodeKeydown",f)),d}finally{c.phase=g}}).on("click"+d+" dblclick"+d,function(c){if(b.disabled)return!0;var d,e=s.getEventTarget(c),f=e.node,g=a.tree,h=g.phase;if(!f)return!0;d=g._makeHookContext(f,c);try{switch(g.phase="userEvent",c.type){case"click":return d.targetType=e.type,g._triggerNodeEvent("click",d,c)===!1?!1:g._callHook("nodeClick",d);case"dblclick":return d.targetType=e.type,g._triggerNodeEvent("dblclick",d,c)===!1?!1:g._callHook("nodeDblclick",d)}}finally{g.phase=h}})},getActiveNode:function(){return this.tree.activeNode},getNodeByKey:function(a){return this.tree.getNodeByKey(a)},getRootNode:function(){return this.tree.rootNode},getTree:function(){return this.tree}}),s=a.ui.fancytree,a.extend(a.ui.fancytree,{version:"2.0.0-11",buildType: "production",debugLevel: 1,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:q,_FancytreeNodeClass:p,jquerySupports:{positionMyOfs:h(a.ui.version,1,9)},assert:function(a,b){return f(a,b)},debug:function(){a.ui.fancytree.debugLevel>=2&&g("log",arguments)},error:function(){g("error",arguments)},escapeHtml:function(a){return(""+a).replace(/[&<>"'\/]/g,function(a){return t[a]})},unescapeHtml:function(a){var b=c.createElement("div");return b.innerHTML=a,0===b.childNodes.length?"":b.childNodes[0].nodeValue},getEventTargetType:function(a){return this.getEventTarget(a).type},getEventTarget:function(a){var b=a&&a.target?a.target.className:"",c={node:this.getNode(a.target),type:d};return/\bfancytree-title\b/.test(b)?c.type="title":/\bfancytree-expander\b/.test(b)?c.type=c.node.hasChildren()===!1?"prefix":"expander":/\bfancytree-checkbox\b/.test(b)||/\bfancytree-radio\b/.test(b)?c.type="checkbox":/\bfancytree-icon\b/.test(b)?c.type="icon":/\bfancytree-node\b/.test(b)&&(c.type="title"),c},getNode:function(a){if(a instanceof p)return a;for(a.selector!==d?a=a[0]:a.originalEvent!==d&&(a=a.target);a;){if(a.ftnode)return a.ftnode;a=a.parentNode}return null},info:function(){a.ui.fancytree.debugLevel>=1&&g("info",arguments)},parseHtml:function(b){var c,e,f,g,h,i,j,k,l=b.find(">li"),m=[];return l.each(function(){var l,o=a(this),p=o.find(">span:first",this),q=p.length?null:o.find(">a:first"),r={tooltip:null,data:{}};for(p.length?r.title=p.html():q&&q.length?(r.title=q.html(),r.data.href=q.attr("href"),r.data.target=q.attr("target"),r.tooltip=q.attr("title")):(r.title=o.html(),g=r.title.search(/
      =0&&(r.title=r.title.substring(0,g))),r.title=a.trim(r.title),e=0,f=u.length;f>e;e++)r[u[e]]=d;for(j=this.className.split(" "),c=[],e=0,f=j.length;f>e;e++)k=j[e],v[k]?r[k]=!0:c.push(k);if(r.extraClasses=c.join(" "),h=o.attr("title"),h&&(r.tooltip=h),h=o.attr("id"),h&&(r.key=h),l=n(o),l&&!a.isEmptyObject(l)){for(e=0,f=w.length;f>e;e++)h=w[e],i=l[h],null!=i&&(delete l[h],r[h]=i);a.extend(r.data,l)}b=o.find(">ul:first"),r.children=b.length?a.ui.fancytree.parseHtml(b):r.lazy?d:null,m.push(r)}),m},registerExtension:function(b){f(null!=b.name,"extensions must have a `name` property."),f(null!=b.version,"extensions must have a `version` property."),a.ui.fancytree._extensions[b.name]=b},warn:function(){g("warn",arguments)}})}(jQuery,window,document); +}catch(b){}1===h.children.length?h.children=[]:h.children.shift()}}function g(b,c){var d=h.children?h.children[0]:null;return d&&d.isStatusNode()?(a.extend(d,b),i._callHook("nodeRender",d)):(b.key="_statusNode",h._setChildren([b]),h.children[0].statusNodeType=c,i.render()),h.children[0]}var h=b.node,i=b.tree;switch(c){case"ok":f(),h._isLoading=!1,h._error=null,h.renderStatus();break;case"loading":h.parent||g({title:i.options.strings.loading+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-wait"},c),h._isLoading=!0,h._error=null,h.renderStatus();break;case"error":g({title:i.options.strings.loadError+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-error"},c),h._isLoading=!1,h._error={message:d,details:e},h.renderStatus();break;default:a.error("invalid node status "+c)}},nodeToggleExpanded:function(a){return this.nodeSetExpanded(a,!a.node.expanded)},nodeToggleSelected:function(a){return this.nodeSetSelected(a,!a.node.selected)},treeClear:function(a){var b=a.tree;b.activeNode=null,b.focusNode=null,b.$div.find(">ul.fancytree-container").empty(),b.rootNode.children=null},treeCreate:function(){},treeDestroy:function(){},treeInit:function(a){this.treeLoad(a)},treeLoad:function(b,c){var d,f,g,h=b.tree,i=b.widget.element,j=a.extend({},b,{node:this.rootNode});if(h.rootNode.children&&this.treeClear(b),c=c||this.options.source)"string"==typeof c&&e();else switch(d=i.data("type")||"html"){case"html":f=i.find(">ul:first"),f.addClass("ui-fancytree-source ui-helper-hidden"),c=a.ui.fancytree.parseHtml(f),this.data=a.extend(this.data,n(f));break;case"json":c=a.parseJSON(i.text()),c.children&&(c.title&&(h.title=c.title),c=c.children);break;default:a.error("Invalid data-type: "+d)}return g=this.nodeLoadChildren(j,c).done(function(){h.render(),3===b.options.selectMode&&h.rootNode.fixSelection3FromEndNodes(),h._triggerTreeEvent("init",!0)}).fail(function(){h.render(),h._triggerTreeEvent("init",!1)})},treeRegisterNode:function(){},treeSetFocus:function(a,b){b=b!==!1,b!==this.hasFocus()&&(this._hasFocus=b,this.$container.toggleClass("fancytree-treefocus",b),this._triggerTreeEvent(b?"focusTree":"blurTree"))}}),a.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!1,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,extensions:[],fx:{height:"toggle",duration:200},generateIds:!1,icons:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,selectMode:2,strings:{loading:"Loading…",loadError:"Load error!"},tabbable:!0,titlesTabbable:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partsel:"fancytree-partsel",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new q(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var b,c,e,g=this.options.extensions,h=this.tree;for(e=0;e"),d&&a.Widget.prototype._setOption.apply(this,arguments),e&&this.tree.render(!0,!1)},destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree),this.tree.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden"),a.Widget.prototype.destroy.call(this)},_unbind:function(){var b=this.tree._ns;this.element.unbind(b),this.tree.$container.unbind(b),a(c).unbind(b)},_bind:function(){var a=this,b=this.options,c=this.tree,d=c._ns;this._unbind(),c.$container.on("focusin"+d+" focusout"+d,function(a){var b=s.getNode(a),d="focusin"===a.type;b?c._callHook("nodeSetFocus",b,d):c._callHook("treeSetFocus",c,d)}).on("selectstart"+d,"span.fancytree-title",function(a){a.preventDefault()}).on("keydown"+d,function(a){if(b.disabled||b.keyboard===!1)return!0;var d,e=c.focusNode,f=c._makeHookContext(e||c,a),g=c.phase;try{return c.phase="userEvent",d=e?c._triggerNodeEvent("keydown",e,a):c._triggerTreeEvent("keydown",a),"preventNav"===d?d=!0:d!==!1&&(d=c._callHook("nodeKeydown",f)),d}finally{c.phase=g}}).on("click"+d+" dblclick"+d,function(c){if(b.disabled)return!0;var d,e=s.getEventTarget(c),f=e.node,g=a.tree,h=g.phase;if(!f)return!0;d=g._makeHookContext(f,c);try{switch(g.phase="userEvent",c.type){case"click":return d.targetType=e.type,g._triggerNodeEvent("click",d,c)===!1?!1:g._callHook("nodeClick",d);case"dblclick":return d.targetType=e.type,g._triggerNodeEvent("dblclick",d,c)===!1?!1:g._callHook("nodeDblclick",d)}}finally{g.phase=h}})},getActiveNode:function(){return this.tree.activeNode},getNodeByKey:function(a){return this.tree.getNodeByKey(a)},getRootNode:function(){return this.tree.rootNode},getTree:function(){return this.tree}}),s=a.ui.fancytree,a.extend(a.ui.fancytree,{version:"2.0.0-12",buildType: "production",debugLevel: 1,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:q,_FancytreeNodeClass:p,jquerySupports:{positionMyOfs:h(a.ui.version,1,9)},assert:function(a,b){return f(a,b)},debug:function(){a.ui.fancytree.debugLevel>=2&&g("log",arguments)},error:function(){g("error",arguments)},escapeHtml:function(a){return(""+a).replace(/[&<>"'\/]/g,function(a){return t[a]})},unescapeHtml:function(a){var b=c.createElement("div");return b.innerHTML=a,0===b.childNodes.length?"":b.childNodes[0].nodeValue},getEventTargetType:function(a){return this.getEventTarget(a).type},getEventTarget:function(a){var b=a&&a.target?a.target.className:"",c={node:this.getNode(a.target),type:d};return/\bfancytree-title\b/.test(b)?c.type="title":/\bfancytree-expander\b/.test(b)?c.type=c.node.hasChildren()===!1?"prefix":"expander":/\bfancytree-checkbox\b/.test(b)||/\bfancytree-radio\b/.test(b)?c.type="checkbox":/\bfancytree-icon\b/.test(b)?c.type="icon":/\bfancytree-node\b/.test(b)&&(c.type="title"),c},getNode:function(a){if(a instanceof p)return a;for(a.selector!==d?a=a[0]:a.originalEvent!==d&&(a=a.target);a;){if(a.ftnode)return a.ftnode;a=a.parentNode}return null},info:function(){a.ui.fancytree.debugLevel>=1&&g("info",arguments)},parseHtml:function(b){var c,e,f,g,h,i,j,k,l=b.find(">li"),m=[];return l.each(function(){var l,o=a(this),p=o.find(">span:first",this),q=p.length?null:o.find(">a:first"),r={tooltip:null,data:{}};for(p.length?r.title=p.html():q&&q.length?(r.title=q.html(),r.data.href=q.attr("href"),r.data.target=q.attr("target"),r.tooltip=q.attr("title")):(r.title=o.html(),g=r.title.search(/
        =0&&(r.title=r.title.substring(0,g))),r.title=a.trim(r.title),e=0,f=u.length;f>e;e++)r[u[e]]=d;for(j=this.className.split(" "),c=[],e=0,f=j.length;f>e;e++)k=j[e],v[k]?r[k]=!0:c.push(k);if(r.extraClasses=c.join(" "),h=o.attr("title"),h&&(r.tooltip=h),h=o.attr("id"),h&&(r.key=h),l=n(o),l&&!a.isEmptyObject(l)){for(e=0,f=w.length;f>e;e++)h=w[e],i=l[h],null!=i&&(delete l[h],r[h]=i);a.extend(r.data,l)}b=o.find(">ul:first"),r.children=b.length?a.ui.fancytree.parseHtml(b):r.lazy?d:null,m.push(r)}),m},registerExtension:function(b){f(null!=b.name,"extensions must have a `name` property."),f(null!=b.version,"extensions must have a `version` property."),a.ui.fancytree._extensions[b.name]=b},warn:function(){g("warn",arguments)}})}(jQuery,window,document); /*! Extension 'jquery.fancytree.childcounter.min.js' */ !function(a){"use strict";a.ui.fancytree._FancytreeClass.prototype.countSelected=function(a){{var b=this;b.options}return b.getSelectedNodes(a).length},a.ui.fancytree._FancytreeNodeClass.prototype.toUpper=function(){var a=this;return a.setTitle(a.title.toUpperCase())},a.ui.fancytree.prototype.widgetMethod1=function(a){this.tree;return a},a.ui.fancytree.registerExtension({name:"childcounter",version:"1.0.0",options:{deep:!0,hideZeros:!0,hideExpanded:!1},foo:42,_appendCounter:function(){},treeInit:function(a){a.options,a.options.childcounter;this._super(a),this.$container.addClass("fancytree-ext-childcounter")},treeDestroy:function(a){this._super(a)},nodeRenderTitle:function(b,c){var d=b.node,e=b.options.childcounter,f=null==d.data.childCounter?d.countChildren(e.deep):+d.data.childCounter;this._super(b,c),!f&&e.hideZeros||d.isExpanded()&&e.hideExpanded||a("span.fancytree-icon",d.span).append(a("").text(f))},nodeSetExpanded:function(a,b,c){{var d=a.tree;a.node}return this._super(a,b,c).always(function(){d.nodeRenderTitle(a)})}})}(jQuery); /*! Extension 'jquery.fancytree.dnd.min.js' */ -!function(a,b,c,d){"use strict";function e(a){return 0===a?"":a>0?"+"+a:""+a}function f(b){var c=b.options.dnd||null;c&&g(),c&&c.dragStart&&b.widget.element.draggable(a.extend({addClasses:!1,appendTo:"body",containment:!1,delay:0,distance:4,revert:!1,scroll:!0,scrollSpeed:7,scrollSensitivity:10,connectToFancytree:!0,helper:function(b){var c=a.ui.fancytree.getNode(b.target);return c?c.tree.ext.dnd._onDragEvent("helper",c,null,b,null,null):"
        ERROR?: helper requested but sourceNode not found
        "},start:function(a,b){var c=b.helper.data("ftSourceNode");return!!c}},b.options.dnd.draggable)),c&&c.dragDrop&&b.widget.element.droppable(a.extend({addClasses:!1,tolerance:"intersect",greedy:!1},b.options.dnd.droppable))}function g(){i||(a.ui.plugin.add("draggable","connectToFancytree",{start:function(b,c){var d=a(this).data("ui-draggable")||a(this).data("draggable"),e=c.helper.data("ftSourceNode")||null;return e?(d.offset.click.top=-2,d.offset.click.left=16,e.tree.ext.dnd._onDragEvent("start",e,null,b,c,d)):void 0},drag:function(b,c){var d,e=a(this).data("ui-draggable")||a(this).data("draggable"),f=c.helper.data("ftSourceNode")||null,g=c.helper.data("ftTargetNode")||null,i=a.ui.fancytree.getNode(b.target);return b.target&&!i&&(d=a(b.target).closest("div.fancytree-drag-helper,#fancytree-drop-marker").length>0)?void h("Drag event over helper: ignored."):(c.helper.data("ftTargetNode",i),g&&g!==i&&g.tree.ext.dnd._onDragEvent("leave",g,f,b,c,e),void(i&&i.tree.options.dnd.dragDrop&&(i===g?i.tree.ext.dnd._onDragEvent("over",i,f,b,c,e):i.tree.ext.dnd._onDragEvent("enter",i,f,b,c,e))))},stop:function(b,c){var d=a(this).data("ui-draggable")||a(this).data("draggable"),e=c.helper.data("ftSourceNode")||null,f=c.helper.data("ftTargetNode")||null,g=b.type,i="mouseup"===g&&1===b.which;i||h("Drag was cancelled"),f&&(i&&f.tree.ext.dnd._onDragEvent("drop",f,e,b,c,d),f.tree.ext.dnd._onDragEvent("leave",f,e,b,c,d)),e&&e.tree.ext.dnd._onDragEvent("stop",e,null,b,c,d)}}),i=!0)}var h=a.ui.fancytree.debug,i=!1;a.ui.fancytree.registerExtension({name:"dnd",version:"0.1.0",options:{dragStart:null,dragStop:null,autoExpandMS:1e3,preventVoidMoves:!0,preventRecursiveMoves:!0,dragEnter:null,dragOver:null,dragDrop:null,dragLeave:null,draggable:null,droppable:null},treeInit:function(a){var b=a.tree;this._super(a),f(b)},nodeKeydown:function(b){var c=b.originalEvent;return c.which===a.ui.keyCode.ESCAPE&&this._local._cancelDrag(),this._super(b)},_setDndStatus:function(b,c,d,f,g){var h,i=0,j="center",k=this._local,l=b?a(b.span):null,m=a(c.span);if(k.$dropMarker||(k.$dropMarker=a("
        ").hide().css({"z-index":1e3}).prependTo(a(this.$div).parent())),"after"===f||"before"===f||"over"===f){switch(f){case"before":k.$dropMarker.removeClass("fancytree-drop-after fancytree-drop-over"),k.$dropMarker.addClass("fancytree-drop-before"),j="top";break;case"after":k.$dropMarker.removeClass("fancytree-drop-before fancytree-drop-over"),k.$dropMarker.addClass("fancytree-drop-after"),j="bottom";break;default:k.$dropMarker.removeClass("fancytree-drop-after fancytree-drop-before"),k.$dropMarker.addClass("fancytree-drop-over"),m.addClass("fancytree-drop-target"),i=8}h=a.ui.fancytree.jquerySupports.positionMyOfs?{my:"left"+e(i)+" center",at:"left "+j,of:m}:{my:"left center",at:"left "+j,of:m,offset:""+i+" 0"},k.$dropMarker.show().position(h)}else m.removeClass("fancytree-drop-target"),k.$dropMarker.hide();"after"===f?m.addClass("fancytree-drop-after"):m.removeClass("fancytree-drop-after"),"before"===f?m.addClass("fancytree-drop-before"):m.removeClass("fancytree-drop-before"),g===!0?(l&&l.addClass("fancytree-drop-accept"),m.addClass("fancytree-drop-accept"),d.addClass("fancytree-drop-accept")):(l&&l.removeClass("fancytree-drop-accept"),m.removeClass("fancytree-drop-accept"),d.removeClass("fancytree-drop-accept")),g===!1?(l&&l.addClass("fancytree-drop-reject"),m.addClass("fancytree-drop-reject"),d.addClass("fancytree-drop-reject")):(l&&l.removeClass("fancytree-drop-reject"),m.removeClass("fancytree-drop-reject"),d.removeClass("fancytree-drop-reject"))},_onDragEvent:function(b,c,e,f,g,i){"over"!==b&&h("tree.ext.dnd._onDragEvent(%s, %o, %o) - %o",b,c,e,this);var j,k,l,m,n,o,p,q=this.options,r=q.dnd,s=this._makeHookContext(c,f,{otherNode:e,ui:g,draggable:i}),t=null,u=a(c.span);switch(b){case"helper":j=a("
        ").append(u.find("span.fancytree-title").clone()),a("ul.fancytree-container",c.tree.$div).append(j),j.data("ftSourceNode",c),t=j;break;case"start":c.isStatusNode()?t=!1:r.dragStart&&(t=r.dragStart(c,s)),t===!1?(this.debug("tree.dragStart() cancelled"),g.helper.trigger("mouseup"),g.helper.hide()):u.addClass("fancytree-drag-source");break;case"enter":p=r.preventRecursiveMoves&&c.isDescendantOf(e)?!1:r.dragEnter?r.dragEnter(c,s):null,t=p?a.isArray(p)?{over:a.inArray("over",p)>=0,before:a.inArray("before",p)>=0,after:a.inArray("after",p)>=0}:{over:p===!0||"over"===p,before:p===!0||"before"===p,after:p===!0||"after"===p}:!1,g.helper.data("enterResponse",t),h("helper.enterResponse: %o",t);break;case"over":n=g.helper.data("enterResponse"),o=null,n===!1||("string"==typeof n?o=n:(k=u.offset(),l={x:f.pageX-k.left,y:f.pageY-k.top},m={x:l.x/u.width(),y:l.y/u.height()},n.after&&m.y>.75?o="after":!n.over&&n.after&&m.y>.5?o="after":n.before&&m.y<=.25?o="before":!n.over&&n.before&&m.y<=.5?o="before":n.over&&(o="over"),r.preventVoidMoves&&(c===e?(h(" drop over source node prevented"),o=null):"before"===o&&e&&c===e.getNextSibling()?(h(" drop after source node prevented"),o=null):"after"===o&&e&&c===e.getPrevSibling()?(h(" drop before source node prevented"),o=null):"over"===o&&e&&e.parent===c&&e.isLastSibling()&&(h(" drop last child over own parent prevented"),o=null)),g.helper.data("hitMode",o))),"over"===o&&r.autoExpandMS&&c.hasChildren()!==!1&&!c.expanded&&c.scheduleAction("expand",r.autoExpandMS),o&&r.dragOver&&(s.hitMode=o,t=r.dragOver(c,s)),this._local._setDndStatus(e,c,g.helper,o,t!==!1&&null!==o);break;case"drop":o=g.helper.data("hitMode"),o&&r.dragDrop&&(s.hitMode=o,r.dragDrop(c,s));break;case"leave":c.scheduleAction("cancel"),g.helper.data("enterResponse",null),g.helper.data("hitMode",null),this._local._setDndStatus(e,c,g.helper,"out",d),r.dragLeave&&r.dragLeave(c,s);break;case"stop":u.removeClass("fancytree-drag-source"),r.dragStop&&r.dragStop(c,s);break;default:throw"Unsupported drag event: "+b}return t},_cancelDrag:function(){var b=a.ui.ddmanager.current;b&&b.cancel()}})}(jQuery,window,document); +!function(a,b,c,d){"use strict";function e(a){return 0===a?"":a>0?"+"+a:""+a}function f(b){var c=b.options.dnd||null;c&&g(),c&&c.dragStart&&b.widget.element.draggable(a.extend({addClasses:!1,appendTo:"body",containment:!1,delay:0,distance:4,revert:!1,scroll:!0,scrollSpeed:7,scrollSensitivity:10,connectToFancytree:!0,helper:function(b){var c=a.ui.fancytree.getNode(b.target);return c?c.tree.ext.dnd._onDragEvent("helper",c,null,b,null,null):"
        ERROR?: helper requested but sourceNode not found
        "},start:function(a,b){var c=b.helper.data("ftSourceNode");return!!c}},b.options.dnd.draggable)),c&&c.dragDrop&&b.widget.element.droppable(a.extend({addClasses:!1,tolerance:"intersect",greedy:!1},b.options.dnd.droppable))}function g(){i||(a.ui.plugin.add("draggable","connectToFancytree",{start:function(b,c){var d=a(this).data("ui-draggable")||a(this).data("draggable"),e=c.helper.data("ftSourceNode")||null;return e?(d.offset.click.top=-2,d.offset.click.left=16,e.tree.ext.dnd._onDragEvent("start",e,null,b,c,d)):void 0},drag:function(b,c){var d,e=a(this).data("ui-draggable")||a(this).data("draggable"),f=c.helper.data("ftSourceNode")||null,g=c.helper.data("ftTargetNode")||null,i=a.ui.fancytree.getNode(b.target);return b.target&&!i&&(d=a(b.target).closest("div.fancytree-drag-helper,#fancytree-drop-marker").length>0)?void h("Drag event over helper: ignored."):(c.helper.data("ftTargetNode",i),g&&g!==i&&g.tree.ext.dnd._onDragEvent("leave",g,f,b,c,e),void(i&&i.tree.options.dnd.dragDrop&&(i===g?i.tree.ext.dnd._onDragEvent("over",i,f,b,c,e):i.tree.ext.dnd._onDragEvent("enter",i,f,b,c,e))))},stop:function(b,c){var d=a(this).data("ui-draggable")||a(this).data("draggable"),e=c.helper.data("ftSourceNode")||null,f=c.helper.data("ftTargetNode")||null,g=b.type,i="mouseup"===g&&1===b.which;i||h("Drag was cancelled"),f&&(i&&f.tree.ext.dnd._onDragEvent("drop",f,e,b,c,d),f.tree.ext.dnd._onDragEvent("leave",f,e,b,c,d)),e&&e.tree.ext.dnd._onDragEvent("stop",e,null,b,c,d)}}),i=!0)}var h=a.ui.fancytree.debug,i=!1;a.ui.fancytree.registerExtension({name:"dnd",version:"0.1.0",options:{dragStart:null,dragStop:null,autoExpandMS:1e3,preventVoidMoves:!0,preventRecursiveMoves:!0,dragEnter:null,dragOver:null,dragDrop:null,dragLeave:null,draggable:null,droppable:null},treeInit:function(a){var b=a.tree;this._super(a),f(b)},nodeKeydown:function(b){var c=b.originalEvent;return c.which===a.ui.keyCode.ESCAPE&&this._local._cancelDrag(),this._super(b)},_setDndStatus:function(b,c,d,f,g){var h,i=0,j="center",k=this._local,l=b?a(b.span):null,m=a(c.span);if(k.$dropMarker||(k.$dropMarker=a("
        ").hide().css({"z-index":1e3}).prependTo(a(this.$div).parent())),"after"===f||"before"===f||"over"===f){switch(f){case"before":k.$dropMarker.removeClass("fancytree-drop-after fancytree-drop-over"),k.$dropMarker.addClass("fancytree-drop-before"),j="top";break;case"after":k.$dropMarker.removeClass("fancytree-drop-before fancytree-drop-over"),k.$dropMarker.addClass("fancytree-drop-after"),j="bottom";break;default:k.$dropMarker.removeClass("fancytree-drop-after fancytree-drop-before"),k.$dropMarker.addClass("fancytree-drop-over"),m.addClass("fancytree-drop-target"),i=8}h=a.ui.fancytree.jquerySupports.positionMyOfs?{my:"left"+e(i)+" center",at:"left "+j,of:m}:{my:"left center",at:"left "+j,of:m,offset:""+i+" 0"},k.$dropMarker.show().position(h)}else m.removeClass("fancytree-drop-target"),k.$dropMarker.hide();"after"===f?m.addClass("fancytree-drop-after"):m.removeClass("fancytree-drop-after"),"before"===f?m.addClass("fancytree-drop-before"):m.removeClass("fancytree-drop-before"),g===!0?(l&&l.addClass("fancytree-drop-accept"),m.addClass("fancytree-drop-accept"),d.addClass("fancytree-drop-accept")):(l&&l.removeClass("fancytree-drop-accept"),m.removeClass("fancytree-drop-accept"),d.removeClass("fancytree-drop-accept")),g===!1?(l&&l.addClass("fancytree-drop-reject"),m.addClass("fancytree-drop-reject"),d.addClass("fancytree-drop-reject")):(l&&l.removeClass("fancytree-drop-reject"),m.removeClass("fancytree-drop-reject"),d.removeClass("fancytree-drop-reject"))},_onDragEvent:function(b,c,e,f,g,i){"over"!==b&&h("tree.ext.dnd._onDragEvent(%s, %o, %o) - %o",b,c,e,this);var j,k,l,m,n,o,p,q=this.options,r=q.dnd,s=this._makeHookContext(c,f,{otherNode:e,ui:g,draggable:i}),t=null,u=a(c.span);switch(b){case"helper":j=a("
        ").append(u.find("span.fancytree-title").clone()),a("ul.fancytree-container",c.tree.$div).append(j),j.data("ftSourceNode",c),t=j;break;case"start":c.isStatusNode()?t=!1:r.dragStart&&(t=r.dragStart(c,s)),t===!1?(this.debug("tree.dragStart() cancelled"),g.helper.trigger("mouseup"),g.helper.hide()):u.addClass("fancytree-drag-source");break;case"enter":p=r.preventRecursiveMoves&&c.isDescendantOf(e)?!1:r.dragEnter?r.dragEnter(c,s):null,t=p?a.isArray(p)?{over:a.inArray("over",p)>=0,before:a.inArray("before",p)>=0,after:a.inArray("after",p)>=0}:{over:p===!0||"over"===p,before:p===!0||"before"===p,after:p===!0||"after"===p}:!1,g.helper.data("enterResponse",t),h("helper.enterResponse: %o",t);break;case"over":n=g.helper.data("enterResponse"),o=null,n===!1||("string"==typeof n?o=n:(k=u.offset(),l={x:f.pageX-k.left,y:f.pageY-k.top},m={x:l.x/u.width(),y:l.y/u.height()},n.after&&m.y>.75?o="after":!n.over&&n.after&&m.y>.5?o="after":n.before&&m.y<=.25?o="before":!n.over&&n.before&&m.y<=.5?o="before":n.over&&(o="over"),r.preventVoidMoves&&(c===e?(h(" drop over source node prevented"),o=null):"before"===o&&e&&c===e.getNextSibling()?(h(" drop after source node prevented"),o=null):"after"===o&&e&&c===e.getPrevSibling()?(h(" drop before source node prevented"),o=null):"over"===o&&e&&e.parent===c&&e.isLastSibling()&&(h(" drop last child over own parent prevented"),o=null)),g.helper.data("hitMode",o))),"over"===o&&r.autoExpandMS&&c.hasChildren()!==!1&&!c.expanded&&c.scheduleAction("expand",r.autoExpandMS),o&&r.dragOver&&(s.hitMode=o,t=r.dragOver(c,s)),this._local._setDndStatus(e,c,g.helper,o,t!==!1&&null!==o);break;case"drop":o=g.helper.data("hitMode"),o&&r.dragDrop&&(s.hitMode=o,r.dragDrop(c,s));break;case"leave":c.scheduleAction("cancel"),g.helper.data("enterResponse",null),g.helper.data("hitMode",null),this._local._setDndStatus(e,c,g.helper,"out",d),r.dragLeave&&r.dragLeave(c,s);break;case"stop":u.removeClass("fancytree-drag-source"),r.dragStop&&r.dragStop(c,s);break;default:a.error("Unsupported drag event: "+b)}return t},_cancelDrag:function(){var b=a.ui.ddmanager.current;b&&b.cancel()}})}(jQuery,window,document); /*! Extension 'jquery.fancytree.edit.min.js' */ -!function(a,b,c){"use strict";var d=/Mac/.test(navigator.platform),e=a.ui.fancytree.escapeHtml,f=a.ui.fancytree.unescapeHtml;a.ui.fancytree._FancytreeNodeClass.prototype.editStart=function(){var b,d=this,e=this.tree,g=e.ext.edit,h=d.title,i=e.options.edit,j=a(".fancytree-title",d.span),k={node:d,tree:e,options:e.options};return i.beforeEdit.call(d,{type:"beforeEdit"},k)===!1?!1:(h=d.title,d.debug("editStart"),e.widget._unbind(),a(c).on("mousedown.fancytree-edit",function(b){a(b.target).hasClass("fancytree-edit-input")||d.editEnd(!0,b)}),b=a("",{"class":"fancytree-edit-input",value:f(h)}),null!=i.adjustWidthOfs&&b.width(j.width()+i.adjustWidthOfs),null!=i.inputCss&&b.css(i.inputCss),k.input=b,j.html(b),a.ui.fancytree.assert(!g.currentNode,"recursive edit"),g.currentNode=this,b.focus().change(function(){b.addClass("fancytree-edit-dirty")}).keydown(function(b){switch(b.which){case a.ui.keyCode.ESCAPE:d.editEnd(!1,b);break;case a.ui.keyCode.ENTER:return d.editEnd(!0,b),!1}}).blur(function(a){return d.editEnd(!0,a)}),void i.edit.call(d,{type:"edit"},k))},a.ui.fancytree._FancytreeNodeClass.prototype.editEnd=function(b,d){var f=this,g=this.tree,h=g.ext.edit,i=g.options.edit,j=a(".fancytree-title",f.span),k=j.find("input.fancytree-edit-input"),l=k.val(),m=k.hasClass("fancytree-edit-dirty"),n=(b||m&&b!==!1)&&l!==f.title,o={node:f,tree:g,options:g.options,originalEvent:d,dirty:m,save:n,input:k,value:l};return i.beforeClose.call(f,{type:"beforeClose"},o)===!1?!1:n&&i.save.call(f,{type:"save"},o)===!1?!1:(k.removeClass("fancytree-edit-dirty").unbind(),a(c).off(".fancytree-edit"),n?f.setTitle(e(l)):f.renderTitle(),g.widget._bind(),h.currentNode=null,f.setFocus(),a(g.$container).focus(),o.input=null,i.close.call(f,{type:"close"},o),!0)},a.ui.fancytree._FancytreeNodeClass.prototype.startEdit=function(){return this.warn("FancytreeNode.startEdit() is deprecated since 2014-01-04. Use .editStart() instead."),this.editStart.apply(this,arguments)},a.ui.fancytree._FancytreeNodeClass.prototype.endEdit=function(){return this.warn("FancytreeNode.endEdit() is deprecated since 2014-01-04. Use .editEnd() instead."),this.editEnd.apply(this,arguments)},a.ui.fancytree._FancytreeClass.prototype.isEditing=function(){return this.ext.edit.currentNode},a.ui.fancytree._FancytreeNodeClass.prototype.isEditing=function(){return this.tree.ext.edit.currentNode===this},a.ui.fancytree.registerExtension({name:"edit",version:"0.1.0",options:{adjustWidthOfs:4,inputCss:{minWidth:"3em"},triggerCancel:["esc","tab","click"],triggerStart:["f2","shift+click","mac+enter"],beforeClose:a.noop,beforeEdit:a.noop,close:a.noop,edit:a.noop,save:a.noop},currentNode:null,treeInit:function(a){this._super(a),this.$container.addClass("fancytree-ext-edit")},nodeClick:function(b){return a.inArray("shift+click",b.options.edit.triggerStart)>=0&&b.originalEvent.shiftKey?(b.node.editStart(),!1):void this._super(b)},nodeDblclick:function(b){return a.inArray("dblclick",b.options.edit.triggerStart)>=0?(b.node.editStart(),!1):this._super(b)},nodeKeydown:function(b){switch(b.originalEvent.which){case 113:if(a.inArray("f2",b.options.edit.triggerStart)>=0)return b.node.editStart(),!1;break;case a.ui.keyCode.ENTER:if(a.inArray("mac+enter",b.options.edit.triggerStart)>=0&&d)return b.node.editStart(),!1}return this._super(b)}})}(jQuery,window,document); +!function(a,b,c){"use strict";var d=/Mac/.test(navigator.platform),e=a.ui.fancytree.escapeHtml,f=a.ui.fancytree.unescapeHtml;a.ui.fancytree._FancytreeNodeClass.prototype.editStart=function(){var b,d=this,e=this.tree,g=e.ext.edit,h=d.title,i=e.options.edit,j=a(".fancytree-title",d.span),k={node:d,tree:e,options:e.options};return i.beforeEdit.call(d,{type:"beforeEdit"},k)===!1?!1:(h=d.title,d.debug("editStart"),e.widget._unbind(),a(c).on("mousedown.fancytree-edit",function(b){a(b.target).hasClass("fancytree-edit-input")||d.editEnd(!0,b)}),b=a("",{"class":"fancytree-edit-input",value:f(h)}),null!=i.adjustWidthOfs&&b.width(j.width()+i.adjustWidthOfs),null!=i.inputCss&&b.css(i.inputCss),k.input=b,j.html(b),a.ui.fancytree.assert(!g.currentNode,"recursive edit"),g.currentNode=this,b.focus().change(function(){b.addClass("fancytree-edit-dirty")}).keydown(function(b){switch(b.which){case a.ui.keyCode.ESCAPE:d.editEnd(!1,b);break;case a.ui.keyCode.ENTER:return d.editEnd(!0,b),!1}}).blur(function(a){return d.editEnd(!0,a)}),void i.edit.call(d,{type:"edit"},k))},a.ui.fancytree._FancytreeNodeClass.prototype.editEnd=function(b,d){var f=this,g=this.tree,h=g.ext.edit,i=g.options.edit,j=a(".fancytree-title",f.span),k=j.find("input.fancytree-edit-input"),l=k.val(),m=k.hasClass("fancytree-edit-dirty"),n=(b||m&&b!==!1)&&l!==f.title,o={node:f,tree:g,options:g.options,originalEvent:d,dirty:m,save:n,input:k,value:l};return i.beforeClose.call(f,{type:"beforeClose"},o)===!1?!1:n&&i.save.call(f,{type:"save"},o)===!1?!1:(k.removeClass("fancytree-edit-dirty").unbind(),a(c).off(".fancytree-edit"),n?f.setTitle(e(l)):f.renderTitle(),g.widget._bind(),h.currentNode=null,f.setFocus(),a(g.$container).focus(),o.input=null,i.close.call(f,{type:"close"},o),!0)},a.ui.fancytree._FancytreeNodeClass.prototype.startEdit=function(){return this.warn("FancytreeNode.startEdit() is deprecated since 2014-01-04. Use .editStart() instead."),this.editStart.apply(this,arguments)},a.ui.fancytree._FancytreeNodeClass.prototype.endEdit=function(){return this.warn("FancytreeNode.endEdit() is deprecated since 2014-01-04. Use .editEnd() instead."),this.editEnd.apply(this,arguments)},a.ui.fancytree._FancytreeClass.prototype.isEditing=function(){return this.ext.edit.currentNode},a.ui.fancytree._FancytreeNodeClass.prototype.isEditing=function(){return this.tree.ext.edit.currentNode===this},a.ui.fancytree.registerExtension({name:"edit",version:"0.1.0",options:{adjustWidthOfs:4,inputCss:{minWidth:"3em"},triggerCancel:["esc","tab","click"],triggerStart:["f2","shift+click","mac+enter"],beforeClose:a.noop,beforeEdit:a.noop,close:a.noop,edit:a.noop,save:a.noop},currentNode:null,treeInit:function(a){this._super(a),this.$container.addClass("fancytree-ext-edit")},nodeClick:function(b){return a.inArray("shift+click",b.options.edit.triggerStart)>=0&&b.originalEvent.shiftKey?(b.node.editStart(),!1):this._super(b)},nodeDblclick:function(b){return a.inArray("dblclick",b.options.edit.triggerStart)>=0?(b.node.editStart(),!1):this._super(b)},nodeKeydown:function(b){switch(b.originalEvent.which){case 113:if(a.inArray("f2",b.options.edit.triggerStart)>=0)return b.node.editStart(),!1;break;case a.ui.keyCode.ENTER:if(a.inArray("mac+enter",b.options.edit.triggerStart)>=0&&d)return b.node.editStart(),!1}return this._super(b)}})}(jQuery,window,document); /*! Extension 'jquery.fancytree.filter.min.js' */ -!function(a){"use strict";function b(a){return(a+"").replace(/([.?*+\^\$\[\]\\(){}|-])/g,"\\$1")}a.ui.fancytree._FancytreeClass.prototype.applyFilter=function(a){var c,d,e=0,f="hide"===this.options.filter.mode,g=this.options.filter.leavesOnly;return"string"==typeof a&&(c=b(a),d=new RegExp(".*"+c+".*","i"),a=function(a){return!!d.exec(a.title)}),this.enableFilter=!0,this.$div.addClass("fancytree-ext-filter"),this.$div.addClass(f?"fancytree-ext-filter-hide":"fancytree-ext-filter-dimm"),this.visit(function(a){delete a.match,delete a.subMatch}),this.visit(function(b){g&&null!=b.children||!a(b)||(e++,b.match=!0,b.visitParents(function(a){a.subMatch=!0}))}),this.render(),e},a.ui.fancytree._FancytreeClass.prototype.clearFilter=function(){this.visit(function(a){delete a.match,delete a.subMatch}),this.enableFilter=!1,this.$div.removeClass("fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"),this.render()},a.ui.fancytree.registerExtension({name:"filter",version:"0.0.2",options:{mode:"dimm",leavesOnly:!1},treeInit:function(a){this._super(a)},treeDestroy:function(a){this._super(a)},nodeRenderStatus:function(b){var c,d=b.node,e=b.tree,f=a(d[e.statusClassPropName]);return c=this._super(b),f.length&&e.enableFilter?(f.toggleClass("fancytree-match",!!d.match),f.toggleClass("fancytree-submatch",!!d.subMatch),f.toggleClass("fancytree-hide",!(d.match||d.subMatch)),c):c}})}(jQuery,window,document); +!function(a){"use strict";function b(a){return(a+"").replace(/([.?*+\^\$\[\]\\(){}|-])/g,"\\$1")}a.ui.fancytree._FancytreeClass.prototype.applyFilter=function(a){var c,d,e=0,f="hide"===this.options.filter.mode,g=this.options.filter.leavesOnly;return"string"==typeof a&&(c=b(a),d=new RegExp(".*"+c+".*","i"),a=function(a){return!!d.exec(a.title)}),this.enableFilter=!0,this.$div.addClass("fancytree-ext-filter"),this.$div.addClass(f?"fancytree-ext-filter-hide":"fancytree-ext-filter-dimm"),this.visit(function(a){delete a.match,delete a.subMatch}),this.visit(function(b){g&&null!=b.children||!a(b)||(e++,b.match=!0,b.visitParents(function(a){a.subMatch=!0}))}),this.render(),e},a.ui.fancytree._FancytreeClass.prototype.clearFilter=function(){this.visit(function(a){delete a.match,delete a.subMatch}),this.enableFilter=!1,this.$div.removeClass("fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"),this.render()},a.ui.fancytree.registerExtension({name:"filter",version:"0.1.0",options:{mode:"dimm",leavesOnly:!1},treeInit:function(a){this._super(a)},nodeRenderStatus:function(b){var c,d=b.node,e=b.tree,f=a(d[e.statusClassPropName]);return c=this._super(b),f.length&&e.enableFilter?(f.toggleClass("fancytree-match",!!d.match).toggleClass("fancytree-submatch",!!d.subMatch).toggleClass("fancytree-hide",!(d.match||d.subMatch)),c):c}})}(jQuery,window,document); /*! Extension 'jquery.fancytree.glyph.min.js' */ -!function(a){"use strict";function b(a,b){return a.map[b]}a.ui.fancytree.registerExtension({name:"glyph",version:"0.0.2",options:{prefix:"icon-",extra:null,map:{doc:"icon-file-alt",docOpen:"icon-file-alt",checkbox:"icon-check-empty",checkboxSelected:"icon-check",checkboxUnknown:"icon-check icon-muted",error:"icon-exclamation-sign",expanderClosed:"icon-caret-right",expanderLazy:"icon-angle-right",expanderOpen:"icon-caret-down",folder:"icon-folder-close-alt",folderOpen:"icon-folder-open-alt",loading:"icon-refresh icon-spin",noExpander:""},icon:null},treeInit:function(a){var b=a.tree;this._super(a),b.$container.addClass("fancytree-ext-glyph")},nodeRenderStatus:function(c){var d,e,f=c.node,g=c.options.glyph,h=g.map;this._super(c),f.isRoot()||(e=a("span.fancytree-expander",f.span).get(0),e&&(d=f.isLoading()?"loading":f.expanded?"expanderOpen":f.isUndefined()?"expanderLazy":f.hasChildren()?"expanderClosed":"noExpander",e.className="fancytree-expander "+h[d]),e=a("span.fancytree-checkbox",f.tr||f.span).get(0),e&&(d=f.selected?"checkboxSelected":f.partsel?"checkboxUnknown":"checkbox",e.className="fancytree-checkbox "+h[d]),e=a("span.fancytree-icon",f.span).get(0),e&&(d=f.folder?f.expanded?b(g,"folderOpen"):b(g,"folder"):f.expanded?b(g,"docOpen"):b(g,"doc"),e.className="fancytree-icon "+d))},nodeSetStatus:function(c,d,e,f){var g,h=c.options.glyph,i=c.node;this._super(c,d,e,f),g=i.parent?a("span.fancytree-expander",i.span).get(0):a(".fancytree-statusnode-wait, .fancytree-statusnode-error",i[this.nodeContainerAttrName]).find("span.fancytree-expander").get(0),"loading"===d?g.className="fancytree-expander "+b(h,"loading"):"error"===d&&(g.className="fancytree-expander "+b(h,"error"))}})}(jQuery,window,document); +!function(a){"use strict";function b(a,b){return a.map[b]}a.ui.fancytree.registerExtension({name:"glyph",version:"0.1.0",options:{prefix:"icon-",extra:null,map:{doc:"icon-file-alt",docOpen:"icon-file-alt",checkbox:"icon-check-empty",checkboxSelected:"icon-check",checkboxUnknown:"icon-check icon-muted",error:"icon-exclamation-sign",expanderClosed:"icon-caret-right",expanderLazy:"icon-angle-right",expanderOpen:"icon-caret-down",folder:"icon-folder-close-alt",folderOpen:"icon-folder-open-alt",loading:"icon-refresh icon-spin",noExpander:""},icon:null},treeInit:function(a){var b=a.tree;this._super(a),b.$container.addClass("fancytree-ext-glyph")},nodeRenderStatus:function(c){var d,e,f=c.node,g=c.options.glyph,h=g.map;this._super(c),f.isRoot()||(e=a("span.fancytree-expander",f.span).get(0),e&&(d=f.isLoading()?"loading":f.expanded?"expanderOpen":f.isUndefined()?"expanderLazy":f.hasChildren()?"expanderClosed":"noExpander",e.className="fancytree-expander "+h[d]),e=a("span.fancytree-checkbox",f.tr||f.span).get(0),e&&(d=f.selected?"checkboxSelected":f.partsel?"checkboxUnknown":"checkbox",e.className="fancytree-checkbox "+h[d]),e=a("span.fancytree-icon",f.span).get(0),e&&(d=f.folder?f.expanded?b(g,"folderOpen"):b(g,"folder"):f.expanded?b(g,"docOpen"):b(g,"doc"),e.className="fancytree-icon "+d))},nodeSetStatus:function(c,d,e,f){var g,h=c.options.glyph,i=c.node;this._super(c,d,e,f),g=i.parent?a("span.fancytree-expander",i.span).get(0):a(".fancytree-statusnode-wait, .fancytree-statusnode-error",i[this.nodeContainerAttrName]).find("span.fancytree-expander").get(0),"loading"===d?g.className="fancytree-expander "+b(h,"loading"):"error"===d&&(g.className="fancytree-expander "+b(h,"error"))}})}(jQuery,window,document); /*! Extension 'jquery.fancytree.gridnav.min.js' */ !function(a){"use strict";function b(b,c){var d,e=c.get(0),f=0;return b.children().each(function(){return this===e?!1:(d=a(this).prop("colspan"),void(f+=d?d:1))}),f}function c(b,c){var d,e=null,f=0;return b.children().each(function(){return f>=c?(e=a(this),!1):(d=a(this).prop("colspan"),void(f+=d?d:1))}),e}function d(a,d){var f,g,h=a.closest("td"),i=null;switch(d){case e.LEFT:i=h.prev();break;case e.RIGHT:i=h.next();break;case e.UP:case e.DOWN:for(f=h.parent(),g=b(f,h);;){if(f=d===e.UP?f.prev():f.next(),!f.length)break;if(!f.is(":hidden")&&(i=c(f,g),i&&i.find(":input").length))break}}return i}var e=a.ui.keyCode,f={text:[e.UP,e.DOWN],checkbox:[e.UP,e.DOWN,e.LEFT,e.RIGHT],radiobutton:[e.UP,e.DOWN,e.LEFT,e.RIGHT],"select-one":[e.LEFT,e.RIGHT],"select-multiple":[e.LEFT,e.RIGHT]};a.ui.fancytree.registerExtension({name:"gridnav",version:"0.0.1",options:{autofocusInput:!1,handleCursorKeys:!0},treeInit:function(b){this._requireExtension("table",!0,!0),this._super(b),this.$container.addClass("fancytree-ext-gridnav"),this.$container.on("focusin",function(c){var d,e=a.ui.fancytree.getNode(c.target);e&&!e.isActive()&&(d=b.tree._makeHookContext(e,c),b.tree._callHook("nodeSetActive",d,!0))})},nodeSetActive:function(b,c){var d,e=b.options.gridnav,f=b.node,g=b.originalEvent||{},h=a(g.target).is(":input");c=c!==!1,this._super(b,c),c&&(b.options.titlesTabbable?(h||(a(f.span).find("span.fancytree-title").focus(),f.setFocus()),b.tree.$container.attr("tabindex","-1")):e.autofocusInput&&!h&&(d=a(f.tr||f.span),d.find(":input:enabled:first").focus()))},nodeKeydown:function(b){var c,e,g,h=b.options.gridnav,i=b.originalEvent,j=a(i.target);return c=j.is(":input:enabled")?j.prop("type"):null,c&&h.handleCursorKeys?(e=f[c],e&&a.inArray(i.which,e)>=0&&(g=d(j,i.which),g&&g.length)?(g.find(":input:enabled").focus(),!1):!0):(b.tree.debug("ext-gridnav NOT HANDLED",i,c),this._super(b))}})}(jQuery,window,document); /*! Extension 'jquery.fancytree.persist.min.js' */ -!function(a,b,c,d){"use strict";function e(b,c){c=c||"",b||a.error("Assertion failed "+c)}function f(b,c,d,e,g){var i,j,k,l,m=!1,n=[],o=[];for(d=d||[],g=g||a.Deferred(),i=0,k=d.length;k>i;i++)j=d[i],l=b.getNodeByKey(j),l?e&&l.isUndefined()?(m=!0,b.debug("_loadLazyNodes: "+l+" is lazy: loading..."),n.push("expand"===e?l.setExpanded():l.load())):(b.debug("_loadLazyNodes: "+l+" already loaded."),l.setExpanded()):(o.push(j),b.debug("_loadLazyNodes: "+l+" was not yet found."));return a.when.apply(a,n).always(function(){if(m&&o.length>0)f(b,c,o,e,g);else{if(o.length)for(b.warn("_loadLazyNodes: could not load those keys: ",o),i=0,k=o.length;k>i;i++)j=d[i],c._setKey(h,d[i],!1);g.resolve()}}),g}var g="active",h="expanded",i="focus",j="selected";a.ui.fancytree._FancytreeClass.prototype.clearCookies=function(b){var c=this.ext.persist,d=c.cookiePrefix;b=b||"active expanded focus selected",b.indexOf(g)>=0&&a.removeCookie(d+g),b.indexOf(h)>=0&&a.removeCookie(d+h),b.indexOf(i)>=0&&a.removeCookie(d+i),b.indexOf(j)>=0&&a.removeCookie(d+j)},a.ui.fancytree._FancytreeClass.prototype.getPersistData=function(){var b=this.ext.persist,c=this.options.persist,d=c.cookieDelimiter,e={};return e[g]=a.cookie(b.cookiePrefix+g),e[h]=(a.cookie(b.cookiePrefix+h)||"").split(d),e[j]=(a.cookie(b.cookiePrefix+j)||"").split(d),e[i]=a.cookie(b.cookiePrefix+i),e},a.ui.fancytree.registerExtension({name:"persist",version:"0.2.0",options:{cookieDelimiter:"~",cookiePrefix:d,cookie:{raw:!1,expires:"",path:"",domain:"",secure:!1},expandLazy:!1,overrideSource:!1,types:"active expanded focus selected"},_setKey:function(b,c,d){c=""+c;var e=this._local,f=this.options.persist,g=e.cookiePrefix+b,h=a.cookie(g),i=h?h.split(f.cookieDelimiter):[],j=a.inArray(c,i);j>=0&&i.splice(j,1),d&&i.push(c),a.cookie(g,i.join(f.cookieDelimiter),f.cookie)},treeInit:function(b){var k=b.tree,l=b.options,m=this._local,n=this.options.persist;e(a.cookie,"Missing required plugin for 'persist' extension: jquery.cookie.js"),m.cookiePrefix=n.cookiePrefix||"fancytree-"+k._id+"-",m.storeActive=n.types.indexOf(g)>=0,m.storeExpanded=n.types.indexOf(h)>=0,m.storeSelected=n.types.indexOf(j)>=0,m.storeFocus=n.types.indexOf(i)>=0,k.$div.bind("fancytreeinit",function(){var b,e,o,p,q,r=a.cookie(m.cookiePrefix+i);k.debug("COOKIE "+c.cookie),b=a.cookie(m.cookiePrefix+h),p=b&&b.split(n.cookieDelimiter),e=m.storeExpanded?f(k,m,p,n.expandLazy?"expand":!1,null):(new a.Deferred).resolve(),e.done(function(){if(m.storeSelected&&(b=a.cookie(m.cookiePrefix+j)))for(p=b.split(n.cookieDelimiter),o=0;oi;i++)j=d[i],l=b.getNodeByKey(j),l?e&&l.isUndefined()?(m=!0,b.debug("_loadLazyNodes: "+l+" is lazy: loading..."),n.push("expand"===e?l.setExpanded():l.load())):(b.debug("_loadLazyNodes: "+l+" already loaded."),l.setExpanded()):(o.push(j),b.debug("_loadLazyNodes: "+l+" was not yet found."));return a.when.apply(a,n).always(function(){if(m&&o.length>0)f(b,c,o,e,g);else{if(o.length)for(b.warn("_loadLazyNodes: could not load those keys: ",o),i=0,k=o.length;k>i;i++)j=d[i],c._setKey(h,d[i],!1);g.resolve()}}),g}var g="active",h="expanded",i="focus",j="selected";a.ui.fancytree._FancytreeClass.prototype.clearCookies=function(b){var c=this.ext.persist,d=c.cookiePrefix;b=b||"active expanded focus selected",b.indexOf(g)>=0&&a.removeCookie(d+g),b.indexOf(h)>=0&&a.removeCookie(d+h),b.indexOf(i)>=0&&a.removeCookie(d+i),b.indexOf(j)>=0&&a.removeCookie(d+j)},a.ui.fancytree._FancytreeClass.prototype.getPersistData=function(){var b=this.ext.persist,c=this.options.persist,d=c.cookieDelimiter,e={};return e[g]=a.cookie(b.cookiePrefix+g),e[h]=(a.cookie(b.cookiePrefix+h)||"").split(d),e[j]=(a.cookie(b.cookiePrefix+j)||"").split(d),e[i]=a.cookie(b.cookiePrefix+i),e},a.ui.fancytree.registerExtension({name:"persist",version:"0.2.0",options:{cookieDelimiter:"~",cookiePrefix:d,cookie:{raw:!1,expires:"",path:"",domain:"",secure:!1},expandLazy:!1,overrideSource:!1,types:"active expanded focus selected"},_setKey:function(b,c,d){c=""+c;var e=this._local,f=this.options.persist,g=e.cookiePrefix+b,h=a.cookie(g),i=h?h.split(f.cookieDelimiter):[],j=a.inArray(c,i);j>=0&&i.splice(j,1),d&&i.push(c),a.cookie(g,i.join(f.cookieDelimiter),f.cookie)},treeInit:function(b){var k=b.tree,l=b.options,m=this._local,n=this.options.persist;return e(a.cookie,"Missing required plugin for 'persist' extension: jquery.cookie.js"),m.cookiePrefix=n.cookiePrefix||"fancytree-"+k._id+"-",m.storeActive=n.types.indexOf(g)>=0,m.storeExpanded=n.types.indexOf(h)>=0,m.storeSelected=n.types.indexOf(j)>=0,m.storeFocus=n.types.indexOf(i)>=0,k.$div.bind("fancytreeinit",function(){var b,e,o,p,q,r=a.cookie(m.cookiePrefix+i);k.debug("COOKIE "+c.cookie),b=a.cookie(m.cookiePrefix+h),p=b&&b.split(n.cookieDelimiter),e=m.storeExpanded?f(k,m,p,n.expandLazy?"expand":!1,null):(new a.Deferred).resolve(),e.done(function(){if(m.storeSelected&&(b=a.cookie(m.cookiePrefix+j)))for(p=b.split(n.cookieDelimiter),o=0;o1&&h[0]!==b)for(c=a.inArray(b,h),f=h[c-1],d(f.tr);f.children&&(e=f.children[f.children.length-1],e.tr);)f=e;else f=g;return f}a.ui.fancytree.registerExtension({name:"table",version:"0.2.0",options:{checkboxColumnIdx:null,customStatus:!1,indentation:16,nodeColumnIdx:0},treeInit:function(b){var d,e,f,g=b.tree,h=g.widget.element;for(h.addClass("fancytree-container fancytree-ext-table"),g.tbody=h.find("> tbody")[0],g.columnCount=a("thead >tr >th",h).length,a(g.tbody).empty(),g.rowFragment=c.createDocumentFragment(),e=a(""),f="",b.options.aria&&(e.attr("role","row"),f=" role='gridcell'"),d=0;d":"");g.rowFragment.appendChild(e.get(0)),g.statusClassPropName="tr",g.ariaPropName="tr",this.nodeContainerAttrName="tr",this._super(b),a(g.rootNode.ul).remove(),g.rootNode.ul=null,g.$container=h,this.$container.attr("tabindex",this.options.tabbable?"0":"-1"),this.options.aria&&g.$container.attr("role","treegrid").attr("aria-readonly",!0)},nodeRemoveChildMarkup:function(b){var c=b.node;c.visit(function(b){b.tr&&(a(b.tr).remove(),b.tr=null)})},nodeRemoveMarkup:function(b){var c=b.node;c.tr&&(a(c.tr).remove(),c.tr=null),this.nodeRemoveChildMarkup(b)},nodeRender:function(b,c,h,i,j){var k,l,m,n,o,p,q,r,s=b.tree,t=b.node,u=b.options,v=!t.parent;if(j||(b.hasCollapsedParents=t.parent&&!t.parent.expanded),!v)if(t.tr)c?this.nodeRenderTitle(b):this.nodeRenderStatus(b);else{if(b.hasCollapsedParents)return void t.debug("nodeRender ignored due to unrendered parent");o=s.rowFragment.firstChild.cloneNode(!0),p=g(t),d(p),i===!0&&j?o.style.display="none":h&&b.hasCollapsedParents&&(o.style.display="none"),p.tr?e(p.tr,o):(d(!p.parent,"prev. row must have a tr, or is system root"),s.tbody.appendChild(o)),t.tr=o,t.key&&u.generateIds&&(t.tr.id=u.idPrefix+t.key),t.tr.ftnode=t,u.aria&&a(t.tr).attr("aria-labelledby","ftal_"+t.key),t.span=a("span.fancytree-node",t.tr).get(0),this.nodeRenderTitle(b),u.createNode&&u.createNode.call(s,{type:"createNode"},b)}if(u.renderNode&&u.renderNode.call(s,{type:"renderNode"},b),k=t.children,k&&(v||h||t.expanded))for(m=0,n=k.length;n>m;m++)r=a.extend({},b,{node:k[m]}),r.hasCollapsedParents=r.hasCollapsedParents||!t.expanded,this.nodeRender(r,c,h,i,!0);k&&!j&&(q=t.tr||null,l=s.tbody.firstChild,t.visit(function(a){if(a.tr){if(a.parent.expanded||"none"===a.tr.style.display||(a.tr.style.display="none",f(a,!1)),a.tr.previousSibling!==q){t.debug("_fixOrder: mismatch at node: "+a);var b=q?q.nextSibling:l;s.tbody.insertBefore(a.tr,b)}q=a.tr}}))},nodeRenderTitle:function(b){var c,d=b.node,e=b.options;this._super(b),e.checkbox&&null!=e.table.checkboxColumnIdx&&(c=a("span.fancytree-checkbox",d.span).detach(),a(d.tr).find("td:first").html(c)),d.isRoot()||this.nodeRenderStatus(b),!e.table.customStatus&&d.isStatusNode()||e.renderColumns&&e.renderColumns.call(b.tree,{type:"renderColumns"},b)},nodeRenderStatus:function(b){var c,d=b.node,e=b.options;this._super(b),a(d.tr).removeClass("fancytree-node"),c=(d.getLevel()-1)*e.table.indentation,a(d.span).css({marginLeft:c+"px"})},nodeSetExpanded:function(b,c,d){function e(a){c=c!==!1,f(b.node,c),h.noEvents||b.tree._triggerNodeEvent(c?"expand":"collapse",b),a?g.resolveWith(b.node):g.rejectWith(b.node)}var g=new a.Deferred,h=d||{};return d=a.extend({},d,{noEvents:!0,noAnimation:!0}),this._super(b,c,d).done(function(){e(!0)}).fail(function(){e(!1)}),g.promise()},nodeSetStatus:function(b,c,d,e){if("ok"===c){var f=b.node,g=f.children?f.children[0]:null;g&&g.isStatusNode()&&a(g.tr).remove()}this._super(b,c,d,e)},treeClear:function(a){return this.nodeRemoveChildMarkup(this._makeHookContext(this.rootNode)),this._super(a)}})}(jQuery,window,document); diff --git a/dist/jquery.fancytree.js b/dist/jquery.fancytree.js index 447eb552..dee2ef55 100644 --- a/dist/jquery.fancytree.js +++ b/dist/jquery.fancytree.js @@ -7,8 +7,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ /** Core Fancytree module. @@ -3772,7 +3772,7 @@ $.extend($.ui.fancytree, /** @lends Fancytree_Static# */ { /** @type {string} */ - version: "2.0.0-11", // Set to semver by 'grunt release' + version: "2.0.0-12", // Set to semver by 'grunt release' /** @type {string} */ buildType: "production", // Set to 'production' by 'grunt build' /** @type {int} */ diff --git a/dist/jquery.fancytree.min.js b/dist/jquery.fancytree.min.js index b7edeebe..8280b56b 100644 --- a/dist/jquery.fancytree.min.js +++ b/dist/jquery.fancytree.min.js @@ -7,8 +7,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ !function(a,b,c,d){"use strict";function e(b){b=b||"",a.error("Not implemented: "+b)}function f(b,c){b||(c=c?": "+c:"",a.error("Assertion failed"+c))}function g(a,c){var d,e,f=b.console?b.console[a]:null;if(f)if(f.apply)f.apply(b.console,c);else{for(e="",d=0;de;return!0}function i(a,b,c,d,e){var f=function(){var c=b[a],f=d[a],g=b.ext[e],h=function(){return c.apply(b,arguments)};return function(){var a=b._local,c=b._super;try{return b._local=g,b._super=h,f.apply(b,arguments)}finally{b._local=a,b._super=c}}}();return f}function j(b,c,d,e){for(var f in d)"function"==typeof d[f]?"function"==typeof b[f]?b[f]=i(f,b,c,d,e):"_"===f.charAt(0)?b.ext[e][f]=i(f,b,c,d,e):a.error("Could not override tree."+f+". Use prefix '_' to create tree."+e+"._"+f):"options"!==f&&(b.ext[e][f]=d[f])}function k(b,c){return b===d?a.Deferred(function(){this.resolve()}).promise():a.Deferred(function(){this.resolveWith(b,c)}).promise()}function l(b,c){return b===d?a.Deferred(function(){this.reject()}).promise():a.Deferred(function(){this.rejectWith(b,c)}).promise()}function m(a,b){return function(){a.resolveWith(b)}}function n(b){var c=a.extend({},b.data()),d=c.json;return delete c.fancytree,d&&(delete c.json,c=a.extend(c,d)),c}function o(a){return a=a.toLowerCase(),function(b){return b.title.toLowerCase().indexOf(a)>=0}}function p(b,c){var d,e,g,h;for(this.parent=b,this.tree=b.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},d=0,e=w.length;e>d;d++)g=w[d],this[g]=c[g];c.data&&a.extend(this.data,c.data);for(g in c)x[g]||a.isFunction(c[g])||y[g]||(this.data[g]=c[g]);null==this.key&&(this.tree.options.defaultKey?(this.key=this.tree.options.defaultKey(this),f(this.key,"defaultKey() must return a unique key")):this.key="_"+s._nextNodeKey++),c.active&&(f(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),c.selected&&(this.tree.lastSelectedNode=this),this.children=null,h=c.children,h&&h.length&&this._setChildren(h),this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function q(b){this.widget=b,this.$div=b.element,this.options=b.options,this.options&&a.isFunction(this.options.lazyload)&&(a.isFunction(this.options.lazyLoad)||(this.options.lazyLoad=function(){s.warn("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),b.options.lazyload.apply(this,arguments)})),this.ext={},this.data=n(this.$div),this._id=a.ui.fancytree._nextId++,this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this.lastSelectedNode=null,this.systemFocusElement=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var c,d={tree:this};this.rootNode=new p(d,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,c=a("
          ",{"class":"ui-fancytree fancytree-container"}).appendTo(this.$div),this.$container=c,this.rootNode.ul=c[0],null==this.options.debugLevel&&(this.options.debugLevel=s.debugLevel),this.$container.attr("tabindex",this.options.tabbable?"0":"-1"),this.options.aria&&this.$container.attr("role","tree").attr("aria-multiselectable",!0)}if(a.ui.fancytree&&a.ui.fancytree.version)return void a.ui.fancytree.warn("Fancytree: ignored duplicate include");var r,s=null,t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},u="active expanded focus folder hideCheckbox lazy selected unselectable".split(" "),v={},w="expanded extraClasses folder hideCheckbox key lazy refKey selected title tooltip unselectable".split(" "),x={},y={active:!0,children:!0,data:!0,focus:!0};for(r=0;rb;b++)if(d[b].key===a)return d[b]}else{if("number"==typeof a)return this.children[a];if(a.parent===this)return a}return null},_setChildren:function(a){f(a&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var b=0,c=a.length;c>b;b++)this.children.push(new p(this,a[b]))},addChildren:function(b,c){var d,e,g,h=null,i=[];for(a.isPlainObject(b)&&(b=[b]),this.children||(this.children=[]),d=0,e=b.length;e>d;d++)i.push(new p(this,b[d]));return h=i[0],null==c?this.children=this.children.concat(i):(c=this._findDirectChild(c),g=a.inArray(c,this.children),f(g>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[g,0].concat(i))),(!this.parent||this.parent.ul||this.tr)&&this.render(),3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),h},addNode:function(a,b){switch((b===d||"over"===b)&&(b="child"),b){case"after":return this.getParent().addChildren(a,this.getNextSibling());case"before":return this.getParent().addChildren(a,this);case"child":case"over":return this.addChildren(a)}f(!1,"Invalid mode: "+b)},appendSibling:function(a){return this.addNode(a,"after")},applyPatch:function(b){if(null===b)return this.remove(),k(this);var c,d,e,f={children:!0,expanded:!0,parent:!0};for(c in b)e=b[c],f[c]||a.isFunction(e)||(x[c]?this[c]=e:this.data[c]=e);return b.hasOwnProperty("children")&&(this.removeChildren(),b.children&&this._setChildren(b.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),d=b.hasOwnProperty("expanded")?this.setExpanded(b.expanded):k(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(a,b,c){return a.addNode(this.toDict(!0,c),b)},countChildren:function(a){var b,c,d,e=this.children;if(!e)return 0;if(d=e.length,a!==!1)for(b=0,c=d;c>b;b++)d+=e[b].countChildren();return d},debug:function(){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),g("debug",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},findAll:function(b){b=a.isFunction(b)?b:o(b);var c=[];return this.visit(function(a){b(a)&&c.push(a)}),c},findFirst:function(b){b=a.isFunction(b)?b:o(b);var c=null;return this.visit(function(a){return b(a)?(c=a,!1):void 0}),c},_changeSelectStatusAttrs:function(a){var b=!1;switch(a){case!1:b=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:b=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case d:b=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:f(!1,"invalid state: "+a)}return b&&this.renderStatus(),b},fixSelection3AfterClick:function(){var a=this.isSelected();this.visit(function(b){b._changeSelectStatusAttrs(a)}),this.fixSelection3FromEndNodes()},fixSelection3FromEndNodes:function(){function a(b){var c,e,f,g,h,i,j,k=b.children;if(k){for(i=!0,j=!1,c=0,e=k.length;e>c;c++)f=k[c],g=a(f),g!==!1&&(j=!0),g!==!0&&(i=!1);h=i?!0:j?d:!1}else h=!!b.selected;return b._changeSelectStatusAttrs(h),h}f(3===this.tree.options.selectMode,"expected selectMode 3"),a(this),this.visitParents(function(a){var b,c,e,f,g=a.children,h=!0,i=!1;for(b=0,c=g.length;c>b;b++)e=g[b],(e.selected||e.partsel)&&(i=!0),e.unselectable||e.selected||(h=!1);f=h?!0:i?d:!1,a._changeSelectStatusAttrs(f)})},fromDict:function(b){for(var c in b)x[c]?this[c]=b[c]:"data"===c?a.extend(this.data,b.data):a.isFunction(b[c])||y[c]||(this.data[c]=b[c]);b.children?(this.removeChildren(),this.addChildren(b.children)):this.renderTitle()},getChildren:function(){return this.hasChildren()===d?d:this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return a.inArray(this,this.parent.children)},getIndexHier:function(b){b=b||".";var c=[];return a.each(this.getParentList(!1,!0),function(a,b){c.push(b.getIndex()+1)}),c.join(b)},getKeyPath:function(a){var b=[],c=this.tree.options.keyPathSeparator;return this.visitParents(function(a){a.parent&&b.unshift(a.key)},!a),c+b.join(c)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var a=0,b=this.parent;b;)a++,b=b.parent;return a},getNextSibling:function(){if(this.parent){var a,b,c=this.parent.children;for(a=0,b=c.length-1;b>a;a++)if(c[a]===this)return c[a+1]}return null},getParent:function(){return this.parent},getParentList:function(a,b){for(var c=[],d=b?this:this.parent;d;)(a||d.parent)&&c.unshift(d),d=d.parent;return c},getPrevSibling:function(){if(this.parent){var a,b,c=this.parent.children;for(a=1,b=c.length;b>a;a++)if(c[a]===this)return c[a-1]}return null},hasChildren:function(){return this.lazy?null==this.children?d:0===this.children.length?!1:1===this.children.length&&this.children[0].isStatusNode()?d:!0:!!this.children},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},isActive:function(){return this.tree.activeNode===this},isChildOf:function(a){return this.parent&&this.parent===a},isDescendantOf:function(a){if(!a||a.tree!==this.tree)return!1;for(var b=this.parent;b;){if(b===a)return!0;b=b.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var a=this.parent;return!a||a.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var a=this.parent;return!a||a.children[a.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||this.hasChildren()!==d},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isUndefined:function(){return this.hasChildren()===d},isVisible:function(){var a,b,c=this.getParentList(!1,!1);for(a=0,b=c.length;b>a;a++)if(!c[a].expanded)return!1;return!0},lazyLoad:function(a){return this.warn("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."),this.load(a)},load:function(a){var b,c,d=this;return f(this.isLazy(),"load() requires a lazy node"),f(a||this.isUndefined(),"Pass forceReload=true to re-load a lazy node"),this.isLoaded()&&this.resetLazy(),c=this.tree._triggerNodeEvent("lazyLoad",this),c===!1?k(this):(f("boolean"!=typeof c,"lazyLoad event must return source in data.result"),b=this.tree._callHook("nodeLoadChildren",this,c),this.expanded&&b.always(function(){d.render()}),b)},makeVisible:function(b){var c,d=this,e=[],f=new a.Deferred,g=this.getParentList(!1,!1),h=g.length,i=!(b&&b.noAnimation===!0),j=!(b&&b.scrollIntoView===!1);for(c=h-1;c>=0;c--)e.push(g[c].setExpanded(!0,b));return a.when.apply(a,e).done(function(){j?d.scrollIntoView(i).done(function(){f.resolve()}):f.resolve()}),f.promise()},moveTo:function(b,c,e){(c===d||"over"===c)&&(c="child");var g,h=this.parent,i="child"===c?b:b.parent;if(this!==b){if(!this.parent)throw"Cannot move system root";if(i.isDescendantOf(this))throw"Cannot move a node to its own descendant";if(1===this.parent.children.length?(this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1):(g=a.inArray(this,this.parent.children),f(g>=0),this.parent.children.splice(g,1)),this.parent=i,i.hasChildren())switch(c){case"child":i.children.push(this);break;case"before":g=a.inArray(b,i.children),f(g>=0),i.children.splice(g,0,this);break;case"after":g=a.inArray(b,i.children),f(g>=0),i.children.splice(g+1,0,this);break;default:throw"Invalid mode "+c}else i.children=[this];e&&b.visit(e,!0),this.tree!==b.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(a){a.tree=b.tree},!0)),h.isDescendantOf(i)||h.render(),i.isDescendantOf(h)||i===h||i.render()}},navigate:function(b,c){function d(d){return d?(d.makeVisible(),a(d.span).is(":visible")?c===!1?d.setFocus():d.setActive():(d.debug("Navigate: skipping hidden node"),void d.navigate(b,c))):void 0}var e,f,g=!0,h=a.ui.keyCode,i=null;switch(b){case h.BACKSPACE:this.parent&&this.parent.parent&&d(this.parent);break;case h.LEFT:this.expanded?(this.setExpanded(!1),d(this)):this.parent&&this.parent.parent&&d(this.parent);break;case h.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&d(this.children[0]):(this.setExpanded(),d(this));break;case h.UP:for(i=this.getPrevSibling();i&&i.expanded&&i.children&&i.children.length;)i=i.children[i.children.length-1];!i&&this.parent&&this.parent.parent&&(i=this.parent),d(i);break;case h.DOWN:if(this.expanded&&this.children&&this.children.length)i=this.children[0];else for(f=this.getParentList(!1,!0),e=f.length-1;e>=0&&!(i=f[e].getNextSibling());e--);d(i);break;default:g=!1}},remove:function(){return this.parent.removeChild(this)},removeChild:function(a){return this.tree._callHook("nodeRemoveChild",this,a)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},render:function(a,b){return this.tree._callHook("nodeRender",this,a,b)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=d,this.renderStatus()},scheduleAction:function(a,b){this.tree.timer&&clearTimeout(this.tree.timer),this.tree.timer=null;var c=this;switch(a){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){c.tree.debug("setTimeout: trigger expand"),c.setExpanded(!0)},b);break;case"activate":this.tree.timer=setTimeout(function(){c.tree.debug("setTimeout: trigger activate"),c.setActive(!0)},b);break;default:throw"Invalid mode "+a}},scrollIntoView:function(b,c){b=b===!0?{duration:200,queue:!1}:b;var d,e=new a.Deferred,f=this,g=a(this.span).position().top,h=a(this.span).height(),i=this.tree.$container,j=i[0].scrollTop,k=Math.max(0,i.innerHeight()-i[0].clientHeight),l=i.height()-k,m=null;return 0>g?m=j+g:g+h>l&&(m=j+g-l+h,c&&(d=c?a(c.span).position().top:0,g-d>l&&(m=j+d))),null!==m?b?(b.complete=function(){e.resolveWith(f)},i.animate({scrollTop:m},b)):(i[0].scrollTop=m,e.resolveWith(this)):e.resolveWith(this),e.promise()},setActive:function(a,b){return this.tree._callHook("nodeSetActive",this,a,b)},setExpanded:function(a,b){return this.tree._callHook("nodeSetExpanded",this,a,b)},setFocus:function(a){return this.tree._callHook("nodeSetFocus",this,a)},setSelected:function(a){return this.tree._callHook("nodeSetSelected",this,a)},setTitle:function(a){this.title=a,this.renderTitle()},sortChildren:function(a,b){var c,d,e=this.children;if(e){if(a=a||function(a,b){var c=a.title.toLowerCase(),d=b.title.toLowerCase();return c===d?0:c>d?1:-1},e.sort(a),b)for(c=0,d=e.length;d>c;c++)e[c].children&&e[c].sortChildren(a,"$norender$");"$norender$"!==b&&this.render()}},toDict:function(b,c){var d,e,f,g={},h=this;if(a.each(w,function(a,b){(h[b]||h[b]===!1)&&(g[b]=h[b])}),a.isEmptyObject(this.data)||(g.data=a.extend({},this.data),a.isEmptyObject(g.data)&&delete g.data),c&&c(g),b&&this.hasChildren())for(g.children=[],d=0,e=this.children.length;e>d;d++)f=this.children[d],f.isStatusNode()||g.children.push(f.toDict(!0,c));return g},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return""},visit:function(a,b){var c,d,e=!0,f=this.children;if(b===!0&&(e=a(this),e===!1||"skip"===e))return e;if(f)for(c=0,d=f.length;d>c&&(e=f[c].visit(a,!0),e!==!1);c++);return e},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},warn:function(){Array.prototype.unshift.call(arguments,this.toString()),g("warn",arguments)}},q.prototype={_makeHookContext:function(b,c,e){var f,g;return b.node!==d?(c&&b.originalEvent!==c&&a.error("invalid args"),f=b):b.tree?(g=b.tree,f={node:b,tree:g,widget:g.widget,options:g.widget.options,originalEvent:c}):b.widget?f={node:null,tree:b,widget:b.widget,options:b.widget.options,originalEvent:c}:a.error("invalid args"),e&&a.extend(f,e),f},_callHook:function(b,c){var d=this._makeHookContext(c),e=this[b],f=Array.prototype.slice.call(arguments,2);return a.isFunction(e)||a.error("_callHook('"+b+"') is not a function"),f.unshift(d),e.apply(this,f)},_requireExtension:function(b,c,d,e){d=!!d;var g=this._local.name,h=this.options.extensions,i=a.inArray(b,h)d;d++)e=b[d],f(2===e.length,"patchList must be an array of length-2-arrays"),g=e[0],h=e[1],i=null===g?this.rootNode:this.getNodeByKey(g),i?(c=new a.Deferred,k.push(c),i.applyPatch(h).always(m(c,i))):this.warn("could not find node with key '"+g+"'");return a.when.apply(a,k).promise()},count:function(){return this.rootNode.countChildren()},debug:function(){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),g("debug",arguments))},generateFormElements:function(b,c){var d,e=b!==!1?"ft_"+this._id:b,f=c!==!1?"ft_"+this._id+"_active":c,g="fancytree_result_"+this._id,h=this.$container.find("div#"+g);h.length?h.empty():h=a("
          ",{id:g}).hide().appendTo(this.$container),e&&(d=this.getSelectedNodes(3===this.options.selectMode),a.each(d,function(b,c){h.append(a("",{type:"checkbox",name:e,value:c.key,checked:!0}))})),f&&this.activeNode&&h.append(a("",{type:"radio",name:f,value:this.activeNode.key,checked:!0}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getNodeByKey:function(a,b){var d,e;return!b&&(d=c.getElementById(this.options.idPrefix+a))?d.ftnode?d.ftnode:null:(b=b||this.rootNode,e=null,b.visit(function(b){return b.key===a?(e=b,!1):void 0},!0),e)},getSelectedNodes:function(a){var b=[];return this.rootNode.visit(function(c){return c.selected&&(b.push(c),a===!0)?"skip":void 0}),b},hasFocus:function(){return!!this._hasFocus},info:function(){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),g("info",arguments))},loadKeyPath:function(b,c,e){function f(a,b,d){c.call(r,b,"loading"),b.load().done(function(){r.loadKeyPath.call(r,l[a],c,b).always(m(d,r))}).fail(function(){r.warn("loadKeyPath: error loading: "+a+" (parent: "+p+")"),c.call(r,b,"error"),d.reject()})}var g,h,i,j,k,l,n,o,p=e||this.rootNode,q=this.options.keyPathSeparator,r=this;for(a.isArray(b)||(b=[b]),l={},i=0;i"},_triggerNodeEvent:function(a,b,c,e){var f=this._makeHookContext(b,c,e),g=this.widget._trigger(a,c,f);return g!==!1&&f.result!==d?f.result:g},_triggerTreeEvent:function(a,b){var c=this._makeHookContext(this,b),e=this.widget._trigger(a,b,c);return e!==!1&&c.result!==d?c.result:e},visit:function(a){return this.rootNode.visit(a,!1)},warn:function(){Array.prototype.unshift.call(arguments,this.toString()),g("warn",arguments)}},a.extend(q.prototype,{nodeClick:function(a){var b,c,d=a.originalEvent,e=a.targetType,f=a.node;if("expander"===e)this._callHook("nodeToggleExpanded",a);else if("checkbox"===e)this._callHook("nodeToggleSelected",a),this._callHook("nodeSetFocus",a,!0);else{if(c=!1,b=!0,f.folder)switch(a.options.clickFolderMode){case 2:c=!0,b=!1;break;case 3:b=!0,c=!0}b&&(this.nodeSetFocus(a),this._callHook("nodeSetActive",a,!0)),c&&this._callHook("nodeToggleExpanded",a)}"a"===d.target.localName&&"fancytree-title"===d.target.className&&d.preventDefault()},nodeCollapseSiblings:function(a,b){var c,d,e,f=a.node;if(f.parent)for(c=f.parent.children,d=0,e=c.length;e>d;d++)c[d]!==f&&c[d].expanded&&this._callHook("nodeSetExpanded",c[d],!1,b)},nodeDblclick:function(a){"title"===a.targetType&&4===a.options.clickFolderMode&&this._callHook("nodeToggleExpanded",a),"title"===a.targetType&&a.originalEvent.preventDefault()},nodeKeydown:function(b){var c,d=b.originalEvent,e=b.node,f=b.tree,g=b.options,h=!0,i=!(d.ctrlKey||!g.autoActivate),j=a.ui.keyCode;switch(e||(this.rootNode.getFirstChild().setFocus(),e=b.node=this.focusNode,e.debug("Keydown force focus on first node")),d.which){case j.NUMPAD_ADD:case 187:f.nodeSetExpanded(b,!0);break;case j.NUMPAD_SUBTRACT:case 189:f.nodeSetExpanded(b,!1);break;case j.SPACE:g.checkbox?f.nodeToggleSelected(b):f.nodeSetActive(b,!0);break;case j.ENTER:f.nodeSetActive(b,!0);break;case j.BACKSPACE:case j.LEFT:case j.RIGHT:case j.UP:case j.DOWN:c=e.navigate(d.which,i);break;default:h=!1}h&&d.preventDefault()},nodeLoadChildren:function(b,c){var d,e,g=b.tree,h=b.node;return a.isFunction(c)&&(c=c()),c.url&&(d=a.extend({},b.options.ajax,c),d.debugDelay?(e=d.debugDelay,a.isArray(e)&&(e=e[0]+Math.random()*(e[1]-e[0])),h.debug("nodeLoadChildren waiting debug delay "+Math.round(e)+"ms"),d.debugDelay=!1,c=a.Deferred(function(b){setTimeout(function(){a.ajax(d).done(function(){b.resolveWith(this,arguments)}).fail(function(){b.rejectWith(this,arguments)})},e)})):c=a.ajax(d),c=c.pipe(function(c){var d;return"string"==typeof c&&a.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),b.options.postProcess?(d=g._triggerNodeEvent("postProcess",b,b.originalEvent,{response:c,dataType:this.dataType}),c=a.isArray(d)?d:c):c&&c.hasOwnProperty("d")&&b.options.enableAspx&&(c="string"==typeof c.d?a.parseJSON(c.d):c.d),c},function(a,b,c){return g._makeHookContext(h,null,{error:a,args:Array.prototype.slice.call(arguments),message:c,details:a.status+": "+c})})),a.isFunction(c.promise)&&(f(!h.isLoading()),g.nodeSetStatus(b,"loading"),c.done(function(){g.nodeSetStatus(b,"ok")}).fail(function(a){var c;c=a.node&&a.error&&a.message?a:g._makeHookContext(h,null,{error:a,args:Array.prototype.slice.call(arguments),message:a?a.message||a.toString():""}),g._triggerNodeEvent("loaderror",c,null),g.nodeSetStatus(b,"error",c.message,c.details)})),a.when(c).done(function(b){var c;a.isPlainObject(b)&&(f(a.isArray(b.children),"source must contain (or be) an array of children"),f(h.isRoot(),"source may only be an object for root nodes"),c=b,b=b.children,delete c.children,a.extend(g.data,c)),f(a.isArray(b),"expected array of children"),h._setChildren(b),g._triggerNodeEvent("loadChildren",h)})},nodeLoadKeyPath:function(){},nodeRemoveChild:function(b,c){var d,e=b.node,g=b.options,h=a.extend({},b,{node:c}),i=e.children;return 1===i.length?(f(c===i[0]),this.nodeRemoveChildren(b)):(this.activeNode&&(c===this.activeNode||this.activeNode.isDescendantOf(c))&&this.activeNode.setActive(!1),this.focusNode&&(c===this.focusNode||this.focusNode.isDescendantOf(c))&&(this.focusNode=null),this.nodeRemoveMarkup(h),this.nodeRemoveChildren(h),d=a.inArray(c,i),f(d>=0),c.visit(function(a){a.parent=null},!0),this._callHook("treeRegisterNode",this,!1,c),g.removeNode&&g.removeNode.call(b.tree,{type:"removeNode"},h),void i.splice(d,1))},nodeRemoveChildMarkup:function(b){var c=b.node;c.ul&&(c.isRoot()?a(c.ul).empty():(a(c.ul).remove(),c.ul=null),c.visit(function(a){a.li=a.ul=null}))},nodeRemoveChildren:function(b){var c,d=b.tree,e=b.node,f=e.children,g=b.options;f&&(this.activeNode&&this.activeNode.isDescendantOf(e)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(e)&&(this.focusNode=null),this.nodeRemoveChildMarkup(b),c=a.extend({},b),e.visit(function(a){a.parent=null,d._callHook("treeRegisterNode",d,!1,a),g.removeNode&&(c.node=a,g.removeNode.call(b.tree,{type:"removeNode"},c))}),e.children=e.lazy?[]:null,this.nodeRenderStatus(b))},nodeRemoveMarkup:function(b){var c=b.node;c.li&&(a(c.li).remove(),c.li=null),this.nodeRemoveChildMarkup(b)},nodeRender:function(b,d,e,g,h){var i,j,k,l,m,n,o,p=b.node,q=b.tree,r=b.options,s=r.aria,t=!1,u=p.parent,v=!u,w=p.children;if(v||u.ul){if(f(v||u.ul,"parent UL must exist"),v||(p.li&&(d||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode!==p.parent.ul&&this.warn("unlink "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(b)),p.li?this.nodeRenderStatus(b):(t=!0,p.li=c.createElement("li"),p.li.ftnode=p,p.key&&r.generateIds&&(p.li.id=r.idPrefix+p.key),p.span=c.createElement("span"),p.span.className="fancytree-node",s&&a(p.span).attr("aria-labelledby","ftal_"+p.key),p.li.appendChild(p.span),this.nodeRenderTitle(b),r.createNode&&r.createNode.call(q,{type:"createNode"},b)),r.renderNode&&r.renderNode.call(q,{type:"renderNode"},b)),w){if(v||p.expanded||e===!0){for(p.ul||(p.ul=c.createElement("ul"),(g===!0&&!h||!p.expanded)&&(p.ul.style.display="none"),s&&a(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),l=0,m=w.length;m>l;l++)o=a.extend({},b,{node:w[l]}),this.nodeRender(o,d,e,!1,!0);for(i=p.ul.firstChild;i;)k=i.ftnode,k&&k.parent!==p?(p.debug("_fixParent: remove missing "+k,i),n=i.nextSibling,i.parentNode.removeChild(i),i=n):i=i.nextSibling;for(i=p.ul.firstChild,l=0,m=w.length-1;m>l;l++)j=w[l],k=i.ftnode,j!==k?p.ul.insertBefore(j.li,k.li):i=i.nextSibling}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(b));v||t&&u.ul.appendChild(p.li)}},nodeRenderTitle:function(a,b){var c,e,f,g,h,i,j=a.node,k=a.tree,l=a.options,m=l.aria,n=j.getLevel(),o=[],p=j.data.icon;b!==d&&(j.title=b),j.span&&(n1&&o.push(m?"":""):o.push(m?"":""),l.checkbox&&j.hideCheckbox!==!0&&!j.isStatusNode()&&o.push(m?"":""),g=m?" role='img'":"",p&&"string"==typeof p?(e="/"===p.charAt(0)?p:l.imagePath+p,o.push("")):j.data.iconclass?o.push(""):(p===!0||p!==!1&&l.icons!==!1)&&o.push(""),f="",l.renderTitle&&(f=l.renderTitle.call(k,{type:"renderTitle"},a)||""),f||(i=j.tooltip?" title='"+s.escapeHtml(j.tooltip)+"'":"",c=m?" id='ftal_"+j.key+"'":"",g=m?" role='treeitem'":"",h=l.titlesTabbable?" tabindex='0'":"",f=""+j.title+""),o.push(f),j.span.innerHTML=o.join(""),this.nodeRenderStatus(a))},nodeRenderStatus:function(b){var c=b.node,d=b.tree,e=b.options,f=c.hasChildren(),g=c.isLastSibling(),h=e.aria,i=a(c.span).find(".fancytree-title"),j=e._classNames,k=[],l=c[d.statusClassPropName];l&&(k.push(j.node),d.activeNode===c&&k.push(j.active),d.focusNode===c?(k.push(j.focused),h&&i.attr("aria-activedescendant",!0)):h&&i.removeAttr("aria-activedescendant"),c.expanded?(k.push(j.expanded),h&&i.attr("aria-expanded",!0)):h&&i.removeAttr("aria-expanded"),c.folder&&k.push(j.folder),f!==!1&&k.push(j.hasChildren),g&&k.push(j.lastsib),c.lazy&&null==c.children&&k.push(j.lazy),c.partsel&&k.push(j.partsel),c._isLoading&&k.push(j.loading),c._error&&k.push(j.error),c.selected?(k.push(j.selected),h&&i.attr("aria-selected",!0)):h&&i.attr("aria-selected",!1),c.extraClasses&&k.push(c.extraClasses),k.push(f===!1?j.combinedExpanderPrefix+"n"+(g?"l":""):j.combinedExpanderPrefix+(c.expanded?"e":"c")+(c.lazy&&null==c.children?"d":"")+(g?"l":"")),k.push(j.combinedIconPrefix+(c.expanded?"e":"c")+(c.folder?"f":"")),l.className=k.join(" "),c.li&&(c.li.className=g?j.lastsib:""))},nodeSetActive:function(b,c,d){d=d||{};var e,g=b.node,h=b.tree,i=b.options,j=d.noEvents===!0,m=g===h.activeNode;return c=c!==!1,m===c?k(g):c&&!j&&this._triggerNodeEvent("beforeActivate",g,b.originalEvent)===!1?l(g,["rejected"]):void(c?(h.activeNode&&(f(h.activeNode!==g,"node was active (inconsistency)"),e=a.extend({},b,{node:h.activeNode}),h.nodeSetActive(e,!1),f(null===h.activeNode,"deactivate was out of sync?")),i.activeVisible&&g.makeVisible(),h.activeNode=g,h.nodeRenderStatus(b),h.nodeSetFocus(b),j||h._triggerNodeEvent("activate",g,b.originalEvent)):(f(h.activeNode===g,"node was not active (inconsistency)"),h.activeNode=null,this.nodeRenderStatus(b),j||b.tree._triggerNodeEvent("deactivate",g,b.originalEvent)))},nodeSetExpanded:function(b,c,e){e=e||{};var f,g,h,i,j,m,n=b.node,o=b.tree,p=b.options,q=e.noAnimation===!0,r=e.noEvents===!0;if(c=c!==!1,n.expanded&&c||!n.expanded&&!c)return k(n);if(c&&!n.lazy&&!n.hasChildren())return k(n);if(!c&&n.getLevel()h;h++)this._callHook("nodeCollapseSiblings",j[h],e)}finally{p.autoCollapse=m}}return g.done(function(){p.autoScroll&&!q?n.getLastChild().scrollIntoView(!0,n).always(function(){r||b.tree._triggerNodeEvent(c?"expand":"collapse",b)}):r||b.tree._triggerNodeEvent(c?"expand":"collapse",b)}),f=function(d){var e,f,g,h;if(n.expanded=c,o._callHook("nodeRender",b,!1,!1,!0),n.ul)if(g="none"!==n.ul.style.display,h=!!n.expanded,g===h)n.warn("nodeSetExpanded: UL.style.display already set");else{if(p.fx&&!q)return e=p.fx.duration||200,f=p.fx.easing,void a(n.ul).animate(p.fx,e,f,function(){d()});n.ul.style.display=n.expanded||!parent?"":"none"}d()},c&&n.lazy&&n.hasChildren()===d?n.load().done(function(){g.notifyWith&&g.notifyWith(n,["loaded"]),f(function(){g.resolveWith(n)})}).fail(function(a){f(function(){g.rejectWith(n,["load failed ("+a+")"])})}):f(function(){g.resolveWith(n)}),g.promise()},nodeSetFocus:function(b,c){var d,e=b.tree,f=b.node;if(c=c!==!1,e.focusNode){if(e.focusNode===f&&c)return;d=a.extend({},b,{node:e.focusNode}),e.focusNode=null,this._triggerNodeEvent("blur",d),this._callHook("nodeRenderStatus",d)}c&&(this.hasFocus()||(f.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",b,!0,!0)),f.makeVisible(),e.focusNode=f,this._triggerNodeEvent("focus",b),b.options.autoScroll&&f.scrollIntoView(),this._callHook("nodeRenderStatus",b))},nodeSetSelected:function(a,b){var c=a.node,d=a.tree,e=a.options;if(b=b!==!1,c.debug("nodeSetSelected("+b+")",a),!c.unselectable){if(c.selected&&b||!c.selected&&!b)return!!c.selected;if(this._triggerNodeEvent("beforeSelect",c,a.originalEvent)===!1)return!!c.selected;b&&1===e.selectMode?d.lastSelectedNode&&d.lastSelectedNode.setSelected(!1):3===e.selectMode&&(c.selected=b,c.fixSelection3AfterClick()),c.selected=b,this.nodeRenderStatus(a),d.lastSelectedNode=b?c:null,d._triggerNodeEvent("select",a)}},nodeSetStatus:function(b,c,d,e){function f(){var a=h.children?h.children[0]:null;if(a&&a.isStatusNode()){try{h.ul&&(h.ul.removeChild(a.li),a.li=null) -}catch(b){}1===h.children.length?h.children=[]:h.children.shift()}}function g(b,c){var d=h.children?h.children[0]:null;return d&&d.isStatusNode()?(a.extend(d,b),i._callHook("nodeRender",d)):(b.key="_statusNode",h._setChildren([b]),h.children[0].statusNodeType=c,i.render()),h.children[0]}var h=b.node,i=b.tree;switch(c){case"ok":f(),h._isLoading=!1,h._error=null,h.renderStatus();break;case"loading":h.parent||g({title:i.options.strings.loading+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-wait"},c),h._isLoading=!0,h._error=null,h.renderStatus();break;case"error":g({title:i.options.strings.loadError+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-error"},c),h._isLoading=!1,h._error={message:d,details:e},h.renderStatus();break;default:a.error("invalid node status "+c)}},nodeToggleExpanded:function(a){return this.nodeSetExpanded(a,!a.node.expanded)},nodeToggleSelected:function(a){return this.nodeSetSelected(a,!a.node.selected)},treeClear:function(a){var b=a.tree;b.activeNode=null,b.focusNode=null,b.$div.find(">ul.fancytree-container").empty(),b.rootNode.children=null},treeCreate:function(){},treeDestroy:function(){},treeInit:function(a){this.treeLoad(a)},treeLoad:function(b,c){var d,f,g,h=b.tree,i=b.widget.element,j=a.extend({},b,{node:this.rootNode});if(h.rootNode.children&&this.treeClear(b),c=c||this.options.source)"string"==typeof c&&e();else switch(d=i.data("type")||"html"){case"html":f=i.find(">ul:first"),f.addClass("ui-fancytree-source ui-helper-hidden"),c=a.ui.fancytree.parseHtml(f),this.data=a.extend(this.data,n(f));break;case"json":c=a.parseJSON(i.text()),c.children&&(c.title&&(h.title=c.title),c=c.children);break;default:a.error("Invalid data-type: "+d)}return g=this.nodeLoadChildren(j,c).done(function(){h.render(),3===b.options.selectMode&&h.rootNode.fixSelection3FromEndNodes(),h._triggerTreeEvent("init",!0)}).fail(function(){h.render(),h._triggerTreeEvent("init",!1)})},treeRegisterNode:function(){},treeSetFocus:function(a,b){b=b!==!1,b!==this.hasFocus()&&(this._hasFocus=b,this.$container.toggleClass("fancytree-treefocus",b),this._triggerTreeEvent(b?"focusTree":"blurTree"))}}),a.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!1,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,extensions:[],fx:{height:"toggle",duration:200},generateIds:!1,icons:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,selectMode:2,strings:{loading:"Loading…",loadError:"Load error!"},tabbable:!0,titlesTabbable:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partsel:"fancytree-partsel",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new q(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var b,c,e,g=this.options.extensions,h=this.tree;for(e=0;e"),d&&a.Widget.prototype._setOption.apply(this,arguments),e&&this.tree.render(!0,!1)},destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree),this.tree.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden"),a.Widget.prototype.destroy.call(this)},_unbind:function(){var b=this.tree._ns;this.element.unbind(b),this.tree.$container.unbind(b),a(c).unbind(b)},_bind:function(){var a=this,b=this.options,c=this.tree,d=c._ns;this._unbind(),c.$container.on("focusin"+d+" focusout"+d,function(a){var b=s.getNode(a),d="focusin"===a.type;b?c._callHook("nodeSetFocus",b,d):c._callHook("treeSetFocus",c,d)}).on("selectstart"+d,"span.fancytree-title",function(a){a.preventDefault()}).on("keydown"+d,function(a){if(b.disabled||b.keyboard===!1)return!0;var d,e=c.focusNode,f=c._makeHookContext(e||c,a),g=c.phase;try{return c.phase="userEvent",d=e?c._triggerNodeEvent("keydown",e,a):c._triggerTreeEvent("keydown",a),"preventNav"===d?d=!0:d!==!1&&(d=c._callHook("nodeKeydown",f)),d}finally{c.phase=g}}).on("click"+d+" dblclick"+d,function(c){if(b.disabled)return!0;var d,e=s.getEventTarget(c),f=e.node,g=a.tree,h=g.phase;if(!f)return!0;d=g._makeHookContext(f,c);try{switch(g.phase="userEvent",c.type){case"click":return d.targetType=e.type,g._triggerNodeEvent("click",d,c)===!1?!1:g._callHook("nodeClick",d);case"dblclick":return d.targetType=e.type,g._triggerNodeEvent("dblclick",d,c)===!1?!1:g._callHook("nodeDblclick",d)}}finally{g.phase=h}})},getActiveNode:function(){return this.tree.activeNode},getNodeByKey:function(a){return this.tree.getNodeByKey(a)},getRootNode:function(){return this.tree.rootNode},getTree:function(){return this.tree}}),s=a.ui.fancytree,a.extend(a.ui.fancytree,{version:"2.0.0-11",buildType: "production",debugLevel: 1,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:q,_FancytreeNodeClass:p,jquerySupports:{positionMyOfs:h(a.ui.version,1,9)},assert:function(a,b){return f(a,b)},debug:function(){a.ui.fancytree.debugLevel>=2&&g("log",arguments)},error:function(){g("error",arguments)},escapeHtml:function(a){return(""+a).replace(/[&<>"'\/]/g,function(a){return t[a]})},unescapeHtml:function(a){var b=c.createElement("div");return b.innerHTML=a,0===b.childNodes.length?"":b.childNodes[0].nodeValue},getEventTargetType:function(a){return this.getEventTarget(a).type},getEventTarget:function(a){var b=a&&a.target?a.target.className:"",c={node:this.getNode(a.target),type:d};return/\bfancytree-title\b/.test(b)?c.type="title":/\bfancytree-expander\b/.test(b)?c.type=c.node.hasChildren()===!1?"prefix":"expander":/\bfancytree-checkbox\b/.test(b)||/\bfancytree-radio\b/.test(b)?c.type="checkbox":/\bfancytree-icon\b/.test(b)?c.type="icon":/\bfancytree-node\b/.test(b)&&(c.type="title"),c},getNode:function(a){if(a instanceof p)return a;for(a.selector!==d?a=a[0]:a.originalEvent!==d&&(a=a.target);a;){if(a.ftnode)return a.ftnode;a=a.parentNode}return null},info:function(){a.ui.fancytree.debugLevel>=1&&g("info",arguments)},parseHtml:function(b){var c,e,f,g,h,i,j,k,l=b.find(">li"),m=[];return l.each(function(){var l,o=a(this),p=o.find(">span:first",this),q=p.length?null:o.find(">a:first"),r={tooltip:null,data:{}};for(p.length?r.title=p.html():q&&q.length?(r.title=q.html(),r.data.href=q.attr("href"),r.data.target=q.attr("target"),r.tooltip=q.attr("title")):(r.title=o.html(),g=r.title.search(/
            =0&&(r.title=r.title.substring(0,g))),r.title=a.trim(r.title),e=0,f=u.length;f>e;e++)r[u[e]]=d;for(j=this.className.split(" "),c=[],e=0,f=j.length;f>e;e++)k=j[e],v[k]?r[k]=!0:c.push(k);if(r.extraClasses=c.join(" "),h=o.attr("title"),h&&(r.tooltip=h),h=o.attr("id"),h&&(r.key=h),l=n(o),l&&!a.isEmptyObject(l)){for(e=0,f=w.length;f>e;e++)h=w[e],i=l[h],null!=i&&(delete l[h],r[h]=i);a.extend(r.data,l)}b=o.find(">ul:first"),r.children=b.length?a.ui.fancytree.parseHtml(b):r.lazy?d:null,m.push(r)}),m},registerExtension:function(b){f(null!=b.name,"extensions must have a `name` property."),f(null!=b.version,"extensions must have a `version` property."),a.ui.fancytree._extensions[b.name]=b},warn:function(){g("warn",arguments)}})}(jQuery,window,document); \ No newline at end of file +}catch(b){}1===h.children.length?h.children=[]:h.children.shift()}}function g(b,c){var d=h.children?h.children[0]:null;return d&&d.isStatusNode()?(a.extend(d,b),i._callHook("nodeRender",d)):(b.key="_statusNode",h._setChildren([b]),h.children[0].statusNodeType=c,i.render()),h.children[0]}var h=b.node,i=b.tree;switch(c){case"ok":f(),h._isLoading=!1,h._error=null,h.renderStatus();break;case"loading":h.parent||g({title:i.options.strings.loading+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-wait"},c),h._isLoading=!0,h._error=null,h.renderStatus();break;case"error":g({title:i.options.strings.loadError+(d?" ("+d+") ":""),tooltip:e,extraClasses:"fancytree-statusnode-error"},c),h._isLoading=!1,h._error={message:d,details:e},h.renderStatus();break;default:a.error("invalid node status "+c)}},nodeToggleExpanded:function(a){return this.nodeSetExpanded(a,!a.node.expanded)},nodeToggleSelected:function(a){return this.nodeSetSelected(a,!a.node.selected)},treeClear:function(a){var b=a.tree;b.activeNode=null,b.focusNode=null,b.$div.find(">ul.fancytree-container").empty(),b.rootNode.children=null},treeCreate:function(){},treeDestroy:function(){},treeInit:function(a){this.treeLoad(a)},treeLoad:function(b,c){var d,f,g,h=b.tree,i=b.widget.element,j=a.extend({},b,{node:this.rootNode});if(h.rootNode.children&&this.treeClear(b),c=c||this.options.source)"string"==typeof c&&e();else switch(d=i.data("type")||"html"){case"html":f=i.find(">ul:first"),f.addClass("ui-fancytree-source ui-helper-hidden"),c=a.ui.fancytree.parseHtml(f),this.data=a.extend(this.data,n(f));break;case"json":c=a.parseJSON(i.text()),c.children&&(c.title&&(h.title=c.title),c=c.children);break;default:a.error("Invalid data-type: "+d)}return g=this.nodeLoadChildren(j,c).done(function(){h.render(),3===b.options.selectMode&&h.rootNode.fixSelection3FromEndNodes(),h._triggerTreeEvent("init",!0)}).fail(function(){h.render(),h._triggerTreeEvent("init",!1)})},treeRegisterNode:function(){},treeSetFocus:function(a,b){b=b!==!1,b!==this.hasFocus()&&(this._hasFocus=b,this.$container.toggleClass("fancytree-treefocus",b),this._triggerTreeEvent(b?"focusTree":"blurTree"))}}),a.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!1,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,extensions:[],fx:{height:"toggle",duration:200},generateIds:!1,icons:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,selectMode:2,strings:{loading:"Loading…",loadError:"Load error!"},tabbable:!0,titlesTabbable:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partsel:"fancytree-partsel",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new q(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var b,c,e,g=this.options.extensions,h=this.tree;for(e=0;e"),d&&a.Widget.prototype._setOption.apply(this,arguments),e&&this.tree.render(!0,!1)},destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree),this.tree.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden"),a.Widget.prototype.destroy.call(this)},_unbind:function(){var b=this.tree._ns;this.element.unbind(b),this.tree.$container.unbind(b),a(c).unbind(b)},_bind:function(){var a=this,b=this.options,c=this.tree,d=c._ns;this._unbind(),c.$container.on("focusin"+d+" focusout"+d,function(a){var b=s.getNode(a),d="focusin"===a.type;b?c._callHook("nodeSetFocus",b,d):c._callHook("treeSetFocus",c,d)}).on("selectstart"+d,"span.fancytree-title",function(a){a.preventDefault()}).on("keydown"+d,function(a){if(b.disabled||b.keyboard===!1)return!0;var d,e=c.focusNode,f=c._makeHookContext(e||c,a),g=c.phase;try{return c.phase="userEvent",d=e?c._triggerNodeEvent("keydown",e,a):c._triggerTreeEvent("keydown",a),"preventNav"===d?d=!0:d!==!1&&(d=c._callHook("nodeKeydown",f)),d}finally{c.phase=g}}).on("click"+d+" dblclick"+d,function(c){if(b.disabled)return!0;var d,e=s.getEventTarget(c),f=e.node,g=a.tree,h=g.phase;if(!f)return!0;d=g._makeHookContext(f,c);try{switch(g.phase="userEvent",c.type){case"click":return d.targetType=e.type,g._triggerNodeEvent("click",d,c)===!1?!1:g._callHook("nodeClick",d);case"dblclick":return d.targetType=e.type,g._triggerNodeEvent("dblclick",d,c)===!1?!1:g._callHook("nodeDblclick",d)}}finally{g.phase=h}})},getActiveNode:function(){return this.tree.activeNode},getNodeByKey:function(a){return this.tree.getNodeByKey(a)},getRootNode:function(){return this.tree.rootNode},getTree:function(){return this.tree}}),s=a.ui.fancytree,a.extend(a.ui.fancytree,{version:"2.0.0-12",buildType: "production",debugLevel: 1,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:q,_FancytreeNodeClass:p,jquerySupports:{positionMyOfs:h(a.ui.version,1,9)},assert:function(a,b){return f(a,b)},debug:function(){a.ui.fancytree.debugLevel>=2&&g("log",arguments)},error:function(){g("error",arguments)},escapeHtml:function(a){return(""+a).replace(/[&<>"'\/]/g,function(a){return t[a]})},unescapeHtml:function(a){var b=c.createElement("div");return b.innerHTML=a,0===b.childNodes.length?"":b.childNodes[0].nodeValue},getEventTargetType:function(a){return this.getEventTarget(a).type},getEventTarget:function(a){var b=a&&a.target?a.target.className:"",c={node:this.getNode(a.target),type:d};return/\bfancytree-title\b/.test(b)?c.type="title":/\bfancytree-expander\b/.test(b)?c.type=c.node.hasChildren()===!1?"prefix":"expander":/\bfancytree-checkbox\b/.test(b)||/\bfancytree-radio\b/.test(b)?c.type="checkbox":/\bfancytree-icon\b/.test(b)?c.type="icon":/\bfancytree-node\b/.test(b)&&(c.type="title"),c},getNode:function(a){if(a instanceof p)return a;for(a.selector!==d?a=a[0]:a.originalEvent!==d&&(a=a.target);a;){if(a.ftnode)return a.ftnode;a=a.parentNode}return null},info:function(){a.ui.fancytree.debugLevel>=1&&g("info",arguments)},parseHtml:function(b){var c,e,f,g,h,i,j,k,l=b.find(">li"),m=[];return l.each(function(){var l,o=a(this),p=o.find(">span:first",this),q=p.length?null:o.find(">a:first"),r={tooltip:null,data:{}};for(p.length?r.title=p.html():q&&q.length?(r.title=q.html(),r.data.href=q.attr("href"),r.data.target=q.attr("target"),r.tooltip=q.attr("title")):(r.title=o.html(),g=r.title.search(/
              =0&&(r.title=r.title.substring(0,g))),r.title=a.trim(r.title),e=0,f=u.length;f>e;e++)r[u[e]]=d;for(j=this.className.split(" "),c=[],e=0,f=j.length;f>e;e++)k=j[e],v[k]?r[k]=!0:c.push(k);if(r.extraClasses=c.join(" "),h=o.attr("title"),h&&(r.tooltip=h),h=o.attr("id"),h&&(r.key=h),l=n(o),l&&!a.isEmptyObject(l)){for(e=0,f=w.length;f>e;e++)h=w[e],i=l[h],null!=i&&(delete l[h],r[h]=i);a.extend(r.data,l)}b=o.find(">ul:first"),r.children=b.length?a.ui.fancytree.parseHtml(b):r.lazy?d:null,m.push(r)}),m},registerExtension:function(b){f(null!=b.name,"extensions must have a `name` property."),f(null!=b.version,"extensions must have a `version` property."),a.ui.fancytree._extensions[b.name]=b},warn:function(){g("warn",arguments)}})}(jQuery,window,document); \ No newline at end of file diff --git a/dist/src/jquery.fancytree.childcounter.js b/dist/src/jquery.fancytree.childcounter.js index 77ce94c4..68b41016 100644 --- a/dist/src/jquery.fancytree.childcounter.js +++ b/dist/src/jquery.fancytree.childcounter.js @@ -19,8 +19,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ // To keep the global namespace clean, we wrap everything in a closure diff --git a/dist/src/jquery.fancytree.clones.js b/dist/src/jquery.fancytree.clones.js index 30fa0b25..812a4ef7 100644 --- a/dist/src/jquery.fancytree.clones.js +++ b/dist/src/jquery.fancytree.clones.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { diff --git a/dist/src/jquery.fancytree.columnview.js b/dist/src/jquery.fancytree.columnview.js index 8ab06aac..40b85e29 100644 --- a/dist/src/jquery.fancytree.columnview.js +++ b/dist/src/jquery.fancytree.columnview.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { diff --git a/dist/src/jquery.fancytree.debug.js b/dist/src/jquery.fancytree.debug.js index 29d34a2f..a3c71214 100644 --- a/dist/src/jquery.fancytree.debug.js +++ b/dist/src/jquery.fancytree.debug.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { diff --git a/dist/src/jquery.fancytree.dnd.js b/dist/src/jquery.fancytree.dnd.js index 339af2ae..011ec432 100644 --- a/dist/src/jquery.fancytree.dnd.js +++ b/dist/src/jquery.fancytree.dnd.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -73,8 +73,7 @@ function _initDragAndDrop(tree) { addClasses: false, tolerance: "intersect", greedy: false - /* - , +/* activate: function(event, ui) { logMsg("droppable - activate", event, ui, this); }, @@ -112,18 +111,11 @@ function _registerDnd() { // 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10 var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), sourceNode = ui.helper.data("ftSourceNode") || null; -// logMsg("draggable-connectToFancytree.start, %s", sourceNode); -// logMsg(" this: %o", this); -// logMsg(" event: %o", event); -// logMsg(" draggable: %o", draggable); -// logMsg(" ui: %o", ui); if(sourceNode) { // Adjust helper offset, so cursor is slightly outside top/left corner draggable.offset.click.top = -2; draggable.offset.click.left = + 16; -// logMsg(" draggable2: %o", draggable); -// logMsg(" draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top); // Trigger dragStart event // TODO: when called as connectTo..., the return value is ignored(?) return sourceNode.tree.ext.dnd._onDragEvent("start", sourceNode, null, event, ui, draggable); @@ -136,8 +128,7 @@ function _registerDnd() { sourceNode = ui.helper.data("ftSourceNode") || null, prevTargetNode = ui.helper.data("ftTargetNode") || null, targetNode = $.ui.fancytree.getNode(event.target); -// logMsg("$.ui.fancytree.getNode(%o): %s", event.target, targetNode); -// logMsg("connectToFancytree.drag: helper: %o", ui.helper[0]); + if(event.target && !targetNode){ // We got a drag event, but the targetNode could not be found // at the event location. This may happen, @@ -150,7 +141,6 @@ function _registerDnd() { return; } } -// logMsg("draggable-connectToFancytree.drag: targetNode(from event): %s, ftTargetNode: %s", targetNode, ui.helper.data("ftTargetNode")); ui.helper.data("ftTargetNode", targetNode); // Leaving a tree node if(prevTargetNode && prevTargetNode !== targetNode ) { @@ -177,10 +167,7 @@ function _registerDnd() { // mouseDownEvent = draggable._mouseDownEvent, eventType = event.type, dropped = (eventType === "mouseup" && event.which === 1); -// logMsg("draggable-connectToFancytree.stop: targetNode(from event): %s, ftTargetNode: %s", targetNode, ui.helper.data("ftTargetNode")); -// logMsg("draggable-connectToFancytree.stop, %s", sourceNode); -// logMsg(" type: %o, downEvent: %o, upEvent: %o", eventType, mouseDownEvent, event); -// logMsg(" targetNode: %o", targetNode); + if(!dropped){ logMsg("Drag was cancelled"); } @@ -204,8 +191,7 @@ function _registerDnd() { * */ -$.ui.fancytree.registerExtension( - { +$.ui.fancytree.registerExtension({ name: "dnd", version: "0.1.0", // Default options for this extension. @@ -226,9 +212,7 @@ $.ui.fancytree.registerExtension( draggable: null, // Additional options passed to jQuery draggable droppable: null // Additional options passed to jQuery droppable }, - // Override virtual methods for this extension. - // `this` : Fancytree instance - // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) + treeInit: function(ctx){ var tree = ctx.tree; this._super(ctx); @@ -257,15 +241,7 @@ $.ui.fancytree.registerExtension( .css({"z-index": 1000}) .prependTo($(this.$div).parent()); // .prependTo("body"); -// logMsg("Creating marker: %o", this.$dropMarker); } -/* - if(hitMode === "start"){ - } - if(hitMode === "stop"){ -// sourceNode.removeClass("fancytree-drop-target"); - } -*/ // this.$dropMarker.attr("class", hitMode); if(hitMode === "after" || hitMode === "before" || hitMode === "over"){ // $source && $source.addClass("fancytree-drag-source"); @@ -386,9 +362,8 @@ $.ui.fancytree.registerExtension( case "helper": // Only event and node argument is available $helper = $("
              ") - // .append($(event.target).closest("span.fancytree-node").find("span.fancytree-title").clone()); .append(nodeTag.find("span.fancytree-title").clone()); - // issue 244: helper should be child of scrollParent + // DT issue 244: helper should be child of scrollParent $("ul.fancytree-container", node.tree.$div).append($helper); // Attach node reference to helper object $helper.data("ftSourceNode", node); @@ -396,6 +371,7 @@ $.ui.fancytree.registerExtension( // logMsg("helper.sourceNode=%o", $helper.data("ftSourceNode")); res = $helper; break; + case "start": if( node.isStatusNode() ) { res = false; @@ -413,6 +389,7 @@ $.ui.fancytree.registerExtension( nodeTag.addClass("fancytree-drag-source"); } break; + case "enter": if(dnd.preventRecursiveMoves && node.isDescendantOf(otherNode)){ r = false; @@ -439,6 +416,7 @@ $.ui.fancytree.registerExtension( ui.helper.data("enterResponse", res); logMsg("helper.enterResponse: %o", res); break; + case "over": enterResponse = ui.helper.data("enterResponse"); hitMode = null; @@ -496,10 +474,11 @@ $.ui.fancytree.registerExtension( ctx.hitMode = hitMode; res = dnd.dragOver(node, ctx); } - // issue 332 + // DT issue 332 // this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false); this._local._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false && hitMode !== null); break; + case "drop": hitMode = ui.helper.data("hitMode"); if(hitMode && dnd.dragDrop){ @@ -507,6 +486,7 @@ $.ui.fancytree.registerExtension( dnd.dragDrop(node, ctx); } break; + case "leave": // Cancel pending expand request node.scheduleAction("cancel"); @@ -517,14 +497,16 @@ $.ui.fancytree.registerExtension( dnd.dragLeave(node, ctx); } break; + case "stop": nodeTag.removeClass("fancytree-drag-source"); if(dnd.dragStop){ dnd.dragStop(node, ctx); } break; + default: - throw "Unsupported drag event: " + eventName; + $.error("Unsupported drag event: " + eventName); } return res; }, diff --git a/dist/src/jquery.fancytree.edit.js b/dist/src/jquery.fancytree.edit.js index aa0bbf54..091243a7 100644 --- a/dist/src/jquery.fancytree.edit.js +++ b/dist/src/jquery.fancytree.edit.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -273,10 +273,6 @@ $.ui.fancytree.registerExtension({ // Local attributes currentNode: null, - // Override virtual methods for this extension. - // `this` : the Fancytree instance - // `this._local`: the namespace that contains extension attributes and private methods (same as this.ext.EXTNAME) - // `this._super`: the virtual function that was overridden (member of previous extension or Fancytree) treeInit: function(ctx){ this._super(ctx); this.$container.addClass("fancytree-ext-edit"); @@ -288,7 +284,7 @@ $.ui.fancytree.registerExtension({ return false; } } - this._super(ctx); + return this._super(ctx); }, nodeDblclick: function(ctx) { if( $.inArray("dblclick", ctx.options.edit.triggerStart) >= 0 ){ diff --git a/dist/src/jquery.fancytree.filter.js b/dist/src/jquery.fancytree.filter.js index 505bd5e7..b17a2c1b 100644 --- a/dist/src/jquery.fancytree.filter.js +++ b/dist/src/jquery.fancytree.filter.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -27,20 +27,6 @@ function _escapeRegex(str){ return (str + "").replace(/([.?*+\^\$\[\]\\(){}|-])/g, "\\$1"); } -/* EXT-TABLE: Show/hide all rows that are structural descendants of `parent`. */ -// function setChildRowVisibility(parent, flag) { -// parent.visit(function(node){ -// var tr = node.tr; -// if(tr){ -// tr.style.display = flag ? "" : "none"; -// } -// node.debug(flag ? "SHOW" : "HIDE"); -// if(!node.expanded){ -// return "skip"; -// } -// }); -// } - /** * [ext-filter] Dimm or hide nodes. * @@ -73,7 +59,6 @@ $.ui.fancytree._FancytreeClass.prototype.applyFilter = function(filter){ } // Reset current filter this.visit(function(node){ -// node.hide = hideMode && true; delete node.match; delete node.subMatch; }); @@ -81,10 +66,8 @@ $.ui.fancytree._FancytreeClass.prototype.applyFilter = function(filter){ this.visit(function(node){ if ((!leavesOnly || node.children == null) && filter(node)) { count++; -// node.hide = false; node.match = true; node.visitParents(function(p){ -// p.hide = false; p.subMatch = true; }); } @@ -102,7 +85,6 @@ $.ui.fancytree._FancytreeClass.prototype.applyFilter = function(filter){ */ $.ui.fancytree._FancytreeClass.prototype.clearFilter = function(){ this.visit(function(node){ -// delete node.hide; delete node.match; delete node.subMatch; }); @@ -117,22 +99,14 @@ $.ui.fancytree._FancytreeClass.prototype.clearFilter = function(){ */ $.ui.fancytree.registerExtension({ name: "filter", - version: "0.0.2", + version: "0.1.0", // Default options for this extension. options: { mode: "dimm", leavesOnly: false }, - // Override virtual methods for this extension. - // `this` : is this extension object - // `this._base` : the Fancytree instance - // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) treeInit: function(ctx){ this._super(ctx); - // ctx.tree.filter = false; - }, - treeDestroy: function(ctx){ - this._super(ctx); }, nodeRenderStatus: function(ctx) { // Set classes for current status @@ -142,31 +116,15 @@ $.ui.fancytree.registerExtension({ $span = $(node[tree.statusClassPropName]); res = this._super(ctx); - - if(!$span.length){ - return res; // nothing to do, if node was not yet rendered - } - if(!tree.enableFilter){ + // nothing to do, if node was not yet rendered + if( !$span.length || !tree.enableFilter ) { return res; } - $span.toggleClass("fancytree-match", !!node.match); - $span.toggleClass("fancytree-submatch", !!node.subMatch); - $span.toggleClass("fancytree-hide", !(node.match || node.subMatch)); + $span + .toggleClass("fancytree-match", !!node.match) + .toggleClass("fancytree-submatch", !!node.subMatch) + .toggleClass("fancytree-hide", !(node.match || node.subMatch)); - // if(opts.filter.mode === "hide"){ - // // visible = !!(node.match || node.subMatch); - // visible = !node.hide; - // node.debug(node.title + ": visible=" + visible); - // if( node.li ) { - // $(node.li).toggle(visible); - // } else if( node.tr ) { - // // Show/hide all rows that are structural descendants of `parent` - // $(node.tr).toggle(visible); - // // if( !visible ) { - // // setChildRowVisibility(node, visible); - // // } - // } - // } return res; } }); diff --git a/dist/src/jquery.fancytree.glyph.js b/dist/src/jquery.fancytree.glyph.js index bc79f626..89801df5 100644 --- a/dist/src/jquery.fancytree.glyph.js +++ b/dist/src/jquery.fancytree.glyph.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -27,7 +27,7 @@ function _getIcon(opts, type){ $.ui.fancytree.registerExtension({ name: "glyph", - version: "0.0.2", + version: "0.1.0", // Default options for this extension. options: { prefix: "icon-", @@ -41,19 +41,15 @@ $.ui.fancytree.registerExtension({ error: "icon-exclamation-sign", expanderClosed: "icon-caret-right", expanderLazy: "icon-angle-right", - // expanderLazy: "icon-refresh icon-spin", expanderOpen: "icon-caret-down", folder: "icon-folder-close-alt", folderOpen: "icon-folder-open-alt", loading: "icon-refresh icon-spin", - // loading: "icon-spinner icon-spin" noExpander: "" }, icon: null // TODO: allow callback here }, - // Overide virtual methods for this extension. - // `this` : is this extension object - // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) + treeInit: function(ctx){ var tree = ctx.tree; this._super(ctx); @@ -117,7 +113,8 @@ $.ui.fancytree.registerExtension({ if(node.parent){ span = $("span.fancytree-expander", node.span).get(0); }else{ - span = $(".fancytree-statusnode-wait, .fancytree-statusnode-error", node[this.nodeContainerAttrName]).find("span.fancytree-expander").get(0); + span = $(".fancytree-statusnode-wait, .fancytree-statusnode-error", node[this.nodeContainerAttrName]) + .find("span.fancytree-expander").get(0); } if( status === "loading"){ // $("span.fancytree-expander", ctx.node.span).addClass(_getIcon(opts, "loading")); diff --git a/dist/src/jquery.fancytree.gridnav.js b/dist/src/jquery.fancytree.gridnav.js index 1b585c0d..8e34afd4 100644 --- a/dist/src/jquery.fancytree.gridnav.js +++ b/dist/src/jquery.fancytree.gridnav.js @@ -9,8 +9,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { diff --git a/dist/src/jquery.fancytree.js b/dist/src/jquery.fancytree.js index 447eb552..dee2ef55 100644 --- a/dist/src/jquery.fancytree.js +++ b/dist/src/jquery.fancytree.js @@ -7,8 +7,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ /** Core Fancytree module. @@ -3772,7 +3772,7 @@ $.extend($.ui.fancytree, /** @lends Fancytree_Static# */ { /** @type {string} */ - version: "2.0.0-11", // Set to semver by 'grunt release' + version: "2.0.0-12", // Set to semver by 'grunt release' /** @type {string} */ buildType: "production", // Set to 'production' by 'grunt build' /** @type {int} */ diff --git a/dist/src/jquery.fancytree.menu.js b/dist/src/jquery.fancytree.menu.js index e18d3a09..24cf233c 100644 --- a/dist/src/jquery.fancytree.menu.js +++ b/dist/src/jquery.fancytree.menu.js @@ -11,8 +11,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { diff --git a/dist/src/jquery.fancytree.persist.js b/dist/src/jquery.fancytree.persist.js index c722126f..fc24d3a6 100644 --- a/dist/src/jquery.fancytree.persist.js +++ b/dist/src/jquery.fancytree.persist.js @@ -11,8 +11,8 @@ * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.0.0-11 - * @date 2014-04-27T22:28 + * @version 2.0.0-12 + * @date 2014-04-29T19:55 */ ;(function($, window, document, undefined) { @@ -43,11 +43,9 @@ function _loadLazyNodes(tree, instData, keyList, mode, dfd) { var i, key, l, node, foundOne = false, deferredList = [], - // lazyNodeList = [], - missingKeyList = []; //keyList.slice(0), + missingKeyList = []; keyList = keyList || []; - // expand = expand !== false; dfd = dfd || $.Deferred(); for( i=0, l=keyList.length; i= 0){ - // $.cookie(cookiePrefix + ACTIVE, null); $.removeCookie(cookiePrefix + ACTIVE); } if(types.indexOf(EXPANDED) >= 0){ - // $.cookie(cookiePrefix + EXPANDED, null); $.removeCookie(cookiePrefix + EXPANDED); } if(types.indexOf(FOCUS) >= 0){ - // $.cookie(cookiePrefix + FOCUS, null); $.removeCookie(cookiePrefix + FOCUS); } if(types.indexOf(SELECTED) >= 0){ - // $.cookie(cookiePrefix + SELECTED, null); $.removeCookie(cookiePrefix + SELECTED); } }; @@ -159,7 +149,6 @@ $.ui.fancytree.registerExtension({ version: "0.2.0", // Default options for this extension. options: { -// appendRequestInfo: false, cookieDelimiter: "~", cookiePrefix: undefined, // 'fancytree--' by default cookie: { @@ -193,9 +182,7 @@ $.ui.fancytree.registerExtension({ } $.cookie(cookieName, cookieList.join(instOpts.cookieDelimiter), instOpts.cookie); }, - // Overide virtual methods for this extension. - // `this` : is this Fancytree object - // `this._super`: the virtual function that was overridden (member of prev. extension or Fancytree) + treeInit: function(ctx){ var tree = ctx.tree, opts = ctx.options, @@ -230,26 +217,6 @@ $.ui.fancytree.registerExtension({ } dfd.done(function(){ - // alert("persistent expand done"); - // if(instData.storeExpanded){ - // cookie = $.cookie(instData.cookiePrefix + EXPANDED); - // if(cookie){ - // keyList = cookie.split(instOpts.cookieDelimiter); - // for(i=0; i