Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery.fancytree

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery.fancytree - npm Package Compare versions

Comparing version 2.26.0 to 2.27.0

dist/skin-material/ui.fancytree.css

208

CHANGELOG.md

@@ -1,5 +0,43 @@

# 2.26.0-0 / Unreleased
# 2.27.1-0 / Unreleased
*
# 2.27.0 / 2017-12-16
* **BREAKING CHANGES:**
- `node.type` is now a first-class property of FancytreeNode.
Node data `{..., type: "foo"}` is now available as `node.type` (before: `node.data.type`).
- The properties `tree.types` and `tree.columns` have been added to Fancytree.
If passed with source data, they are now available directly instead of
`tree.data.types` or `tree.data.columns`.
* **Support patterns for node types:**
- The properties `node.type` and `tree.types` are recommended to implement node-type
specific configuration ([details](https://github.com/mar10/fancytree/wiki/TutorialNodeTypes)).
- Event `data` argument contains `typeInfo == tree.types[node.type]`.
* **Improved ext-glyph:**
- [Added] support for ligature icons (e.g. [material icons](https://material.io/icons/)).
- [Added] `icon` option can now return a dict to create a ligature icon.
* **Improved tree.loadKeyPath():**
- [Added] support for a custom path segment matcher.
This allows to have key paths with segments other than `node.key`.
- [Improved] the returned deferred promise now triggers `progress()` events which can
be used instead of the callback.
* The property `tree.columns` was added to Fancytree. Currently only reserved as
recommended pattern to pass global meta-data for ext-table.
* [Added] ext-edit: new trigger mode `clickActive` for option `triggerStart: [...]`.
* [Added] #798 Tooltip support for icons (dynamic option `iconTooltip`).
* [Added] #808 Pass custom storage providers to ext-persist.
* [Improved] ext-table no longer needs empty tbody/tr if thead is present.
* [Fixed] #796 UMD requirements for node/CommonJS
* [Fixed] #803 jquery.fancytree.ui-deps.js does not override existing widgets.
* [Fixed] #815 `<mark>` element missing in filtered nodes (minified bundle, IE 11).
* [Fixed] #816 findNextNode() doesn't set default for 'startNode' argument.
* [Added] Material Design demo
* [Added] Demo for Fancytree inside a jquery-confirm popup
* [Changed] String representation is now `"FancytreeNode@_4[title='My name']"`
* [DEPRECATED] `tree.clearCookies()`. Use `tree.clearData()` instead.
# 2.26.0 / 2017-11-04
* **BREAKING CHANGES:**
- [Fixed] #792 postProcess is now also called for non-Ajax sources.
* [Improved] LESS now compiles with webpack
* [Added] #791 ext-glyph support for radio buttons
* [Added] #792 Call postProcess for non-Ajax sources
* [Added] Color definitions for skin-awesome (taken from skin-lion)

@@ -10,8 +48,11 @@ * [Fixed] `$.ui.fancytree.getNode()` for ES6 environments

# 2.25.0 / 2017-10-31
* **BREAKING CHANGES:**
- The `dist/src/` folder was renamed to `dist/modules`.
- Some directories like `demo/` are no longer part of the npm install.
* **Improved Module Support and Distribution**<br>
* The `dist/` folder now includes a `modules/` directory with fancytree core
- The `dist/` folder now includes a `modules/` directory with fancytree core
and all extensions.
* All modules have UMD wrappers with defined dependencies.
* Internal jQuery UI dependencies are deployed as module and implicitly loaded.
* `jquery.fancytree/dist/modules/jquery.fancytree` is defined as
- All modules have UMD wrappers with defined dependencies.
- Internal jQuery UI dependencies are deployed as module and implicitly loaded.
- `jquery.fancytree/dist/modules/jquery.fancytree` is defined as
package main module, so Fancytree can be included using a simple<br>

@@ -21,8 +62,5 @@ `fancytree = require('jquery.fancytree')`.<br>

for details.
* All modules now return the
- All modules now return the
[$.ui.fancytree object](http://www.wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Static.html).
* [Added] new static method `$.ui.fancytree.createTree(elem, opts)`
* BREAKING CHANGES:<br>
The `dist/src/` folder was renamed to `dist/modules`.<br>
Some directories like `demo/` are no longer part of the npm install.
- [Added] new static method `$.ui.fancytree.createTree(elem, opts)`
* [Added] Source map files for `jquery.fancytree-all-deps.min.js`

@@ -65,3 +103,3 @@ * [Added] New extension ext-fixed (work-in-progress, experimental)

* BREAKING CHANGES:
* **BREAKING CHANGES:**
* The `hideCheckbox` option was removed. Use `checkbox: false` instead.<br>

@@ -242,3 +280,3 @@ Note that the `<li class='hideCheckbox'>` is still parsed from input

* [Added] #542 new method `node.getSelectedNodes()`
* [Added] Helper class `glyphicon-spin` to allow rotating loading icon with bootstrap
* [Added] Helper class `glyphicon-spin` to allow rotating loading icon with bootstrap3
* [Improved] #356: serialize load requests

@@ -389,3 +427,3 @@ * [Improved] #538: Be more robust if site css defines custom li:before

* [Improved] #153 Add class `fancytree-unselectable` to respective nodes and
dimm unselectable checkboxes
dim unselectable checkboxes
* [Improved] Update to jQuery 1.1.11, jQuery UI 1.11.2

@@ -439,3 +477,2 @@ * [Improved] New mode 'firstChild' for node.addNode()

# 2.1.0 / 2014-05-29

@@ -461,144 +498,7 @@ * [Added] #210: [ext-persist] optionally store information in sessionStorage or localStorage

# 2.0.0 / 2014-05-01
* [Added] [ext-clones] #213 New method Fancytree.changeRefKey()
* Released 2.0.0
# 2.0.0-12 / 2014-04-29
* [Added] /dist/src folder contains uncompressed extensions for bower
* [Improved] cleanup
# 2.0.0-11 / 2014-04-27
* [Added] /dist/jquery.fancytree-custom.min.js with AMD support
* [Added] #56: Allow to set special node.attributes from data-...
* [Added] #191: Allow to set additional tree.data attributes from <ul data-...>
* [Added] [ext-childcounter] #202: Allow lazy children count
* [Improved] #192: Removed 'height: 100%' for container (was introduced to fix
an IE 9 bug, that now should be solved by 'min-height: 0%')
* [Improved] [ext-table] #93 renderColumns called for status nodes
(added 'customStatus' option)
* [Improved] [ext-dnd] #196 Make draggable/droppable options configurable
* [Fixed] [ext-glyph] #194 Render noExpander icon from icon map for leaf nodes
* [Fixed] #197: Allow special characters in tooltips
* [Fixed] #68: renderStatus method doesn't render 'loading' status
* [Fixed] #201: originalEvent not passed along to activate callback
* [Fixed] [ext-glyph] compatible with ext-table
# 2.0.0-10 / 2014-04-13
* [Added] New method node.appendSibling()
* [Improved] setExpanded resolves promise *after* scrollIntoView
* [Improved] Allow to return false in lazyLoad for manual loading.
* [Improved] [ext-table] trigger expand event *after* anPimations
* [Improved] [ext-gridnav] skips empty and merged cells
* [Improved] grunt build no longer depends on tabfix.py
* [Fixed] selectMode: 1 + "selected": true looks buggy
# 2.0.0-9 / 2014-04-02
* [Added] New helper method $.ui.fancytree.escapeHtml().
* [Added] [ext-clones] new method node.reRegister(key, refKey)
* [Added] Support for bower.
* [Added] dist/ folder to repository
* [Improved] [ext-edit] handles `<`, `>`, ...
* [Improved] [ext-table] node.render(force) trigger renderColumns event
* [Fixed] [ext-table] #178 children are not displayed when filtering
# 2.0.0-8 / 2014-04-01
* [FEATURE] #18: load lazy nodes, if initialized as 'expanded'.
* [FEATURE] #162: Optional parameter `noEvents` for node.setActive() and .setExpanded().
* [CHANGE] Prefixed all Less variables with '@fancy-' and introduced '@fancy-image-dir'.
* [CHANGE] 'loadChildren' event is now also triggered for initial tree load (before it was only triggered for lazy child nodes)
* [BUGFIX] #117: line height too large when using doctype xhtml
* [BUGFIX] #115: Fixed error when trying to drag table headers
* [BUGFIX] #163: lazy load throws error if autoscroll: true and result is empty
* [FEATURE] [ext-clones] (experimental) new extension that introduces
`node.refKey`, which may occur multiple times in one tree (as opposed to `key`,
which must be unique).
New methods `node.isClone()`, `node.getCloneList()` and `tree.getNodesByRef()`.
Optionally, clones are tagged wit the `fancytree-clone` class.
* [FEATURE] New option 'defaultKey'. This calback allows to generate keys while loading.
* build process creates /dist folder
* "bower install fancytree" delivers dist folder
# 2.0.0-7 / 2014-03-09
* [BREAKING CHANGE] node.isStatusNode() is now a function (was a property before).
Added new property `node.statusNodeType`.
* [BREAKING CHANGE] Renamed ext-awesome to ext-glyph
* [DEPRECATION] Deprecated event `lazyload`, use `lazyLoad` (upper case L) instead.
* [DEPRECATION] Deprecated methods node.lazyLoad() and node.discard(). use load() and resetLazy() instead.
* [FEATURE] Added node.isUndefined(), isLoaded(), resetLazy(), load(), resetLazy()
* [FEATURE] [ext-persist] Added option `expandLazy` for recursive loading (still experimental).
* [FEATURE] [ext-filter] 'mode: hide' now works with ext-table (still experimental).
* [FEATURE] node.makeVisible() accepts options, scrolls into view, and returns a promise.
* [FEATURE] Sample xxl and bootstrap themes.
* [CHANGE] nodeRenderStatus() is now implicitly called by nodeRenderTitle().<br>
This also means that now all markup and css classes are finshed, when `renderNode`
is fired.
* [CHANGE] Calling setExpanded() on a leaf node fires .done() (not .fail())
* [CHANGE] Removing the last child node collapses the parent; lazy nodes become empty (not undefined).
# 2.0.0-6 / 2014-02-08
* [BREAKING CHANGE] Removed 'name' argument from `$.ui.fancytree.registerExtension()`
(now the extension object requires a 'name' property)
* [DEPRECATION] Deprecated startEdit/endEdit to use editStart/editEnd
* [FEATURE] New method `tree._requireExtension()`
* [FEATURE] Fixed d'n'd for ext-table
* [FEATURE] New option `titlesTabbable`
* [FEATURE] New argument `opts` for setExpanded() and setActive()
* [BUGFIX] ext-edit: fixed loosing focus and made chainable
* [BUGFIX] ext-filter: fixed navigation for hidden nodes
* Added browser test matrix (saucelabs)
# 2.0.0-5 / 2013-12-23
* [BREAKING CHANGE] Refactored drag'n'drop extension.
For example `dnd.onDrop(node)` --> `dnd.dragDrop(node, data)`.
See [[TutorialExtDnd]]
* [BREAKING CHANGE] Renamed `rencercolumns` event to `renderColumns`
* [BREAKING CHANGE] Renamed `fancytree-focused` class to `fancytree-treefocus` (container only)
* [FEATURE] Experimental `ext-gridnav` implents key navigation for tables.
Refactored keyboard handling. Keydown handlers are now bound to the container instead of document
(Co-work with Koloto)
* [FEATURE] Allow to return 'preventNav' in keydown event to prevent withput blocking keys in embedded input controls.
* [FEATURE] New method `node.navigate()` to support custom keyboard handlers
* [FEATURE] Refactored CSS style to use a common LESS template
* [FEATURE] Improvement of lazy load errors handling (Koloto, issue #87)
* [FEATURE] Allow to pass metadata with `source` on initialization
* [FEATURE] The edit extension is now beta
* [BUGFIX] Fixed BACKSPACE on top-level nodes
* [BUGFIX] Fixed #71, #75, #90, #104, #105
* Improved table render speed by 15%
* `grunt dev` combines `grunt server` + `grunt watch` (trigger jshint and
less on save)
# 2.0.0-4 / 2013-10-14
* Misc. fixes
# 2.0.0-3
* [BREAKING CHANGE] Changed extension syntax
* [FEATURE] Edit extension (alpha)
# 2.0.0-2 / 2013-09-15
* [BREAKING CHANGE] Renamed `onCustomRender` to `renderTitle`.
`renderTitle`, `renderNode` and `createNode` events are only triggered as options callback (not DOM events), for performance reasons.
* [BREAKING CHANGE] Renamed `data.orgEvent` to `data.originalEvent`
* [BREAKING CHANGE] Renamed events to camelCase as suggested by the jQuery style guide (`rendernnode` -> `renderNode`, ...)
* See also [[WhatsNew]] since Dynatree 1.x in general.
# 1.x
* See [Dynatree](https://code.google.com/p/dynatree/)
* See [Dynatree](https://code.google.com/p/dynatree/)

@@ -1,14 +0,1 @@

/*!
* jquery.fancytree.js
* Tree view control with support for lazy loading and much more.
* https://github.com/mar10/fancytree/
*
* Copyright (c) 2008-2017, Martin Wendt (http://wwWendt.de)
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree.ui-deps"],a):"object"==typeof module&&module.exports?(require("jquery.fancytree.ui-deps"),module.exports=a(require("jquery"))):a(jQuery)}(function(a){"use strict";function b(b,c){b||(c=c?": "+c:"",a.error("Fancytree assertion failed"+c))}function c(a,b){var c,d,e=window.console?window.console[a]:null;if(e)try{e.apply(window.console,b)}catch(f){for(d="",c=0;c<b.length;c++)d+=b[c];e(d)}}function d(a){return!(!a.tree||void 0===a.statusNodeType)}function e(b,c,d,e){var f,g,h,i=a.map(a.trim(b).split("."),function(a){return parseInt(a,10)}),j=a.map(Array.prototype.slice.call(arguments,1),function(a){return parseInt(a,10)});for(f=0;f<j.length;f++)if(g=i[f]||0,h=j[f]||0,g!==h)return g>h;return!0}function f(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)},i=function(a){return c.apply(b,a)};return function(){var a=b._local,c=b._super,d=b._superApply;try{return b._local=g,b._super=h,b._superApply=i,f.apply(b,arguments)}finally{b._local=a,b._super=c,b._superApply=d}}}();return f}function g(b,c,d,e){for(var g in d)"function"==typeof d[g]?"function"==typeof b[g]?b[g]=f(g,b,c,d,e):"_"===g.charAt(0)?b.ext[e][g]=f(g,b,c,d,e):a.error("Could not override tree."+g+". Use prefix '_' to create tree."+e+"._"+g):"options"!==g&&(b.ext[e][g]=d[g])}function h(b,c){return void 0===b?a.Deferred(function(){this.resolve()}).promise():a.Deferred(function(){this.resolveWith(b,c)}).promise()}function i(b,c){return void 0===b?a.Deferred(function(){this.reject()}).promise():a.Deferred(function(){this.rejectWith(b,c)}).promise()}function j(a,b){return function(){a.resolveWith(b)}}function k(b){var c=a.extend({},b.data()),d=c.json;return delete c.fancytree,delete c.uiFancytree,d&&(delete c.json,c=a.extend(c,d)),c}function l(a){return(""+a).replace(v,function(a){return x[a]})}function m(a){return a=a.toLowerCase(),function(b){return b.title.toLowerCase().indexOf(a)>=0}}function n(a){var b=new RegExp("^"+a,"i");return function(a){return b.test(a.title)}}function o(c,d){var e,f,g,h;for(this.parent=c,this.tree=c.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},e=0,f=D.length;e<f;e++)g=D[e],this[g]=d[g];null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),d.hideCheckbox&&a.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),d.data&&a.extend(this.data,d.data);for(g in d)E[g]||a.isFunction(d[g])||G[g]||(this.data[g]=d[g]);null==this.key?this.tree.options.defaultKey?(this.key=this.tree.options.defaultKey(this),b(this.key,"defaultKey() must return a unique key")):this.key="_"+s._nextNodeKey++:this.key=""+this.key,d.active&&(b(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),d.selected&&(this.tree.lastSelectedNode=this),h=d.children,h?h.length?this._setChildren(h):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function p(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(){return s.warn("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),b.options.lazyload.apply(this,arguments)}),a.isFunction(this.options.loaderror)&&a.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&s.warn("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&a.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.data=k(this.$div),this._id=a.ui.fancytree._nextId++,this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var c,d={tree:this};this.rootNode=new o(d,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,c=a("<ul>",{"class":"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=c,this.rootNode.ul=c[0],null==this.options.debugLevel&&(this.options.debugLevel=s.debugLevel)}if(a.ui&&a.ui.fancytree)return void a.ui.fancytree.warn("Fancytree: ignored duplicate include");var q,r,s=null,t=new RegExp(/\.|\//),u=/[&<>"'\/]/g,v=/[<>"'\/]/g,w="$recursive_request",x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},y={16:!0,17:!0,18:!0},z={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},A={0:"",1:"left",2:"middle",3:"right"},B="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),C={},D="checkbox expanded extraClasses folder icon key lazy radiogroup refKey selected statusNodeType title tooltip unselectable unselectableIgnore unselectableStatus".split(" "),E={},F={},G={active:!0,children:!0,data:!0,focus:!0};for(q=0;q<B.length;q++)C[B[q]]=!0;for(q=0;q<D.length;q++)r=D[q],E[r]=!0,r!==r.toLowerCase()&&(F[r.toLowerCase()]=r);return b(a.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),o.prototype={_findDirectChild:function(a){var b,c,d=this.children;if(d)if("string"==typeof a){for(b=0,c=d.length;b<c;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){b(a&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var c=0,d=a.length;c<d;c++)this.children.push(new o(this,a[c]))},addChildren:function(c,d){var e,f,g,h=this.getFirstChild(),i=this.getLastChild(),j=null,k=[];for(a.isPlainObject(c)&&(c=[c]),this.children||(this.children=[]),e=0,f=c.length;e<f;e++)k.push(new o(this,c[e]));if(j=k[0],null==d?this.children=this.children.concat(k):(d=this._findDirectChild(d),g=a.inArray(d,this.children),b(g>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[g,0].concat(k))),h&&!d){for(e=0,f=k.length;e<f;e++)k[e].render();h!==this.getFirstChild()&&h.renderStatus(),i!==this.getLastChild()&&i.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===k.length?k[0]:null),j},addClass:function(a){return this.toggleClass(a,!0)},addNode:function(a,c){switch(void 0!==c&&"over"!==c||(c="child"),c){case"after":return this.getParent().addChildren(a,this.getNextSibling());case"before":return this.getParent().addChildren(a,this);case"firstChild":var d=this.children?this.children[0]:null;return this.addChildren(a,d);case"child":case"over":return this.addChildren(a)}b(!1,"Invalid mode: "+c)},addPagingNode:function(b,c){var d,e;if(c=c||"child",b===!1){for(d=this.children.length-1;d>=0;d--)e=this.children[d],"paging"===e.statusNodeType&&this.removeChild(e);return void(this.partload=!1)}return b=a.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},b),this.partload=!0,this.addNode(b,c)},appendSibling:function(a){return this.addNode(a,"after")},applyPatch:function(b){if(null===b)return this.remove(),h(this);var c,d,e,f={children:!0,expanded:!0,parent:!0};for(c in b)e=b[c],f[c]||a.isFunction(e)||(E[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):h(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;b<c;b++)d+=e[b].countChildren();return d},debug:function(a){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),c("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(a){var b=a?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(b,this)},findAll:function(b){b=a.isFunction(b)?b:m(b);var c=[];return this.visit(function(a){b(a)&&c.push(a)}),c},findFirst:function(b){b=a.isFunction(b)?b:m(b);var c=null;return this.visit(function(a){if(b(a))return c=a,!1}),c},_changeSelectStatusAttrs:function(a){var c=!1,d=this.tree.options,e=s.evalOption("unselectable",this,this,d,!1),f=s.evalOption("unselectableStatus",this,this,d,void 0);switch(e&&null!=f&&(a=f),a){case!1:c=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:c=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:c=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:b(!1,"invalid state: "+a)}return c&&this.renderStatus(),c},fixSelection3AfterClick:function(a){var b=this.isSelected();this.visit(function(a){a._changeSelectStatusAttrs(b)}),this.fixSelection3FromEndNodes(a)},fixSelection3FromEndNodes:function(a){function c(a){var b,e,f,g,h,i,j,k,l,m=a.children;if(m&&m.length){for(i=!0,j=!1,b=0,e=m.length;b<e;b++)f=m[b],g=c(f),k=s.evalOption("unselectableIgnore",f,f,d,!1),k||(g!==!1&&(j=!0),g!==!0&&(i=!1));h=!!i||!!j&&void 0}else l=s.evalOption("unselectableStatus",a,a,d,void 0),h=null==l?!!a.selected:!!l;return a._changeSelectStatusAttrs(h),h}var d=this.tree.options;b(3===d.selectMode,"expected selectMode 3"),c(this),this.visitParents(function(a){var b,c,e,f,g,h,i=a.children,j=!0,k=!1;for(b=0,c=i.length;b<c;b++)e=i[b],g=s.evalOption("unselectableIgnore",e,e,d,!1),g||(h=s.evalOption("unselectableStatus",e,e,d,void 0),f=null==h?!!e.selected:!!h,(f||e.partsel)&&(k=!0),f||(j=!1));f=!!j||!!k&&void 0,a._changeSelectStatusAttrs(f)})},fromDict:function(b){for(var c in b)E[c]?this[c]=b[c]:"data"===c?a.extend(this.data,b.data):a.isFunction(b[c])||G[c]||(this.data[c]=b[c]);b.children&&(this.removeChildren(),this.addChildren(b.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return a.inArray(this,this.parent.children)},getIndexHier:function(b,c){b=b||".";var d,e=[];return a.each(this.getParentList(!1,!0),function(a,b){d=""+(b.getIndex()+1),c&&(d=("0000000"+d).substr(-c)),e.push(d)}),e.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;a<b;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;a<b;a++)if(c[a]===this)return c[a-1]}return null},getSelectedNodes:function(a){var b=[];return this.visit(function(c){if(c.selected&&(b.push(c),a===!0))return"skip"}),b},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(a){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),c("info",arguments))},isActive:function(){return this.tree.activeNode===this},isChildOf:function(a){return this.parent&&this.parent===a},isDescendantOf:function(b){if(!b||b.tree!==this.tree)return!1;for(var c=this.parent;c;){if(c===b)return!0;c===c.parent&&a.error("Recursive parent link: "+c),c=c.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||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var a,b,c=this.getParentList(!1,!1);for(a=0,b=c.length;a<b;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 c,d,e=this,f=this.isExpanded();return b(this.isLazy(),"load() requires a lazy node"),a||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),d=this.tree._triggerNodeEvent("lazyLoad",this),d===!1?h(this):(b("boolean"!=typeof d,"lazyLoad event must return source in data.result"),c=this.tree._callHook("nodeLoadChildren",this,d),f?(this.expanded=!0,c.always(function(){e.render()})):c.always(function(){e.renderStatus()}),c)):h(this)},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(c,d,e){void 0===d||"over"===d?d="child":"firstChild"===d&&(c.children&&c.children.length?(d="before",c=c.children[0]):d="child");var f,g=this.parent,h="child"===d?c:c.parent;if(this!==c){if(this.parent?h.isDescendantOf(this)&&a.error("Cannot move a node to its own descendant"):a.error("Cannot move system root"),h!==g&&g.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===h)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else f=a.inArray(this,this.parent.children),b(f>=0,"invalid source parent"),this.parent.children.splice(f,1);if(this.parent=h,h.hasChildren())switch(d){case"child":h.children.push(this);break;case"before":f=a.inArray(c,h.children),b(f>=0,"invalid target parent"),h.children.splice(f,0,this);break;case"after":f=a.inArray(c,h.children),b(f>=0,"invalid target parent"),h.children.splice(f+1,0,this);break;default:a.error("Invalid mode "+d)}else h.children=[this];e&&c.visit(e,!0),h===g?h.triggerModifyChild("move",this):h.triggerModifyChild("add",this),this.tree!==c.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(a){a.tree=c.tree},!0)),g.isDescendantOf(h)||g.render(),h.isDescendantOf(g)||h===g||h.render()}},navigate:function(b,c){function d(d){if(d){try{d.makeVisible({scrollIntoView:!1})}catch(e){}return a(d.span).is(":visible")?c===!1?d.setFocus():d.setActive():(d.debug("Navigate: skipping hidden node"),void d.navigate(b,c))}}var e,f,g,i=!0,j=a.ui.keyCode,k=null;switch(b){case j.BACKSPACE:this.parent&&this.parent.parent&&(g=d(this.parent));break;case j.HOME:this.tree.visit(function(b){if(a(b.span).is(":visible"))return g=d(b),!1});break;case j.END:this.tree.visit(function(b){a(b.span).is(":visible")&&(g=b)}),g&&(g=d(g));break;case j.LEFT:this.expanded?(this.setExpanded(!1),g=d(this)):this.parent&&this.parent.parent&&(g=d(this.parent));break;case j.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&(g=d(this.children[0])):(this.setExpanded(),g=d(this));break;case j.UP:for(k=this.getPrevSibling();k&&!a(k.span).is(":visible");)k=k.getPrevSibling();for(;k&&k.expanded&&k.children&&k.children.length;)k=k.children[k.children.length-1];!k&&this.parent&&this.parent.parent&&(k=this.parent),g=d(k);break;case j.DOWN:if(this.expanded&&this.children&&this.children.length)k=this.children[0];else for(f=this.getParentList(!1,!0),e=f.length-1;e>=0;e--){for(k=f[e].getNextSibling();k&&!a(k.span).is(":visible");)k=k.getNextSibling();if(k)break}g=d(k);break;default:i=!1}return g||h()},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)},removeClass:function(a){return this.toggleClass(a,!1)},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)},replaceWith:function(c){var d,e=this.parent,f=a.inArray(this,e.children),g=this;return b(this.isPagingNode(),"replaceWith() currently requires a paging status node"),d=this.tree._callHook("nodeLoadChildren",this,c),d.done(function(a){var b=g.children;for(q=0;q<b.length;q++)b[q].parent=e;e.children.splice.apply(e.children,[f+1,0].concat(b)),g.children=null,g.remove(),e.render()}).fail(function(){g.setExpanded()}),d},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(b,c){this.tree.timer&&clearTimeout(this.tree.timer),this.tree.timer=null;var d=this;switch(b){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){d.tree.debug("setTimeout: trigger expand"),d.setExpanded(!0)},c);break;case"activate":this.tree.timer=setTimeout(function(){d.tree.debug("setTimeout: trigger activate"),d.setActive(!0)},c);break;default:a.error("Invalid mode "+b)}},scrollIntoView:function(c,e){void 0!==e&&d(e)&&(this.warn("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead."),e={topNode:e});var f,g,i,j,k=a.extend({effects:c===!0?{duration:200,queue:!1}:c,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent||this.tree.$container,topNode:null},e),l=new a.Deferred,m=this,n=a(this.span).height(),o=a(k.scrollParent),p=k.scrollOfs.top||0,q=k.scrollOfs.bottom||0,r=o.height(),s=o.scrollTop(),t=o,u=o[0]===window,v=k.topNode||null,w=null;return a(this.span).is(":visible")?(u?(g=a(this.span).offset().top,f=v&&v.span?a(v.span).offset().top:0,t=a("html,body")):(b(o[0]!==document&&o[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),j=o.offset().top,g=a(this.span).offset().top-j+s,f=v?a(v.span).offset().top-j+s:0,i=Math.max(0,o.innerHeight()-o[0].clientHeight),r-=i),g<s+p?w=g-p:g+n>s+r-q&&(w=g+n-r+q,v&&(b(v.isRootNode()||a(v.span).is(":visible"),"topNode must be visible"),f<w&&(w=f-p))),null!==w?k.effects?(k.effects.complete=function(){l.resolveWith(m)},t.stop(!0).animate({scrollTop:w},k.effects)):(t[0].scrollTop=w,l.resolveWith(this)):l.resolveWith(this),l.promise()):(this.warn("scrollIntoView(): node is invisible."),h())},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,b){return this.tree._callHook("nodeSetSelected",this,a,b)},setStatus:function(a,b,c){return this.tree._callHook("nodeSetStatus",this,a,b,c)},setTitle:function(a){this.title=a,this.renderTitle(),this.triggerModify("rename")},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;c<d;c++)e[c].children&&e[c].sortChildren(a,"$norender$");"$norender$"!==b&&this.render(),this.triggerModifyChild("sort")}},toDict:function(b,c){var d,e,f,g={},h=this;if(a.each(D,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,h),b&&this.hasChildren())for(g.children=[],d=0,e=this.children.length;d<e;d++)f=this.children[d],f.isStatusNode()||g.children.push(f.toDict(!0,c));return g},toggleClass:function(b,c){var d,e,f=/\S+/g,g=b.match(f)||[],h=0,i=!1,j=this[this.tree.statusClassPropName],k=" "+(this.extraClasses||"")+" ";for(j&&a(j).toggleClass(b,c);d=g[h++];)if(e=k.indexOf(" "+d+" ")>=0,c=void 0===c?!e:!!c)e||(k+=d+" ",i=!0);else for(;k.indexOf(" "+d+" ")>-1;)k=k.replace(" "+d+" "," ");return this.extraClasses=a.trim(k),i},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"<FancytreeNode(#"+this.key+", '"+this.title+"')>"},triggerModifyChild:function(b,c,d){var e,f=this.tree.options.modifyChild;f&&(c&&c.parent!==this&&a.error("childNode "+c+" is not a child of "+this),e={node:this,tree:this.tree,operation:b,childNode:c||null},d&&a.extend(e,d),f({type:"modifyChild"},e))},triggerModify:function(a,b){this.parent.triggerModifyChild(a,this,b)},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;c<d&&(e=f[c].visit(a,!0),e!==!1);c++);return e},visitAndLoad:function(b,c,d){var e,f,g,i=this;return b&&c===!0&&(f=b(i),f===!1||"skip"===f)?d?f:h():i.children||i.lazy?(e=new a.Deferred,g=[],i.load().done(function(){for(var c=0,d=i.children.length;c<d;c++){if(f=i.children[c].visitAndLoad(b,!0,!0),f===!1){e.reject();break}"skip"!==f&&g.push(f)}a.when.apply(this,g).then(function(){e.resolve()})}),e.promise()):h()},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},visitSiblings:function(a,b){var c,d,e,f=this.parent.children;for(c=0,d=f.length;c<d;c++)if(e=f[c],(b||e!==this)&&a(e)===!1)return!1;return!0},warn:function(a){Array.prototype.unshift.call(arguments,this.toString()),c("warn",arguments)}},p.prototype={_makeHookContext:function(b,c,d){var e,f;return void 0!==b.node?(c&&b.originalEvent!==c&&a.error("invalid args"),e=b):b.tree?(f=b.tree,e={node:b,tree:f,widget:f.widget,options:f.widget.options,originalEvent:c}):b.widget?e={node:null,tree:b,widget:b.widget,options:b.widget.options,originalEvent:c}:a.error("invalid args"),d&&a.extend(e,d),e},_callHook:function(b,c,d){var e=this._makeHookContext(c),f=this[b],g=Array.prototype.slice.call(arguments,2);return a.isFunction(f)||a.error("_callHook('"+b+"') is not a function"),g.unshift(e),f.apply(this,g)},_setExpiringValue:function(a,b,c){this._tempCache[a]={value:b,expire:Date.now()+(+c||50)}},_getExpiringValue:function(a){var b=this._tempCache[a];return b&&b.expire<Date.now()?b.value:(delete this._tempCache[a],null)},_requireExtension:function(c,d,e,f){e=!!e;var g=this._local.name,h=this.options.extensions,i=a.inArray(c,h)<a.inArray(g,h),j=d&&null==this.ext[c],k=!j&&null!=e&&e!==i;return b(g&&g!==c,"invalid or same name"),!j&&!k||(f||(j||d?(f="'"+g+"' extension requires '"+c+"'",k&&(f+=" to be registered "+(e?"before":"after")+" itself")):f="If used together, `"+c+"` must be registered "+(e?"before":"after")+" `"+g+"`"),a.error(f),!1)},activateKey:function(a){var b=this.getNodeByKey(a);return b?b.setActive():this.activeNode&&this.activeNode.setActive(!1),b},addPagingNode:function(a,b){return this.rootNode.addPagingNode(a,b)},applyPatch:function(c){var d,e,f,g,h,i,k=c.length,l=[];for(e=0;e<k;e++)f=c[e],b(2===f.length,"patchList must be an array of length-2-arrays"),g=f[0],h=f[1],i=null===g?this.rootNode:this.getNodeByKey(g),i?(d=new a.Deferred,l.push(d),i.applyPatch(h).always(j(d,i))):this.warn("could not find node with key '"+g+"'");return a.when.apply(a,l).promise()},clear:function(a){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(a){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),c("log",arguments))},enableUpdate:function(a){return a=a!==!1,!!this._enableUpdate==!!a?a:(this._enableUpdate=a,a?(this.debug("enableUpdate(true): redraw "),this.render()):this.debug("enableUpdate(false)..."),!a)},findAll:function(a){return this.rootNode.findAll(a)},findFirst:function(a){return this.rootNode.findFirst(a)},findNextNode:function(b,c,d){var e=null,f=c.parent.children,g=null,h=function(a,b,c){var d,e,f=a.children,g=f.length,i=f[b];if(i&&c(i)===!1)return!1;if(i&&i.children&&i.expanded&&h(i,0,c)===!1)return!1;for(d=b+1;d<g;d++)if(h(a,d,c)===!1)return!1;return e=a.parent,e?h(e,e.children.indexOf(a)+1,c):h(a,0,c)};return b="string"==typeof b?n(b):b,c=c||this.getFirstChild(),h(c.parent,f.indexOf(c),function(d){return d!==e&&(e=e||d,a(d.span).is(":visible")?(!b(d)||(g=d,g===c))&&void 0:void d.debug("quicksearch: skipping hidden node"))}),g},generateFormElements:function(b,c,d){function e(b){j.append(a("<input>",{type:"checkbox",name:g,value:b.key,checked:!0}))}d=d||{};var f,g="string"==typeof b?b:"ft_"+this._id+"[]",h="string"==typeof c?c:"ft_"+this._id+"_active",i="fancytree_result_"+this._id,j=a("#"+i),k=3===this.options.selectMode&&d.stopOnParents!==!1;j.length?j.empty():j=a("<div>",{id:i}).hide().insertAfter(this.$container),c!==!1&&this.activeNode&&j.append(a("<input>",{type:"radio",name:h,value:this.activeNode.key,checked:!0})),d.filter?this.visit(function(a){var b=d.filter(a);return"skip"===b?b:void(b!==!1&&e(a))}):b!==!1&&(f=this.getSelectedNodes(k),a.each(f,function(a,b){e(b)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getNodeByKey:function(a,b){var c,d;return!b&&(c=document.getElementById(this.options.idPrefix+a))?c.ftnode?c.ftnode:null:(b=b||this.rootNode,d=null,b.visit(function(b){if(b.key===a)return d=b,!1},!0),d)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(a){return this.rootNode.getSelectedNodes(a)},hasFocus:function(){return!!this._hasFocus},info:function(a){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),c("info",arguments))},loadKeyPath:function(b,c,d){function e(a,b,d){c.call(q,b,"loading"),b.load().done(function(){q.loadKeyPath.call(q,l[a],c,b).always(j(d,q))}).fail(function(e){q.warn("loadKeyPath: error loading: "+a+" (parent: "+n+")"),c.call(q,b,"error"),d.reject()})}var f,g,h,i,k,l,m,n,o,p=this.options.keyPathSeparator,q=this;for(c=c||a.noop,a.isArray(b)||(b=[b]),l={},h=0;h<b.length;h++)for(n=d||this.rootNode,i=b[h],i.charAt(0)===p&&(i=i.substr(1)),o=i.split(p);o.length;){if(k=o.shift(),m=n._findDirectChild(k),!m){this.warn("loadKeyPath: key not found: "+k+" (parent: "+n+")"),c.call(this,k,"error");break}if(0===o.length){c.call(this,m,"ok");break}if(m.lazy&&void 0===m.hasChildren()){c.call(this,m,"loaded"),l[k]?l[k].push(o.join(p)):l[k]=[o.join(p)];break}c.call(this,m,"loaded"),n=m}f=[];for(k in l)m=n._findDirectChild(k),null==m&&(m=q.getNodeByKey(k)),g=new a.Deferred,f.push(g),e(k,m,g);return a.when.apply(a,f).promise()},reactivate:function(a){var b,c=this.activeNode;return c?(this.activeNode=null,b=c.setActive(!0,{noFocus:!0}),a&&c.setFocus(),b):h()},reload:function(a){return this._callHook("treeClear",this),this._callHook("treeLoad",this,a)},render:function(a,b){return this.rootNode.render(a,b)},setFocus:function(a){return this._callHook("treeSetFocus",this,a)},toDict:function(a,b){var c=this.rootNode.toDict(!0,b);return a?c:c.children},toString:function(){return"<Fancytree(#"+this._id+")>"},_triggerNodeEvent:function(a,b,c,d){var e=this._makeHookContext(b,c,d),f=this.widget._trigger(a,c,e);return f!==!1&&void 0!==e.result?e.result:f},_triggerTreeEvent:function(a,b,c){var d=this._makeHookContext(this,b,c),e=this.widget._trigger(a,b,d);return e!==!1&&void 0!==d.result?d.result:e},visit:function(a){return this.rootNode.visit(a,!1)},warn:function(a){Array.prototype.unshift.call(arguments,this.toString()),c("warn",arguments)}},a.extend(p.prototype,{nodeClick:function(a){var b,c,d=a.targetType,e=a.node;if("expander"===d){if(e.isLoading())return void e.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",a)}else if("checkbox"===d)this._callHook("nodeToggleSelected",a),a.options.focusOnSelect&&this._callHook("nodeSetFocus",a,!0);else{if(c=!1,b=!0,e.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)}},nodeCollapseSiblings:function(a,b){var c,d,e,f=a.node;if(f.parent)for(c=f.parent.children,d=0,e=c.length;d<e;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,e,f,g=b.originalEvent,h=b.node,i=b.tree,j=b.options,k=g.which,l=String.fromCharCode(k),m=!(g.altKey||g.ctrlKey||g.metaKey||g.shiftKey),n=a(g.target),o=!0,p=!(g.ctrlKey||!j.autoActivate);if(h||(f=this.getActiveNode()||this.getFirstChild(),f&&(f.setFocus(),h=b.node=this.focusNode,h.debug("Keydown force focus on active node"))),j.quicksearch&&m&&/\w/.test(l)&&!z[k]&&!n.is(":input:enabled"))return d=(new Date).getTime(),d-i.lastQuicksearchTime>500&&(i.lastQuicksearchTerm=""),i.lastQuicksearchTime=d,i.lastQuicksearchTerm+=l,c=i.findNextNode(i.lastQuicksearchTerm,i.getActiveNode()),c&&c.setActive(),void g.preventDefault();switch(s.eventToString(g)){case"+":case"=":i.nodeSetExpanded(b,!0);break;case"-":i.nodeSetExpanded(b,!1);break;case"space":h.isPagingNode()?i._triggerNodeEvent("clickPaging",b,g):s.evalOption("checkbox",h,h,j,!1)?i.nodeToggleSelected(b):i.nodeSetActive(b,!0);break;case"return":i.nodeSetActive(b,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":e=h.navigate(g.which,p,!0);break;default:o=!1}o&&g.preventDefault()},nodeLoadChildren:function(c,d){var e,f,g,h=c.tree,i=c.node,j=(new Date).getTime();return a.isFunction(d)&&(d=d.call(h,{type:"source"},c),b(!a.isFunction(d),"source callback must not return another function")),d.url&&(i._requestId&&i.warn("Recursive load request #"+j+" while #"+i._requestId+" is pending."),e=a.extend({},c.options.ajax,d),i._requestId=j,e.debugDelay?(f=e.debugDelay,a.isArray(f)&&(f=f[0]+Math.random()*(f[1]-f[0])),i.warn("nodeLoadChildren waiting debugDelay "+Math.round(f)+" ms ..."),e.debugDelay=!1,g=a.Deferred(function(b){setTimeout(function(){a.ajax(e).done(function(){b.resolveWith(this,arguments)}).fail(function(){b.rejectWith(this,arguments)})},f)})):g=a.ajax(e),d=new a.Deferred,g.done(function(b,e,f){var g,k;if("json"!==this.dataType&&"jsonp"!==this.dataType||"string"!=typeof b||a.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),i._requestId&&i._requestId>j)return void d.rejectWith(this,[w]);
if(c.options.postProcess){try{k=h._triggerNodeEvent("postProcess",c,c.originalEvent,{response:b,error:null,dataType:this.dataType})}catch(l){k={error:l,message:""+l,details:"postProcess failed"}}if(k.error)return g=a.isPlainObject(k.error)?k.error:{message:k.error},g=h._makeHookContext(i,null,g),void d.rejectWith(this,[g]);b=a.isArray(k)?k:b}else b&&b.hasOwnProperty("d")&&c.options.enableAspx&&(b="string"==typeof b.d?a.parseJSON(b.d):b.d);d.resolveWith(this,[b])}).fail(function(a,b,c){var e=h._makeHookContext(i,null,{error:a,args:Array.prototype.slice.call(arguments),message:c,details:a.status+": "+c});d.rejectWith(this,[e])})),a.isFunction(d.then)&&a.isFunction(d["catch"])&&(g=d,d=new a.Deferred,g.then(function(a){d.resolve(a)},function(a){d.reject(a)})),a.isFunction(d.promise)?(h.nodeSetStatus(c,"loading"),d.done(function(a){h.nodeSetStatus(c,"ok"),i._requestId=null}).fail(function(a){var b;return a===w?void i.warn("Ignored response for obsolete load request #"+j+" (expected #"+i._requestId+")"):(a.node&&a.error&&a.message?b=a:(b=h._makeHookContext(i,null,{error:a,args:Array.prototype.slice.call(arguments),message:a?a.message||a.toString():""}),"[object Object]"===b.message&&(b.message="")),i.warn("Load children failed ("+b.message+")",b),void(h._triggerNodeEvent("loadError",b,null)!==!1&&h.nodeSetStatus(c,"error",b.message,b.details)))})):c.options.postProcess&&h._triggerNodeEvent("postProcess",c,c.originalEvent,{response:d,error:null,dataType:typeof d}),a.when(d).done(function(c){var d;a.isPlainObject(c)&&(b(i.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),b(a.isArray(c.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),d=c,c=c.children,delete d.children,a.extend(h.data,d)),b(a.isArray(c),"expected array of children"),i._setChildren(c),h._triggerNodeEvent("loadChildren",i)})},nodeLoadKeyPath:function(a,b){},nodeRemoveChild:function(c,d){var e,f=c.node,g=a.extend({},c,{node:d}),h=f.children;return 1===h.length?(b(d===h[0],"invalid single child"),this.nodeRemoveChildren(c)):(this.activeNode&&(d===this.activeNode||this.activeNode.isDescendantOf(d))&&this.activeNode.setActive(!1),this.focusNode&&(d===this.focusNode||this.focusNode.isDescendantOf(d))&&(this.focusNode=null),this.nodeRemoveMarkup(g),this.nodeRemoveChildren(g),e=a.inArray(d,h),b(e>=0,"invalid child"),f.triggerModifyChild("remove",d),d.visit(function(a){a.parent=null},!0),this._callHook("treeRegisterNode",this,!1,d),void h.splice(e,1))},nodeRemoveChildMarkup:function(b){var c=b.node;c.ul&&(c.isRootNode()?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;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.triggerModifyChild("remove",null),e.visit(function(a){a.parent=null,d._callHook("treeRegisterNode",d,!1,a)}),e.lazy?e.children=[]:e.children=null,e.isRootNode()||(e.expanded=!1),this.nodeRenderStatus(b))},nodeRemoveMarkup:function(b){var c=b.node;c.li&&(a(c.li).remove(),c.li=null),this.nodeRemoveChildMarkup(b)},nodeRender:function(c,d,e,f,g){var h,i,j,k,l,m,n,o=c.node,p=c.tree,q=c.options,r=q.aria,s=!1,t=o.parent,u=!t,v=o.children,w=null;if(p._enableUpdate!==!1&&(u||t.ul)){if(b(u||t.ul,"parent UL must exist"),u||(o.li&&(d||o.li.parentNode!==o.parent.ul)&&(o.li.parentNode===o.parent.ul?w=o.li.nextSibling:this.debug("Unlinking "+o+" (must be child of "+o.parent+")"),this.nodeRemoveMarkup(c)),o.li?this.nodeRenderStatus(c):(s=!0,o.li=document.createElement("li"),o.li.ftnode=o,o.key&&q.generateIds&&(o.li.id=q.idPrefix+o.key),o.span=document.createElement("span"),o.span.className="fancytree-node",r&&!o.tr&&a(o.li).attr("role","treeitem"),o.li.appendChild(o.span),this.nodeRenderTitle(c),q.createNode&&q.createNode.call(p,{type:"createNode"},c)),q.renderNode&&q.renderNode.call(p,{type:"renderNode"},c)),v){if(u||o.expanded||e===!0){for(o.ul||(o.ul=document.createElement("ul"),(f!==!0||g)&&o.expanded||(o.ul.style.display="none"),r&&a(o.ul).attr("role","group"),o.li?o.li.appendChild(o.ul):o.tree.$div.append(o.ul)),k=0,l=v.length;k<l;k++)n=a.extend({},c,{node:v[k]}),this.nodeRender(n,d,e,!1,!0);for(h=o.ul.firstChild;h;)j=h.ftnode,j&&j.parent!==o?(o.debug("_fixParent: remove missing "+j,h),m=h.nextSibling,h.parentNode.removeChild(h),h=m):h=h.nextSibling;for(h=o.ul.firstChild,k=0,l=v.length-1;k<l;k++)i=v[k],j=h.ftnode,i!==j?o.ul.insertBefore(i.li,j.li):h=h.nextSibling}}else o.ul&&(this.warn("remove child markup for "+o),this.nodeRemoveChildMarkup(c));u||s&&t.ul.insertBefore(o.li,w)}},nodeRenderTitle:function(b,c){var d,e,f,g,h,i,j,k=b.node,m=b.tree,n=b.options,o=n.aria,p=k.getLevel(),q=[];void 0!==c&&(k.title=c),k.span&&m._enableUpdate!==!1&&(h=o&&k.hasChildren()!==!1?" role='button'":"",p<n.minExpandLevel?(k.lazy||(k.expanded=!0),p>1&&q.push("<span "+h+" class='fancytree-expander fancytree-expander-fixed'></span>")):q.push("<span "+h+" class='fancytree-expander'></span>"),d=s.evalOption("checkbox",k,k,n,!1),d&&!k.isStatusNode()&&(h=o?" role='checkbox'":"",e="fancytree-checkbox",("radio"===d||k.parent&&k.parent.radiogroup)&&(e+=" fancytree-radio"),q.push("<span "+h+" class='"+e+"'></span>")),void 0!==k.data.iconClass&&(k.icon?a.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(k.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),k.icon=k.data.iconClass)),f=s.evalOption("icon",k,k,n,!0),"boolean"!=typeof f&&(f=""+f),f!==!1&&(h=o?" role='presentation'":"","string"==typeof f?t.test(f)?(f="/"===f.charAt(0)?f:(n.imagePath||"")+f,q.push("<img src='"+f+"' class='fancytree-icon' alt='' />")):q.push("<span "+h+" class='fancytree-custom-icon "+f+"'></span>"):q.push("<span "+h+" class='fancytree-icon'></span>")),g="",n.renderTitle&&(g=n.renderTitle.call(m,{type:"renderTitle"},b)||""),g||(j=s.evalOption("tooltip",k,k,n,null),j===!0&&(j=k.title),j=j?" title='"+l(j)+"'":"",i=n.titlesTabbable?" tabindex='0'":"",g="<span class='fancytree-title'"+j+i+">"+(n.escapeTitles?s.escapeHtml(k.title):k.title)+"</span>"),q.push(g),k.span.innerHTML=q.join(""),this.nodeRenderStatus(b),n.enhanceTitle&&(b.$title=a(">span.fancytree-title",k.span),g=n.enhanceTitle.call(m,{type:"enhanceTitle"},b)||""))},nodeRenderStatus:function(b){var c,d=b.node,e=b.tree,f=b.options,g=d.hasChildren(),h=d.isLastSibling(),i=f.aria,j=f._classNames,k=[],l=d[e.statusClassPropName];l&&e._enableUpdate!==!1&&(i&&(c=a(d.tr||d.li)),k.push(j.node),e.activeNode===d&&k.push(j.active),e.focusNode===d&&k.push(j.focused),d.expanded&&k.push(j.expanded),i&&(g!==!1?c.attr("aria-expanded",Boolean(d.expanded)):c.removeAttr("aria-expanded")),d.folder&&k.push(j.folder),g!==!1&&k.push(j.hasChildren),h&&k.push(j.lastsib),d.lazy&&null==d.children&&k.push(j.lazy),d.partload&&k.push(j.partload),d.partsel&&k.push(j.partsel),s.evalOption("unselectable",d,d,f,!1)&&k.push(j.unselectable),d._isLoading&&k.push(j.loading),d._error&&k.push(j.error),d.statusNodeType&&k.push(j.statusNodePrefix+d.statusNodeType),d.selected?(k.push(j.selected),i&&c.attr("aria-selected",!0)):i&&c.attr("aria-selected",!1),d.extraClasses&&k.push(d.extraClasses),g===!1?k.push(j.combinedExpanderPrefix+"n"+(h?"l":"")):k.push(j.combinedExpanderPrefix+(d.expanded?"e":"c")+(d.lazy&&null==d.children?"d":"")+(h?"l":"")),k.push(j.combinedIconPrefix+(d.expanded?"e":"c")+(d.folder?"f":"")),l.className=k.join(" "),d.li&&a(d.li).toggleClass(j.lastsib,h))},nodeSetActive:function(c,d,e){e=e||{};var f,g=c.node,j=c.tree,k=c.options,l=e.noEvents===!0,m=e.noFocus===!0,n=g===j.activeNode;return d=d!==!1,n===d?h(g):d&&!l&&this._triggerNodeEvent("beforeActivate",g,c.originalEvent)===!1?i(g,["rejected"]):(d?(j.activeNode&&(b(j.activeNode!==g,"node was active (inconsistency)"),f=a.extend({},c,{node:j.activeNode}),j.nodeSetActive(f,!1),b(null===j.activeNode,"deactivate was out of sync?")),k.activeVisible&&g.makeVisible({scrollIntoView:m&&null==j.focusNode}),j.activeNode=g,j.nodeRenderStatus(c),m||j.nodeSetFocus(c),l||j._triggerNodeEvent("activate",g,c.originalEvent)):(b(j.activeNode===g,"node was not active (inconsistency)"),j.activeNode=null,this.nodeRenderStatus(c),l||c.tree._triggerNodeEvent("deactivate",g,c.originalEvent)),h(g))},nodeSetExpanded:function(b,c,d){d=d||{};var e,f,g,j,k,l,m=b.node,n=b.tree,o=b.options,p=d.noAnimation===!0,q=d.noEvents===!0;if(c=c!==!1,m.expanded&&c||!m.expanded&&!c)return h(m);if(c&&!m.lazy&&!m.hasChildren())return h(m);if(!c&&m.getLevel()<o.minExpandLevel)return i(m,["locked"]);if(!q&&this._triggerNodeEvent("beforeExpand",m,b.originalEvent)===!1)return i(m,["rejected"]);if(p||m.isVisible()||(p=d.noAnimation=!0),f=new a.Deferred,c&&!m.expanded&&o.autoCollapse){k=m.getParentList(!1,!0),l=o.autoCollapse;try{for(o.autoCollapse=!1,g=0,j=k.length;g<j;g++)this._callHook("nodeCollapseSiblings",k[g],d)}finally{o.autoCollapse=l}}return f.done(function(){var a=m.getLastChild();c&&o.autoScroll&&!p&&a?a.scrollIntoView(!0,{topNode:m}).always(function(){q||b.tree._triggerNodeEvent(c?"expand":"collapse",b)}):q||b.tree._triggerNodeEvent(c?"expand":"collapse",b)}),e=function(d){var e,f,g=o._classNames,h=o.toggleEffect;if(m.expanded=c,n._callHook("nodeRender",b,!1,!1,!0),m.ul)if(e="none"!==m.ul.style.display,f=!!m.expanded,e===f)m.warn("nodeSetExpanded: UL.style.display already set");else{if(h&&!p)return a(m.li).addClass(g.animating),void a(m.ul).addClass(g.animating).toggle(h.effect,h.options,h.duration,function(){a(this).removeClass(g.animating),a(m.li).removeClass(g.animating),d()});m.ul.style.display=m.expanded||!parent?"":"none"}d()},c&&m.lazy&&void 0===m.hasChildren()?m.load().done(function(){f.notifyWith&&f.notifyWith(m,["loaded"]),e(function(){f.resolveWith(m)})}).fail(function(a){e(function(){f.rejectWith(m,["load failed ("+a+")"])})}):e(function(){f.resolveWith(m)}),f.promise()},nodeSetFocus:function(b,c){var d,e=b.tree,f=b.node,g=e.options,h=!!b.originalEvent&&a(b.originalEvent.target).is(":input");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,{calledByNode:!0})),f.makeVisible({scrollIntoView:!1}),e.focusNode=f,g.titlesTabbable?h||a(f.span).find(".fancytree-title").focus():0===a(document.activeElement).closest(".fancytree-container").length&&a(e.$container).focus(),g.aria&&a(e.$container).attr("aria-activedescendant",a(f.tr||f.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",b),g.autoScroll&&f.scrollIntoView(),this._callHook("nodeRenderStatus",b))},nodeSetSelected:function(a,b,c){c=c||{};var d=a.node,e=a.tree,f=a.options,g=c.noEvents===!0,h=d.parent;if(b=b!==!1,!s.evalOption("unselectable",d,d,f,!1)){if(d._lastSelectIntent=b,!!d.selected===b&&(3!==f.selectMode||!d.partsel||b))return b;if(!g&&this._triggerNodeEvent("beforeSelect",d,a.originalEvent)===!1)return!!d.selected;b&&1===f.selectMode?(e.lastSelectedNode&&e.lastSelectedNode.setSelected(!1),d.selected=b):3!==f.selectMode||!h||h.radiogroup||d.radiogroup?h&&h.radiogroup?d.visitSiblings(function(a){a._changeSelectStatusAttrs(b&&a===d)},!0):d.selected=b:(d.selected=b,d.fixSelection3AfterClick(c)),this.nodeRenderStatus(a),e.lastSelectedNode=b?d:null,g||e._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),d.statusNodeType=c,i._callHook("nodeRenderTitle",d)):(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+")":""),checkbox:!1,tooltip:e},c),h._isLoading=!0,h._error=null,h.renderStatus();break;case"error":g({title:i.options.strings.loadError+(d?" ("+d+")":""),checkbox:!1,tooltip:e},c),h._isLoading=!1,h._error={message:d,details:e},h.renderStatus();break;case"nodata":g({title:i.options.strings.noData,checkbox:!1,tooltip:e},c),h._isLoading=!1,h._error=null,h.renderStatus();break;default:a.error("invalid node status "+c)}},nodeToggleExpanded:function(a){return this.nodeSetExpanded(a,!a.node.expanded)},nodeToggleSelected:function(a){var b=a.node,c=!b.selected;return b.partsel&&!b.selected&&b._lastSelectIntent===!0&&(c=!1,b.selected=!0),b._lastSelectIntent=c,this.nodeSetSelected(a,c)},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(a){},treeDestroy:function(a){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden")},treeInit:function(a){var b=a.tree,c=b.options;b.$container.attr("tabindex",c.tabindex),c.rtl?b.$container.attr("DIR","RTL").addClass("fancytree-rtl"):b.$container.removeAttr("DIR").removeClass("fancytree-rtl"),c.aria&&(b.$container.attr("role","tree"),1!==c.selectMode&&b.$container.attr("aria-multiselectable",!0)),this.treeLoad(a)},treeLoad:function(c,d){var e,f,g,h,i=c.tree,j=c.widget.element,l=a.extend({},c,{node:this.rootNode});if(i.rootNode.children&&this.treeClear(c),d=d||this.options.source)"string"==typeof d&&a.error("Not implemented");else switch(f=j.data("type")||"html"){case"html":g=j.find(">ul:first"),g.addClass("ui-fancytree-source ui-helper-hidden"),d=a.ui.fancytree.parseHtml(g),this.data=a.extend(this.data,k(g));break;case"json":d=a.parseJSON(j.text()),j.contents().filter(function(){return 3===this.nodeType}).remove(),a.isPlainObject(d)&&(b(a.isArray(d.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),e=d,d=d.children,delete e.children,a.extend(i.data,e));break;default:a.error("Invalid data-type: "+f)}return h=this.nodeLoadChildren(l,d).done(function(){i.render(),3===c.options.selectMode&&i.rootNode.fixSelection3FromEndNodes(),i.activeNode&&i.options.activeVisible&&i.activeNode.makeVisible(),i._triggerTreeEvent("init",null,{status:!0})}).fail(function(){i.render(),i._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(a,b,c){},treeSetFocus:function(b,c,d){var e;c=c!==!1,c!==this.hasFocus()&&(this._hasFocus=c,!c&&this.focusNode?this.focusNode.setFocus(!1):!c||d&&d.calledByNode||a(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",c),this._triggerTreeEvent(c?"focusTree":"blurTree"),c&&!this.activeNode&&(e=this._lastMousedownNode||this.getFirstChild(),e&&e.setFocus()))},treeSetOption:function(b,c,d){var e=b.tree,f=!0,g=!1,h=!1;switch(c){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":g=!0,h=!0;break;case"escapeTitles":case"tooltip":h=!0;break;case"rtl":d===!1?e.$container.removeAttr("DIR").removeClass("fancytree-rtl"):e.$container.attr("DIR","RTL").addClass("fancytree-rtl"),h=!0;break;case"source":f=!1,e._callHook("treeLoad",e,d),h=!0}e.debug("set option "+c+"="+d+" <"+typeof d+">"),f&&(this.widget._super?this.widget._super.call(this.widget,c,d):a.Widget.prototype._setOption.call(this.widget,c,d)),g&&e._callHook("treeCreate",e),h&&e.render(!0,!1)}}),a.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,escapeTitles:!1,extensions:[],toggleEffect:{effect:"blind",options:{direction:"vertical",scale:"box"},duration:200},generateIds:!1,icon:!0,idPrefix:"ft_",focusOnSelect:!1,keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,tooltip:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",animating:"fancytree-animating",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",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",unselectable:"fancytree-unselectable",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error",statusNodePrefix:"fancytree-statusnode-"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new p(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var c,d,e,f=this.options,h=f.extensions,i=this.tree;for(e=0;e<h.length;e++)d=h[e],c=a.ui.fancytree._extensions[d],c||a.error("Could not apply extension '"+d+"' (it is not registered, did you forget to include it?)"),this.tree.options[d]=a.extend(!0,{},c.options,this.tree.options[d]),b(void 0===this.tree.ext[d],"Extension name must not exist as Fancytree.ext attribute: '"+d+"'"),this.tree.ext[d]={},g(this.tree,i,c,d),i=c;void 0!==f.icons&&(f.icon!==!0?a.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),f.icon=f.icons)),void 0!==f.iconClass&&(f.icon?a.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),f.icon=f.iconClass)),void 0!==f.tabbable&&(f.tabindex=f.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+f.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(a,b){return this.tree._callHook("treeSetOption",this.tree,a,b)},destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree),a.Widget.prototype.destroy.call(this)},_unbind:function(){var b=this.tree._ns;this.element.off(b),this.tree.$container.off(b),a(document).off(b)},_bind:function(){var b=this,c=this.options,d=this.tree,e=d._ns;this._unbind(),d.$container.on("focusin"+e+" focusout"+e,function(b){var c=s.getNode(b),e="focusin"===b.type;return e&&d._getExpiringValue("focusin")?void s.info("Ignored double focusin."):(d._setExpiringValue("focusin",!0,50),e&&!c&&(c=d._getExpiringValue("mouseDownNode"),c&&s.info("Reconstruct mouse target for focusin from recent event.")),void(c?d._callHook("nodeSetFocus",d._makeHookContext(c,b),e):d.tbody&&a(b.target).parents("table.fancytree-container > thead").length?d.debug("Ignore focus event outside table body.",b):d._callHook("treeSetFocus",d,e)))}).on("selectstart"+e,"span.fancytree-title",function(a){a.preventDefault()}).on("keydown"+e,function(a){if(c.disabled||c.keyboard===!1)return!0;var b,e=d.focusNode,f=d._makeHookContext(e||d,a),g=d.phase;try{return d.phase="userEvent",b=e?d._triggerNodeEvent("keydown",e,a):d._triggerTreeEvent("keydown",a),"preventNav"===b?b=!0:b!==!1&&(b=d._callHook("nodeKeydown",f)),b}finally{d.phase=g}}).on("mousedown"+e,function(a){var b=s.getEventTarget(a);d._lastMousedownNode=b?b.node:null,d._setExpiringValue("mouseDownNode",d._lastMousedownNode)}).on("click"+e+" dblclick"+e,function(a){if(c.disabled)return!0;var d,e=s.getEventTarget(a),f=e.node,g=b.tree,h=g.phase;if(!f)return!0;d=g._makeHookContext(f,a);try{switch(g.phase="userEvent",a.type){case"click":return d.targetType=e.type,f.isPagingNode()?g._triggerNodeEvent("clickPaging",d,a)===!0:g._triggerNodeEvent("click",d,a)!==!1&&g._callHook("nodeClick",d);case"dblclick":return d.targetType=e.type,g._triggerNodeEvent("dblclick",d,a)!==!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.26.0",buildType: "production",debugLevel: 1,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:p,_FancytreeNodeClass:o,jquerySupports:{positionMyOfs:e(a.ui.version,1,9)},assert:function(a,c){return b(a,c)},createTree:function(b,c){var d=a(b).fancytree(c).fancytree("getTree");return d},debounce:function(a,b,c,d){var e;return 3===arguments.length&&"boolean"!=typeof c&&(d=c,c=!1),function(){var f=arguments;d=d||this,c&&!e&&b.apply(d,f),clearTimeout(e),e=setTimeout(function(){c||b.apply(d,f),e=null},a)}},debug:function(b){a.ui.fancytree.debugLevel>=2&&c("log",arguments)},error:function(a){c("error",arguments)},escapeHtml:function(a){return(""+a).replace(u,function(a){return x[a]})},fixPositionOptions:function(b){if((b.offset||(""+b.my+b.at).indexOf("%")>=0)&&a.error("expected new position syntax (but '%' is not supported)"),!a.ui.fancytree.jquerySupports.positionMyOfs){var c=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(b.my),d=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(b.at),e=(c[2]?+c[2]:0)+(d[2]?+d[2]:0),f=(c[4]?+c[4]:0)+(d[4]?+d[4]:0);b=a.extend({},b,{my:c[1]+" "+c[3],at:d[1]+" "+d[3]}),(e||f)&&(b.offset=""+e+" "+f)}return b},getEventTarget:function(b){var c=b&&b.target?b.target.className:"",d={node:this.getNode(b.target),type:void 0};return/\bfancytree-title\b/.test(c)?d.type="title":/\bfancytree-expander\b/.test(c)?d.type=d.node.hasChildren()===!1?"prefix":"expander":/\bfancytree-checkbox\b/.test(c)?d.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(c)?d.type="icon":/\bfancytree-node\b/.test(c)?d.type="title":b&&a(b.target).is("ul[role=group]")?(s.info("Ignoring click on outer UL."),d.node=null):b&&b.target&&a(b.target).closest(".fancytree-title").length&&(d.type="title"),d},getEventTargetType:function(a){return this.getEventTarget(a).type},getNode:function(b){if(b instanceof o)return b;for(b instanceof a?b=b[0]:void 0!==b.originalEvent&&(b=b.target);b;){if(b.ftnode)return b.ftnode;b=b.parentNode}return null},getTree:function(b){var c;return b instanceof p?b:(void 0===b&&(b=0),"number"==typeof b?b=a(".fancytree-container").eq(b):"string"==typeof b?b=a(b).eq(0):void 0!==b.selector?b=b.eq(0):void 0!==b.originalEvent&&(b=a(b.target)),b=b.closest(":ui-fancytree"),c=b.data("ui-fancytree")||b.data("fancytree"),c?c.tree:null)},evalOption:function(b,c,d,e,f){var g,h,i=c.tree,j=e[b],k=d[b];return a.isFunction(j)?(g={node:c,tree:i,widget:i.widget,options:i.widget.options},h=j.call(i,{type:b},g),null==h&&(h=k)):h=null!=k?k:j,null==h&&(h=f),h},eventToString:function(a){var b=a.which,c=a.type,d=[];return a.altKey&&d.push("alt"),a.ctrlKey&&d.push("ctrl"),a.metaKey&&d.push("meta"),a.shiftKey&&d.push("shift"),"click"===c||"dblclick"===c?d.push(A[a.button]+c):y[b]||d.push(z[b]||String.fromCharCode(b).toLowerCase()),d.join("+")},info:function(b){a.ui.fancytree.debugLevel>=1&&c("info",arguments)},keyEventToString:function(a){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(a)},overrideMethod:function(b,c,d){var e,f=b[c]||a.noop;b[c]=function(){try{return e=this._super,this._super=f,d.apply(this,arguments)}finally{this._super=e}}},parseHtml:function(b){var c,d,e,f,g,h,i,j,l=b.find(">li"),m=[];return l.each(function(){var l,n,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(/<ul/i),g>=0&&(r.title=r.title.substring(0,g))),r.title=a.trim(r.title),f=0,h=B.length;f<h;f++)r[B[f]]=void 0;for(c=this.className.split(" "),e=[],f=0,h=c.length;f<h;f++)d=c[f],C[d]?r[d]=!0:e.push(d);if(r.extraClasses=e.join(" "),i=o.attr("title"),i&&(r.tooltip=i),i=o.attr("id"),i&&(r.key=i),o.attr("hideCheckbox")&&(r.checkbox=!1),l=k(o),l&&!a.isEmptyObject(l)){for(n in F)l.hasOwnProperty(n)&&(l[F[n]]=l[n],delete l[n]);for(f=0,h=D.length;f<h;f++)i=D[f],j=l[i],null!=j&&(delete l[i],r[i]=j);a.extend(r.data,l)}b=o.find(">ul:first"),b.length?r.children=a.ui.fancytree.parseHtml(b):r.children=r.lazy?void 0:null,m.push(r)}),m},registerExtension:function(c){b(null!=c.name,"extensions must have a `name` property."),b(null!=c.version,"extensions must have a `version` property."),a.ui.fancytree._extensions[c.name]=c},unescapeHtml:function(a){var b=document.createElement("div");return b.innerHTML=a,0===b.childNodes.length?"":b.childNodes[0].nodeValue},warn:function(a){c("warn",arguments)}}),a.ui.fancytree});
!function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree.ui-deps"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree.ui-deps"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";function t(t,n){t||(n=n?": "+n:"",e.error("Fancytree assertion failed"+n))}function n(e,t){var n,i,r=window.console?window.console[e]:null;if(r)try{r.apply(window.console,t)}catch(e){for(i="",n=0;n<t.length;n++)i+=t[n];r(i)}}function i(e,t,n,i,r){return function(){var n=t[e],o=i[e],s=t.ext[r],a=function(){return n.apply(t,arguments)},l=function(e){return n.apply(t,e)};return function(){var e=t._local,n=t._super,i=t._superApply;try{return t._local=s,t._super=a,t._superApply=l,o.apply(t,arguments)}finally{t._local=e,t._super=n,t._superApply=i}}}()}function r(t,n,r,o){for(var s in r)"function"==typeof r[s]?"function"==typeof t[s]?t[s]=i(s,t,0,r,o):"_"===s.charAt(0)?t.ext[o][s]=i(s,t,0,r,o):e.error("Could not override tree."+s+". Use prefix '_' to create tree."+o+"._"+s):"options"!==s&&(t.ext[o][s]=r[s])}function o(t,n){return void 0===t?e.Deferred(function(){this.resolve()}).promise():e.Deferred(function(){this.resolveWith(t,n)}).promise()}function s(t,n){return void 0===t?e.Deferred(function(){this.reject()}).promise():e.Deferred(function(){this.rejectWith(t,n)}).promise()}function a(e,t){return function(){e.resolveWith(t)}}function l(t){var n=e.extend({},t.data()),i=n.json;return delete n.fancytree,delete n.uiFancytree,i&&(delete n.json,n=e.extend(n,i)),n}function d(e){return(""+e).replace(b,function(e){return x[e]})}function c(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function u(n,i){var r,o,s,a;for(this.parent=n,this.tree=n.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},r=0,o=E.length;r<o;r++)this[s=E[r]]=i[s];null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),i.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),i.data&&e.extend(this.data,i.data);for(s in i)T[s]||e.isFunction(i[s])||A[s]||(this.data[s]=i[s]);null==this.key?this.tree.options.defaultKey?(this.key=this.tree.options.defaultKey(this),t(this.key,"defaultKey() must return a unique key")):this.key="_"+g._nextNodeKey++:this.key=""+this.key,i.active&&(t(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),i.selected&&(this.tree.lastSelectedNode=this),(a=i.children)?a.length?this._setChildren(a):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function h(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(e.isFunction(this.options.lazyload)&&!e.isFunction(this.options.lazyLoad)&&(this.options.lazyLoad=function(){return g.warn("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),t.options.lazyload.apply(this,arguments)}),e.isFunction(this.options.loaderror)&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&g.warn("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=l(this.$div),this._id=e.ui.fancytree._nextId++,this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var n,i={tree:this};this.rootNode=new u(i,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,n=e("<ul>",{class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=n,this.rootNode.ul=n[0],null==this.options.debugLevel&&(this.options.debugLevel=g.debugLevel)}{if(!e.ui||!e.ui.fancytree){var f,p,g=null,v=new RegExp(/\.|\//),y=/[&<>"'\/]/g,b=/[<>"'\/]/g,m="$recursive_request",x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},k={16:!0,17:!0,18:!0},N={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_={0:"",1:"left",2:"middle",3:"right"},C="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),S={},w="columns types".split(" "),E="checkbox expanded extraClasses folder icon iconTooltip key lazy radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),T={},L={},A={active:!0,children:!0,data:!0,focus:!0};for(f=0;f<C.length;f++)S[C[f]]=!0;for(f=0;f<E.length;f++)p=E[f],T[p]=!0,p!==p.toLowerCase()&&(L[p.toLowerCase()]=p);return t(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),u.prototype={_findDirectChild:function(e){var t,n,i=this.children;if(i)if("string"==typeof e){for(t=0,n=i.length;t<n;t++)if(i[t].key===e)return i[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){t(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var n=0,i=e.length;n<i;n++)this.children.push(new u(this,e[n]))},addChildren:function(n,i){var r,o,s,a=this.getFirstChild(),l=this.getLastChild(),d=null,c=[];for(e.isPlainObject(n)&&(n=[n]),this.children||(this.children=[]),r=0,o=n.length;r<o;r++)c.push(new u(this,n[r]));if(d=c[0],null==i?this.children=this.children.concat(c):(i=this._findDirectChild(i),t((s=e.inArray(i,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[s,0].concat(c))),a&&!i){for(r=0,o=c.length;r<o;r++)c[r].render();a!==this.getFirstChild()&&a.renderStatus(),l!==this.getLastChild()&&l.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===c.length?c[0]:null),d},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,n){switch(void 0!==n&&"over"!==n||(n="child"),n){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var i=this.children?this.children[0]:null;return this.addChildren(e,i);case"child":case"over":return this.addChildren(e)}t(!1,"Invalid mode: "+n)},addPagingNode:function(t,n){var i,r;n=n||"child";{if(!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,n);for(i=this.children.length-1;i>=0;i--)"paging"===(r=this.children[i]).statusNodeType&&this.removeChild(r);this.partload=!1}},appendSibling:function(e){return this.addNode(e,"after")},applyPatch:function(t){if(null===t)return this.remove(),o(this);var n,i,r={children:!0,expanded:!0,parent:!0};for(n in t)i=t[n],r[n]||e.isFunction(i)||(T[n]?this[n]=i:this.data[n]=i);return t.hasOwnProperty("children")&&(this.removeChildren(),t.children&&this._setChildren(t.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),t.hasOwnProperty("expanded")?this.setExpanded(t.expanded):o(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,n){return e.addNode(this.toDict(!0,n),t)},countChildren:function(e){var t,n,i,r=this.children;if(!r)return 0;if(i=r.length,!1!==e)for(t=0,n=i;t<n;t++)i+=r[t].countChildren();return i},debug:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),n("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},findAll:function(t){t=e.isFunction(t)?t:c(t);var n=[];return this.visit(function(e){t(e)&&n.push(e)}),n},findFirst:function(t){t=e.isFunction(t)?t:c(t);var n=null;return this.visit(function(e){if(t(e))return n=e,!1}),n},_changeSelectStatusAttrs:function(e){var n=!1,i=this.tree.options,r=g.evalOption("unselectable",this,this,i,!1),o=g.evalOption("unselectableStatus",this,this,i,void 0);switch(r&&null!=o&&(e=o),e){case!1:n=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:n=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:n=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:t(!1,"invalid state: "+e)}return n&&this.renderStatus(),n},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){e._changeSelectStatusAttrs(t)}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){function n(e){var t,r,o,s,a,l,d,c,u=e.children;if(u&&u.length){for(l=!0,d=!1,t=0,r=u.length;t<r;t++)s=n(o=u[t]),g.evalOption("unselectableIgnore",o,o,i,!1)||(!1!==s&&(d=!0),!0!==s&&(l=!1));a=!!l||!!d&&void 0}else a=null==(c=g.evalOption("unselectableStatus",e,e,i,void 0))?!!e.selected:!!c;return e._changeSelectStatusAttrs(a),a}var i=this.tree.options;t(3===i.selectMode,"expected selectMode 3"),n(this),this.visitParents(function(e){var t,n,r,o,s,a=e.children,l=!0,d=!1;for(t=0,n=a.length;t<n;t++)r=a[t],g.evalOption("unselectableIgnore",r,r,i,!1)||(((o=null==(s=g.evalOption("unselectableStatus",r,r,i,void 0))?!!r.selected:!!s)||r.partsel)&&(d=!0),o||(l=!1));o=!!l||!!d&&void 0,e._changeSelectStatusAttrs(o)})},fromDict:function(t){for(var n in t)T[n]?this[n]=t[n]:"data"===n?e.extend(this.data,t.data):e.isFunction(t[n])||A[n]||(this.data[n]=t[n]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,n){t=t||".";var i,r=[];return e.each(this.getParentList(!1,!0),function(e,t){i=""+(t.getIndex()+1),n&&(i=("0000000"+i).substr(-n)),r.push(i)}),r.join(t)},getKeyPath:function(e){var t=[],n=this.tree.options.keyPathSeparator;return this.visitParents(function(e){e.parent&&t.unshift(e.key)},!e),n+t.join(n)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=0,t=n.length-1;e<t;e++)if(n[e]===this)return n[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var n=[],i=t?this:this.parent;i;)(e||i.parent)&&n.unshift(i),i=i.parent;return n},getPrevSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=1,t=n.length;e<t;e++)if(n[e]===this)return n[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit(function(n){if(n.selected&&(t.push(n),!0===e))return"skip"}),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),n("info",arguments))},isActive:function(){return this.tree.activeNode===this},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var n=this.parent;n;){if(n===t)return!0;n===n.parent&&e.error("Recursive parent link: "+n),n=n.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,n=this.getParentList(!1,!1);for(e=0,t=n.length;e<t;e++)if(!n[e].expanded)return!1;return!0},lazyLoad:function(e){return this.warn("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."),this.load(e)},load:function(e){var n,i,r=this,s=this.isExpanded();return t(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(i=this.tree._triggerNodeEvent("lazyLoad",this))?o(this):(t("boolean"!=typeof i,"lazyLoad event must return source in data.result"),n=this.tree._callHook("nodeLoadChildren",this,i),s?(this.expanded=!0,n.always(function(){r.render()})):n.always(function(){r.renderStatus()}),n)):o(this)},makeVisible:function(t){var n,i=this,r=[],o=new e.Deferred,s=this.getParentList(!1,!1),a=s.length,l=!(t&&!0===t.noAnimation),d=!(t&&!1===t.scrollIntoView);for(n=a-1;n>=0;n--)r.push(s[n].setExpanded(!0,t));return e.when.apply(e,r).done(function(){d?i.scrollIntoView(l).done(function(){o.resolve()}):o.resolve()}),o.promise()},moveTo:function(n,i,r){void 0===i||"over"===i?i="child":"firstChild"===i&&(n.children&&n.children.length?(i="before",n=n.children[0]):i="child");var o,s=this.parent,a="child"===i?n:n.parent;if(this!==n){if(this.parent?a.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),a!==s&&s.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===a)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else t((o=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(o,1);if(this.parent=a,a.hasChildren())switch(i){case"child":a.children.push(this);break;case"before":t((o=e.inArray(n,a.children))>=0,"invalid target parent"),a.children.splice(o,0,this);break;case"after":t((o=e.inArray(n,a.children))>=0,"invalid target parent"),a.children.splice(o+1,0,this);break;default:e.error("Invalid mode "+i)}else a.children=[this];r&&n.visit(r,!0),a===s?a.triggerModifyChild("move",this):a.triggerModifyChild("add",this),this.tree!==n.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(e){e.tree=n.tree},!0)),s.isDescendantOf(a)||s.render(),a.isDescendantOf(s)||a===s||a.render()}},navigate:function(t,n){function i(i){if(i){try{i.makeVisible({scrollIntoView:!1})}catch(e){}return e(i.span).is(":visible")?!1===n?i.setFocus():i.setActive():(i.debug("Navigate: skipping hidden node"),void i.navigate(t,n))}}var r,s,a,l=e.ui.keyCode,d=null;switch(t){case l.BACKSPACE:this.parent&&this.parent.parent&&(a=i(this.parent));break;case l.HOME:this.tree.visit(function(t){if(e(t.span).is(":visible"))return a=i(t),!1});break;case l.END:this.tree.visit(function(t){e(t.span).is(":visible")&&(a=t)}),a&&(a=i(a));break;case l.LEFT:this.expanded?(this.setExpanded(!1),a=i(this)):this.parent&&this.parent.parent&&(a=i(this.parent));break;case l.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&(a=i(this.children[0])):(this.setExpanded(),a=i(this));break;case l.UP:for(d=this.getPrevSibling();d&&!e(d.span).is(":visible");)d=d.getPrevSibling();for(;d&&d.expanded&&d.children&&d.children.length;)d=d.children[d.children.length-1];!d&&this.parent&&this.parent.parent&&(d=this.parent),a=i(d);break;case l.DOWN:if(this.expanded&&this.children&&this.children.length)d=this.children[0];else for(r=(s=this.getParentList(!1,!0)).length-1;r>=0;r--){for(d=s[r].getNextSibling();d&&!e(d.span).is(":visible");)d=d.getNextSibling();if(d)break}a=i(d);break;default:!1}return a||o()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(n){var i,r=this.parent,o=e.inArray(this,r.children),s=this;return t(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(i=this.tree._callHook("nodeLoadChildren",this,n)).done(function(e){var t=s.children;for(f=0;f<t.length;f++)t[f].parent=r;r.children.splice.apply(r.children,[o+1,0].concat(t)),s.children=null,s.remove(),r.render()}).fail(function(){s.setExpanded()}),i},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,n){this.tree.timer&&clearTimeout(this.tree.timer),this.tree.timer=null;var i=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger expand"),i.setExpanded(!0)},n);break;case"activate":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger activate"),i.setActive(!0)},n);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(n,i){void 0!==i&&function(e){return!(!e.tree||void 0===e.statusNodeType)}(i)&&(this.warn("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead."),i={topNode:i});var r,s,a,l=e.extend({effects:!0===n?{duration:200,queue:!1}:n,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent||this.tree.$container,topNode:null},i),d=new e.Deferred,c=this,u=e(this.span).height(),h=e(l.scrollParent),f=l.scrollOfs.top||0,p=l.scrollOfs.bottom||0,g=h.height(),v=h.scrollTop(),y=h,b=h[0]===window,m=l.topNode||null,x=null;return e(this.span).is(":visible")?(b?(s=e(this.span).offset().top,r=m&&m.span?e(m.span).offset().top:0,y=e("html,body")):(t(h[0]!==document&&h[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),a=h.offset().top,s=e(this.span).offset().top-a+v,r=m?e(m.span).offset().top-a+v:0,g-=Math.max(0,h.innerHeight()-h[0].clientHeight)),s<v+f?x=s-f:s+u>v+g-p&&(x=s+u-g+p,m&&(t(m.isRootNode()||e(m.span).is(":visible"),"topNode must be visible"),r<x&&(x=r-f))),null!==x?l.effects?(l.effects.complete=function(){d.resolveWith(c)},y.stop(!0).animate({scrollTop:x},l.effects)):(y[0].scrollTop=x,d.resolveWith(this)):d.resolveWith(this),d.promise()):(this.warn("scrollIntoView(): node is invisible."),o())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,n){return this.tree._callHook("nodeSetStatus",this,e,t,n)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var n,i,r=this.children;if(r){if(e=e||function(e,t){var n=e.title.toLowerCase(),i=t.title.toLowerCase();return n===i?0:n>i?1:-1},r.sort(e),t)for(n=0,i=r.length;n<i;n++)r[n].children&&r[n].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,n){var i,r,o,s={},a=this;if(e.each(E,function(e,t){(a[t]||!1===a[t])&&(s[t]=a[t])}),e.isEmptyObject(this.data)||(s.data=e.extend({},this.data),e.isEmptyObject(s.data)&&delete s.data),n&&n(s,a),t&&this.hasChildren())for(s.children=[],i=0,r=this.children.length;i<r;i++)(o=this.children[i]).isStatusNode()||s.children.push(o.toDict(!0,n));return s},toggleClass:function(t,n){var i,r,o=t.match(/\S+/g)||[],s=0,a=!1,l=this[this.tree.statusClassPropName],d=" "+(this.extraClasses||"")+" ";for(l&&e(l).toggleClass(t,n);i=o[s++];)if(r=d.indexOf(" "+i+" ")>=0,n=void 0===n?!r:!!n)r||(d+=i+" ",a=!0);else for(;d.indexOf(" "+i+" ")>-1;)d=d.replace(" "+i+" "," ");return this.extraClasses=e.trim(d),a},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,n,i){var r,o=this.tree.options.modifyChild;o&&(n&&n.parent!==this&&e.error("childNode "+n+" is not a child of "+this),r={node:this,tree:this.tree,operation:t,childNode:n||null},i&&e.extend(r,i),o({type:"modifyChild"},r))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var n,i,r=!0,o=this.children;if(!0===t&&(!1===(r=e(this))||"skip"===r))return r;if(o)for(n=0,i=o.length;n<i&&!1!==(r=o[n].visit(e,!0));n++);return r},visitAndLoad:function(t,n,i){var r,s,a,l=this;return!t||!0!==n||!1!==(s=t(l))&&"skip"!==s?l.children||l.lazy?(r=new e.Deferred,a=[],l.load().done(function(){for(var n=0,i=l.children.length;n<i;n++){if(!1===(s=l.children[n].visitAndLoad(t,!0,!0))){r.reject();break}"skip"!==s&&a.push(s)}e.when.apply(this,a).then(function(){r.resolve()})}),r.promise()):o():i?s:o()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var n=this.parent;n;){if(!1===e(n))return!1;n=n.parent}return!0},visitSiblings:function(e,t){var n,i,r,o=this.parent.children;for(n=0,i=o.length;n<i;n++)if(r=o[n],(t||r!==this)&&!1===e(r))return!1;return!0},warn:function(e){Array.prototype.unshift.call(arguments,this.toString()),n("warn",arguments)}},h.prototype={_makeHookContext:function(t,n,i){var r,o;return void 0!==t.node?(n&&t.originalEvent!==n&&e.error("invalid args"),r=t):t.tree?r={node:t,tree:o=t.tree,widget:o.widget,options:o.widget.options,originalEvent:n,typeInfo:o.types[t.type]||{}}:t.widget?r={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:n}:e.error("invalid args"),i&&e.extend(r,i),r},_callHook:function(t,n,i){var r=this._makeHookContext(n),o=this[t],s=Array.prototype.slice.call(arguments,2);return e.isFunction(o)||e.error("_callHook('"+t+"') is not a function"),s.unshift(r),o.apply(this,s)},_setExpiringValue:function(e,t,n){this._tempCache[e]={value:t,expire:Date.now()+(+n||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_requireExtension:function(n,i,r,o){r=!!r;var s=this._local.name,a=this.options.extensions,l=e.inArray(n,a)<e.inArray(s,a),d=i&&null==this.ext[n],c=!d&&null!=r&&r!==l;return t(s&&s!==n,"invalid or same name"),!d&&!c||(o||(d||i?(o="'"+s+"' extension requires '"+n+"'",c&&(o+=" to be registered "+(r?"before":"after")+" itself")):o="If used together, `"+n+"` must be registered "+(r?"before":"after")+" `"+s+"`"),e.error(o),!1)},activateKey:function(e){var t=this.getNodeByKey(e);return t?t.setActive():this.activeNode&&this.activeNode.setActive(!1),t},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyPatch:function(n){var i,r,o,s,l,d,c=n.length,u=[];for(r=0;r<c;r++)t(2===(o=n[r]).length,"patchList must be an array of length-2-arrays"),s=o[0],l=o[1],(d=null===s?this.rootNode:this.getNodeByKey(s))?(i=new e.Deferred,u.push(i),d.applyPatch(l).always(a(i,d))):this.warn("could not find node with key '"+s+"'");return e.when.apply(e,u).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),n("log",arguments))},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){Array.prototype.unshift.call(arguments,this.toString()),n("error",arguments)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(t,n,i){t="string"==typeof t?function(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}(t):t;var r=null,o=(n=n||this.getFirstChild()).parent.children,s=null,a=function(e,t,n){var i,r,o=e.children,s=o.length,l=o[t];if(l&&!1===n(l))return!1;if(l&&l.children&&l.expanded&&!1===a(l,0,n))return!1;for(i=t+1;i<s;i++)if(!1===a(e,i,n))return!1;return(r=e.parent)?a(r,r.children.indexOf(e)+1,n):a(e,0,n)};return a(n.parent,o.indexOf(n),function(i){if(i===r)return!1;r=r||i;{if(e(i.span).is(":visible"))return(!t(i)||(s=i)===n)&&void 0;i.debug("quicksearch: skipping hidden node")}}),s},generateFormElements:function(t,n,i){function r(t){d.append(e("<input>",{type:"checkbox",name:s,value:t.key,checked:!0}))}i=i||{};var o,s="string"==typeof t?t:"ft_"+this._id+"[]",a="string"==typeof n?n:"ft_"+this._id+"_active",l="fancytree_result_"+this._id,d=e("#"+l),c=3===this.options.selectMode&&!1!==i.stopOnParents;d.length?d.empty():d=e("<div>",{id:l}).hide().insertAfter(this.$container),!1!==n&&this.activeNode&&d.append(e("<input>",{type:"radio",name:a,value:this.activeNode.key,checked:!0})),i.filter?this.visit(function(e){var t=i.filter(e);if("skip"===t)return t;!1!==t&&r(e)}):!1!==t&&(o=this.getSelectedNodes(c),e.each(o,function(e,t){r(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getNodeByKey:function(e,t){var n,i;return!t&&(n=document.getElementById(this.options.idPrefix+e))?n.ftnode?n.ftnode:null:(t=t||this.rootNode,i=null,t.visit(function(t){if(t.key===e)return i=t,!1},!0),i)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),n("info",arguments))},loadKeyPath:function(t,n){var i,r,o,s=this,a=new e.Deferred,l=this.getRootNode(),d=this.options.keyPathSeparator,c=[],u=e.extend({},n);for("function"==typeof n?i=n:n&&n.callback&&(i=n.callback),u.callback=function(e,t,n){i&&i.call(e,t,n),a.notifyWith(e,[{node:t,status:n}])},null==u.matchKey&&(u.matchKey=function(e,t){return e.key===t}),e.isArray(t)||(t=[t]),r=0;r<t.length;r++)(o=t[r]).charAt(0)===d&&(o=o.substr(1)),c.push(o.split(d));return setTimeout(function(){s._loadKeyPathImpl(a,u,l,c).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(t,n,i,r){function o(e,t){var i,r,o=e.children;if(o)for(i=0,r=o.length;i<r;i++)if(n.matchKey(o[i],t))return o[i];return null}function s(e,t,i){n.callback(v,t,"loading"),t.load().done(function(){v._loadKeyPathImpl.call(v,e,n,t,i).always(a(e,v))}).fail(function(i){v.warn("loadKeyPath: error loading lazy "+t),n.callback(v,u,"error"),e.rejectWith(v)})}var l,d,c,u,h,f,p,g,v=this;for(h={},d=0;d<r.length;d++)for(p=r[d],f=i;p.length;){if(c=p.shift(),!(u=o(f,c))){this.warn("loadKeyPath: key not found: "+c+" (parent: "+f+")"),n.callback(this,c,"error");break}if(0===p.length){n.callback(this,u,"ok");break}if(u.lazy&&void 0===u.hasChildren()){n.callback(this,u,"loaded"),h[c=u.key]?h[c].pathSegList.push(p):h[c]={parent:u,pathSegList:[p]};break}n.callback(this,u,"loaded"),f=u}l=[];for(var y in h){var b=h[y];g=new e.Deferred,l.push(g),s(g,b.parent,b.pathSegList)}return e.when.apply(e,l).promise()},reactivate:function(e){var t,n=this.activeNode;return n?(this.activeNode=null,t=n.setActive(!0,{noFocus:!0}),e&&n.setFocus(),t):o()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},toDict:function(e,t){var n=this.rootNode.toDict(!0,t);return e?n:n.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,n,i){var r=this._makeHookContext(t,n,i),o=this.widget._trigger(e,n,r);return!1!==o&&void 0!==r.result?r.result:o},_triggerTreeEvent:function(e,t,n){var i=this._makeHookContext(this,t,n),r=this.widget._trigger(e,t,i);return!1!==r&&void 0!==i.result?i.result:r},visit:function(e){return this.rootNode.visit(e,!1)},warn:function(e){Array.prototype.unshift.call(arguments,this.toString()),n("warn",arguments)}},e.extend(h.prototype,{nodeClick:function(e){var t,n,i=e.targetType,r=e.node;if("expander"===i){if(r.isLoading())return void r.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===i)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(n=!1,t=!0,r.folder)switch(e.options.clickFolderMode){case 2:n=!0,t=!1;break;case 3:t=!0,n=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,i,r,o=e.node;if(o.parent)for(i=0,r=(n=o.parent.children).length;i<r;i++)n[i]!==o&&n[i].expanded&&this._callHook("nodeSetExpanded",n[i],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var n,i,r,o=t.originalEvent,s=t.node,a=t.tree,l=t.options,d=o.which,c=String.fromCharCode(d),u=!(o.altKey||o.ctrlKey||o.metaKey||o.shiftKey),h=e(o.target),f=!0,p=!(o.ctrlKey||!l.autoActivate);if(s||(r=this.getActiveNode()||this.getFirstChild())&&(r.setFocus(),(s=t.node=this.focusNode).debug("Keydown force focus on active node")),l.quicksearch&&u&&/\w/.test(c)&&!N[d]&&!h.is(":input:enabled"))return(i=(new Date).getTime())-a.lastQuicksearchTime>500&&(a.lastQuicksearchTerm=""),a.lastQuicksearchTime=i,a.lastQuicksearchTerm+=c,(n=a.findNextNode(a.lastQuicksearchTerm,a.getActiveNode()))&&n.setActive(),void o.preventDefault();switch(g.eventToString(o)){case"+":case"=":a.nodeSetExpanded(t,!0);break;case"-":a.nodeSetExpanded(t,!1);break;case"space":s.isPagingNode()?a._triggerNodeEvent("clickPaging",t,o):g.evalOption("checkbox",s,s,l,!1)?a.nodeToggleSelected(t):a.nodeSetActive(t,!0);break;case"return":a.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":s.navigate(o.which,p,!0);break;default:f=!1}f&&o.preventDefault()},nodeLoadChildren:function(n,i){var r,o,s,a=n.tree,l=n.node,d=(new Date).getTime();if(e.isFunction(i)&&(i=i.call(a,{type:"source"},n),t(!e.isFunction(i),"source callback must not return another function")),i.url&&(l._requestId&&l.warn("Recursive load request #"+d+" while #"+l._requestId+" is pending."),r=e.extend({},n.options.ajax,i),l._requestId=d,r.debugDelay?(o=r.debugDelay,e.isArray(o)&&(o=o[0]+Math.random()*(o[1]-o[0])),l.warn("nodeLoadChildren waiting debugDelay "+Math.round(o)+" ms ..."),r.debugDelay=!1,s=e.Deferred(function(t){setTimeout(function(){e.ajax(r).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},o)})):s=e.ajax(r),i=new e.Deferred,s.done(function(t,r,o){var s,c;if("json"!==this.dataType&&"jsonp"!==this.dataType||"string"!=typeof t||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),l._requestId&&l._requestId>d)i.rejectWith(this,[m]);else{if(n.options.postProcess){try{c=a._triggerNodeEvent("postProcess",n,n.originalEvent,{response:t,error:null,dataType:this.dataType})}catch(e){c={error:e,message:""+e,details:"postProcess failed"}}if(c.error)return s=e.isPlainObject(c.error)?c.error:{message:c.error},s=a._makeHookContext(l,null,s),void i.rejectWith(this,[s]);t=e.isArray(c)?c:t}else t&&t.hasOwnProperty("d")&&n.options.enableAspx&&(t="string"==typeof t.d?e.parseJSON(t.d):t.d);i.resolveWith(this,[t])}}).fail(function(e,t,n){var r=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});i.rejectWith(this,[r])})),e.isFunction(i.then)&&e.isFunction(i.catch)&&(s=i,i=new e.Deferred,s.then(function(e){i.resolve(e)},function(e){i.reject(e)})),e.isFunction(i.promise))a.nodeSetStatus(n,"loading"),i.done(function(e){a.nodeSetStatus(n,"ok"),l._requestId=null}).fail(function(e){var t;e!==m?(e.node&&e.error&&e.message?t=e:"[object Object]"===(t=a._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(t.message=""),l.warn("Load children failed ("+t.message+")",t),!1!==a._triggerNodeEvent("loadError",t,null)&&a.nodeSetStatus(n,"error",t.message,t.details)):l.warn("Ignored response for obsolete load request #"+d+" (expected #"+l._requestId+")")});else if(n.options.postProcess){var c=a._triggerNodeEvent("postProcess",n,n.originalEvent,{response:i,error:null,dataType:typeof i});i=e.isArray(c)?c:i}return e.when(i).done(function(n){var i;e.isPlainObject(n)&&(t(l.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),t(e.isArray(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=n,n=n.children,delete i.children,e.each(w,function(e,t){void 0!==i[t]&&(a[t]=i[t],delete i[t])}),e.extend(a.data,i)),t(e.isArray(n),"expected array of children"),l._setChildren(n),a._triggerNodeEvent("loadChildren",l)})},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(n,i){var r,o=n.node,s=e.extend({},n,{node:i}),a=o.children;if(1===a.length)return t(i===a[0],"invalid single child"),this.nodeRemoveChildren(n);this.activeNode&&(i===this.activeNode||this.activeNode.isDescendantOf(i))&&this.activeNode.setActive(!1),this.focusNode&&(i===this.focusNode||this.focusNode.isDescendantOf(i))&&(this.focusNode=null),this.nodeRemoveMarkup(s),this.nodeRemoveChildren(s),t((r=e.inArray(i,a))>=0,"invalid child"),o.triggerModifyChild("remove",i),i.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,i),a.splice(r,1)},nodeRemoveChildMarkup:function(t){var n=t.node;n.ul&&(n.isRootNode()?e(n.ul).empty():(e(n.ul).remove(),n.ul=null),n.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(t){var n=t.tree,i=t.node;i.children&&(this.activeNode&&this.activeNode.isDescendantOf(i)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(i)&&(this.focusNode=null),this.nodeRemoveChildMarkup(t),e.extend({},t),i.triggerModifyChild("remove",null),i.visit(function(e){e.parent=null,n._callHook("treeRegisterNode",n,!1,e)}),i.lazy?i.children=[]:i.children=null,i.isRootNode()||(i.expanded=!1),this.nodeRenderStatus(t))},nodeRemoveMarkup:function(t){var n=t.node;n.li&&(e(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(n,i,r,o,s){var a,l,d,c,u,h,f,p=n.node,g=n.tree,v=n.options,y=v.aria,b=!1,m=p.parent,x=!m,k=p.children,N=null;if(!1!==g._enableUpdate&&(x||m.ul)){if(t(x||m.ul,"parent UL must exist"),x||(p.li&&(i||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?N=p.li.nextSibling:this.debug("Unlinking "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(n)),p.li?this.nodeRenderStatus(n):(b=!0,p.li=document.createElement("li"),p.li.ftnode=p,p.key&&v.generateIds&&(p.li.id=v.idPrefix+p.key),p.span=document.createElement("span"),p.span.className="fancytree-node",y&&!p.tr&&e(p.li).attr("role","treeitem"),p.li.appendChild(p.span),this.nodeRenderTitle(n),v.createNode&&v.createNode.call(g,{type:"createNode"},n)),v.renderNode&&v.renderNode.call(g,{type:"renderNode"},n)),k){if(x||p.expanded||!0===r){for(p.ul||(p.ul=document.createElement("ul"),(!0!==o||s)&&p.expanded||(p.ul.style.display="none"),y&&e(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),c=0,u=k.length;c<u;c++)f=e.extend({},n,{node:k[c]}),this.nodeRender(f,i,r,!1,!0);for(a=p.ul.firstChild;a;)(d=a.ftnode)&&d.parent!==p?(p.debug("_fixParent: remove missing "+d,a),h=a.nextSibling,a.parentNode.removeChild(a),a=h):a=a.nextSibling;for(a=p.ul.firstChild,c=0,u=k.length-1;c<u;c++)(l=k[c])!==(d=a.ftnode)?p.ul.insertBefore(l.li,d.li):a=a.nextSibling}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(n));x||b&&m.ul.insertBefore(p.li,N)}},nodeRenderTitle:function(t,n){var i,r,o,s,a,l,c,u=t.node,h=t.tree,f=t.options,p=f.aria,y=u.getLevel(),b=[];void 0!==n&&(u.title=n),u.span&&!1!==h._enableUpdate&&(a=p&&!1!==u.hasChildren()?" role='button'":"",y<f.minExpandLevel?(u.lazy||(u.expanded=!0),y>1&&b.push("<span "+a+" class='fancytree-expander fancytree-expander-fixed'></span>")):b.push("<span "+a+" class='fancytree-expander'></span>"),(i=g.evalOption("checkbox",u,u,f,!1))&&!u.isStatusNode()&&(a=p?" role='checkbox'":"",r="fancytree-checkbox",("radio"===i||u.parent&&u.parent.radiogroup)&&(r+=" fancytree-radio"),b.push("<span "+a+" class='"+r+"'></span>")),void 0!==u.data.iconClass&&(u.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(u.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),u.icon=u.data.iconClass)),!1!==(o=g.evalOption("icon",u,u,f,!0))&&(a=p?" role='presentation'":"",c=(c=g.evalOption("iconTooltip",u,u,f,null))?" title='"+d(c)+"'":"","string"==typeof o?v.test(o)?(o="/"===o.charAt(0)?o:(f.imagePath||"")+o,b.push("<img src='"+o+"' class='fancytree-icon'"+c+" alt='' />")):b.push("<span "+a+" class='fancytree-custom-icon "+o+"'"+c+"></span>"):o.text?b.push("<span "+a+" class='fancytree-custom-icon "+(o.addClass||"")+"'"+c+">"+o.text+"</span>"):b.push("<span "+a+" class='fancytree-icon'"+c+"></span>")),s="",f.renderTitle&&(s=f.renderTitle.call(h,{type:"renderTitle"},t)||""),s||(!0===(l=g.evalOption("tooltip",u,u,f,null))&&(l=u.title),s="<span class='fancytree-title'"+(l=l?" title='"+d(l)+"'":"")+(f.titlesTabbable?" tabindex='0'":"")+">"+(f.escapeTitles?g.escapeHtml(u.title):u.title)+"</span>"),b.push(s),u.span.innerHTML=b.join(""),this.nodeRenderStatus(t),f.enhanceTitle&&(t.$title=e(">span.fancytree-title",u.span),s=f.enhanceTitle.call(h,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n,i=t.node,r=t.tree,o=t.options,s=i.hasChildren(),a=i.isLastSibling(),l=o.aria,d=o._classNames,c=[],u=i[r.statusClassPropName];u&&!1!==r._enableUpdate&&(l&&(n=e(i.tr||i.li)),c.push(d.node),r.activeNode===i&&c.push(d.active),r.focusNode===i&&c.push(d.focused),i.expanded&&c.push(d.expanded),l&&(!1!==s?n.attr("aria-expanded",Boolean(i.expanded)):n.removeAttr("aria-expanded")),i.folder&&c.push(d.folder),!1!==s&&c.push(d.hasChildren),a&&c.push(d.lastsib),i.lazy&&null==i.children&&c.push(d.lazy),i.partload&&c.push(d.partload),i.partsel&&c.push(d.partsel),g.evalOption("unselectable",i,i,o,!1)&&c.push(d.unselectable),i._isLoading&&c.push(d.loading),i._error&&c.push(d.error),i.statusNodeType&&c.push(d.statusNodePrefix+i.statusNodeType),i.selected?(c.push(d.selected),l&&n.attr("aria-selected",!0)):l&&n.attr("aria-selected",!1),i.extraClasses&&c.push(i.extraClasses),!1===s?c.push(d.combinedExpanderPrefix+"n"+(a?"l":"")):c.push(d.combinedExpanderPrefix+(i.expanded?"e":"c")+(i.lazy&&null==i.children?"d":"")+(a?"l":"")),c.push(d.combinedIconPrefix+(i.expanded?"e":"c")+(i.folder?"f":"")),u.className=c.join(" "),i.li&&e(i.li).toggleClass(d.lastsib,a))},nodeSetActive:function(n,i,r){r=r||{};var a,l=n.node,d=n.tree,c=n.options,u=!0===r.noEvents,h=!0===r.noFocus;return i=!1!==i,l===d.activeNode===i?o(l):i&&!u&&!1===this._triggerNodeEvent("beforeActivate",l,n.originalEvent)?s(l,["rejected"]):(i?(d.activeNode&&(t(d.activeNode!==l,"node was active (inconsistency)"),a=e.extend({},n,{node:d.activeNode}),d.nodeSetActive(a,!1),t(null===d.activeNode,"deactivate was out of sync?")),c.activeVisible&&l.makeVisible({scrollIntoView:h&&null==d.focusNode}),d.activeNode=l,d.nodeRenderStatus(n),h||d.nodeSetFocus(n),u||d._triggerNodeEvent("activate",l,n.originalEvent)):(t(d.activeNode===l,"node was not active (inconsistency)"),d.activeNode=null,this.nodeRenderStatus(n),u||n.tree._triggerNodeEvent("deactivate",l,n.originalEvent)),o(l))},nodeSetExpanded:function(t,n,i){i=i||{};var r,a,l,d,c,u,h=t.node,f=t.tree,p=t.options,g=!0===i.noAnimation,v=!0===i.noEvents;if(n=!1!==n,h.expanded&&n||!h.expanded&&!n)return o(h);if(n&&!h.lazy&&!h.hasChildren())return o(h);if(!n&&h.getLevel()<p.minExpandLevel)return s(h,["locked"]);if(!v&&!1===this._triggerNodeEvent("beforeExpand",h,t.originalEvent))return s(h,["rejected"]);if(g||h.isVisible()||(g=i.noAnimation=!0),a=new e.Deferred,n&&!h.expanded&&p.autoCollapse){c=h.getParentList(!1,!0),u=p.autoCollapse;try{for(p.autoCollapse=!1,l=0,d=c.length;l<d;l++)this._callHook("nodeCollapseSiblings",c[l],i)}finally{p.autoCollapse=u}}return a.done(function(){var e=h.getLastChild();n&&p.autoScroll&&!g&&e?e.scrollIntoView(!0,{topNode:h}).always(function(){v||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}):v||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}),r=function(i){var r,o,s=p._classNames,a=p.toggleEffect;if(h.expanded=n,f._callHook("nodeRender",t,!1,!1,!0),h.ul)if(r="none"!==h.ul.style.display,o=!!h.expanded,r===o)h.warn("nodeSetExpanded: UL.style.display already set");else{if(a&&!g)return e(h.li).addClass(s.animating),void e(h.ul).addClass(s.animating).toggle(a.effect,a.options,a.duration,function(){e(this).removeClass(s.animating),e(h.li).removeClass(s.animating),i()});h.ul.style.display=h.expanded||!parent?"":"none"}i()},n&&h.lazy&&void 0===h.hasChildren()?h.load().done(function(){a.notifyWith&&a.notifyWith(h,["loaded"]),r(function(){a.resolveWith(h)})}).fail(function(e){r(function(){a.rejectWith(h,["load failed ("+e+")"])})}):r(function(){a.resolveWith(h)}),a.promise()},nodeSetFocus:function(t,n){var i,r=t.tree,o=t.node,s=r.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(n=!1!==n,r.focusNode){if(r.focusNode===o&&n)return;i=e.extend({},t,{node:r.focusNode}),r.focusNode=null,this._triggerNodeEvent("blur",i),this._callHook("nodeRenderStatus",i)}n&&(this.hasFocus()||(o.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),o.makeVisible({scrollIntoView:!1}),r.focusNode=o,s.titlesTabbable?a||e(o.span).find(".fancytree-title").focus():0===e(document.activeElement).closest(".fancytree-container").length&&e(r.$container).focus(),s.aria&&e(r.$container).attr("aria-activedescendant",e(o.tr||o.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),s.autoScroll&&o.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,n){n=n||{};var i=e.node,r=e.tree,o=e.options,s=!0===n.noEvents,a=i.parent;if(t=!1!==t,!g.evalOption("unselectable",i,i,o,!1)){if(i._lastSelectIntent=t,!!i.selected===t&&(3!==o.selectMode||!i.partsel||t))return t;if(!s&&!1===this._triggerNodeEvent("beforeSelect",i,e.originalEvent))return!!i.selected;t&&1===o.selectMode?(r.lastSelectedNode&&r.lastSelectedNode.setSelected(!1),i.selected=t):3!==o.selectMode||!a||a.radiogroup||i.radiogroup?a&&a.radiogroup?i.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===i)},!0):i.selected=t:(i.selected=t,i.fixSelection3AfterClick(n)),this.nodeRenderStatus(e),r.lastSelectedNode=t?i:null,s||r._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,n,i,r){function o(t,n){var i=s.children?s.children[0]:null;return i&&i.isStatusNode()?(e.extend(i,t),i.statusNodeType=n,a._callHook("nodeRenderTitle",i)):(s._setChildren([t]),s.children[0].statusNodeType=n,a.render()),s.children[0]}var s=t.node,a=t.tree;switch(n){case"ok":!function(){var e=s.children?s.children[0]:null;if(e&&e.isStatusNode()){try{s.ul&&(s.ul.removeChild(e.li),e.li=null)}catch(e){}1===s.children.length?s.children=[]:s.children.shift()}}(),s._isLoading=!1,s._error=null,s.renderStatus();break;case"loading":s.parent||o({title:a.options.strings.loading+(i?" ("+i+")":""),checkbox:!1,tooltip:r},n),s._isLoading=!0,s._error=null,s.renderStatus();break;case"error":o({title:a.options.strings.loadError+(i?" ("+i+")":""),checkbox:!1,tooltip:r},n),s._isLoading=!1,s._error={message:i,details:r},s.renderStatus();break;case"nodata":o({title:a.options.strings.noData,checkbox:!1,tooltip:r},n),s._isLoading=!1,s._error=null,s.renderStatus();break;default:e.error("invalid node status "+n)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,n=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(n=!1,t.selected=!0),t._lastSelectIntent=n,this.nodeSetSelected(e,n)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden")},treeInit:function(t){var n=t.tree,i=n.options;n.$container.attr("tabindex",i.tabindex),e.each(w,function(e,t){void 0!==i[t]&&(n.info("Move option "+t+" to tree"),n[t]=i[t],delete i[t])}),i.rtl?n.$container.attr("DIR","RTL").addClass("fancytree-rtl"):n.$container.removeAttr("DIR").removeClass("fancytree-rtl"),i.aria&&(n.$container.attr("role","tree"),1!==i.selectMode&&n.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(n,i){var r,o,s,a=n.tree,d=n.widget.element,c=e.extend({},n,{node:this.rootNode});if(a.rootNode.children&&this.treeClear(n),i=i||this.options.source)"string"==typeof i&&e.error("Not implemented");else switch(o=d.data("type")||"html"){case"html":(s=d.find(">ul:first")).addClass("ui-fancytree-source ui-helper-hidden"),i=e.ui.fancytree.parseHtml(s),this.data=e.extend(this.data,l(s));break;case"json":i=e.parseJSON(d.text()),d.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(i)&&(t(e.isArray(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),r=i,i=i.children,delete r.children,e.each(w,function(e,t){void 0!==r[t]&&(a[t]=r[t],delete r[t])}),e.extend(a.data,r));break;default:e.error("Invalid data-type: "+o)}return this.nodeLoadChildren(c,i).done(function(){a.render(),3===n.options.selectMode&&a.rootNode.fixSelection3FromEndNodes(),a.activeNode&&a.options.activeVisible&&a.activeNode.makeVisible(),a._triggerTreeEvent("init",null,{status:!0})}).fail(function(){a.render(),a._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){},treeSetFocus:function(t,n,i){var r;(n=!1!==n)!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&(r=this._lastMousedownNode||this.getFirstChild())&&r.setFocus())},treeSetOption:function(t,n,i){var r=t.tree,o=!0,s=!1,a=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":s=!0,a=!0;break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===i?r.$container.removeAttr("DIR").removeClass("fancytree-rtl"):r.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":o=!1,r._callHook("treeLoad",r,i),a=!0}r.debug("set option "+n+"="+i+" <"+typeof i+">"),o&&(this.widget._super?this.widget._super.call(this.widget,n,i):e.Widget.prototype._setOption.call(this.widget,n,i)),s&&r._callHook("treeCreate",r),a&&r.render(!0,!1)}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,debugLevel:null,disabled:!1,enableAspx:!0,escapeTitles:!1,extensions:[],toggleEffect:{effect:"blind",options:{direction:"vertical",scale:"box"},duration:200},generateIds:!1,icon:!0,idPrefix:"ft_",focusOnSelect:!1,keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,tooltip:!1,_classNames:{node:"fancytree-node",folder:"fancytree-folder",animating:"fancytree-animating",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",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",unselectable:"fancytree-unselectable",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error",statusNodePrefix:"fancytree-statusnode-"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new h(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var n,i,o,s=this.options,a=s.extensions;this.tree;for(o=0;o<a.length;o++)i=a[o],(n=e.ui.fancytree._extensions[i])||e.error("Could not apply extension '"+i+"' (it is not registered, did you forget to include it?)"),this.tree.options[i]=e.extend(!0,{},n.options,this.tree.options[i]),t(void 0===this.tree.ext[i],"Extension name must not exist as Fancytree.ext attribute: '"+i+"'"),this.tree.ext[i]={},r(this.tree,0,n,i),n;void 0!==s.icons&&(!0!==s.icon?e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),s.icon=s.icons)),void 0!==s.iconClass&&(s.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),s.icon=s.iconClass)),void 0!==s.tabbable&&(s.tabindex=s.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+s.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree),e.Widget.prototype.destroy.call(this)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,n=this.options,i=this.tree,r=i._ns;this._unbind(),i.$container.on("focusin"+r+" focusout"+r,function(t){var n=g.getNode(t),r="focusin"===t.type;r&&i._getExpiringValue("focusin")?g.info("Ignored double focusin."):(i._setExpiringValue("focusin",!0,50),r&&!n&&(n=i._getExpiringValue("mouseDownNode"))&&g.info("Reconstruct mouse target for focusin from recent event."),n?i._callHook("nodeSetFocus",i._makeHookContext(n,t),r):i.tbody&&e(t.target).parents("table.fancytree-container > thead").length?i.debug("Ignore focus event outside table body.",t):i._callHook("treeSetFocus",i,r))}).on("selectstart"+r,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+r,function(e){if(n.disabled||!1===n.keyboard)return!0;var t,r=i.focusNode,o=i._makeHookContext(r||i,e),s=i.phase;try{return i.phase="userEvent","preventNav"===(t=r?i._triggerNodeEvent("keydown",r,e):i._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=i._callHook("nodeKeydown",o)),t}finally{i.phase=s}}).on("mousedown"+r,function(e){var t=g.getEventTarget(e);i._lastMousedownNode=t?t.node:null,i._setExpiringValue("mouseDownNode",i._lastMousedownNode)}).on("click"+r+" dblclick"+r,function(e){if(n.disabled)return!0;var i,r=g.getEventTarget(e),o=r.node,s=t.tree,a=s.phase;if(!o)return!0;i=s._makeHookContext(o,e);try{switch(s.phase="userEvent",e.type){case"click":return i.targetType=r.type,o.isPagingNode()?!0===s._triggerNodeEvent("clickPaging",i,e):!1!==s._triggerNodeEvent("click",i,e)&&s._callHook("nodeClick",i);case"dblclick":return i.targetType=r.type,!1!==s._triggerNodeEvent("dblclick",i,e)&&s._callHook("nodeDblclick",i)}}finally{s.phase=a}})},getActiveNode:function(){return this.tree.activeNode},getNodeByKey:function(e){return this.tree.getNodeByKey(e)},getRootNode:function(){return this.tree.rootNode},getTree:function(){return this.tree}}),g=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.27.0",buildType: "production",debugLevel: 1,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:h,_FancytreeNodeClass:u,jquerySupports:{positionMyOfs:function(t,n,i,r){var o,s,a,l=e.map(e.trim(t).split("."),function(e){return parseInt(e,10)}),d=e.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)});for(o=0;o<d.length;o++)if(s=l[o]||0,a=d[o]||0,s!==a)return s>a;return!0}(e.ui.version,1,9)},assert:function(e,n){return t(e,n)},createTree:function(t,n){return e(t).fancytree(n).fancytree("getTree")},debounce:function(e,t,n,i){var r;return 3===arguments.length&&"boolean"!=typeof n&&(i=n,n=!1),function(){var o=arguments;i=i||this,n&&!r&&t.apply(i,o),clearTimeout(r),r=setTimeout(function(){n||t.apply(i,o),r=null},e)}},debug:function(t){e.ui.fancytree.debugLevel>=2&&n("log",arguments)},error:function(e){n("error",arguments)},escapeHtml:function(e){return(""+e).replace(y,function(e){return x[e]})},fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),r=(n[2]?+n[2]:0)+(i[2]?+i[2]:0),o=(n[4]?+n[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:n[1]+" "+n[3],at:i[1]+" "+i[3]}),(r||o)&&(t.offset=r+" "+o)}return t},getEventTarget:function(t){var n=t&&t.target?t.target.className:"",i={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(n)?i.type="title":/\bfancytree-expander\b/.test(n)?i.type=!1===i.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(n)?i.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(n)?i.type="icon":/\bfancytree-node\b/.test(n)?i.type="title":t&&e(t.target).is("ul[role=group]")?(g.info("Ignoring click on outer UL."),i.node=null):t&&t.target&&e(t.target).closest(".fancytree-title").length&&(i.type="title"),i},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof u)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var n;return t instanceof h?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?t=e(t).eq(0):void 0!==t.selector?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),t=t.closest(":ui-fancytree"),(n=t.data("ui-fancytree")||t.data("fancytree"))?n.tree:null)},evalOption:function(t,n,i,r,o){var s,a,l=n.tree,d=r[t],c=i[t];return e.isFunction(d)?(s={node:n,tree:l,widget:l.widget,options:l.widget.options,typeInfo:l.types[n.type]||{}},null==(a=d.call(l,{type:t},s))&&(a=c)):a=null!=c?c:d,null==a&&(a=o),a},setSpanIcon:function(t,n,i){var r=e(t);"string"==typeof i?r.attr("class",n+" "+i):(i.text&&r.text(""+i.text),r.attr("class",n+" "+(i.addClass||"")))},eventToString:function(e){var t=e.which,n=e.type,i=[];return e.altKey&&i.push("alt"),e.ctrlKey&&i.push("ctrl"),e.metaKey&&i.push("meta"),e.shiftKey&&i.push("shift"),"click"===n||"dblclick"===n?i.push(_[e.button]+n):k[t]||i.push(N[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=1&&n("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,n,i){var r,o=t[n]||e.noop;t[n]=function(){try{return r=this._super,this._super=o,i.apply(this,arguments)}finally{this._super=r}}},parseHtml:function(t){var n,i,r,o,s,a,d,c,u=[];return t.find(">li").each(function(){var h,f,p=e(this),g=p.find(">span:first",this),v=g.length?null:p.find(">a:first"),y={tooltip:null,data:{}};for(g.length?y.title=g.html():v&&v.length?(y.title=v.html(),y.data.href=v.attr("href"),y.data.target=v.attr("target"),y.tooltip=v.attr("title")):(y.title=p.html(),(s=y.title.search(/<ul/i))>=0&&(y.title=y.title.substring(0,s))),y.title=e.trim(y.title),o=0,a=C.length;o<a;o++)y[C[o]]=void 0;for(n=this.className.split(" "),r=[],o=0,a=n.length;o<a;o++)i=n[o],S[i]?y[i]=!0:r.push(i);if(y.extraClasses=r.join(" "),(d=p.attr("title"))&&(y.tooltip=d),(d=p.attr("id"))&&(y.key=d),p.attr("hideCheckbox")&&(y.checkbox=!1),(h=l(p))&&!e.isEmptyObject(h)){for(f in L)h.hasOwnProperty(f)&&(h[L[f]]=h[f],delete h[f]);for(o=0,a=E.length;o<a;o++)d=E[o],null!=(c=h[d])&&(delete h[d],y[d]=c);e.extend(y.data,h)}(t=p.find(">ul:first")).length?y.children=e.ui.fancytree.parseHtml(t):y.children=y.lazy?void 0:null,u.push(y)}),u},registerExtension:function(n){t(null!=n.name,"extensions must have a `name` property."),t(null!=n.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[n.name]=n},unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(e){n("warn",arguments)}}),e.ui.fancytree}e.ui.fancytree.warn("Fancytree: ignored duplicate include")}});

@@ -15,4 +15,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -30,3 +30,3 @@

// Node/CommonJS
require( "jquery.fancytree.table" ); // core + table
require( "./jquery.fancytree.table" ); // core + table
module.exports = factory( require( "jquery" ) );

@@ -275,3 +275,3 @@ } else {

name: "ariagrid",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -278,0 +278,0 @@ options: {

@@ -22,4 +22,4 @@ // Extending Fancytree

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -38,3 +38,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -143,3 +143,3 @@ } else {

// Version information should be compliant with [semver](http://semver.org)
version: "2.26.0",
version: "2.27.0",

@@ -146,0 +146,0 @@ // Extension specific options and their defaults.

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -360,3 +360,3 @@ } else {

name: "clones",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -363,0 +363,0 @@ options: {

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -59,3 +59,3 @@ } else {

name: "columnview",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -62,0 +62,0 @@ options: {

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -53,3 +53,3 @@ } else {

name: "debug",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -56,0 +56,0 @@ options: {

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -28,3 +28,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -212,3 +212,3 @@ } else {

$helper.find(".fancytree-drag-helper-img")
.addClass(glyph.map.dragHelper);
.addClass(glyph.map._addClass + " " + glyph.map.dragHelper);
}

@@ -271,3 +271,3 @@ // Allow to modify the helper, e.g. to add multi-node-drag feedback

name: "dnd",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -341,5 +341,4 @@ options: {

if( glyphOpt ) {
// instData.$dropMarker.addClass(glyph.map.dragHelper);
instData.$dropMarker
.addClass(glyphOpt.map.dropMarker);
.addClass(glyphOpt.map._addClass + " " + glyphOpt.map.dropMarker);
}

@@ -346,0 +345,0 @@ }

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -37,3 +37,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -52,3 +52,3 @@ } else {

*/
var
var FT = $.ui.fancytree,
classDragSource = "fancytree-drag-source",

@@ -251,3 +251,3 @@ classDragRemove = "fancytree-drag-remove",

.show()
.position($.ui.fancytree.fixPositionOptions({
.position(FT.fixPositionOptions({
my: "left" + offsetString(markerOffsetX) + " center",

@@ -280,3 +280,3 @@ at: "left " + markerAt,

name: "dnd5",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -313,3 +313,3 @@ options: {

dndOpts = opts.dnd5,
getNode = $.ui.fancytree.getNode;
getNode = FT.getNode;

@@ -326,3 +326,3 @@ if( $.inArray("dnd", opts.extensions) >= 0 ) {

if( dndOpts.dragStart ) {
$.ui.fancytree.overrideMethod(ctx.options, "createNode", function(event, data) {
FT.overrideMethod(ctx.options, "createNode", function(event, data) {
// Default processing if any

@@ -355,3 +355,4 @@ this._super.apply(this, arguments);

if( glyph ) {
$dropMarker.addClass(glyph.map.dropMarker);
FT.setSpanIcon($dropMarker[0], glyph.map._addClass, glyph.map.dropMarker);
// $dropMarker.addClass(glyph.map._addClass + " " + glyph.map.dropMarker);
}

@@ -358,0 +359,0 @@ }

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -152,3 +152,3 @@ } else {

} else if( eventData.isNew ) {
// In create mode, we save everyting, except for empty text
// In create mode, we save everything, except for empty text
eventData.save = (newVal !== "");

@@ -272,3 +272,3 @@ } else {

name: "edit",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -280,4 +280,3 @@ options: {

// triggerCancel: ["esc", "tab", "click"],
// triggerStart: ["f2", "dblclick", "shift+click", "mac+enter"],
triggerStart: ["f2", "shift+click", "mac+enter"],
triggerStart: ["f2", "mac+enter", "shift+click"],
trim: true, // Trim whitespace before save

@@ -306,2 +305,11 @@ // Events:

}
if( $.inArray("clickActive", ctx.options.edit.triggerStart) >= 0 ){
// Only when click was inside title text (not aynwhere else in the row)
if( ctx.node.isActive() && !ctx.node.isEditing() &&
$(ctx.originalEvent.target).hasClass("fancytree-title")
){
ctx.node.editStart();
return false;
}
}
return this._superApply(arguments);

@@ -308,0 +316,0 @@ },

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -306,3 +306,3 @@ } else {

name: "filter",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -309,0 +309,0 @@ options: {

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -27,3 +27,3 @@

// Node/CommonJS
require("jquery.fancytree.table"); // core + table
require("./jquery.fancytree.table"); // core + table
module.exports = factory(require("jquery"));

@@ -30,0 +30,0 @@ } else {

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -41,78 +41,114 @@ } else {

PRESETS = {
"awesome3": {
checkbox: "icon-check-empty",
checkboxSelected: "icon-check",
checkboxUnknown: "icon-check icon-muted",
radio: "icon-circle-blank",
radioSelected: "icon-circle",
radioUnknown: "icon-circle icon-muted",
// radioUnknown: "icon-remove-circle-blank",
dragHelper: "icon-caret-right",
dropMarker: "icon-caret-right",
error: "icon-exclamation-sign",
expanderClosed: "icon-caret-right",
expanderLazy: "icon-angle-right",
expanderOpen: "icon-caret-down",
loading: "icon-refresh icon-spin",
nodata: "icon-meh",
noExpander: "",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "icon-file-alt",
docOpen: "icon-file-alt",
folder: "icon-folder-close-alt",
folderOpen: "icon-folder-open-alt"
},
"awesome4": {
checkbox: "fa fa-square-o",
checkboxSelected: "fa fa-check-square-o",
// checkboxUnknown: "fa fa-window-close-o",
checkboxUnknown: "fa fa-square",
radio: "fa fa-circle-o",
radioSelected: "fa fa-circle",
radioUnknown: "fa fa-dot-circle-o",
dragHelper: "fa fa-arrow-right",
dropMarker: "fa fa-long-arrow-right",
error: "fa fa-warning",
expanderClosed: "fa fa-caret-right",
expanderLazy: "fa fa-angle-right",
expanderOpen: "fa fa-caret-down",
loading: "fa fa-spinner fa-pulse",
nodata: "fa fa-meh-o",
noExpander: "",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "fa fa-file-o",
docOpen: "fa fa-file-o",
folder: "fa fa-folder-o",
folderOpen: "fa fa-folder-open-o"
},
"bootstrap3": {
checkbox: "glyphicon glyphicon-unchecked",
checkboxSelected: "glyphicon glyphicon-check",
checkboxUnknown: "glyphicon glyphicon-expand",
radio: "glyphicon glyphicon-remove-circle",
radioSelected: "glyphicon glyphicon-ok-circle",
radioUnknown: "glyphicon glyphicon-ban-circle",
dragHelper: "glyphicon glyphicon-play",
dropMarker: "glyphicon glyphicon-arrow-right",
error: "glyphicon glyphicon-warning-sign",
expanderClosed: "glyphicon glyphicon-menu-right", // glyphicon-plus-sign
expanderLazy: "glyphicon glyphicon-menu-right", // glyphicon-plus-sign
expanderOpen: "glyphicon glyphicon-menu-down", // glyphicon-minus-sign
loading: "glyphicon glyphicon-refresh glyphicon-spin",
nodata: "glyphicon glyphicon-info-sign",
noExpander: "",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "glyphicon glyphicon-file",
docOpen: "glyphicon glyphicon-file",
folder: "glyphicon glyphicon-folder-close",
folderOpen: "glyphicon glyphicon-folder-open"
}
"awesome3": { // Outdated!
_addClass: "",
checkbox: "icon-check-empty",
checkboxSelected: "icon-check",
checkboxUnknown: "icon-check icon-muted",
dragHelper: "icon-caret-right",
dropMarker: "icon-caret-right",
error: "icon-exclamation-sign",
expanderClosed: "icon-caret-right",
expanderLazy: "icon-angle-right",
expanderOpen: "icon-caret-down",
loading: "icon-refresh icon-spin",
nodata: "icon-meh",
noExpander: "",
radio: "icon-circle-blank",
radioSelected: "icon-circle",
// radioUnknown: "icon-circle icon-muted",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "icon-file-alt",
docOpen: "icon-file-alt",
folder: "icon-folder-close-alt",
folderOpen: "icon-folder-open-alt"
},
"awesome4": {
_addClass: "fa",
checkbox: "fa-square-o",
checkboxSelected: "fa-check-square-o",
checkboxUnknown: "fa-square",
dragHelper: "fa-arrow-right",
dropMarker: "fa-long-arrow-right",
error: "fa-warning",
expanderClosed: "fa-caret-right",
expanderLazy: "fa-angle-right",
expanderOpen: "fa-caret-down",
loading: "fa-spinner fa-pulse",
nodata: "fa-meh-o",
noExpander: "",
radio: "fa-circle-thin", // "fa-circle-o"
radioSelected: "fa-circle",
// radioUnknown: "fa-dot-circle-o",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "fa-file-o",
docOpen: "fa-file-o",
folder: "fa-folder-o",
folderOpen: "fa-folder-open-o"
},
"bootstrap3": {
_addClass: "glyphicon",
checkbox: "glyphicon-unchecked",
checkboxSelected: "glyphicon-check",
checkboxUnknown: "glyphicon-expand", // "glyphicon-share",
dragHelper: "glyphicon-play",
dropMarker: "glyphicon-arrow-right",
error: "glyphicon-warning-sign",
expanderClosed: "glyphicon-menu-right", // glyphicon-plus-sign
expanderLazy: "glyphicon-menu-right", // glyphicon-plus-sign
expanderOpen: "glyphicon-menu-down", // glyphicon-minus-sign
loading: "glyphicon-refresh glyphicon-spin",
nodata: "glyphicon-info-sign",
noExpander: "",
radio: "glyphicon-remove-circle", // "glyphicon-unchecked",
radioSelected: "glyphicon-ok-circle", // "glyphicon-check",
// radioUnknown: "glyphicon-ban-circle",
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: "glyphicon-file",
docOpen: "glyphicon-file",
folder: "glyphicon-folder-close",
folderOpen: "glyphicon-folder-open"
},
"material": {
_addClass: "material-icons",
checkbox: { text: "check_box_outline_blank" },
checkboxSelected: { text: "check_box" },
checkboxUnknown: { text: "indeterminate_check_box" },
dragHelper: { text: "play_arrow" },
dropMarker: { text: "arrow-forward" },
error: { text: "warning" },
expanderClosed: { text: "chevron_right" },
expanderLazy: { text: "last_page" },
expanderOpen: { text: "expand_more" },
loading: { text: "autorenew", addClass: "glyphicon-spin" },
nodata: { text: "info" },
noExpander: { text: "" },
radio: { text: "radio_button_unchecked" },
radioSelected: { text: "radio_button_checked" },
// Default node icons.
// (Use tree.options.icon callback to define custom icons based on node data)
doc: { text: "insert_drive_file" },
docOpen: { text: "insert_drive_file" },
folder: { text: "folder" },
folderOpen: { text: "folder_open" }
}
};
function _getIcon(opts, type){
return opts.map[type];
function setIcon( span, baseClass, opts, type ) {
var map = opts.map,
icon = map[ type ],
$span = $( span ),
setClass = baseClass + " " + (map._addClass || "");
if( typeof icon === "string" ) {
$span.attr( "class", setClass + " " + icon );
} else {
if( icon.text ) {
$span.text( "" + icon.text );
}
$span.attr( "class", setClass + " " + ( icon.addClass || "" ) );
}
}

@@ -123,6 +159,6 @@

name: "glyph",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.
options: {
preset: null, // 'awesome3', 'awesome4', 'bootstrap3'
preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material'
map: {

@@ -147,7 +183,6 @@ }

nodeRenderStatus: function(ctx) {
var checkbox, className, icon, res, span,
var checkbox, icon, res, span,
node = ctx.node,
$span = $(node.span),
opts = ctx.options.glyph,
map = opts.map;
$span = $( node.span ),
opts = ctx.options.glyph;

@@ -172,3 +207,4 @@ res = this._super(ctx);

}
span.className = "fancytree-expander " + map[icon];
// span.className = "fancytree-expander " + map[icon];
setIcon( span, "fancytree-expander", opts, icon );
}

@@ -181,13 +217,11 @@

}
if( span ){
checkbox = FT.evalOption("checkbox", node, node, ctx.options, false);
if( checkbox && !node.isStatusNode() ) {
className = "fancytree-checkbox ";
if( checkbox === "radio" || (node.parent && node.parent.radiogroup) ) {
className += "fancytree-radio ";
icon = node.selected ? "radioSelected" : (node.partsel ? "radioUnknown" : "radio");
} else {
icon = node.selected ? "checkboxSelected" : (node.partsel ? "checkboxUnknown" : "checkbox");
}
span.className = className + map[icon];
if( span ) {
checkbox = FT.evalOption("checkbox", node, node, opts, false);
if( (node.parent && node.parent.radiogroup ) || checkbox === "radio" ) {
icon = node.selected ? "radioSelected" : "radio";
setIcon( span, "fancytree-checkbox fancytree-radio", opts, icon );
} else {
icon = node.selected ? "checkboxSelected" : (node.partsel ? "checkboxUnknown" : "checkbox");
// span.className = "fancytree-checkbox " + map[icon];
setIcon( span, "fancytree-checkbox", opts, icon );
}

@@ -201,9 +235,9 @@ }

if( node.statusNodeType ){
icon = _getIcon(opts, node.statusNodeType); // loading, error
icon = node.statusNodeType; // loading, error
}else if( node.folder ){
icon = node.expanded && node.hasChildren() ? _getIcon(opts, "folderOpen") : _getIcon(opts, "folder");
icon = ( node.expanded && node.hasChildren() ) ? "folderOpen" : "folder";
}else{
icon = node.expanded ? _getIcon(opts, "docOpen") : _getIcon(opts, "doc");
icon = node.expanded ? "docOpen" : "doc";
}
span.className = "fancytree-icon " + icon;
setIcon( span, "fancytree-icon", opts, icon );
}

@@ -223,3 +257,3 @@ return res;

if( span ) {
span.className = "fancytree-expander " + _getIcon(opts, status);
setIcon( span, "fancytree-expander", opts, status );
}

@@ -230,3 +264,3 @@ }else{ //

if( span ) {
span.className = "fancytree-icon " + _getIcon(opts, status);
setIcon( span, "fancytree-icon", opts, status );
}

@@ -233,0 +267,0 @@ }

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -27,3 +27,3 @@

// Node/CommonJS
require("jquery.fancytree.table"); // core + table
require("./jquery.fancytree.table"); // core + table
module.exports = factory(require("jquery"));

@@ -138,3 +138,3 @@ } else {

name: "gridnav",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -141,0 +141,0 @@ options: {

@@ -14,4 +14,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -25,3 +25,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -28,0 +28,0 @@ } else {

@@ -14,4 +14,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -25,3 +25,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -41,3 +41,13 @@ } else {

*/
var cookieGetter, cookieRemover, cookieSetter,
var cookieStore = null,
localStorageStore = window.localStorage ? {
get: function(key){ return window.localStorage.getItem(key); },
set: function(key, value){ window.localStorage.setItem(key, value); },
remove: function(key){ window.localStorage.removeItem(key); }
} : null,
sessionStorageStore = window.sessionStorage ? {
get: function(key){ return window.sessionStorage.getItem(key); },
set: function(key, value){ window.sessionStorage.setItem(key, value); },
remove: function(key){ window.sessionStorage.removeItem(key); }
} : null,
_assert = $.ui.fancytree.assert,

@@ -51,9 +61,18 @@ ACTIVE = "active",

// Assume https://github.com/js-cookie/js-cookie
cookieSetter = Cookies.set;
cookieGetter = Cookies.get;
cookieRemover = Cookies.remove;
} else {
cookieStore = {
get: Cookies.get,
set: function(key, value) {
Cookies.set(key, value, this.options.persist.cookie);
},
remove: Cookies.remove
};
} else if ( $ && typeof $.cookie === "function" ) {
// Fall back to https://github.com/carhartl/jquery-cookie
cookieSetter = cookieGetter = $.cookie;
cookieRemover = $.removeCookie;
cookieStore = {
get: $.cookie,
set: function(key, value) {
$.cookie.set(key, value, this.options.persist.cookie);
},
remove: $.removeCookie
};
}

@@ -117,10 +136,10 @@

/**
* [ext-persist] Remove persistence cookies of the given type(s).
* [ext-persist] Remove persistence data of the given type(s).
* Called like
* $("#tree").fancytree("getTree").clearCookies("active expanded focus selected");
*
* @alias Fancytree#clearCookies
* @alias Fancytree#clearData
* @requires jquery.fancytree.persist.js
*/
$.ui.fancytree._FancytreeClass.prototype.clearCookies = function(types){
$.ui.fancytree._FancytreeClass.prototype.clearData = function(types){
var local = this.ext.persist,

@@ -144,2 +163,6 @@ prefix = local.cookiePrefix;

$.ui.fancytree._FancytreeClass.prototype.clearCookies = function(types){
this.warn("'tree.clearCookies()' is deprecated since v2.27.0: use 'clearData()' instead.");
return this.clearData(types);
};

@@ -174,3 +197,3 @@ /**

name: "persist",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -197,18 +220,10 @@ options: {

_data: function(key, value){
var ls = this._local.localStorage; // null, sessionStorage, or localStorage
var store = this._local.store;
if( value === undefined ) {
return ls ? ls.getItem(key) : cookieGetter(key);
return store.get.call(this, key);
} else if ( value === null ) {
if( ls ) {
ls.removeItem(key);
} else {
cookieRemover(key);
}
store.remove.call(this, key);
} else {
if( ls ) {
ls.setItem(key, value);
} else {
cookieSetter(key, value, this.options.persist.cookie);
}
store.set.call(this, key, value);
}

@@ -244,5 +259,5 @@ },

// For 'auto' or 'cookie' mode, the cookie plugin must be available
_assert((instOpts.store !== "auto" && instOpts.store !== "cookie") || cookieGetter,
"Missing required plugin for 'persist' extension: js.cookie.js or jquery.cookie.js");
// // For 'auto' or 'cookie' mode, the cookie plugin must be available
// _assert((instOpts.store !== "auto" && instOpts.store !== "cookie") || cookieStore,
// "Missing required plugin for 'persist' extension: js.cookie.js or jquery.cookie.js");

@@ -254,7 +269,17 @@ local.cookiePrefix = instOpts.cookiePrefix || ("fancytree-" + tree._id + "-");

local.storeFocus = instOpts.types.indexOf(FOCUS) >= 0;
if( instOpts.store === "cookie" || !window.localStorage ) {
local.localStorage = null;
} else {
local.localStorage = (instOpts.store === "local") ? window.localStorage : window.sessionStorage;
local.store = null;
if( instOpts.store === "auto" ) {
instOpts.store = localStorageStore ? "local" : "cookie";
}
if( $.isPlainObject(instOpts.store) ) {
local.store = instOpts.store;
} else if( instOpts.store === "cookie" ) {
local.store = cookieStore;
} else if( instOpts.store === "local" ){
local.store = (instOpts.store === "local") ? localStorageStore : sessionStorageStore;
} else if( instOpts.store === "session" ){
local.store = (instOpts.store === "local") ? localStorageStore : sessionStorageStore;
}
_assert(local.store, "Need a valid store.");

@@ -261,0 +286,0 @@ // Bind init-handler to apply cookie state

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -48,3 +48,3 @@ } else {

name: "select",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -51,0 +51,0 @@ options: {

@@ -12,4 +12,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -23,3 +23,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -106,3 +106,3 @@ } else {

name: "table",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -142,5 +142,13 @@ options: {

$table.addClass("fancytree-container fancytree-ext-table");
tree.tbody = $table.find(">tbody")[0];
$tbody = $(tree.tbody);
$tbody = $table.find(">tbody");
if( !$tbody.length ) {
// TODO: not sure if we can rely on browsers to insert missing <tbody> before <tr>s:
if( $table.find(">tr").length ) {
$.error("Expected table > tbody > tr. If you see this please open an issue.");
}
$tbody = $("<tbody>").appendTo($table);
}
tree.tbody = $tbody[0];
// Prepare row templates:

@@ -147,0 +155,0 @@ // Determine column count from table header if any

@@ -14,4 +14,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -25,3 +25,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -42,3 +42,3 @@ } else {

name: "themeroller",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -45,0 +45,0 @@ options: {

@@ -11,4 +11,4 @@ /*!

*
* @version 2.26.0
* @date 2017-11-04T17:52:53Z
* @version 2.27.0
* @date 2017-12-16T09:14:27Z
*/

@@ -22,3 +22,3 @@

// Node/CommonJS
require("jquery.fancytree");
require("./jquery.fancytree");
module.exports = factory(require("jquery"));

@@ -89,3 +89,3 @@ } else {

"#" + containerId + " div.ui-effects-wrapper ul li span.fancytree-title, " +
"#" + containerId + " ul.fancytree-animating span.fancytree-title " + // #716
"#" + containerId + " li.fancytree-animating span.fancytree-title " + // #716
"{ padding-left: " + labelOfs + measureUnit + "; position: static; width: auto; }");

@@ -128,3 +128,3 @@ return rules.join("\n");

name: "wide",
version: "2.26.0",
version: "2.27.0",
// Default options for this extension.

@@ -131,0 +131,0 @@ options: {

@@ -5,3 +5,3 @@ {

"description": "jQuery tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkboxes, drag'n'drop, and lazy loading",
"version": "2.26.0",
"version": "2.27.0",
"homepage": "https://github.com/mar10/fancytree",

@@ -55,3 +55,3 @@ "author": {

"grunt-contrib-qunit": "^1.0.1",
"grunt-contrib-uglify": "^1.0.0",
"grunt-contrib-uglify": "^3.2.1",
"grunt-contrib-watch": "^1.0.0",

@@ -58,0 +58,0 @@ "grunt-dev-update": "^2.0.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc