From 1bcf9f6fbd3ce3e88289903f3008d3328462a88a Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Wed, 27 Jun 2018 20:51:54 +0200 Subject: [PATCH] Bump version to 2.29.1 --- bower.json | 2 +- dist/jquery.fancytree-all-deps.js | 202 ++++++++++++----- dist/jquery.fancytree-all-deps.min.js | 2 +- dist/jquery.fancytree-all-deps.min.js.map | 2 +- dist/jquery.fancytree-all.js | 206 ++++++++++++------ dist/jquery.fancytree-all.min.js | 28 +-- dist/jquery.fancytree.min.js | 2 +- dist/modules/jquery.fancytree.ariagrid.js | 63 ++++-- dist/modules/jquery.fancytree.childcounter.js | 6 +- dist/modules/jquery.fancytree.clones.js | 6 +- dist/modules/jquery.fancytree.columnview.js | 6 +- dist/modules/jquery.fancytree.debug.js | 6 +- dist/modules/jquery.fancytree.dnd.js | 6 +- dist/modules/jquery.fancytree.dnd5.js | 62 ++++-- dist/modules/jquery.fancytree.edit.js | 6 +- dist/modules/jquery.fancytree.filter.js | 6 +- dist/modules/jquery.fancytree.fixed.js | 4 +- dist/modules/jquery.fancytree.glyph.js | 6 +- dist/modules/jquery.fancytree.gridnav.js | 10 +- dist/modules/jquery.fancytree.js | 74 ++++++- dist/modules/jquery.fancytree.menu.js | 4 +- dist/modules/jquery.fancytree.multi.js | 6 +- dist/modules/jquery.fancytree.persist.js | 6 +- dist/modules/jquery.fancytree.select.js | 6 +- dist/modules/jquery.fancytree.table.js | 6 +- dist/modules/jquery.fancytree.themeroller.js | 6 +- dist/modules/jquery.fancytree.ui-deps.js | 9 +- dist/modules/jquery.fancytree.wide.js | 6 +- package.json | 2 +- src/jquery.fancytree.js | 2 +- 30 files changed, 513 insertions(+), 245 deletions(-) diff --git a/bower.json b/bower.json index 863906c2..e2829173 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "jquery.fancytree", "description": "JavaScript tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkboxes, drag'n'drop, and lazy loading", - "version": "2.29.1-0", + "version": "2.29.1", "main": [ "dist/jquery.fancytree-all-deps.min.js" ], diff --git a/dist/jquery.fancytree-all-deps.js b/dist/jquery.fancytree-all-deps.js index f8478569..93033dca 100644 --- a/dist/jquery.fancytree-all-deps.js +++ b/dist/jquery.fancytree-all-deps.js @@ -1,4 +1,4 @@ -/*! jQuery Fancytree Plugin - 2.29.0 - 2018-06-16T11:23:53Z +/*! jQuery Fancytree Plugin - 2.29.1 - 2018-06-27T18:51:43Z * https://github.com/mar10/fancytree * Copyright (c) 2018 Martin Wendt; Licensed MIT */ @@ -1365,8 +1365,8 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ /** Core Fancytree module. @@ -1509,6 +1509,62 @@ function isVersionAtLeast(dottedVersion, major, minor, patch){ return true; } + +/** + * Deep-merge a list of objects (but replace array-type options). + * + * jQuery's $.extend(true, ...) method does a deep merge, that also merges Arrays. + * This variant is used to merge extension defaults with user options, and should + * merge objects, but override arrays (for example the `triggerStart: [...]` option + * of ext-edit). Also `null` values are copied over and not skipped. + * + * See issue #876 + * + * Example: + * _simpleDeepMerge({}, o1, o2); + */ + function _simpleDeepMerge() { + var options, name, src, copy, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length; + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !$.isFunction( target ) ) { + target = {}; + } + if ( i === length ) { + throw "need at least two args"; + } + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + // Recurse if we're merging plain objects + // (NOTE: unlike $.extend, we don't merge arrays, but relace them) + if ( copy && jQuery.isPlainObject( copy ) ) { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + // Never move original objects, clone them + target[ name ] = _simpleDeepMerge( clone, copy ); + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + // Return the modified object + return target; +} + + /** Return a wrapper that calls sub.methodName() and exposes * this : tree * this._local : tree.ext.EXTNAME @@ -3059,7 +3115,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{ scheduleAction: function(mode, ms) { if( this.tree.timer ) { clearTimeout(this.tree.timer); -// this.tree.debug("clearTimeout(%o)", this.tree.timer); + this.tree.debug("clearTimeout(%o)", this.tree.timer); } this.tree.timer = null; var self = this; // required for closures @@ -6269,7 +6325,15 @@ $.widget("ui.fancytree", } // Add extension options as tree.options.EXTENSION // _assert(!this.tree.options[extName], "Extension name must not exist as option name: " + extName); - this.tree.options[extName] = $.extend(true, {}, extension.options, this.tree.options[extName]); + + // console.info("extend " + extName, extension.options, this.tree.options[extName]) + // issue #876: we want to replace custom array-options, not merge them + this.tree.options[extName] = _simpleDeepMerge({}, extension.options, this.tree.options[extName]); + // this.tree.options[extName] = $.extend(true, {}, extension.options, this.tree.options[extName]); + + // console.info("extend " + extName + " =>", this.tree.options[extName]) + // console.info("extend " + extName + " org default =>", extension.options) + // Add a namespace tree.ext.EXTENSION, to hold instance data _assert(this.tree.ext[extName] === undefined, "Extension name must not exist as Fancytree.ext attribute: '" + extName + "'"); // this.tree[extName] = extension; @@ -6515,7 +6579,7 @@ $.extend($.ui.fancytree, /** @lends Fancytree_Static# */ { /** @type {string} */ - version: "2.29.0", // Set to semver by 'grunt release' + version: "2.29.1", // Set to semver by 'grunt release' /** @type {string} */ buildType: "production", // Set to 'production' by 'grunt build' /** @type {int} */ @@ -7063,8 +7127,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ // To keep the global namespace clean, we wrap everything in a closure. @@ -7183,7 +7247,7 @@ $.ui.fancytree.registerExtension({ // Every extension must be registered by a unique name. name: "childcounter", // Version information should be compliant with [semver](http://semver.org) - version: "2.29.0", + version: "2.29.1", // Extension specific options and their defaults. // This options will be available as `tree.options.childcounter.hideExpanded` @@ -7284,8 +7348,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -7597,7 +7661,7 @@ $.ui.fancytree._FancytreeClass.prototype.changeRefKey = function(oldRefKey, newR */ $.ui.fancytree.registerExtension({ name: "clones", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers @@ -7733,8 +7797,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ @@ -7787,14 +7851,19 @@ var FT = $.ui.fancytree, SOURCE_NODE_LIST = null, $sourceList = null, DRAG_ENTER_RESPONSE = null, - LAST_HIT_MODE = null; + LAST_HIT_MODE = null, + DRAG_OVER_STAMP = null; // Time when a node entered the 'over' hitmode /* */ function _clearGlobals() { SOURCE_NODE = null; SOURCE_NODE_LIST = null; + if( $sourceList ) { + $sourceList.removeClass(classDragSource + " " + classDragRemove); + } $sourceList = null; DRAG_ENTER_RESPONSE = null; + DRAG_OVER_STAMP = null; } /* Convert number to string and prepend +/-; return empty string for 0.*/ @@ -8051,7 +8120,7 @@ function getDropEffect(event, data) { $.ui.fancytree.registerExtension({ name: "dnd5", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { autoExpandMS: 1500, // Expand nodes after n milliseconds of hovering @@ -8251,9 +8320,6 @@ $.ui.fancytree.registerExtension({ break; case "dragend": - if( $sourceList ) { - $sourceList.removeClass(classDragSource + " " + classDragRemove); - } _clearGlobals(); // data.dropEffect = dropEffect; data.isCancelled = (dropEffect === "none"); @@ -8297,6 +8363,7 @@ $.ui.fancytree.registerExtension({ // The dragenter event is fired when a dragged element or // text selection enters a valid drop target. + DRAG_OVER_STAMP = null; if( !node ) { // Sometimes we get dragenter for the container element tree.debug("Ignore non-node " + event.type + ": " + event.target.tagName + "." + event.target.className); @@ -8318,20 +8385,6 @@ $.ui.fancytree.registerExtension({ break; } - // NOTE: dragenter is fired BEFORE the dragleave event - // of the previous element! - // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19041 - setTimeout(function(){ - // node.info("DELAYED " + event.type, event.target, DRAG_ENTER_RESPONSE); - // Auto-expand node (only when 'over' the node, not 'before', or 'after') - if( dndOpts.autoExpandMS && - node.hasChildren() !== false && !node.expanded && - (!dndOpts.dragExpand || dndOpts.dragExpand(node, data) !== false) - ) { - node.scheduleAction("expand", dndOpts.autoExpandMS); - } - }, 0); - $dropMarker.show(); // Call dragEnter() to figure out if (and where) dropping is allowed @@ -8354,6 +8407,37 @@ $.ui.fancytree.registerExtension({ // console.log(event.type, "dropEffect: " + dataTransfer.dropEffect) LAST_HIT_MODE = handleDragOver(event, data); allowDrop = !!LAST_HIT_MODE; + + // console.log(event.type, LAST_HIT_MODE, DRAG_OVER_STAMP) + + if( LAST_HIT_MODE === "over" && + !node.expanded && node.hasChildren() !== false ) { + if( !DRAG_OVER_STAMP ) { + DRAG_OVER_STAMP = Date.now(); + } else if( dndOpts.autoExpandMS && + (Date.now() - DRAG_OVER_STAMP) > dndOpts.autoExpandMS && + (!dndOpts.dragExpand || dndOpts.dragExpand(node, data) !== false) + ) { + node.setExpanded(); + } + } else { + DRAG_OVER_STAMP = null; + } + // // NOTE: dragenter is fired BEFORE the dragleave event + // // of the previous element! + // // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19041 + // setTimeout(function(){ + // node.info("DELAYED " + event.type, event.target, DRAG_ENTER_RESPONSE); + // // Auto-expand node (only when 'over' the node, not 'before', or 'after') + // if( dndOpts.autoExpandMS && + // node.hasChildren() !== false && !node.expanded && + // (!dndOpts.dragExpand || dndOpts.dragExpand(node, data) !== false) + // // res.over + // ) { + // node.scheduleAction("expand", dndOpts.autoExpandMS); + // } + // }, 0); + break; case "dragleave": @@ -8442,8 +8526,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -8699,7 +8783,7 @@ $.ui.fancytree._FancytreeNodeClass.prototype.isEditing = function(){ */ $.ui.fancytree.registerExtension({ name: "edit", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { adjustWidthOfs: 4, // null: don't adjust input size to content @@ -8782,8 +8866,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -9077,7 +9161,7 @@ $.ui.fancytree._FancytreeNodeClass.prototype.isMatched = function(){ */ $.ui.fancytree.registerExtension({ name: "filter", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { autoApply: true, // Re-apply last filter if lazy data is loaded @@ -9170,8 +9254,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -9347,7 +9431,7 @@ function setIcon( span, baseClass, opts, type ) { $.ui.fancytree.registerExtension({ name: "glyph", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material' @@ -9469,8 +9553,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -9593,11 +9677,11 @@ function findNeighbourTd($target, keyCode){ */ $.ui.fancytree.registerExtension({ name: "gridnav", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { - autofocusInput: false, // Focus first embedded input if node gets activated - handleCursorKeys: true // Allow UP/DOWN in inputs to move to prev/next node + autofocusInput: false, // Focus first embedded input if node gets activated + handleCursorKeys: true // Allow UP/DOWN in inputs to move to prev/next node }, treeInit: function(ctx){ @@ -9695,8 +9779,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -9872,7 +9956,7 @@ $.ui.fancytree._FancytreeClass.prototype.getPersistData = function(){ */ $.ui.fancytree.registerExtension({ name: "persist", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { cookieDelimiter: "~", @@ -10124,8 +10208,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -10216,7 +10300,7 @@ function findPrevRowNode(node){ $.ui.fancytree.registerExtension({ name: "table", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { checkboxColumnIdx: null, // render the checkboxes into the this column index (default: nodeColumnIdx) @@ -10600,8 +10684,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -10626,7 +10710,7 @@ return $.ui.fancytree; */ $.ui.fancytree.registerExtension({ name: "themeroller", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { activeClass: "ui-state-active", // Class added to active node @@ -10712,8 +10796,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.29.0 - * @date 2018-06-16T11:23:53Z + * @version 2.29.1 + * @date 2018-06-27T18:51:43Z */ ;(function( factory ) { @@ -10826,7 +10910,7 @@ function renderLevelCss(containerId, depth, levelOfs, lineOfs, labelOfs, measure */ $.ui.fancytree.registerExtension({ name: "wide", - version: "2.29.0", + version: "2.29.1", // Default options for this extension. options: { iconWidth: null, // Adjust this if @fancy-icon-width != "16px" diff --git a/dist/jquery.fancytree-all-deps.min.js b/dist/jquery.fancytree-all-deps.min.js index f7083535..59b04a32 100644 --- a/dist/jquery.fancytree-all-deps.min.js +++ b/dist/jquery.fancytree-all-deps.min.js @@ -1,2 +1,2 @@ -!function(e){e.ui=e.ui||{};e.ui.version="1.12.1";var t=0,n=Array.prototype.slice;e.cleanData=function(t){return function(n){var i,r,o;for(o=0;null!=(r=n[o]);o++)try{(i=e._data(r,"events"))&&i.remove&&e(r).triggerHandler("remove")}catch(e){}t(n)}}(e.cleanData),e.widget=function(t,n,i){var r,o,s,a={},l=t.split(".")[0],d=l+"-"+(t=t.split(".")[1]);return i||(i=n,n=e.Widget),e.isArray(i)&&(i=e.extend.apply(null,[{}].concat(i))),e.expr[":"][d.toLowerCase()]=function(t){return!!e.data(t,d)},e[l]=e[l]||{},r=e[l][t],o=e[l][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,r,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),s=new n,s.options=e.widget.extend({},s.options),e.each(i,function(t,i){e.isFunction(i)?a[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function r(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,o=this._superApply;return this._super=e,this._superApply=r,t=i.apply(this,arguments),this._super=n,this._superApply=o,t}}():a[t]=i}),o.prototype=e.widget.extend(s,{widgetEventPrefix:r?s.widgetEventPrefix||t:t},a,{constructor:o,namespace:l,widgetName:t,widgetFullName:d}),r?(e.each(r._childConstructors,function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,o,n._proto)}),delete r._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,r,o=n.call(arguments,1),s=0,a=o.length;s",options:{classes:{},disabled:!1,create:null},_createWidget:function(n,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,n){t._removeClass(n,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var i,r,o,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(r=s[t]=e.widget.extend({},this.options[t]),o=0;o
"),o=r.children()[0];return e("body").append(r),t=o.offsetWidth,r.css("overflow","scroll"),n=o.offsetWidth,t===n&&(n=r[0].clientWidth),r.remove(),i=t-n},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),r="scroll"===n||"auto"===n&&t.width0?"right":"center",vertical:a<0?"top":s>0?"bottom":"middle"};hr(o(s),o(a))?c.important="horizontal":c.important="vertical",i.using.call(this,e,c)}),l.offset(e.extend(w,{using:a}))})},e.ui.position={fit:{left:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollLeft:i.offset.left,s=i.width,a=e.left-t.collisionPosition.marginLeft,l=o-a,d=a+t.collisionWidth-s-o;t.collisionWidth>s?l>0&&d<=0?(n=e.left+l+t.collisionWidth-s-o,e.left+=l-n):e.left=d>0&&l<=0?o:l>d?o+s-t.collisionWidth:o:l>0?e.left+=l:d>0?e.left-=d:e.left=r(e.left-a,e.left)},top:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollTop:i.offset.top,s=t.within.height,a=e.top-t.collisionPosition.marginTop,l=o-a,d=a+t.collisionHeight-s-o;t.collisionHeight>s?l>0&&d<=0?(n=e.top+l+t.collisionHeight-s-o,e.top+=l-n):e.top=d>0&&l<=0?o:l>d?o+s-t.collisionHeight:o:l>0?e.top+=l:d>0?e.top-=d:e.top=r(e.top-a,e.top)}},flip:{left:function(e,t){var n,i,r=t.within,s=r.offset.left+r.scrollLeft,a=r.width,l=r.isWindow?r.scrollLeft:r.offset.left,d=e.left-t.collisionPosition.marginLeft,c=d-l,u=d+t.collisionWidth-a-l,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,f="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,p=-2*t.offset[0];c<0?((n=e.left+h+f+p+t.collisionWidth-a-s)<0||n0&&((i=e.left-t.collisionPosition.marginLeft+h+f+p-l)>0||o(i)0&&((n=e.top-t.collisionPosition.marginTop+h+f+p-l)>0||o(n)=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;rul.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("
    ",{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,y=new RegExp(/\.|\//),v=/[&<>"'\/]/g,m=/[<>"'\/]/g,x="$recursive_request",b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},C={16:!0,17:!0,18:!0},_={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:"'"},k={0:"",1:"left",2:"middle",3:"right"},N="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),w={},S="columns types".split(" "),E="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),T={},A={},O={active:!0,children:!0,data:!0,focus:!0};for(f=0;f=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=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=4&&(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)},error:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),n("error",arguments))},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=3&&(Array.prototype.unshift.call(arguments,this.toString()),n("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},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=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;fy+g-p&&(b=s+u-g+p,x&&(t(x.isRootNode()||e(x.span).is(":visible"),"topNode must be visible"),ri?1:-1},r.sort(e),t)for(n=0,i=r.length;n=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=2&&(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)=4&&(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)},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