diff --git a/bower.json b/bower.json index 86b29467..69e61364 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.38.1-0", + "version": "2.38.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 2dd43590..fd18310c 100644 --- a/dist/jquery.fancytree-all-deps.js +++ b/dist/jquery.fancytree-all-deps.js @@ -1,10 +1,10 @@ -/*! jQuery Fancytree Plugin - 2.38.0 - 2021-02-09T20:03:49Z +/*! jQuery Fancytree Plugin - 2.38.1 - 2022-01-14T18:41:36Z * https://github.com/mar10/fancytree - * Copyright (c) 2021 Martin Wendt; Licensed MIT + * Copyright (c) 2022 Martin Wendt; Licensed MIT */ -/*! jQuery UI - v1.12.1 - 2018-05-20 +/*! jQuery UI - v1.13.0 - 2021-11-09 * http://jqueryui.com -* Includes: widget.js, position.js, keycode.js, scroll-parent.js, unique-id.js +* Includes: widget.js, position.js, jquery-patch.js, keycode.js, scroll-parent.js, unique-id.js * Copyright jQuery Foundation and other contributors; Licensed MIT */ /* @@ -13,1329 +13,1428 @@ */ (function( $ ) { -$.ui = $.ui || {}; + $.ui = $.ui || {}; -var version = $.ui.version = "1.12.1"; + var version = $.ui.version = "1.13.0"; -/*! - * jQuery UI Widget 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Widget -//>>group: Core -//>>description: Provides a factory for creating stateful widgets with a common API. -//>>docs: http://api.jqueryui.com/jQuery.widget/ -//>>demos: http://jqueryui.com/widget/ + /*! + * jQuery UI Widget 1.13.0 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + //>>label: Widget + //>>group: Core + //>>description: Provides a factory for creating stateful widgets with a common API. + //>>docs: http://api.jqueryui.com/jQuery.widget/ + //>>demos: http://jqueryui.com/widget/ -var widgetUuid = 0; -var widgetSlice = Array.prototype.slice; + var widgetUuid = 0; + var widgetHasOwnProperty = Array.prototype.hasOwnProperty; + var widgetSlice = Array.prototype.slice; -$.cleanData = ( function( orig ) { - return function( elems ) { - var events, elem, i; - for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { - try { + $.cleanData = ( function( orig ) { + return function( elems ) { + var events, elem, i; + for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { // Only trigger remove when necessary to save time events = $._data( elem, "events" ); if ( events && events.remove ) { $( elem ).triggerHandler( "remove" ); } + } + orig( elems ); + }; + } )( $.cleanData ); - // Http://bugs.jquery.com/ticket/8235 - } catch ( e ) {} - } - orig( elems ); - }; -} )( $.cleanData ); - -$.widget = function( name, base, prototype ) { - var existingConstructor, constructor, basePrototype; - - // ProxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - var proxiedPrototype = {}; + $.widget = function( name, base, prototype ) { + var existingConstructor, constructor, basePrototype; - var namespace = name.split( "." )[ 0 ]; - name = name.split( "." )[ 1 ]; - var fullName = namespace + "-" + name; + // ProxiedPrototype allows the provided prototype to remain unmodified + // so that it can be used as a mixin for multiple widgets (#8876) + var proxiedPrototype = {}; - if ( !prototype ) { - prototype = base; - base = $.Widget; - } + var namespace = name.split( "." )[ 0 ]; + name = name.split( "." )[ 1 ]; + var fullName = namespace + "-" + name; - if ( $.isArray( prototype ) ) { - prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); - } + if ( !prototype ) { + prototype = base; + base = $.Widget; + } - // Create selector for plugin - $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { - return !!$.data( elem, fullName ); - }; + if ( Array.isArray( prototype ) ) { + prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); + } - $[ namespace ] = $[ namespace ] || {}; - existingConstructor = $[ namespace ][ name ]; - constructor = $[ namespace ][ name ] = function( options, element ) { + // Create selector for plugin + $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) { + return !!$.data( elem, fullName ); + }; - // Allow instantiation without "new" keyword - if ( !this._createWidget ) { - return new constructor( options, element ); - } + $[ namespace ] = $[ namespace ] || {}; + existingConstructor = $[ namespace ][ name ]; + constructor = $[ namespace ][ name ] = function( options, element ) { - // Allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; + // Allow instantiation without "new" keyword + if ( !this._createWidget ) { + return new constructor( options, element ); + } - // Extend with the existing constructor to carry over any static properties - $.extend( constructor, existingConstructor, { - version: prototype.version, + // Allow instantiation without initializing for simple inheritance + // must use "new" keyword (the code above always passes args) + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; - // Copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend( {}, prototype ), + // Extend with the existing constructor to carry over any static properties + $.extend( constructor, existingConstructor, { + version: prototype.version, - // Track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - } ); + // Copy the object used to create the prototype in case we need to + // redefine the widget later + _proto: $.extend( {}, prototype ), - basePrototype = new base(); + // Track widgets that inherit from this widget in case this widget is + // redefined after a widget inherits from it + _childConstructors: [] + } ); - // We need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend( {}, basePrototype.options ); - $.each( prototype, function( prop, value ) { - if ( !$.isFunction( value ) ) { - proxiedPrototype[ prop ] = value; - return; - } - proxiedPrototype[ prop ] = ( function() { - function _super() { - return base.prototype[ prop ].apply( this, arguments ); - } + basePrototype = new base(); - function _superApply( args ) { - return base.prototype[ prop ].apply( this, args ); + // We need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + basePrototype.options = $.widget.extend( {}, basePrototype.options ); + $.each( prototype, function( prop, value ) { + if ( typeof value !== "function" ) { + proxiedPrototype[ prop ] = value; + return; } + proxiedPrototype[ prop ] = ( function() { + function _super() { + return base.prototype[ prop ].apply( this, arguments ); + } - return function() { - var __super = this._super; - var __superApply = this._superApply; - var returnValue; + function _superApply( args ) { + return base.prototype[ prop ].apply( this, args ); + } - this._super = _super; - this._superApply = _superApply; + return function() { + var __super = this._super; + var __superApply = this._superApply; + var returnValue; - returnValue = value.apply( this, arguments ); + this._super = _super; + this._superApply = _superApply; - this._super = __super; - this._superApply = __superApply; + returnValue = value.apply( this, arguments ); - return returnValue; - }; - } )(); - } ); - constructor.prototype = $.widget.extend( basePrototype, { - - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name - }, proxiedPrototype, { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - } ); + this._super = __super; + this._superApply = __superApply; - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if ( existingConstructor ) { - $.each( existingConstructor._childConstructors, function( i, child ) { - var childPrototype = child.prototype; - - // Redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, - child._proto ); + return returnValue; + }; + } )(); + } ); + constructor.prototype = $.widget.extend( basePrototype, { + + // TODO: remove support for widgetEventPrefix + // always use the name + a colon as the prefix, e.g., draggable:start + // don't prefix for widgets that aren't DOM-based + widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name + }, proxiedPrototype, { + constructor: constructor, + namespace: namespace, + widgetName: name, + widgetFullName: fullName } ); - // Remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push( constructor ); - } + // If this widget is being redefined then we need to find all widgets that + // are inheriting from it and redefine all of them so that they inherit from + // the new version of this widget. We're essentially trying to replace one + // level in the prototype chain. + if ( existingConstructor ) { + $.each( existingConstructor._childConstructors, function( i, child ) { + var childPrototype = child.prototype; + + // Redefine the child widget using the same prototype that was + // originally used, but inherit from the new version of the base + $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, + child._proto ); + } ); - $.widget.bridge( name, constructor ); + // Remove the list of existing child constructors from the old constructor + // so the old child constructors can be garbage collected + delete existingConstructor._childConstructors; + } else { + base._childConstructors.push( constructor ); + } - return constructor; -}; + $.widget.bridge( name, constructor ); -$.widget.extend = function( target ) { - var input = widgetSlice.call( arguments, 1 ); - var inputIndex = 0; - var inputLength = input.length; - var key; - var value; + return constructor; + }; - for ( ; inputIndex < inputLength; inputIndex++ ) { - for ( key in input[ inputIndex ] ) { - value = input[ inputIndex ][ key ]; - if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + $.widget.extend = function( target ) { + var input = widgetSlice.call( arguments, 1 ); + var inputIndex = 0; + var inputLength = input.length; + var key; + var value; - // Clone objects - if ( $.isPlainObject( value ) ) { - target[ key ] = $.isPlainObject( target[ key ] ) ? - $.widget.extend( {}, target[ key ], value ) : + for ( ; inputIndex < inputLength; inputIndex++ ) { + for ( key in input[ inputIndex ] ) { + value = input[ inputIndex ][ key ]; + if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) { - // Don't extend strings, arrays, etc. with objects - $.widget.extend( {}, value ); + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : - // Copy everything else by reference - } else { - target[ key ] = value; + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + + // Copy everything else by reference + } else { + target[ key ] = value; + } } } } - } - return target; -}; - -$.widget.bridge = function( name, object ) { - var fullName = object.prototype.widgetFullName || name; - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string"; - var args = widgetSlice.call( arguments, 1 ); - var returnValue = this; - - if ( isMethodCall ) { - - // If this is an empty collection, we need to have the instance method - // return undefined instead of the jQuery instance - if ( !this.length && options === "instance" ) { - returnValue = undefined; + return target; + }; + + $.widget.bridge = function( name, object ) { + var fullName = object.prototype.widgetFullName || name; + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string"; + var args = widgetSlice.call( arguments, 1 ); + var returnValue = this; + + if ( isMethodCall ) { + + // If this is an empty collection, we need to have the instance method + // return undefined instead of the jQuery instance + if ( !this.length && options === "instance" ) { + returnValue = undefined; + } else { + this.each( function() { + var methodValue; + var instance = $.data( this, fullName ); + + if ( options === "instance" ) { + returnValue = instance; + return false; + } + + if ( !instance ) { + return $.error( "cannot call methods on " + name + + " prior to initialization; " + + "attempted to call method '" + options + "'" ); + } + + if ( typeof instance[ options ] !== "function" || + options.charAt( 0 ) === "_" ) { + return $.error( "no such method '" + options + "' for " + name + + " widget instance" ); + } + + methodValue = instance[ options ].apply( instance, args ); + + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue && methodValue.jquery ? + returnValue.pushStack( methodValue.get() ) : + methodValue; + return false; + } + } ); + } } else { + + // Allow multiple hashes to be passed on init + if ( args.length ) { + options = $.widget.extend.apply( null, [ options ].concat( args ) ); + } + this.each( function() { - var methodValue; var instance = $.data( this, fullName ); - - if ( options === "instance" ) { - returnValue = instance; - return false; + if ( instance ) { + instance.option( options || {} ); + if ( instance._init ) { + instance._init(); + } + } else { + $.data( this, fullName, new object( options, this ) ); } + } ); + } - if ( !instance ) { - return $.error( "cannot call methods on " + name + - " prior to initialization; " + - "attempted to call method '" + options + "'" ); - } + return returnValue; + }; + }; - if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) { - return $.error( "no such method '" + options + "' for " + name + - " widget instance" ); - } + $.Widget = function( /* options, element */ ) {}; + $.Widget._childConstructors = []; - methodValue = instance[ options ].apply( instance, args ); + $.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + defaultElement: "
", - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue && methodValue.jquery ? - returnValue.pushStack( methodValue.get() ) : - methodValue; - return false; + options: { + classes: {}, + disabled: false, + + // Callbacks + create: null + }, + + _createWidget: function( options, element ) { + element = $( element || this.defaultElement || this )[ 0 ]; + this.element = $( element ); + this.uuid = widgetUuid++; + this.eventNamespace = "." + this.widgetName + this.uuid; + + this.bindings = $(); + this.hoverable = $(); + this.focusable = $(); + this.classesElementLookup = {}; + + if ( element !== this ) { + $.data( element, this.widgetFullName, this ); + this._on( true, this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } } } ); - } - } else { + this.document = $( element.style ? - // Allow multiple hashes to be passed on init - if ( args.length ) { - options = $.widget.extend.apply( null, [ options ].concat( args ) ); + // Element within the document + element.ownerDocument : + + // Element is window or document + element.document || element ); + this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); } - this.each( function() { - var instance = $.data( this, fullName ); - if ( instance ) { - instance.option( options || {} ); - if ( instance._init ) { - instance._init(); - } - } else { - $.data( this, fullName, new object( options, this ) ); - } - } ); - } + this.options = $.widget.extend( {}, + this.options, + this._getCreateOptions(), + options ); - return returnValue; - }; -}; + this._create(); -$.Widget = function( /* options, element */ ) {}; -$.Widget._childConstructors = []; + if ( this.options.disabled ) { + this._setOptionDisabled( this.options.disabled ); + } -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - defaultElement: "
", + this._trigger( "create", null, this._getCreateEventData() ); + this._init(); + }, - options: { - classes: {}, - disabled: false, + _getCreateOptions: function() { + return {}; + }, - // Callbacks - create: null - }, + _getCreateEventData: $.noop, - _createWidget: function( options, element ) { - element = $( element || this.defaultElement || this )[ 0 ]; - this.element = $( element ); - this.uuid = widgetUuid++; - this.eventNamespace = "." + this.widgetName + this.uuid; + _create: $.noop, - this.bindings = $(); - this.hoverable = $(); - this.focusable = $(); - this.classesElementLookup = {}; + _init: $.noop, - if ( element !== this ) { - $.data( element, this.widgetFullName, this ); - this._on( true, this.element, { - remove: function( event ) { - if ( event.target === element ) { - this.destroy(); - } - } + destroy: function() { + var that = this; + + this._destroy(); + $.each( this.classesElementLookup, function( key, value ) { + that._removeClass( value, key ); } ); - this.document = $( element.style ? - // Element within the document - element.ownerDocument : + // We can probably remove the unbind calls in 2.0 + // all event bindings should go through this._on() + this.element + .off( this.eventNamespace ) + .removeData( this.widgetFullName ); + this.widget() + .off( this.eventNamespace ) + .removeAttr( "aria-disabled" ); - // Element is window or document - element.document || element ); - this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); - } + // Clean up events and states + this.bindings.off( this.eventNamespace ); + }, - this.options = $.widget.extend( {}, - this.options, - this._getCreateOptions(), - options ); + _destroy: $.noop, - this._create(); + widget: function() { + return this.element; + }, - if ( this.options.disabled ) { - this._setOptionDisabled( this.options.disabled ); - } + option: function( key, value ) { + var options = key; + var parts; + var curOption; + var i; + + if ( arguments.length === 0 ) { - this._trigger( "create", null, this._getCreateEventData() ); - this._init(); - }, + // Don't return a reference to the internal hash + return $.widget.extend( {}, this.options ); + } - _getCreateOptions: function() { - return {}; - }, + if ( typeof key === "string" ) { - _getCreateEventData: $.noop, + // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } + options = {}; + parts = key.split( "." ); + key = parts.shift(); + if ( parts.length ) { + curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); + for ( i = 0; i < parts.length - 1; i++ ) { + curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; + curOption = curOption[ parts[ i ] ]; + } + key = parts.pop(); + if ( arguments.length === 1 ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; + } else { + if ( arguments.length === 1 ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } + options[ key ] = value; + } + } - _create: $.noop, + this._setOptions( options ); - _init: $.noop, + return this; + }, - destroy: function() { - var that = this; + _setOptions: function( options ) { + var key; - this._destroy(); - $.each( this.classesElementLookup, function( key, value ) { - that._removeClass( value, key ); - } ); + for ( key in options ) { + this._setOption( key, options[ key ] ); + } - // We can probably remove the unbind calls in 2.0 - // all event bindings should go through this._on() - this.element - .off( this.eventNamespace ) - .removeData( this.widgetFullName ); - this.widget() - .off( this.eventNamespace ) - .removeAttr( "aria-disabled" ); - - // Clean up events and states - this.bindings.off( this.eventNamespace ); - }, - - _destroy: $.noop, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key; - var parts; - var curOption; - var i; + return this; + }, - if ( arguments.length === 0 ) { + _setOption: function( key, value ) { + if ( key === "classes" ) { + this._setOptionClasses( value ); + } - // Don't return a reference to the internal hash - return $.widget.extend( {}, this.options ); - } + this.options[ key ] = value; - if ( typeof key === "string" ) { + if ( key === "disabled" ) { + this._setOptionDisabled( value ); + } - // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } - options = {}; - parts = key.split( "." ); - key = parts.shift(); - if ( parts.length ) { - curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); - for ( i = 0; i < parts.length - 1; i++ ) { - curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; - curOption = curOption[ parts[ i ] ]; - } - key = parts.pop(); - if ( arguments.length === 1 ) { - return curOption[ key ] === undefined ? null : curOption[ key ]; - } - curOption[ key ] = value; - } else { - if ( arguments.length === 1 ) { - return this.options[ key ] === undefined ? null : this.options[ key ]; + return this; + }, + + _setOptionClasses: function( value ) { + var classKey, elements, currentElements; + + for ( classKey in value ) { + currentElements = this.classesElementLookup[ classKey ]; + if ( value[ classKey ] === this.options.classes[ classKey ] || + !currentElements || + !currentElements.length ) { + continue; } - options[ key ] = value; - } - } - this._setOptions( options ); + // We are doing this to create a new jQuery object because the _removeClass() call + // on the next line is going to destroy the reference to the current elements being + // tracked. We need to save a copy of this collection so that we can add the new classes + // below. + elements = $( currentElements.get() ); + this._removeClass( currentElements, classKey ); - return this; - }, + // We don't use _addClass() here, because that uses this.options.classes + // for generating the string of classes. We want to use the value passed in from + // _setOption(), this is the new value of the classes option which was passed to + // _setOption(). We pass this value directly to _classes(). + elements.addClass( this._classes( { + element: elements, + keys: classKey, + classes: value, + add: true + } ) ); + } + }, - _setOptions: function( options ) { - var key; + _setOptionDisabled: function( value ) { + this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); - for ( key in options ) { - this._setOption( key, options[ key ] ); - } + // If the widget is becoming disabled, then nothing is interactive + if ( value ) { + this._removeClass( this.hoverable, null, "ui-state-hover" ); + this._removeClass( this.focusable, null, "ui-state-focus" ); + } + }, - return this; - }, + enable: function() { + return this._setOptions( { disabled: false } ); + }, - _setOption: function( key, value ) { - if ( key === "classes" ) { - this._setOptionClasses( value ); - } + disable: function() { + return this._setOptions( { disabled: true } ); + }, - this.options[ key ] = value; + _classes: function( options ) { + var full = []; + var that = this; - if ( key === "disabled" ) { - this._setOptionDisabled( value ); - } + options = $.extend( { + element: this.element, + classes: this.options.classes || {} + }, options ); - return this; - }, - - _setOptionClasses: function( value ) { - var classKey, elements, currentElements; - - for ( classKey in value ) { - currentElements = this.classesElementLookup[ classKey ]; - if ( value[ classKey ] === this.options.classes[ classKey ] || - !currentElements || - !currentElements.length ) { - continue; - } - - // We are doing this to create a new jQuery object because the _removeClass() call - // on the next line is going to destroy the reference to the current elements being - // tracked. We need to save a copy of this collection so that we can add the new classes - // below. - elements = $( currentElements.get() ); - this._removeClass( currentElements, classKey ); - - // We don't use _addClass() here, because that uses this.options.classes - // for generating the string of classes. We want to use the value passed in from - // _setOption(), this is the new value of the classes option which was passed to - // _setOption(). We pass this value directly to _classes(). - elements.addClass( this._classes( { - element: elements, - keys: classKey, - classes: value, - add: true - } ) ); - } - }, + function bindRemoveEvent() { + options.element.each( function( _, element ) { + var isTracked = $.map( that.classesElementLookup, function( elements ) { + return elements; + } ) + .some( function( elements ) { + return elements.is( element ); + } ); - _setOptionDisabled: function( value ) { - this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); + if ( !isTracked ) { + that._on( $( element ), { + remove: "_untrackClassesElement" + } ); + } + } ); + } - // If the widget is becoming disabled, then nothing is interactive - if ( value ) { - this._removeClass( this.hoverable, null, "ui-state-hover" ); - this._removeClass( this.focusable, null, "ui-state-focus" ); - } - }, - - enable: function() { - return this._setOptions( { disabled: false } ); - }, - - disable: function() { - return this._setOptions( { disabled: true } ); - }, - - _classes: function( options ) { - var full = []; - var that = this; - - options = $.extend( { - element: this.element, - classes: this.options.classes || {} - }, options ); - - function processClassString( classes, checkOption ) { - var current, i; - for ( i = 0; i < classes.length; i++ ) { - current = that.classesElementLookup[ classes[ i ] ] || $(); - if ( options.add ) { - current = $( $.unique( current.get().concat( options.element.get() ) ) ); - } else { - current = $( current.not( options.element ).get() ); - } - that.classesElementLookup[ classes[ i ] ] = current; - full.push( classes[ i ] ); - if ( checkOption && options.classes[ classes[ i ] ] ) { - full.push( options.classes[ classes[ i ] ] ); + function processClassString( classes, checkOption ) { + var current, i; + for ( i = 0; i < classes.length; i++ ) { + current = that.classesElementLookup[ classes[ i ] ] || $(); + if ( options.add ) { + bindRemoveEvent(); + current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) ); + } else { + current = $( current.not( options.element ).get() ); + } + that.classesElementLookup[ classes[ i ] ] = current; + full.push( classes[ i ] ); + if ( checkOption && options.classes[ classes[ i ] ] ) { + full.push( options.classes[ classes[ i ] ] ); + } } } - } - this._on( options.element, { - "remove": "_untrackClassesElement" - } ); + if ( options.keys ) { + processClassString( options.keys.match( /\S+/g ) || [], true ); + } + if ( options.extra ) { + processClassString( options.extra.match( /\S+/g ) || [] ); + } - if ( options.keys ) { - processClassString( options.keys.match( /\S+/g ) || [], true ); - } - if ( options.extra ) { - processClassString( options.extra.match( /\S+/g ) || [] ); - } + return full.join( " " ); + }, - return full.join( " " ); - }, + _untrackClassesElement: function( event ) { + var that = this; + $.each( that.classesElementLookup, function( key, value ) { + if ( $.inArray( event.target, value ) !== -1 ) { + that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); + } + } ); - _untrackClassesElement: function( event ) { - var that = this; - $.each( that.classesElementLookup, function( key, value ) { - if ( $.inArray( event.target, value ) !== -1 ) { - that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); - } - } ); - }, - - _removeClass: function( element, keys, extra ) { - return this._toggleClass( element, keys, extra, false ); - }, - - _addClass: function( element, keys, extra ) { - return this._toggleClass( element, keys, extra, true ); - }, - - _toggleClass: function( element, keys, extra, add ) { - add = ( typeof add === "boolean" ) ? add : extra; - var shift = ( typeof element === "string" || element === null ), - options = { - extra: shift ? keys : extra, - keys: shift ? element : keys, - element: shift ? this.element : element, - add: add - }; - options.element.toggleClass( this._classes( options ), add ); - return this; - }, - - _on: function( suppressDisabledCheck, element, handlers ) { - var delegateElement; - var instance = this; - - // No suppressDisabledCheck flag, shuffle arguments - if ( typeof suppressDisabledCheck !== "boolean" ) { - handlers = element; - element = suppressDisabledCheck; - suppressDisabledCheck = false; - } + this._off( $( event.target ) ); + }, - // No element argument, shuffle and use this.element - if ( !handlers ) { - handlers = element; - element = this.element; - delegateElement = this.widget(); - } else { - element = delegateElement = $( element ); - this.bindings = this.bindings.add( element ); - } + _removeClass: function( element, keys, extra ) { + return this._toggleClass( element, keys, extra, false ); + }, - $.each( handlers, function( event, handler ) { - function handlerProxy() { + _addClass: function( element, keys, extra ) { + return this._toggleClass( element, keys, extra, true ); + }, - // Allow widgets to customize the disabled handling - // - disabled as an array instead of boolean - // - disabled class as method for disabling individual parts - if ( !suppressDisabledCheck && - ( instance.options.disabled === true || - $( this ).hasClass( "ui-state-disabled" ) ) ) { - return; - } - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } + _toggleClass: function( element, keys, extra, add ) { + add = ( typeof add === "boolean" ) ? add : extra; + var shift = ( typeof element === "string" || element === null ), + options = { + extra: shift ? keys : extra, + keys: shift ? element : keys, + element: shift ? this.element : element, + add: add + }; + options.element.toggleClass( this._classes( options ), add ); + return this; + }, - // Copy the guid so direct unbinding works - if ( typeof handler !== "string" ) { - handlerProxy.guid = handler.guid = - handler.guid || handlerProxy.guid || $.guid++; - } + _on: function( suppressDisabledCheck, element, handlers ) { + var delegateElement; + var instance = this; - var match = event.match( /^([\w:-]*)\s*(.*)$/ ); - var eventName = match[ 1 ] + instance.eventNamespace; - var selector = match[ 2 ]; + // No suppressDisabledCheck flag, shuffle arguments + if ( typeof suppressDisabledCheck !== "boolean" ) { + handlers = element; + element = suppressDisabledCheck; + suppressDisabledCheck = false; + } - if ( selector ) { - delegateElement.on( eventName, selector, handlerProxy ); + // No element argument, shuffle and use this.element + if ( !handlers ) { + handlers = element; + element = this.element; + delegateElement = this.widget(); } else { - element.on( eventName, handlerProxy ); + element = delegateElement = $( element ); + this.bindings = this.bindings.add( element ); } - } ); - }, - - _off: function( element, eventName ) { - eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + - this.eventNamespace; - element.off( eventName ).off( eventName ); - - // Clear the stack to avoid memory leaks (#10056) - this.bindings = $( this.bindings.not( element ).get() ); - this.focusable = $( this.focusable.not( element ).get() ); - this.hoverable = $( this.hoverable.not( element ).get() ); - }, - - _delay: function( handler, delay ) { - function handlerProxy() { - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - var instance = this; - return setTimeout( handlerProxy, delay || 0 ); - }, - - _hoverable: function( element ) { - this.hoverable = this.hoverable.add( element ); - this._on( element, { - mouseenter: function( event ) { - this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); - }, - mouseleave: function( event ) { - this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); - } - } ); - }, - _focusable: function( element ) { - this.focusable = this.focusable.add( element ); - this._on( element, { - focusin: function( event ) { - this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); - }, - focusout: function( event ) { - this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); - } - } ); - }, + $.each( handlers, function( event, handler ) { + function handlerProxy() { - _trigger: function( type, event, data ) { - var prop, orig; - var callback = this.options[ type ]; + // Allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( !suppressDisabledCheck && + ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) ) { + return; + } + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } - data = data || {}; - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); + // Copy the guid so direct unbinding works + if ( typeof handler !== "string" ) { + handlerProxy.guid = handler.guid = + handler.guid || handlerProxy.guid || $.guid++; + } - // The original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[ 0 ]; + var match = event.match( /^([\w:-]*)\s*(.*)$/ ); + var eventName = match[ 1 ] + instance.eventNamespace; + var selector = match[ 2 ]; - // Copy original event properties over to the new event - orig = event.originalEvent; - if ( orig ) { - for ( prop in orig ) { - if ( !( prop in event ) ) { - event[ prop ] = orig[ prop ]; + if ( selector ) { + delegateElement.on( eventName, selector, handlerProxy ); + } else { + element.on( eventName, handlerProxy ); } - } - } + } ); + }, - this.element.trigger( event, data ); - return !( $.isFunction( callback ) && - callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || - event.isDefaultPrevented() ); - } -}; + _off: function( element, eventName ) { + eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + + this.eventNamespace; + element.off( eventName ); -$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { - $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { - if ( typeof options === "string" ) { - options = { effect: options }; - } + // Clear the stack to avoid memory leaks (#10056) + this.bindings = $( this.bindings.not( element ).get() ); + this.focusable = $( this.focusable.not( element ).get() ); + this.hoverable = $( this.hoverable.not( element ).get() ); + }, - var hasOptions; - var effectName = !options ? - method : - options === true || typeof options === "number" ? - defaultEffect : - options.effect || defaultEffect; + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, - options = options || {}; - if ( typeof options === "number" ) { - options = { duration: options }; - } + _hoverable: function( element ) { + this.hoverable = this.hoverable.add( element ); + this._on( element, { + mouseenter: function( event ) { + this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); + }, + mouseleave: function( event ) { + this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); + } + } ); + }, - hasOptions = !$.isEmptyObject( options ); - options.complete = callback; + _focusable: function( element ) { + this.focusable = this.focusable.add( element ); + this._on( element, { + focusin: function( event ) { + this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); + }, + focusout: function( event ) { + this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); + } + } ); + }, - if ( options.delay ) { - element.delay( options.delay ); - } + _trigger: function( type, event, data ) { + var prop, orig; + var callback = this.options[ type ]; - if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { - element[ method ]( options ); - } else if ( effectName !== method && element[ effectName ] ) { - element[ effectName ]( options.duration, options.easing, callback ); - } else { - element.queue( function( next ) { - $( this )[ method ](); - if ( callback ) { - callback.call( element[ 0 ] ); + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + + // The original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // Copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } } - next(); - } ); + } + + this.element.trigger( event, data ); + return !( typeof callback === "function" && + callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || + event.isDefaultPrevented() ); } }; -} ); -var widget = $.widget; + $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + if ( typeof options === "string" ) { + options = { effect: options }; + } + var hasOptions; + var effectName = !options ? + method : + options === true || typeof options === "number" ? + defaultEffect : + options.effect || defaultEffect; -/*! - * jQuery UI Position 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/position/ - */ + options = options || {}; + if ( typeof options === "number" ) { + options = { duration: options }; + } else if ( options === true ) { + options = {}; + } -//>>label: Position -//>>group: Core -//>>description: Positions elements relative to other elements. -//>>docs: http://api.jqueryui.com/position/ -//>>demos: http://jqueryui.com/position/ - - -( function() { -var cachedScrollbarWidth, - max = Math.max, - abs = Math.abs, - rhorizontal = /left|center|right/, - rvertical = /top|center|bottom/, - roffset = /[\+\-]\d+(\.[\d]+)?%?/, - rposition = /^\w+/, - rpercent = /%$/, - _position = $.fn.position; - -function getOffsets( offsets, width, height ) { - return [ - parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), - parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) - ]; -} - -function parseCss( element, property ) { - return parseInt( $.css( element, property ), 10 ) || 0; -} - -function getDimensions( elem ) { - var raw = elem[ 0 ]; - if ( raw.nodeType === 9 ) { - return { - width: elem.width(), - height: elem.height(), - offset: { top: 0, left: 0 } - }; - } - if ( $.isWindow( raw ) ) { - return { - width: elem.width(), - height: elem.height(), - offset: { top: elem.scrollTop(), left: elem.scrollLeft() } - }; - } - if ( raw.preventDefault ) { - return { - width: 0, - height: 0, - offset: { top: raw.pageY, left: raw.pageX } + hasOptions = !$.isEmptyObject( options ); + options.complete = callback; + + if ( options.delay ) { + element.delay( options.delay ); + } + + if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { + element[ method ]( options ); + } else if ( effectName !== method && element[ effectName ] ) { + element[ effectName ]( options.duration, options.easing, callback ); + } else { + element.queue( function( next ) { + $( this )[ method ](); + if ( callback ) { + callback.call( element[ 0 ] ); + } + next(); + } ); + } }; - } - return { - width: elem.outerWidth(), - height: elem.outerHeight(), - offset: elem.offset() - }; -} + } ); -$.position = { - scrollbarWidth: function() { - if ( cachedScrollbarWidth !== undefined ) { - return cachedScrollbarWidth; - } - var w1, w2, - div = $( "
" + - "
" ), - innerDiv = div.children()[ 0 ]; + var widget = $.widget; - $( "body" ).append( div ); - w1 = innerDiv.offsetWidth; - div.css( "overflow", "scroll" ); - w2 = innerDiv.offsetWidth; + /*! + * jQuery UI Position 1.13.0 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/position/ + */ - if ( w1 === w2 ) { - w2 = div[ 0 ].clientWidth; - } + //>>label: Position + //>>group: Core + //>>description: Positions elements relative to other elements. + //>>docs: http://api.jqueryui.com/position/ + //>>demos: http://jqueryui.com/position/ + + + ( function() { + var cachedScrollbarWidth, + max = Math.max, + abs = Math.abs, + rhorizontal = /left|center|right/, + rvertical = /top|center|bottom/, + roffset = /[\+\-]\d+(\.[\d]+)?%?/, + rposition = /^\w+/, + rpercent = /%$/, + _position = $.fn.position; + + function getOffsets( offsets, width, height ) { + return [ + parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + ]; + } - div.remove(); - - return ( cachedScrollbarWidth = w1 - w2 ); - }, - getScrollInfo: function( within ) { - var overflowX = within.isWindow || within.isDocument ? "" : - within.element.css( "overflow-x" ), - overflowY = within.isWindow || within.isDocument ? "" : - within.element.css( "overflow-y" ), - hasOverflowX = overflowX === "scroll" || - ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), - hasOverflowY = overflowY === "scroll" || - ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); - return { - width: hasOverflowY ? $.position.scrollbarWidth() : 0, - height: hasOverflowX ? $.position.scrollbarWidth() : 0 - }; - }, - getWithinInfo: function( element ) { - var withinElement = $( element || window ), - isWindow = $.isWindow( withinElement[ 0 ] ), - isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, - hasOffset = !isWindow && !isDocument; - return { - element: withinElement, - isWindow: isWindow, - isDocument: isDocument, - offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, - scrollLeft: withinElement.scrollLeft(), - scrollTop: withinElement.scrollTop(), - width: withinElement.outerWidth(), - height: withinElement.outerHeight() - }; + function parseCss( element, property ) { + return parseInt( $.css( element, property ), 10 ) || 0; } -}; -$.fn.position = function( options ) { - if ( !options || !options.of ) { - return _position.apply( this, arguments ); + function isWindow( obj ) { + return obj != null && obj === obj.window; } - // Make a copy, we don't want to modify arguments - options = $.extend( {}, options ); + function getDimensions( elem ) { + var raw = elem[ 0 ]; + if ( raw.nodeType === 9 ) { + return { + width: elem.width(), + height: elem.height(), + offset: { top: 0, left: 0 } + }; + } + if ( isWindow( raw ) ) { + return { + width: elem.width(), + height: elem.height(), + offset: { top: elem.scrollTop(), left: elem.scrollLeft() } + }; + } + if ( raw.preventDefault ) { + return { + width: 0, + height: 0, + offset: { top: raw.pageY, left: raw.pageX } + }; + } + return { + width: elem.outerWidth(), + height: elem.outerHeight(), + offset: elem.offset() + }; + } - var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, - target = $( options.of ), - within = $.position.getWithinInfo( options.within ), - scrollInfo = $.position.getScrollInfo( within ), - collision = ( options.collision || "flip" ).split( " " ), - offsets = {}; + $.position = { + scrollbarWidth: function() { + if ( cachedScrollbarWidth !== undefined ) { + return cachedScrollbarWidth; + } + var w1, w2, + div = $( "
" + + "
" ), + innerDiv = div.children()[ 0 ]; - dimensions = getDimensions( target ); - if ( target[ 0 ].preventDefault ) { + $( "body" ).append( div ); + w1 = innerDiv.offsetWidth; + div.css( "overflow", "scroll" ); - // Force left top to allow flipping - options.at = "left top"; - } - targetWidth = dimensions.width; - targetHeight = dimensions.height; - targetOffset = dimensions.offset; - - // Clone to reuse original targetOffset later - basePosition = $.extend( {}, targetOffset ); - - // Force my and at to have valid horizontal and vertical positions - // if a value is missing or invalid, it will be converted to center - $.each( [ "my", "at" ], function() { - var pos = ( options[ this ] || "" ).split( " " ), - horizontalOffset, - verticalOffset; - - if ( pos.length === 1 ) { - pos = rhorizontal.test( pos[ 0 ] ) ? - pos.concat( [ "center" ] ) : - rvertical.test( pos[ 0 ] ) ? - [ "center" ].concat( pos ) : - [ "center", "center" ]; - } - pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; - pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; - - // Calculate offsets - horizontalOffset = roffset.exec( pos[ 0 ] ); - verticalOffset = roffset.exec( pos[ 1 ] ); - offsets[ this ] = [ - horizontalOffset ? horizontalOffset[ 0 ] : 0, - verticalOffset ? verticalOffset[ 0 ] : 0 - ]; + w2 = innerDiv.offsetWidth; - // Reduce to just the positions without the offsets - options[ this ] = [ - rposition.exec( pos[ 0 ] )[ 0 ], - rposition.exec( pos[ 1 ] )[ 0 ] - ]; - } ); + if ( w1 === w2 ) { + w2 = div[ 0 ].clientWidth; + } - // Normalize collision option - if ( collision.length === 1 ) { - collision[ 1 ] = collision[ 0 ]; - } + div.remove(); - if ( options.at[ 0 ] === "right" ) { - basePosition.left += targetWidth; - } else if ( options.at[ 0 ] === "center" ) { - basePosition.left += targetWidth / 2; - } + return ( cachedScrollbarWidth = w1 - w2 ); + }, + getScrollInfo: function( within ) { + var overflowX = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-x" ), + overflowY = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-y" ), + hasOverflowX = overflowX === "scroll" || + ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), + hasOverflowY = overflowY === "scroll" || + ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); + return { + width: hasOverflowY ? $.position.scrollbarWidth() : 0, + height: hasOverflowX ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function( element ) { + var withinElement = $( element || window ), + isElemWindow = isWindow( withinElement[ 0 ] ), + isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, + hasOffset = !isElemWindow && !isDocument; + return { + element: withinElement, + isWindow: isElemWindow, + isDocument: isDocument, + offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + width: withinElement.outerWidth(), + height: withinElement.outerHeight() + }; + } + }; - if ( options.at[ 1 ] === "bottom" ) { - basePosition.top += targetHeight; - } else if ( options.at[ 1 ] === "center" ) { - basePosition.top += targetHeight / 2; - } + $.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // Make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, + + // Make sure string options are treated as CSS selectors + target = typeof options.of === "string" ? + $( document ).find( options.of ) : + $( options.of ), + + within = $.position.getWithinInfo( options.within ), + scrollInfo = $.position.getScrollInfo( within ), + collision = ( options.collision || "flip" ).split( " " ), + offsets = {}; + + dimensions = getDimensions( target ); + if ( target[ 0 ].preventDefault ) { + + // Force left top to allow flipping + options.at = "left top"; + } + targetWidth = dimensions.width; + targetHeight = dimensions.height; + targetOffset = dimensions.offset; + + // Clone to reuse original targetOffset later + basePosition = $.extend( {}, targetOffset ); + + // Force my and at to have valid horizontal and vertical positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[ this ] || "" ).split( " " ), + horizontalOffset, + verticalOffset; + + if ( pos.length === 1 ) { + pos = rhorizontal.test( pos[ 0 ] ) ? + pos.concat( [ "center" ] ) : + rvertical.test( pos[ 0 ] ) ? + [ "center" ].concat( pos ) : + [ "center", "center" ]; + } + pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; + pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; + + // Calculate offsets + horizontalOffset = roffset.exec( pos[ 0 ] ); + verticalOffset = roffset.exec( pos[ 1 ] ); + offsets[ this ] = [ + horizontalOffset ? horizontalOffset[ 0 ] : 0, + verticalOffset ? verticalOffset[ 0 ] : 0 + ]; + + // Reduce to just the positions without the offsets + options[ this ] = [ + rposition.exec( pos[ 0 ] )[ 0 ], + rposition.exec( pos[ 1 ] )[ 0 ] + ]; + } ); - atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); - basePosition.left += atOffset[ 0 ]; - basePosition.top += atOffset[ 1 ]; - - return this.each( function() { - var collisionPosition, using, - elem = $( this ), - elemWidth = elem.outerWidth(), - elemHeight = elem.outerHeight(), - marginLeft = parseCss( this, "marginLeft" ), - marginTop = parseCss( this, "marginTop" ), - collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + - scrollInfo.width, - collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + - scrollInfo.height, - position = $.extend( {}, basePosition ), - myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); - - if ( options.my[ 0 ] === "right" ) { - position.left -= elemWidth; - } else if ( options.my[ 0 ] === "center" ) { - position.left -= elemWidth / 2; + // Normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; } - if ( options.my[ 1 ] === "bottom" ) { - position.top -= elemHeight; - } else if ( options.my[ 1 ] === "center" ) { - position.top -= elemHeight / 2; + if ( options.at[ 0 ] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[ 0 ] === "center" ) { + basePosition.left += targetWidth / 2; } - position.left += myOffset[ 0 ]; - position.top += myOffset[ 1 ]; + if ( options.at[ 1 ] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[ 1 ] === "center" ) { + basePosition.top += targetHeight / 2; + } - collisionPosition = { - marginLeft: marginLeft, - marginTop: marginTop - }; + atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); + basePosition.left += atOffset[ 0 ]; + basePosition.top += atOffset[ 1 ]; - $.each( [ "left", "top" ], function( i, dir ) { - if ( $.ui.position[ collision[ i ] ] ) { - $.ui.position[ collision[ i ] ][ dir ]( position, { - targetWidth: targetWidth, - targetHeight: targetHeight, - elemWidth: elemWidth, - elemHeight: elemHeight, - collisionPosition: collisionPosition, - collisionWidth: collisionWidth, - collisionHeight: collisionHeight, - offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], - my: options.my, - at: options.at, - within: within, - elem: elem - } ); - } - } ); + return this.each( function() { + var collisionPosition, using, + elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseCss( this, "marginLeft" ), + marginTop = parseCss( this, "marginTop" ), + collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + + scrollInfo.width, + collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + + scrollInfo.height, + position = $.extend( {}, basePosition ), + myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); + + if ( options.my[ 0 ] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[ 0 ] === "center" ) { + position.left -= elemWidth / 2; + } + + if ( options.my[ 1 ] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[ 1 ] === "center" ) { + position.top -= elemHeight / 2; + } + + position.left += myOffset[ 0 ]; + position.top += myOffset[ 1 ]; + + collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; - if ( options.using ) { - - // Adds feedback as second argument to using callback, if present - using = function( props ) { - var left = targetOffset.left - position.left, - right = left + targetWidth - elemWidth, - top = targetOffset.top - position.top, - bottom = top + targetHeight - elemHeight, - feedback = { - target: { - element: target, - left: targetOffset.left, - top: targetOffset.top, - width: targetWidth, - height: targetHeight - }, - element: { - element: elem, - left: position.left, - top: position.top, - width: elemWidth, - height: elemHeight - }, - horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", - vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" - }; - if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { - feedback.horizontal = "center"; - } - if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { - feedback.vertical = "middle"; + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[ i ] ] ) { + $.ui.position[ collision[ i ] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], + my: options.my, + at: options.at, + within: within, + elem: elem + } ); } - if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { - feedback.important = "horizontal"; - } else { - feedback.important = "vertical"; - } - options.using.call( this, props, feedback ); - }; - } + } ); - elem.offset( $.extend( position, { using: using } ) ); - } ); -}; - -$.ui.position = { - fit: { - left: function( position, data ) { - var within = data.within, - withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, - outerWidth = within.width, - collisionPosLeft = position.left - data.collisionPosition.marginLeft, - overLeft = withinOffset - collisionPosLeft, - overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, - newOverRight; - - // Element is wider than within - if ( data.collisionWidth > outerWidth ) { - - // Element is initially over the left side of within - if ( overLeft > 0 && overRight <= 0 ) { - newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - - withinOffset; - position.left += overLeft - newOverRight; - - // Element is initially over right side of within - } else if ( overRight > 0 && overLeft <= 0 ) { - position.left = withinOffset; - - // Element is initially over both left and right sides of within - } else { - if ( overLeft > overRight ) { - position.left = withinOffset + outerWidth - data.collisionWidth; + if ( options.using ) { + + // Adds feedback as second argument to using callback, if present + using = function( props ) { + var left = targetOffset.left - position.left, + right = left + targetWidth - elemWidth, + top = targetOffset.top - position.top, + bottom = top + targetHeight - elemHeight, + feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" + }; + if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { + feedback.horizontal = "center"; + } + if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { + feedback.vertical = "middle"; + } + if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { + feedback.important = "horizontal"; } else { - position.left = withinOffset; + feedback.important = "vertical"; } - } - - // Too far left -> align with left edge - } else if ( overLeft > 0 ) { - position.left += overLeft; + options.using.call( this, props, feedback ); + }; + } - // Too far right -> align with right edge - } else if ( overRight > 0 ) { - position.left -= overRight; + elem.offset( $.extend( position, { using: using } ) ); + } ); + }; - // Adjust based on position and margin - } else { - position.left = max( position.left - collisionPosLeft, position.left ); - } - }, - top: function( position, data ) { - var within = data.within, - withinOffset = within.isWindow ? within.scrollTop : within.offset.top, - outerHeight = data.within.height, - collisionPosTop = position.top - data.collisionPosition.marginTop, - overTop = withinOffset - collisionPosTop, - overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, - newOverBottom; + $.ui.position = { + fit: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, + outerWidth = within.width, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = withinOffset - collisionPosLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, + newOverRight; + + // Element is wider than within + if ( data.collisionWidth > outerWidth ) { + + // Element is initially over the left side of within + if ( overLeft > 0 && overRight <= 0 ) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - + withinOffset; + position.left += overLeft - newOverRight; + + // Element is initially over right side of within + } else if ( overRight > 0 && overLeft <= 0 ) { + position.left = withinOffset; - // Element is taller than within - if ( data.collisionHeight > outerHeight ) { + // Element is initially over both left and right sides of within + } else { + if ( overLeft > overRight ) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } - // Element is initially over the top of within - if ( overTop > 0 && overBottom <= 0 ) { - newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - - withinOffset; - position.top += overTop - newOverBottom; + // Too far left -> align with left edge + } else if ( overLeft > 0 ) { + position.left += overLeft; - // Element is initially over bottom of within - } else if ( overBottom > 0 && overTop <= 0 ) { - position.top = withinOffset; + // Too far right -> align with right edge + } else if ( overRight > 0 ) { + position.left -= overRight; - // Element is initially over both top and bottom of within + // Adjust based on position and margin } else { - if ( overTop > overBottom ) { - position.top = withinOffset + outerHeight - data.collisionHeight; - } else { + position.left = max( position.left - collisionPosLeft, position.left ); + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollTop : within.offset.top, + outerHeight = data.within.height, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = withinOffset - collisionPosTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, + newOverBottom; + + // Element is taller than within + if ( data.collisionHeight > outerHeight ) { + + // Element is initially over the top of within + if ( overTop > 0 && overBottom <= 0 ) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - + withinOffset; + position.top += overTop - newOverBottom; + + // Element is initially over bottom of within + } else if ( overBottom > 0 && overTop <= 0 ) { position.top = withinOffset; + + // Element is initially over both top and bottom of within + } else { + if ( overTop > overBottom ) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } } - } - // Too far up -> align with top - } else if ( overTop > 0 ) { - position.top += overTop; + // Too far up -> align with top + } else if ( overTop > 0 ) { + position.top += overTop; - // Too far down -> align with bottom edge - } else if ( overBottom > 0 ) { - position.top -= overBottom; + // Too far down -> align with bottom edge + } else if ( overBottom > 0 ) { + position.top -= overBottom; - // Adjust based on position and margin - } else { - position.top = max( position.top - collisionPosTop, position.top ); - } - } - }, - flip: { - left: function( position, data ) { - var within = data.within, - withinOffset = within.offset.left + within.scrollLeft, - outerWidth = within.width, - offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, - collisionPosLeft = position.left - data.collisionPosition.marginLeft, - overLeft = collisionPosLeft - offsetLeft, - overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, - myOffset = data.my[ 0 ] === "left" ? - -data.elemWidth : - data.my[ 0 ] === "right" ? - data.elemWidth : - 0, - atOffset = data.at[ 0 ] === "left" ? - data.targetWidth : - data.at[ 0 ] === "right" ? - -data.targetWidth : - 0, - offset = -2 * data.offset[ 0 ], - newOverRight, - newOverLeft; - - if ( overLeft < 0 ) { - newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - - outerWidth - withinOffset; - if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { - position.left += myOffset + atOffset + offset; - } - } else if ( overRight > 0 ) { - newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + - atOffset + offset - offsetLeft; - if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { - position.left += myOffset + atOffset + offset; - } - } - }, - top: function( position, data ) { - var within = data.within, - withinOffset = within.offset.top + within.scrollTop, - outerHeight = within.height, - offsetTop = within.isWindow ? within.scrollTop : within.offset.top, - collisionPosTop = position.top - data.collisionPosition.marginTop, - overTop = collisionPosTop - offsetTop, - overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, - top = data.my[ 1 ] === "top", - myOffset = top ? - -data.elemHeight : - data.my[ 1 ] === "bottom" ? - data.elemHeight : - 0, - atOffset = data.at[ 1 ] === "top" ? - data.targetHeight : - data.at[ 1 ] === "bottom" ? - -data.targetHeight : - 0, - offset = -2 * data.offset[ 1 ], - newOverTop, - newOverBottom; - if ( overTop < 0 ) { - newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - - outerHeight - withinOffset; - if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { - position.top += myOffset + atOffset + offset; - } - } else if ( overBottom > 0 ) { - newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + - offset - offsetTop; - if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { - position.top += myOffset + atOffset + offset; + // Adjust based on position and margin + } else { + position.top = max( position.top - collisionPosTop, position.top ); + } + } + }, + flip: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.offset.left + within.scrollLeft, + outerWidth = within.width, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = collisionPosLeft - offsetLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + data.at[ 0 ] === "right" ? + -data.targetWidth : + 0, + offset = -2 * data.offset[ 0 ], + newOverRight, + newOverLeft; + + if ( overLeft < 0 ) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - + outerWidth - withinOffset; + if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { + position.left += myOffset + atOffset + offset; + } + } else if ( overRight > 0 ) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + + atOffset + offset - offsetLeft; + if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { + position.left += myOffset + atOffset + offset; + } } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.offset.top + within.scrollTop, + outerHeight = within.height, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = collisionPosTop - offsetTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, + top = data.my[ 1 ] === "top", + myOffset = top ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + data.at[ 1 ] === "bottom" ? + -data.targetHeight : + 0, + offset = -2 * data.offset[ 1 ], + newOverTop, + newOverBottom; + if ( overTop < 0 ) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - + outerHeight - withinOffset; + if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { + position.top += myOffset + atOffset + offset; + } + } else if ( overBottom > 0 ) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + + offset - offsetTop; + if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function() { + $.ui.position.flip.left.apply( this, arguments ); + $.ui.position.fit.left.apply( this, arguments ); + }, + top: function() { + $.ui.position.flip.top.apply( this, arguments ); + $.ui.position.fit.top.apply( this, arguments ); } } - }, - flipfit: { - left: function() { - $.ui.position.flip.left.apply( this, arguments ); - $.ui.position.fit.left.apply( this, arguments ); - }, - top: function() { - $.ui.position.flip.top.apply( this, arguments ); - $.ui.position.fit.top.apply( this, arguments ); - } - } -}; + }; -} )(); + } )(); -var position = $.ui.position; + var position = $.ui.position; -/*! - * jQuery UI Keycode 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ + /*! + * jQuery UI Support for jQuery core 1.8.x and newer 1.13.0 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + */ -//>>label: Keycode -//>>group: Core -//>>description: Provide keycodes as keynames -//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ - - -var keycode = $.ui.keyCode = { - BACKSPACE: 8, - COMMA: 188, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - LEFT: 37, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SPACE: 32, - TAB: 9, - UP: 38 -}; + //>>label: jQuery 1.8+ Support + //>>group: Core + //>>description: Support version 1.8.x and newer of jQuery core -/*! - * jQuery UI Scroll Parent 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ + // Support: jQuery 1.9.x or older + // $.expr[ ":" ] is deprecated. + if ( !$.expr.pseudos ) { + $.expr.pseudos = $.expr[ ":" ]; + } -//>>label: scrollParent -//>>group: Core -//>>description: Get the closest ancestor element that is scrollable. -//>>docs: http://api.jqueryui.com/scrollParent/ + // Support: jQuery 1.11.x or older + // $.unique has been renamed to $.uniqueSort + if ( !$.uniqueSort ) { + $.uniqueSort = $.unique; + } + // Support: jQuery 2.2.x or older. + // This method has been defined in jQuery 3.0.0. + // Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js + if ( !$.escapeSelector ) { + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; -var scrollParent = $.fn.scrollParent = function( includeHidden ) { - var position = this.css( "position" ), - excludeStaticParent = position === "absolute", - overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, - scrollParent = this.parents().filter( function() { - var parent = $( this ); - if ( excludeStaticParent && parent.css( "position" ) === "static" ) { - return false; + var fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } - return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + - parent.css( "overflow-x" ) ); - } ).eq( 0 ); - return position === "fixed" || !scrollParent.length ? - $( this[ 0 ].ownerDocument || document ) : - scrollParent; -}; + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }; + $.escapeSelector = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); + }; + } + + // Support: jQuery 3.4.x or older + // These methods have been defined in jQuery 3.5.0. + if ( !$.fn.even || !$.fn.odd ) { + $.fn.extend( { + even: function() { + return this.filter( function( i ) { + return i % 2 === 0; + } ); + }, + odd: function() { + return this.filter( function( i ) { + return i % 2 === 1; + } ); + } + } ); + } + + ; + /*! + * jQuery UI Keycode 1.13.0 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + + //>>label: Keycode + //>>group: Core + //>>description: Provide keycodes as keynames + //>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ + + + var keycode = $.ui.keyCode = { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + }; + + + /*! + * jQuery UI Scroll Parent 1.13.0 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + + //>>label: scrollParent + //>>group: Core + //>>description: Get the closest ancestor element that is scrollable. + //>>docs: http://api.jqueryui.com/scrollParent/ -/*! - * jQuery UI Unique ID 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -//>>label: uniqueId -//>>group: Core -//>>description: Functions to generate and remove uniqueId's -//>>docs: http://api.jqueryui.com/uniqueId/ + var scrollParent = $.fn.scrollParent = function( includeHidden ) { + var position = this.css( "position" ), + excludeStaticParent = position === "absolute", + overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, + scrollParent = this.parents().filter( function() { + var parent = $( this ); + if ( excludeStaticParent && parent.css( "position" ) === "static" ) { + return false; + } + return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + + parent.css( "overflow-x" ) ); + } ).eq( 0 ); + + return position === "fixed" || !scrollParent.length ? + $( this[ 0 ].ownerDocument || document ) : + scrollParent; + }; + + + /*! + * jQuery UI Unique ID 1.13.0 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + //>>label: uniqueId + //>>group: Core + //>>description: Functions to generate and remove uniqueId's + //>>docs: http://api.jqueryui.com/uniqueId/ -var uniqueId = $.fn.extend( { - uniqueId: ( function() { - var uuid = 0; + var uniqueId = $.fn.extend( { + uniqueId: ( function() { + var uuid = 0; - return function() { + return function() { + return this.each( function() { + if ( !this.id ) { + this.id = "ui-id-" + ( ++uuid ); + } + } ); + }; + } )(), + + removeUniqueId: function() { return this.each( function() { - if ( !this.id ) { - this.id = "ui-id-" + ( ++uuid ); + if ( /^ui-id-\d+$/.test( this.id ) ) { + $( this ).removeAttr( "id" ); } } ); - }; - } )(), + } + } ); + - removeUniqueId: function() { - return this.each( function() { - if ( /^ui-id-\d+$/.test( this.id ) ) { - $( this ).removeAttr( "id" ); - } - } ); - } -} ); // NOTE: Original jQuery UI wrapper was replaced. See README-Fancytree.md @@ -1365,15 +1464,15 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ /** Core Fancytree module. */ // UMD wrapper for the Fancytree core module -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree.ui-deps"], factory); @@ -1385,7 +1484,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; // prevent duplicate loading @@ -1490,17 +1589,19 @@ var uniqueId = $.fn.extend( { MOUSE_BUTTONS = { 0: "", 1: "left", 2: "middle", 3: "right" }, // Boolean attributes that can be set with equivalent class names in the LI tags // Note: v2.23: checkbox and hideCheckbox are *not* in this list - CLASS_ATTRS = "active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split( - " " - ), + CLASS_ATTRS = + "active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split( + " " + ), CLASS_ATTR_MAP = {}, // Top-level Fancytree attributes, that can be set by dict TREE_ATTRS = "columns types".split(" "), // TREE_ATTR_MAP = {}, // Top-level FancytreeNode attributes, that can be set by dict - NODE_ATTRS = "checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split( - " " - ), + NODE_ATTRS = + "checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split( + " " + ), NODE_ATTR_MAP = {}, // Mapping of lowercase -> real name (because HTML5 data-... attribute only supports lowercase) NODE_ATTR_LOWERCASE_MAP = {}, @@ -1543,6 +1644,23 @@ var uniqueId = $.fn.extend( { } } + function _hasProp(object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + } + + /* Replacement for the deprecated `jQuery.isFunction()`. */ + function _isFunction(obj) { + return typeof obj === "function"; + } + + /* Replacement for the deprecated `jQuery.trim()`. */ + function _trim(text) { + return text == null ? "" : text.trim(); + } + + /* Replacement for the deprecated `jQuery.isArray()`. */ + var _isArray = Array.isArray; + _assert($.ui, "Fancytree requires jQuery UI (http://jqueryui.com)"); function consoleApply(method, args) { @@ -1584,12 +1702,12 @@ var uniqueId = $.fn.extend( { var i, v, t, - verParts = $.map($.trim(dottedVersion).split("."), function(e) { + verParts = $.map(_trim(dottedVersion).split("."), function (e) { return parseInt(e, 10); }), testParts = $.map( Array.prototype.slice.call(arguments, 1), - function(e) { + function (e) { return parseInt(e, 10); } ); @@ -1628,7 +1746,7 @@ var uniqueId = $.fn.extend( { length = arguments.length; // Handle case when target is a string or something (possible in deep copy) - if (typeof target !== "object" && !$.isFunction(target)) { + if (typeof target !== "object" && !_isFunction(target)) { target = {}; } if (i === length) { @@ -1639,7 +1757,7 @@ var uniqueId = $.fn.extend( { if ((options = arguments[i]) != null) { // Extend the base object for (name in options) { - if (options.hasOwnProperty(name)) { + if (_hasProp(options, name)) { src = target[name]; copy = options[name]; // Prevent never-ending loop @@ -1677,19 +1795,19 @@ var uniqueId = $.fn.extend( { // return func; // } // Use an immediate function as closure - var proxy = (function() { + var proxy = (function () { var prevFunc = tree[methodName], // org. tree method or prev. proxy baseFunc = extension[methodName], // _local = tree.ext[extName], - _super = function() { + _super = function () { return prevFunc.apply(tree, arguments); }, - _superApply = function(args) { + _superApply = function (args) { return prevFunc.apply(tree, args); }; // Return the wrapper function - return function() { + return function () { var prevLocal = tree._local, prevSuper = tree._super, prevSuperApply = tree._superApply; @@ -1755,28 +1873,28 @@ var uniqueId = $.fn.extend( { function _getResolvedPromise(context, argArray) { if (context === undefined) { - return $.Deferred(function() { + return $.Deferred(function () { this.resolve(); }).promise(); } - return $.Deferred(function() { + return $.Deferred(function () { this.resolveWith(context, argArray); }).promise(); } function _getRejectedPromise(context, argArray) { if (context === undefined) { - return $.Deferred(function() { + return $.Deferred(function () { this.reject(); }).promise(); } - return $.Deferred(function() { + return $.Deferred(function () { this.rejectWith(context, argArray); }).promise(); } function _makeResolveFunc(deferred, context) { - return function() { + return function () { deferred.resolveWith(context); }; } @@ -1798,7 +1916,7 @@ var uniqueId = $.fn.extend( { } function _escapeTooltip(s) { - return ("" + s).replace(REX_TOOLTIP, function(s) { + return ("" + s).replace(REX_TOOLTIP, function (s) { return ENTITY_MAP[s]; }); } @@ -1806,14 +1924,14 @@ var uniqueId = $.fn.extend( { // TODO: use currying function _makeNodeTitleMatcher(s) { s = s.toLowerCase(); - return function(node) { + return function (node) { return node.title.toLowerCase().indexOf(s) >= 0; }; } function _makeNodeTitleStartMatcher(s) { var reMatch = new RegExp("^" + s, "i"); - return function(node) { + return function (node) { return reMatch.test(node.title); }; } @@ -1890,7 +2008,7 @@ var uniqueId = $.fn.extend( { if ( !NODE_ATTR_MAP[name] && (this.tree.options.copyFunctionsToData || - !$.isFunction(obj[name])) && + !_isFunction(obj[name])) && !NONE_NODE_DATA_MAP[name] ) { // node.data.NAME = obj.NAME @@ -1947,7 +2065,7 @@ var uniqueId = $.fn.extend( { FancytreeNode.prototype = /** @lends FancytreeNode# */ { /* Return the direct child FancytreeNode with a given key, index. */ - _findDirectChild: function(ptr) { + _findDirectChild: function (ptr) { var i, l, cl = this.children; @@ -1970,7 +2088,7 @@ var uniqueId = $.fn.extend( { // TODO: activate() // TODO: activateSilently() /* Internal helper called in recursive addChildren sequence.*/ - _setChildren: function(children) { + _setChildren: function (children) { _assert( children && (!this.children || this.children.length === 0), "only init supported" @@ -1995,7 +2113,7 @@ var uniqueId = $.fn.extend( { * * @see FancytreeNode#applyPatch */ - addChildren: function(children, insertBefore) { + addChildren: function (children, insertBefore) { var i, l, pos, @@ -2063,7 +2181,7 @@ var uniqueId = $.fn.extend( { * * @since 2.17 */ - addClass: function(className) { + addClass: function (className) { return this.toggleClass(className, true); }, /** @@ -2075,7 +2193,7 @@ var uniqueId = $.fn.extend( { * @param {string} [mode=child] 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child') * @returns {FancytreeNode} new node */ - addNode: function(node, mode) { + addNode: function (node, mode) { if (mode === undefined || mode === "over") { mode = "child"; } @@ -2104,7 +2222,7 @@ var uniqueId = $.fn.extend( { * @param {string} [mode='child'] 'child'|firstChild' * @since 2.15 */ - addPagingNode: function(node, mode) { + addPagingNode: function (node, mode) { var i, n; mode = mode || "child"; @@ -2137,7 +2255,7 @@ var uniqueId = $.fn.extend( { * @param {NodeData} node node definition * @returns {FancytreeNode} new node */ - appendSibling: function(node) { + appendSibling: function (node) { return this.addNode(node, "after"); }, /** @@ -2148,7 +2266,7 @@ var uniqueId = $.fn.extend( { * @see Fancytree#applyCommand * @since 2.32 */ - applyCommand: function(cmd, opts) { + applyCommand: function (cmd, opts) { return this.tree.applyCommand(cmd, this, opts); }, /** @@ -2158,7 +2276,7 @@ var uniqueId = $.fn.extend( { * @returns {$.Promise} * @see FancytreeNode#addChildren */ - applyPatch: function(patch) { + applyPatch: function (patch) { // patch [key, null] means 'remove' if (patch === null) { this.remove(); @@ -2172,9 +2290,9 @@ var uniqueId = $.fn.extend( { IGNORE_MAP = { children: true, expanded: true, parent: true }; // TODO: should be global for (name in patch) { - if (patch.hasOwnProperty(name)) { + if (_hasProp(patch, name)) { v = patch[name]; - if (!IGNORE_MAP[name] && !$.isFunction(v)) { + if (!IGNORE_MAP[name] && !_isFunction(v)) { if (NODE_ATTR_MAP[name]) { this[name] = v; } else { @@ -2184,7 +2302,7 @@ var uniqueId = $.fn.extend( { } } // Remove and/or create children - if (patch.hasOwnProperty("children")) { + if (_hasProp(patch, "children")) { this.removeChildren(); if (patch.children) { // only if not null and not empty list @@ -2198,7 +2316,7 @@ var uniqueId = $.fn.extend( { this.renderStatus(); } // Expand collapse (final step, since this may be async) - if (patch.hasOwnProperty("expanded")) { + if (_hasProp(patch, "expanded")) { promise = this.setExpanded(patch.expanded); } else { promise = _getResolvedPromise(this); @@ -2208,7 +2326,7 @@ var uniqueId = $.fn.extend( { /** Collapse all sibling nodes. * @returns {$.Promise} */ - collapseSiblings: function() { + collapseSiblings: function () { return this.tree._callHook("nodeCollapseSiblings", this); }, /** Copy this node as sibling or child of `node`. @@ -2218,7 +2336,7 @@ var uniqueId = $.fn.extend( { * @param {Function} [map] callback function(NodeData, FancytreeNode) that could modify the new node * @returns {FancytreeNode} new */ - copyTo: function(node, mode, map) { + copyTo: function (node, mode, map) { return node.addNode(this.toDict(true, map), mode); }, /** Count direct and indirect children. @@ -2226,7 +2344,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [deep=true] pass 'false' to only count direct children * @returns {int} number of child nodes */ - countChildren: function(deep) { + countChildren: function (deep) { var cl = this.children, i, l, @@ -2247,7 +2365,7 @@ var uniqueId = $.fn.extend( { * * @param {*} msg string or object or array of such */ - debug: function(msg) { + debug: function (msg) { if (this.tree.options.debugLevel >= 4) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("log", arguments); @@ -2256,7 +2374,7 @@ var uniqueId = $.fn.extend( { /** Deprecated. * @deprecated since 2014-02-16. Use resetLazy() instead. */ - discard: function() { + discard: function () { this.warn( "FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead." ); @@ -2266,7 +2384,7 @@ var uniqueId = $.fn.extend( { * to keep the DOM small. * @param {boolean} [includeSelf=false] */ - discardMarkup: function(includeSelf) { + discardMarkup: function (includeSelf) { var fn = includeSelf ? "nodeRemoveMarkup" : "nodeRemoveChildMarkup"; this.tree._callHook(fn, this); }, @@ -2274,7 +2392,7 @@ var uniqueId = $.fn.extend( { * * @param {*} msg string or object or array of such */ - error: function(msg) { + error: function (msg) { if (this.tree.options.debugLevel >= 1) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("error", arguments); @@ -2286,10 +2404,10 @@ var uniqueId = $.fn.extend( { * callback function that returns `true` if a node is matched. * @returns {FancytreeNode[]} array of nodes (may be empty) */ - findAll: function(match) { - match = $.isFunction(match) ? match : _makeNodeTitleMatcher(match); + findAll: function (match) { + match = _isFunction(match) ? match : _makeNodeTitleMatcher(match); var res = []; - this.visit(function(n) { + this.visit(function (n) { if (match(n)) { res.push(n); } @@ -2303,10 +2421,10 @@ var uniqueId = $.fn.extend( { * @returns {FancytreeNode} matching node or null * @see FancytreeNode#findAll */ - findFirst: function(match) { - match = $.isFunction(match) ? match : _makeNodeTitleMatcher(match); + findFirst: function (match) { + match = _isFunction(match) ? match : _makeNodeTitleMatcher(match); var res = null; - this.visit(function(n) { + this.visit(function (n) { if (match(n)) { res = n; return false; @@ -2321,11 +2439,11 @@ var uniqueId = $.fn.extend( { * @returns {FancytreeNode} * @since v2.31 */ - findRelatedNode: function(where, includeHidden) { + findRelatedNode: function (where, includeHidden) { return this.tree.findRelatedNode(this, where, includeHidden); }, /* Apply selection state (internal use only) */ - _changeSelectStatusAttrs: function(state) { + _changeSelectStatusAttrs: function (state) { var changed = false, opts = this.tree.options, unselectable = FT.evalOption( @@ -2375,12 +2493,12 @@ var uniqueId = $.fn.extend( { * Fix selection status, after this node was (de)selected in multi-hier mode. * This includes (de)selecting all children. */ - fixSelection3AfterClick: function(callOpts) { + fixSelection3AfterClick: function (callOpts) { var flag = this.isSelected(); // this.debug("fixSelection3AfterClick()"); - this.visit(function(node) { + this.visit(function (node) { node._changeSelectStatusAttrs(flag); if (node.radiogroup) { // #931: don't (de)select this branch @@ -2395,7 +2513,7 @@ var uniqueId = $.fn.extend( { * Should be called after this node has loaded new children or after * children have been modified using the API. */ - fixSelection3FromEndNodes: function(callOpts) { + fixSelection3FromEndNodes: function (callOpts) { var opts = this.tree.options; // this.debug("fixSelection3FromEndNodes()"); @@ -2473,7 +2591,7 @@ var uniqueId = $.fn.extend( { _walk(this); // Update parent's state - this.visitParents(function(node) { + this.visitParents(function (node) { var i, l, child, @@ -2529,7 +2647,7 @@ var uniqueId = $.fn.extend( { * @see FancytreeNode#addChildren * @see FancytreeNode#applyPatch */ - fromDict: function(dict) { + fromDict: function (dict) { // copy all other attributes to this.data.xxx for (var name in dict) { if (NODE_ATTR_MAP[name]) { @@ -2539,7 +2657,7 @@ var uniqueId = $.fn.extend( { // node.data += dict.data $.extend(this.data, dict.data); } else if ( - !$.isFunction(dict[name]) && + !_isFunction(dict[name]) && !NONE_NODE_DATA_MAP[name] ) { // node.data.NAME = dict.NAME @@ -2569,7 +2687,7 @@ var uniqueId = $.fn.extend( { /** Return the list of child nodes (undefined for unexpanded lazy nodes). * @returns {FancytreeNode[] | undefined} */ - getChildren: function() { + getChildren: function () { if (this.hasChildren() === undefined) { // TODO: only required for lazy nodes? return undefined; // Lazy node: unloaded, currently loading, or load error @@ -2579,13 +2697,13 @@ var uniqueId = $.fn.extend( { /** Return the first child node or null. * @returns {FancytreeNode | null} */ - getFirstChild: function() { + getFirstChild: function () { return this.children ? this.children[0] : null; }, /** Return the 0-based child index. * @returns {int} */ - getIndex: function() { + getIndex: function () { // return this.parent.children.indexOf(this); return $.inArray(this, this.parent.children); // indexOf doesn't work in IE7 }, @@ -2594,11 +2712,11 @@ var uniqueId = $.fn.extend( { * @param {int} [digits=1] * @returns {string} */ - getIndexHier: function(separator, digits) { + getIndexHier: function (separator, digits) { separator = separator || "."; var s, res = []; - $.each(this.getParentList(false, true), function(i, o) { + $.each(this.getParentList(false, true), function (i, o) { s = "" + (o.getIndex() + 1); if (digits) { // prepend leading zeroes @@ -2616,7 +2734,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [excludeSelf=false] * @returns {string} */ - getKeyPath: function(excludeSelf) { + getKeyPath: function (excludeSelf) { var sep = this.tree.options.keyPathSeparator; return sep + this.getPath(!excludeSelf, "key", sep); @@ -2624,7 +2742,7 @@ var uniqueId = $.fn.extend( { /** Return the last child of this node or null. * @returns {FancytreeNode | null} */ - getLastChild: function() { + getLastChild: function () { return this.children ? this.children[this.children.length - 1] : null; @@ -2632,7 +2750,7 @@ var uniqueId = $.fn.extend( { /** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... . * @returns {int} */ - getLevel: function() { + getLevel: function () { var level = 0, dtn = this.parent; while (dtn) { @@ -2644,7 +2762,7 @@ var uniqueId = $.fn.extend( { /** Return the successor node (under the same parent) or null. * @returns {FancytreeNode | null} */ - getNextSibling: function() { + getNextSibling: function () { // TODO: use indexOf, if available: (not in IE6) if (this.parent) { var i, @@ -2663,7 +2781,7 @@ var uniqueId = $.fn.extend( { /** Return the parent node (null for the system root node). * @returns {FancytreeNode | null} */ - getParent: function() { + getParent: function () { // TODO: return null for top-level nodes? return this.parent; }, @@ -2672,7 +2790,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [includeSelf=false] Include the node itself. * @returns {FancytreeNode[]} */ - getParentList: function(includeRoot, includeSelf) { + getParentList: function (includeRoot, includeSelf) { var l = [], dtn = includeSelf ? this : this.parent; while (dtn) { @@ -2690,16 +2808,16 @@ var uniqueId = $.fn.extend( { * @returns {string} * @since v2.31 */ - getPath: function(includeSelf, part, separator) { + getPath: function (includeSelf, part, separator) { includeSelf = includeSelf !== false; part = part || "title"; separator = separator || "/"; var val, path = [], - isFunc = $.isFunction(part); + isFunc = _isFunction(part); - this.visitParents(function(n) { + this.visitParents(function (n) { if (n.parent) { val = isFunc ? part(n) : n[part]; path.unshift(val); @@ -2710,7 +2828,7 @@ var uniqueId = $.fn.extend( { /** Return the predecessor node (under the same parent) or null. * @returns {FancytreeNode | null} */ - getPrevSibling: function() { + getPrevSibling: function () { if (this.parent) { var i, l, @@ -2731,9 +2849,9 @@ var uniqueId = $.fn.extend( { * node (useful with selectMode 3) * @returns {FancytreeNode[]} */ - getSelectedNodes: function(stopOnParents) { + getSelectedNodes: function (stopOnParents) { var nodeList = []; - this.visit(function(node) { + this.visit(function (node) { if (node.selected) { nodeList.push(node); if (stopOnParents === true) { @@ -2746,7 +2864,7 @@ var uniqueId = $.fn.extend( { /** Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded). * @returns {boolean | undefined} */ - hasChildren: function() { + hasChildren: function () { if (this.lazy) { if (this.children == null) { // null or undefined: Not yet loaded @@ -2773,7 +2891,7 @@ var uniqueId = $.fn.extend( { * * @since 2.32 */ - hasClass: function(className) { + hasClass: function (className) { return ( (" " + (this.extraClasses || "") + " ").indexOf( " " + className + " " @@ -2783,14 +2901,14 @@ var uniqueId = $.fn.extend( { /** Return true if node has keyboard focus. * @returns {boolean} */ - hasFocus: function() { + hasFocus: function () { return this.tree.hasFocus() && this.tree.focusNode === this; }, /** Write to browser console if debugLevel >= 3 (prepending node info) * * @param {*} msg string or object or array of such */ - info: function(msg) { + info: function (msg) { if (this.tree.options.debugLevel >= 3) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("info", arguments); @@ -2799,7 +2917,7 @@ var uniqueId = $.fn.extend( { /** Return true if node is active (see also FancytreeNode#isSelected). * @returns {boolean} */ - isActive: function() { + isActive: function () { return this.tree.activeNode === this; }, /** Return true if node is vertically below `otherNode`, i.e. rendered in a subsequent row. @@ -2807,21 +2925,21 @@ var uniqueId = $.fn.extend( { * @returns {boolean} * @since 2.28 */ - isBelowOf: function(otherNode) { + isBelowOf: function (otherNode) { return this.getIndexHier(".", 5) > otherNode.getIndexHier(".", 5); }, /** Return true if node is a direct child of otherNode. * @param {FancytreeNode} otherNode * @returns {boolean} */ - isChildOf: function(otherNode) { + isChildOf: function (otherNode) { return this.parent && this.parent === otherNode; }, /** Return true, if node is a direct or indirect sub node of otherNode. * @param {FancytreeNode} otherNode * @returns {boolean} */ - isDescendantOf: function(otherNode) { + isDescendantOf: function (otherNode) { if (!otherNode || otherNode.tree !== this.tree) { return false; } @@ -2840,112 +2958,112 @@ var uniqueId = $.fn.extend( { /** Return true if node is expanded. * @returns {boolean} */ - isExpanded: function() { + isExpanded: function () { return !!this.expanded; }, /** Return true if node is the first node of its parent's children. * @returns {boolean} */ - isFirstSibling: function() { + isFirstSibling: function () { var p = this.parent; return !p || p.children[0] === this; }, /** Return true if node is a folder, i.e. has the node.folder attribute set. * @returns {boolean} */ - isFolder: function() { + isFolder: function () { return !!this.folder; }, /** Return true if node is the last node of its parent's children. * @returns {boolean} */ - isLastSibling: function() { + isLastSibling: function () { var p = this.parent; return !p || p.children[p.children.length - 1] === this; }, /** Return true if node is lazy (even if data was already loaded) * @returns {boolean} */ - isLazy: function() { + isLazy: function () { return !!this.lazy; }, /** Return true if node is lazy and loaded. For non-lazy nodes always return true. * @returns {boolean} */ - isLoaded: function() { + isLoaded: function () { return !this.lazy || this.hasChildren() !== undefined; // Also checks if the only child is a status node }, /** Return true if children are currently beeing loaded, i.e. a Ajax request is pending. * @returns {boolean} */ - isLoading: function() { + isLoading: function () { return !!this._isLoading; }, /* * @deprecated since v2.4.0: Use isRootNode() instead */ - isRoot: function() { + isRoot: function () { return this.isRootNode(); }, /** Return true if node is partially selected (tri-state). * @returns {boolean} * @since 2.23 */ - isPartsel: function() { + isPartsel: function () { return !this.selected && !!this.partsel; }, /** (experimental) Return true if this is partially loaded. * @returns {boolean} * @since 2.15 */ - isPartload: function() { + isPartload: function () { return !!this.partload; }, /** Return true if this is the (invisible) system root node. * @returns {boolean} * @since 2.4 */ - isRootNode: function() { + isRootNode: function () { return this.tree.rootNode === this; }, /** Return true if node is selected, i.e. has a checkmark set (see also FancytreeNode#isActive). * @returns {boolean} */ - isSelected: function() { + isSelected: function () { return !!this.selected; }, /** Return true if this node is a temporarily generated system node like * 'loading', 'paging', or 'error' (node.statusNodeType contains the type). * @returns {boolean} */ - isStatusNode: function() { + isStatusNode: function () { return !!this.statusNodeType; }, /** Return true if this node is a status node of type 'paging'. * @returns {boolean} * @since 2.15 */ - isPagingNode: function() { + isPagingNode: function () { return this.statusNodeType === "paging"; }, /** Return true if this a top level node, i.e. a direct child of the (invisible) system root node. * @returns {boolean} * @since 2.4 */ - isTopLevel: function() { + isTopLevel: function () { return this.tree.rootNode === this.parent; }, /** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false. * @returns {boolean} */ - isUndefined: function() { + isUndefined: function () { return this.hasChildren() === undefined; // also checks if the only child is a status node }, /** Return true if all parent nodes are expanded. Note: this does not check * whether the node is scrolled into the visible part of the screen. * @returns {boolean} */ - isVisible: function() { + isVisible: function () { var i, l, n, @@ -2978,7 +3096,7 @@ var uniqueId = $.fn.extend( { /** Deprecated. * @deprecated since 2014-02-16: use load() instead. */ - lazyLoad: function(discard) { + lazyLoad: function (discard) { $.error( "FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead." ); @@ -2988,7 +3106,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [forceReload=false] Pass true to discard any existing nodes before. Otherwise this method does nothing if the node was already loaded. * @returns {$.Promise} */ - load: function(forceReload) { + load: function (forceReload) { var res, source, self = this, @@ -3016,11 +3134,11 @@ var uniqueId = $.fn.extend( { res = this.tree._callHook("nodeLoadChildren", this, source); if (wasExpanded) { this.expanded = true; - res.always(function() { + res.always(function () { self.render(); }); } else { - res.always(function() { + res.always(function () { self.renderStatus(); // fix expander icon to 'loaded' }); } @@ -3032,7 +3150,7 @@ var uniqueId = $.fn.extend( { * Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true} * @returns {$.Promise} */ - makeVisible: function(opts) { + makeVisible: function (opts) { var i, self = this, deferreds = [], @@ -3047,11 +3165,11 @@ var uniqueId = $.fn.extend( { // self.debug("pushexpand" + parents[i]); deferreds.push(parents[i].setExpanded(true, opts)); } - $.when.apply($, deferreds).done(function() { + $.when.apply($, deferreds).done(function () { // All expands have finished // self.debug("expand DONE", scroll); if (scroll) { - self.scrollIntoView(effects).done(function() { + self.scrollIntoView(effects).done(function () { // self.debug("scroll DONE"); dfd.resolve(); }); @@ -3072,7 +3190,7 @@ var uniqueId = $.fn.extend( { * 'after': add this node as sibling after targetNode. * @param {function} [map] optional callback(FancytreeNode) to allow modifcations */ - moveTo: function(targetNode, mode, map) { + moveTo: function (targetNode, mode, map) { if (mode === undefined || mode === "over") { mode = "child"; } else if (mode === "firstChild") { @@ -3170,7 +3288,7 @@ var uniqueId = $.fn.extend( { // Fix node.tree for all source nodes // _assert(false, "Cross-tree move is not yet implemented."); this.warn("Cross-tree moveTo is experimental!"); - this.visit(function(n) { + this.visit(function (n) { // TODO: fix selection state and activation, ... n.tree = targetNode.tree; }, true); @@ -3240,7 +3358,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [activate=true] * @returns {$.Promise} */ - navigate: function(where, activate) { + navigate: function (where, activate) { var node, KC = $.ui.keyCode; @@ -3278,14 +3396,14 @@ var uniqueId = $.fn.extend( { /** * Remove this node (not allowed for system root). */ - remove: function() { + remove: function () { return this.parent.removeChild(this); }, /** * Remove childNode from list of direct children. * @param {FancytreeNode} childNode */ - removeChild: function(childNode) { + removeChild: function (childNode) { return this.tree._callHook("nodeRemoveChild", this, childNode); }, /** @@ -3293,7 +3411,7 @@ var uniqueId = $.fn.extend( { * If this was a lazy node, it is still considered 'loaded'; call node.resetLazy() * in order to trigger lazyLoad on next expand. */ - removeChildren: function() { + removeChildren: function () { return this.tree._callHook("nodeRemoveChildren", this); }, /** @@ -3303,7 +3421,7 @@ var uniqueId = $.fn.extend( { * * @since 2.17 */ - removeClass: function(className) { + removeClass: function (className) { return this.toggleClass(className, false); }, /** @@ -3323,20 +3441,20 @@ var uniqueId = $.fn.extend( { * @param {boolean} [force=false] re-render, even if html markup was already created * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed */ - render: function(force, deep) { + render: function (force, deep) { return this.tree._callHook("nodeRender", this, force, deep); }, /** Create HTML markup for the node's outer `` (expander, checkbox, icon, and title). * Implies {@link FancytreeNode#renderStatus}. * @see Fancytree_Hooks#nodeRenderTitle */ - renderTitle: function() { + renderTitle: function () { return this.tree._callHook("nodeRenderTitle", this); }, /** Update element's CSS classes according to node state. * @see Fancytree_Hooks#nodeRenderStatus */ - renderStatus: function() { + renderStatus: function () { return this.tree._callHook("nodeRenderStatus", this); }, /** @@ -3345,7 +3463,7 @@ var uniqueId = $.fn.extend( { * @param {NodeData[]} source List of child node definitions * @since 2.15 */ - replaceWith: function(source) { + replaceWith: function (source) { var res, parent = this.parent, pos = $.inArray(this, parent.children), @@ -3357,7 +3475,7 @@ var uniqueId = $.fn.extend( { ); res = this.tree._callHook("nodeLoadChildren", this, source); - res.done(function(data) { + res.done(function (data) { // New nodes are currently children of `this`. var children = self.children; // Prepend newly loaded child nodes to `this` @@ -3377,7 +3495,7 @@ var uniqueId = $.fn.extend( { parent.render(); // TODO: set node.partload = false if this was tha last paging node? // parent.addPagingNode(false); - }).fail(function() { + }).fail(function () { self.setExpanded(); }); return res; @@ -3387,7 +3505,7 @@ var uniqueId = $.fn.extend( { * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad * event is triggered on next expand. */ - resetLazy: function() { + resetLazy: function () { this.removeChildren(); this.expanded = false; this.lazy = true; @@ -3399,7 +3517,7 @@ var uniqueId = $.fn.extend( { * @param {string} mode * @param {number} ms */ - scheduleAction: function(mode, ms) { + scheduleAction: function (mode, ms) { if (this.tree.timer) { clearTimeout(this.tree.timer); this.tree.debug("clearTimeout(%o)", this.tree.timer); @@ -3411,13 +3529,13 @@ var uniqueId = $.fn.extend( { // Simply made sure that timer was cleared break; case "expand": - this.tree.timer = setTimeout(function() { + this.tree.timer = setTimeout(function () { self.tree.debug("setTimeout: trigger expand"); self.setExpanded(true); }, ms); break; case "activate": - this.tree.timer = setTimeout(function() { + this.tree.timer = setTimeout(function () { self.tree.debug("setTimeout: trigger activate"); self.setActive(true); }, ms); @@ -3434,7 +3552,7 @@ var uniqueId = $.fn.extend( { * any case, even if `this` is outside the scroll pane. * @returns {$.Promise} */ - scrollIntoView: function(effects, options) { + scrollIntoView: function (effects, options) { if (options !== undefined && _isNode(options)) { throw Error( "scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead." @@ -3566,7 +3684,7 @@ var uniqueId = $.fn.extend( { } else { // this.debug(" scrollIntoView(), SET newScrollTop=" + newScrollTop); if (opts.effects) { - opts.effects.complete = function() { + opts.effects.complete = function () { dfd.resolveWith(self); }; $animateTarget.stop(true).animate( @@ -3591,7 +3709,7 @@ var uniqueId = $.fn.extend( { * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false, cell: null} * @returns {$.Promise} */ - setActive: function(flag, opts) { + setActive: function (flag, opts) { return this.tree._callHook("nodeSetActive", this, flag, opts); }, /**Expand or collapse this node. Promise is resolved, when lazy loading and animations are done. @@ -3599,14 +3717,14 @@ var uniqueId = $.fn.extend( { * @param {object} [opts] additional options. Defaults to {noAnimation: false, noEvents: false} * @returns {$.Promise} */ - setExpanded: function(flag, opts) { + setExpanded: function (flag, opts) { return this.tree._callHook("nodeSetExpanded", this, flag, opts); }, /**Set keyboard focus to this node. * @param {boolean} [flag=true] pass false to blur * @see Fancytree#setFocus */ - setFocus: function(flag) { + setFocus: function (flag) { return this.tree._callHook("nodeSetFocus", this, flag); }, /**Select this node, i.e. check the checkbox. @@ -3614,7 +3732,7 @@ var uniqueId = $.fn.extend( { * @param {object} [opts] additional options. Defaults to {noEvents: false, p * propagateDown: null, propagateUp: null, callback: null } */ - setSelected: function(flag, opts) { + setSelected: function (flag, opts) { return this.tree._callHook("nodeSetSelected", this, flag, opts); }, /**Mark a lazy node as 'error', 'loading', 'nodata', or 'ok'. @@ -3622,7 +3740,7 @@ var uniqueId = $.fn.extend( { * @param {string} [message] * @param {string} [details] */ - setStatus: function(status, message, details) { + setStatus: function (status, message, details) { return this.tree._callHook( "nodeSetStatus", this, @@ -3634,7 +3752,7 @@ var uniqueId = $.fn.extend( { /**Rename this node. * @param {string} title */ - setTitle: function(title) { + setTitle: function (title) { this.title = title; this.renderTitle(); this.triggerModify("rename"); @@ -3643,7 +3761,7 @@ var uniqueId = $.fn.extend( { * @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title). * @param {boolean} [deep=false] pass true to sort all descendant nodes */ - sortChildren: function(cmp, deep) { + sortChildren: function (cmp, deep) { var i, l, cl = this.children; @@ -3653,7 +3771,7 @@ var uniqueId = $.fn.extend( { } cmp = cmp || - function(a, b) { + function (a, b) { var x = a.title.toLowerCase(), y = b.title.toLowerCase(); @@ -3682,7 +3800,7 @@ var uniqueId = $.fn.extend( { * Return `false` to ignore this node or `"skip"` to include this node without its children. * @returns {NodeData} */ - toDict: function(recursive, callback) { + toDict: function (recursive, callback) { var i, l, node, @@ -3690,7 +3808,7 @@ var uniqueId = $.fn.extend( { dict = {}, self = this; - $.each(NODE_ATTRS, function(i, a) { + $.each(NODE_ATTRS, function (i, a) { if (self[a] || self[a] === false) { dict[a] = self[a]; } @@ -3711,7 +3829,7 @@ var uniqueId = $.fn.extend( { } } if (recursive) { - if ($.isArray(this.children)) { + if (_isArray(this.children)) { dict.children = []; for (i = 0, l = this.children.length; i < l; i++) { node = this.children[i]; @@ -3735,7 +3853,7 @@ var uniqueId = $.fn.extend( { * * @since 2.17 */ - toggleClass: function(value, flag) { + toggleClass: function (value, flag) { var className, hasClass, rnotwhite = /\S+/g, @@ -3769,19 +3887,19 @@ var uniqueId = $.fn.extend( { } } } - this.extraClasses = $.trim(curClasses); + this.extraClasses = _trim(curClasses); // this.info("-> toggleClass('" + value + "', " + flag + "): '" + this.extraClasses + "'"); return wasAdded; }, /** Flip expanded status. */ - toggleExpanded: function() { + toggleExpanded: function () { return this.tree._callHook("nodeToggleExpanded", this); }, /** Flip selection status. */ - toggleSelected: function() { + toggleSelected: function () { return this.tree._callHook("nodeToggleSelected", this); }, - toString: function() { + toString: function () { return "FancytreeNode@" + this.key + "[title='" + this.title + "']"; // return ""; }, @@ -3791,7 +3909,7 @@ var uniqueId = $.fn.extend( { * @param {FancytreeNode} [childNode] * @param {object} [extra] */ - triggerModifyChild: function(operation, childNode, extra) { + triggerModifyChild: function (operation, childNode, extra) { var data, modifyChild = this.tree.options.modifyChild; @@ -3818,7 +3936,7 @@ var uniqueId = $.fn.extend( { * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ... * @param {object} [extra] */ - triggerModify: function(operation, extra) { + triggerModify: function (operation, extra) { this.parent.triggerModifyChild(operation, this, extra); }, /** Call fn(node) for all child nodes in hierarchical order (depth-first).
@@ -3831,7 +3949,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [includeSelf=false] * @returns {boolean} */ - visit: function(fn, includeSelf) { + visit: function (fn, includeSelf) { var i, l, res = true, @@ -3865,7 +3983,7 @@ var uniqueId = $.fn.extend( { * @returns {$.Promise} * @since 2.4 */ - visitAndLoad: function(fn, includeSelf, _recursion) { + visitAndLoad: function (fn, includeSelf, _recursion) { var dfd, res, loaders, @@ -3884,7 +4002,7 @@ var uniqueId = $.fn.extend( { dfd = new $.Deferred(); loaders = []; // node.debug("load()..."); - node.load().done(function() { + node.load().done(function () { // node.debug("load()... done."); for (var i = 0, l = node.children.length; i < l; i++) { res = node.children[i].visitAndLoad(fn, true, true); @@ -3895,7 +4013,7 @@ var uniqueId = $.fn.extend( { loaders.push(res); // Add promise to the list } } - $.when.apply(this, loaders).then(function() { + $.when.apply(this, loaders).then(function () { dfd.resolve(); }); }); @@ -3910,7 +4028,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [includeSelf=false] * @returns {boolean} */ - visitParents: function(fn, includeSelf) { + visitParents: function (fn, includeSelf) { // Visit parent nodes (bottom up) if (includeSelf && fn(this) === false) { return false; @@ -3933,7 +4051,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [includeSelf=false] * @returns {boolean} */ - visitSiblings: function(fn, includeSelf) { + visitSiblings: function (fn, includeSelf) { var i, l, n, @@ -3953,7 +4071,7 @@ var uniqueId = $.fn.extend( { * * @param {*} msg string or object or array of such */ - warn: function(msg) { + warn: function (msg) { if (this.tree.options.debugLevel >= 2) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("warn", arguments); @@ -4096,7 +4214,7 @@ var uniqueId = $.fn.extend( { * @param {Object} extra * @returns {EventData} */ - _makeHookContext: function(obj, originalEvent, extra) { + _makeHookContext: function (obj, originalEvent, extra) { var ctx, tree; if (obj.node !== undefined) { // obj is already a context object @@ -4139,24 +4257,24 @@ var uniqueId = $.fn.extend( { * @param {any} [_extraArgs] optional additional arguments * @returns {any} */ - _callHook: function(funcName, contextObject, _extraArgs) { + _callHook: function (funcName, contextObject, _extraArgs) { var ctx = this._makeHookContext(contextObject), fn = this[funcName], args = Array.prototype.slice.call(arguments, 2); - if (!$.isFunction(fn)) { + if (!_isFunction(fn)) { $.error("_callHook('" + funcName + "') is not a function"); } args.unshift(ctx); // this.debug("_hook", funcName, ctx.node && ctx.node.toString() || ctx.tree.toString(), args); return fn.apply(this, args); }, - _setExpiringValue: function(key, value, ms) { + _setExpiringValue: function (key, value, ms) { this._tempCache[key] = { value: value, expire: Date.now() + (+ms || 50), }; }, - _getExpiringValue: function(key) { + _getExpiringValue: function (key) { var entry = this._tempCache[key]; if (entry && entry.expire > Date.now()) { return entry.value; @@ -4168,7 +4286,7 @@ var uniqueId = $.fn.extend( { * * @param {string} name name of the required extension */ - _usesExtension: function(name) { + _usesExtension: function (name) { return $.inArray(name, this.options.extensions) >= 0; }, /* Check if current extensions dependencies are met and throw an error if not. @@ -4180,7 +4298,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [before] `true` if `name` must be included before this, `false` otherwise (use `null` if order doesn't matter) * @param {string} [message] optional error message (defaults to a descriptve error message) */ - _requireExtension: function(name, required, before, message) { + _requireExtension: function (name, required, before, message) { if (before != null) { before = !!before; } @@ -4236,7 +4354,7 @@ var uniqueId = $.fn.extend( { * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false} * @returns {FancytreeNode} activated node (null, if not found) */ - activateKey: function(key, opts) { + activateKey: function (key, opts) { var node = this.getNodeByKey(key); if (node) { node.setActive(true, opts); @@ -4250,7 +4368,7 @@ var uniqueId = $.fn.extend( { * @param {string} [mode='append'] 'child'|firstChild' * @since 2.15 */ - addPagingNode: function(node, mode) { + addPagingNode: function (node, mode) { return this.rootNode.addPagingNode(node, mode); }, /** @@ -4270,7 +4388,7 @@ var uniqueId = $.fn.extend( { * * @since 2.32 */ - applyCommand: function(cmd, node, opts_) { + applyCommand: function (cmd, node, opts_) { var // clipboard, refNode; // opts = $.extend( @@ -4372,7 +4490,7 @@ var uniqueId = $.fn.extend( { * @returns {$.Promise} resolved, when all patches have been applied * @see TreePatch */ - applyPatch: function(patchList) { + applyPatch: function (patchList) { var dfd, i, p2, @@ -4413,20 +4531,20 @@ var uniqueId = $.fn.extend( { /** Remove all nodes. * @since 2.14 */ - clear: function(source) { + clear: function (source) { this._callHook("treeClear", this); }, /** Return the number of nodes. * @returns {integer} */ - count: function() { + count: function () { return this.rootNode.countChildren(); }, /** Write to browser console if debugLevel >= 4 (prepending tree name) * * @param {*} msg string or object or array of such */ - debug: function(msg) { + debug: function (msg) { if (this.options.debugLevel >= 4) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("log", arguments); @@ -4436,7 +4554,7 @@ var uniqueId = $.fn.extend( { * * @since 2.34 */ - destroy: function() { + destroy: function () { this.widget.destroy(); }, /** Enable (or disable) the tree control. @@ -4444,7 +4562,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [flag=true] pass false to disable * @since 2.30 */ - enable: function(flag) { + enable: function (flag) { if (flag === false) { this.widget.disable(); } else { @@ -4457,7 +4575,7 @@ var uniqueId = $.fn.extend( { * @returns {boolean} previous status * @since 2.19 */ - enableUpdate: function(flag) { + enableUpdate: function (flag) { flag = flag !== false; if (!!this._enableUpdate === !!flag) { return flag; @@ -4477,7 +4595,7 @@ var uniqueId = $.fn.extend( { * * @param {*} msg string or object or array of such */ - error: function(msg) { + error: function (msg) { if (this.options.debugLevel >= 1) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("error", arguments); @@ -4492,11 +4610,11 @@ var uniqueId = $.fn.extend( { * @param {object} [opts] passed to setExpanded() * @since 2.30 */ - expandAll: function(flag, opts) { + expandAll: function (flag, opts) { var prev = this.enableUpdate(false); flag = flag !== false; - this.visit(function(node) { + this.visit(function (node) { if ( node.hasChildren() !== false && node.isExpanded() !== flag @@ -4514,7 +4632,7 @@ var uniqueId = $.fn.extend( { * @see FancytreeNode#findAll * @since 2.12 */ - findAll: function(match) { + findAll: function (match) { return this.rootNode.findAll(match); }, /**Find first node that matches condition. @@ -4525,7 +4643,7 @@ var uniqueId = $.fn.extend( { * @see FancytreeNode#findFirst * @since 2.12 */ - findFirst: function(match) { + findFirst: function (match) { return this.rootNode.findFirst(match); }, /** Find the next visible node that starts with `match`, starting at `startNode` @@ -4535,7 +4653,7 @@ var uniqueId = $.fn.extend( { * @param {FancytreeNode} [startNode] defaults to first node * @returns {FancytreeNode} matching node or null */ - findNextNode: function(match, startNode) { + findNextNode: function (match, startNode) { //, visibleOnly) { var res = null, firstNode = this.getFirstChild(); @@ -4578,7 +4696,7 @@ var uniqueId = $.fn.extend( { * @returns {FancytreeNode|null} * @since v2.31 */ - findRelatedNode: function(node, where, includeHidden) { + findRelatedNode: function (node, where, includeHidden) { var res = null, KC = $.ui.keyCode; @@ -4592,7 +4710,7 @@ var uniqueId = $.fn.extend( { case "first": case KC.HOME: // First visible node - this.visit(function(n) { + this.visit(function (n) { if (n.isVisible()) { res = n; return false; @@ -4601,7 +4719,7 @@ var uniqueId = $.fn.extend( { break; case "last": case KC.END: - this.visit(function(n) { + this.visit(function (n) { // last visible node if (n.isVisible()) { res = n; @@ -4628,7 +4746,7 @@ var uniqueId = $.fn.extend( { case "up": case KC.UP: this.visitRows( - function(n) { + function (n) { res = n; return false; }, @@ -4638,7 +4756,7 @@ var uniqueId = $.fn.extend( { case "down": case KC.DOWN: this.visitRows( - function(n) { + function (n) { res = n; return false; }, @@ -4671,7 +4789,7 @@ var uniqueId = $.fn.extend( { * @param {boolean | string} [active=true] Pass false to disable, pass a string to override the field name (default: 'ft_ID_active') * @param {object} [opts] default { filter: null, stopOnParents: true } */ - generateFormElements: function(selected, active, opts) { + generateFormElements: function (selected, active, opts) { opts = opts || {}; var nodeList, @@ -4719,7 +4837,7 @@ var uniqueId = $.fn.extend( { ); } if (opts.filter) { - this.visit(function(node) { + this.visit(function (node) { var res = opts.filter(node); if (res === "skip") { return res; @@ -4730,7 +4848,7 @@ var uniqueId = $.fn.extend( { }); } else if (selected !== false) { nodeList = this.getSelectedNodes(stopOnParents); - $.each(nodeList, function(idx, node) { + $.each(nodeList, function (idx, node) { _appender(node); }); } @@ -4739,20 +4857,20 @@ var uniqueId = $.fn.extend( { * Return the currently active node or null. * @returns {FancytreeNode} */ - getActiveNode: function() { + getActiveNode: function () { return this.activeNode; }, /** Return the first top level node if any (not the invisible root node). * @returns {FancytreeNode | null} */ - getFirstChild: function() { + getFirstChild: function () { return this.rootNode.getFirstChild(); }, /** * Return node that has keyboard focus or null. * @returns {FancytreeNode} */ - getFocusNode: function() { + getFocusNode: function () { return this.focusNode; }, /** @@ -4762,7 +4880,7 @@ var uniqueId = $.fn.extend( { * @param {string} name option name (may contain '.') * @returns {any} */ - getOption: function(optionName) { + getOption: function (optionName) { return this.widget.option(optionName); }, /** @@ -4772,7 +4890,7 @@ var uniqueId = $.fn.extend( { * @param {FancytreeNode} [searchRoot] only search below this node * @returns {FancytreeNode | null} */ - getNodeByKey: function(key, searchRoot) { + getNodeByKey: function (key, searchRoot) { // Search the DOM by element ID (assuming this is faster than traversing all nodes). var el, match; // TODO: use tree.keyMap if available @@ -4787,7 +4905,7 @@ var uniqueId = $.fn.extend( { searchRoot = searchRoot || this.rootNode; match = null; key = "" + key; // Convert to string (#1005) - searchRoot.visit(function(node) { + searchRoot.visit(function (node) { if (node.key === key) { match = node; return false; // Stop iteration @@ -4798,7 +4916,7 @@ var uniqueId = $.fn.extend( { /** Return the invisible system root node. * @returns {FancytreeNode} */ - getRootNode: function() { + getRootNode: function () { return this.rootNode; }, /** @@ -4811,13 +4929,13 @@ var uniqueId = $.fn.extend( { * node (useful with selectMode 3) * @returns {FancytreeNode[]} */ - getSelectedNodes: function(stopOnParents) { + getSelectedNodes: function (stopOnParents) { return this.rootNode.getSelectedNodes(stopOnParents); }, /** Return true if the tree control has keyboard focus * @returns {boolean} */ - hasFocus: function() { + hasFocus: function () { // var ae = document.activeElement, // hasFocus = !!( // ae && $(ae).closest(".fancytree-container").length @@ -4837,7 +4955,7 @@ var uniqueId = $.fn.extend( { /** Write to browser console if debugLevel >= 3 (prepending tree name) * @param {*} msg string or object or array of such */ - info: function(msg) { + info: function (msg) { if (this.options.debugLevel >= 3) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("info", arguments); @@ -4847,10 +4965,10 @@ var uniqueId = $.fn.extend( { * @returns {boolean} * @since 2.32 */ - isLoading: function() { + isLoading: function () { var res = false; - this.rootNode.visit(function(n) { + this.rootNode.visit(function (n) { // also visit rootNode if (n._isLoading || n._requestId) { res = true; @@ -4912,7 +5030,7 @@ var uniqueId = $.fn.extend( { * Pass an object to define custom key matchers for the path segments: {callback: function, matchKey: function}. * @returns {$.Promise} */ - loadKeyPath: function(keyPathList, optsOrCallback) { + loadKeyPath: function (keyPathList, optsOrCallback) { var callback, i, path, @@ -4929,19 +5047,19 @@ var uniqueId = $.fn.extend( { } else if (optsOrCallback && optsOrCallback.callback) { callback = optsOrCallback.callback; } - opts.callback = function(ctx, node, status) { + opts.callback = function (ctx, node, status) { if (callback) { callback.call(ctx, node, status); } dfd.notifyWith(ctx, [{ node: node, status: status }]); }; if (opts.matchKey == null) { - opts.matchKey = function(node, key) { + opts.matchKey = function (node, key) { return node.key === key; }; } // Convert array of path strings to array of segment arrays - if (!$.isArray(keyPathList)) { + if (!_isArray(keyPathList)) { keyPathList = [keyPathList]; } for (i = 0; i < keyPathList.length; i++) { @@ -4956,9 +5074,9 @@ var uniqueId = $.fn.extend( { } // The timeout forces async behavior always (even if nodes are all loaded) // This way a potential progress() event will fire. - setTimeout(function() { + setTimeout(function () { self._loadKeyPathImpl(dfd, opts, parent, pathSegList).done( - function() { + function () { dfd.resolve(); } ); @@ -4968,7 +5086,7 @@ var uniqueId = $.fn.extend( { /* * Resolve a list of paths, relative to one parent node. */ - _loadKeyPathImpl: function(dfd, opts, parent, pathSegList) { + _loadKeyPathImpl: function (dfd, opts, parent, pathSegList) { var deferredList, i, key, @@ -5058,12 +5176,12 @@ var uniqueId = $.fn.extend( { opts.callback(self, parent, "loading"); parent .load() - .done(function() { + .done(function () { self._loadKeyPathImpl .call(self, dfd, opts, parent, pathSegList) .always(_makeResolveFunc(dfd, self)); }) - .fail(function(errMsg) { + .fail(function (errMsg) { self.warn("loadKeyPath: error loading lazy " + parent); opts.callback(self, node, "error"); dfd.rejectWith(self); @@ -5072,7 +5190,7 @@ var uniqueId = $.fn.extend( { // remainMap contains parent nodes, each with a list of relative sub-paths. // We start loading all of them now, and pass the the list to each loader. for (nodeKey in remainMap) { - if (remainMap.hasOwnProperty(nodeKey)) { + if (_hasProp(remainMap, nodeKey)) { remain = remainMap[nodeKey]; // console.log("for(): remain=", remain, "remainMap=", remainMap); // key = remain.segList.shift(); @@ -5102,7 +5220,7 @@ var uniqueId = $.fn.extend( { * focus. * @param [setFocus=false] */ - reactivate: function(setFocus) { + reactivate: function (setFocus) { var res, node = this.activeNode; @@ -5120,7 +5238,7 @@ var uniqueId = $.fn.extend( { * @param [source] optional new source (defaults to initial source data) * @returns {$.Promise} */ - reload: function(source) { + reload: function (source) { this._callHook("treeClear", this); return this._callHook("treeLoad", this, source); }, @@ -5128,15 +5246,15 @@ var uniqueId = $.fn.extend( { * @param {boolean} [force=false] create DOM elemnts, even if parent is collapsed * @param {boolean} [deep=false] */ - render: function(force, deep) { + render: function (force, deep) { return this.rootNode.render(force, deep); }, /**(De)select all nodes. * @param {boolean} [flag=true] * @since 2.28 */ - selectAll: function(flag) { - this.visit(function(node) { + selectAll: function (flag) { + this.visit(function (node) { node.setSelected(flag); }); }, @@ -5145,7 +5263,7 @@ var uniqueId = $.fn.extend( { /** * @param {boolean} [flag=true] */ - setFocus: function(flag) { + setFocus: function (flag) { return this._callHook("treeSetFocus", this, flag); }, /** @@ -5154,7 +5272,7 @@ var uniqueId = $.fn.extend( { * @param {string} name option name (may contain '.') * @param {any} new value */ - setOption: function(optionName, value) { + setOption: function (optionName, value) { return this.widget.option(optionName, value); }, /** @@ -5162,7 +5280,7 @@ var uniqueId = $.fn.extend( { * * @param {string} label */ - debugTime: function(label) { + debugTime: function (label) { if (this.options.debugLevel >= 4) { window.console.time(this + " - " + label); } @@ -5172,7 +5290,7 @@ var uniqueId = $.fn.extend( { * * @param {string} label */ - debugTimeEnd: function(label) { + debugTimeEnd: function (label) { if (this.options.debugLevel >= 4) { window.console.timeEnd(this + " - " + label); } @@ -5186,21 +5304,21 @@ var uniqueId = $.fn.extend( { * @returns {Array | object} * @see FancytreeNode#toDict */ - toDict: function(includeRoot, callback) { + toDict: function (includeRoot, callback) { var res = this.rootNode.toDict(true, callback); return includeRoot ? res : res.children; }, /* Implicitly called for string conversions. * @returns {string} */ - toString: function() { + toString: function () { return "Fancytree@" + this._id; // return ""; }, /* _trigger a widget event with additional node ctx. * @see EventData */ - _triggerNodeEvent: function(type, node, originalEvent, extra) { + _triggerNodeEvent: function (type, node, originalEvent, extra) { // this.debug("_trigger(" + type + "): '" + ctx.node.title + "'", ctx); var ctx = this._makeHookContext(node, originalEvent, extra), res = this.widget._trigger(type, originalEvent, ctx); @@ -5210,7 +5328,7 @@ var uniqueId = $.fn.extend( { return res; }, /* _trigger a widget event with additional tree data. */ - _triggerTreeEvent: function(type, originalEvent, extra) { + _triggerTreeEvent: function (type, originalEvent, extra) { // this.debug("_trigger(" + type + ")", ctx); var ctx = this._makeHookContext(this, originalEvent, extra), res = this.widget._trigger(type, originalEvent, ctx); @@ -5226,7 +5344,7 @@ var uniqueId = $.fn.extend( { * Return false to stop iteration, return "skip" to skip this node and children only. * @returns {boolean} false, if the iterator was stopped. */ - visit: function(fn) { + visit: function (fn) { return this.rootNode.visit(fn, false); }, /** Call fn(node) for all nodes in vertical order, top down (or bottom up).
@@ -5241,7 +5359,7 @@ var uniqueId = $.fn.extend( { * @returns {boolean} false if iteration was cancelled * @since 2.28 */ - visitRows: function(fn, opts) { + visitRows: function (fn, opts) { if (!this.rootNode.hasChildren()) { return false; } @@ -5293,7 +5411,7 @@ var uniqueId = $.fn.extend( { // Disable warning: Functions declared within loops referencing an outer // scoped variable may lead to confusing semantics: /*jshint -W083 */ - res = node.visit(function(n) { + res = node.visit(function (n) { if (checkFilter && !n.match && !n.subMatchCount) { return "skip"; } @@ -5319,7 +5437,7 @@ var uniqueId = $.fn.extend( { }, /* Call fn(node) for all nodes in vertical order, bottom up. */ - _visitRowsUp: function(fn, opts) { + _visitRowsUp: function (fn, opts) { var children, idx, parent, @@ -5367,7 +5485,7 @@ var uniqueId = $.fn.extend( { * * @param {*} msg string or object or array of such */ - warn: function(msg) { + warn: function (msg) { if (this.options.debugLevel >= 2) { Array.prototype.unshift.call(arguments, this.toString()); consoleApply("warn", arguments); @@ -5390,7 +5508,7 @@ var uniqueId = $.fn.extend( { * * @param {EventData} ctx */ - nodeClick: function(ctx) { + nodeClick: function (ctx) { var activate, expand, // event = ctx.originalEvent, @@ -5460,7 +5578,7 @@ var uniqueId = $.fn.extend( { * @param {EventData} ctx * @param {object} callOpts */ - nodeCollapseSiblings: function(ctx, callOpts) { + nodeCollapseSiblings: function (ctx, callOpts) { // TODO: return promise? var ac, i, @@ -5484,7 +5602,7 @@ var uniqueId = $.fn.extend( { /** Default handling for mouse douleclick events. * @param {EventData} ctx */ - nodeDblclick: function(ctx) { + nodeDblclick: function (ctx) { // TODO: return promise? if ( ctx.targetType === "title" && @@ -5504,7 +5622,7 @@ var uniqueId = $.fn.extend( { * NOTE: this may be called with node == null if tree (but no node) has focus. * @param {EventData} ctx */ - nodeKeydown: function(ctx) { + nodeKeydown: function (ctx) { // TODO: return promise? var matchNode, stamp, @@ -5626,7 +5744,7 @@ var uniqueId = $.fn.extend( { * @returns {$.Promise} The deferred will be resolved as soon as the (ajax) * data was rendered. */ - nodeLoadChildren: function(ctx, source) { + nodeLoadChildren: function (ctx, source) { var ajax, delay, ajaxDfd = null, @@ -5639,16 +5757,16 @@ var uniqueId = $.fn.extend( { requestId = Date.now(); // `source` is a callback: use the returned result instead: - if ($.isFunction(source)) { + if (_isFunction(source)) { source = source.call(tree, { type: "source" }, ctx); _assert( - !$.isFunction(source), + !_isFunction(source), "source callback must not return another function" ); } // `source` is already a promise: - if ($.isFunction(source.then)) { - // _assert($.isFunction(source.always), "Expected jQuery?"); + if (_isFunction(source.then)) { + // _assert(_isFunction(source.always), "Expected jQuery?"); ajaxDfd = source; } else if (source.url) { // `source` is an Ajax options object @@ -5657,7 +5775,7 @@ var uniqueId = $.fn.extend( { // Simulate a slow server delay = ajax.debugDelay; delete ajax.debugDelay; // remove debug option - if ($.isArray(delay)) { + if (_isArray(delay)) { // random delay range [min..max] delay = delay[0] + @@ -5668,13 +5786,13 @@ var uniqueId = $.fn.extend( { Math.round(delay) + " ms ..." ); - ajaxDfd = $.Deferred(function(ajaxDfd) { - setTimeout(function() { + ajaxDfd = $.Deferred(function (ajaxDfd) { + setTimeout(function () { $.ajax(ajax) - .done(function() { + .done(function () { ajaxDfd.resolveWith(this, arguments); }) - .fail(function() { + .fail(function () { ajaxDfd.rejectWith(this, arguments); }); }, delay); @@ -5682,7 +5800,7 @@ var uniqueId = $.fn.extend( { } else { ajaxDfd = $.ajax(ajax); } - } else if ($.isPlainObject(source) || $.isArray(source)) { + } else if ($.isPlainObject(source) || _isArray(source)) { // `source` is already a constant dict or list, but we convert // to a thenable for unified processing. // 2020-01-03: refactored. @@ -5691,7 +5809,7 @@ var uniqueId = $.fn.extend( { // would probably also break current implementations out there. // So we mock-up a thenable that resolves synchronously: ajaxDfd = { - then: function(resolve, reject) { + then: function (resolve, reject) { resolve(source, null, null); }, }; @@ -5728,7 +5846,7 @@ var uniqueId = $.fn.extend( { // expected result type of nodeLoadChildren() resultDfd = new $.Deferred(); ajaxDfd.then( - function(data, textStatus, jqXHR) { + function (data, textStatus, jqXHR) { // ajaxDfd was resolved, but we reject or resolve resultDfd // depending on the response data var errorObj, res; @@ -5806,9 +5924,8 @@ var uniqueId = $.fn.extend( { return; } if ( - $.isArray(res) || - ($.isPlainObject(res) && - $.isArray(res.children)) + _isArray(res) || + ($.isPlainObject(res) && _isArray(res.children)) ) { // Use `ctx.result` if valid // (otherwise use existing data, which may have been modified in-place) @@ -5816,7 +5933,7 @@ var uniqueId = $.fn.extend( { } } else if ( data && - data.hasOwnProperty("d") && + _hasProp(data, "d") && ctx.options.enableAspx ) { // Process ASPX WebMethod JSON object inside "d" property @@ -5834,7 +5951,7 @@ var uniqueId = $.fn.extend( { } resultDfd.resolveWith(this, [data]); }, - function(jqXHR, textStatus, errorThrown) { + function (jqXHR, textStatus, errorThrown) { // ajaxDfd was rejected, so we reject resultDfd as well var errorObj = tree._makeHookContext(node, null, { error: jqXHR, @@ -5852,7 +5969,7 @@ var uniqueId = $.fn.extend( { // Now we implement the UI update and add the data to the tree. // We also return this promise to the caller. resultDfd - .done(function(data) { + .done(function (data) { tree.nodeSetStatus(ctx, "ok"); var children, metaData, noDataRes; @@ -5864,14 +5981,14 @@ var uniqueId = $.fn.extend( { "source may only be an object for root nodes (expecting an array of child objects otherwise)" ); _assert( - $.isArray(data.children), + _isArray(data.children), "if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')" ); metaData = data; children = data.children; delete metaData.children; // Copy some attributes to tree.data - $.each(TREE_ATTRS, function(i, attr) { + $.each(TREE_ATTRS, function (i, attr) { if (metaData[attr] !== undefined) { tree[attr] = metaData[attr]; delete metaData[attr]; @@ -5883,13 +6000,13 @@ var uniqueId = $.fn.extend( { children = data; } _assert( - $.isArray(children), + _isArray(children), "expected array of children" ); node._setChildren(children); if (tree.options.nodata && children.length === 0) { - if ($.isFunction(tree.options.nodata)) { + if (_isFunction(tree.options.nodata)) { noDataRes = tree.options.nodata.call( tree, { type: "nodata" }, @@ -5913,7 +6030,7 @@ var uniqueId = $.fn.extend( { // trigger fancytreeloadchildren tree._triggerNodeEvent("loadChildren", node); }) - .fail(function(error) { + .fail(function (error) { var ctxErr; if (error === RECURSIVE_REQUEST_ERROR) { @@ -5964,7 +6081,7 @@ var uniqueId = $.fn.extend( { ); } }) - .always(function() { + .always(function () { node._requestId = null; if (isAsync) { tree.debugTimeEnd(tag); @@ -5974,7 +6091,7 @@ var uniqueId = $.fn.extend( { return resultDfd.promise(); }, /** [Not Implemented] */ - nodeLoadKeyPath: function(ctx, keyPathList) { + nodeLoadKeyPath: function (ctx, keyPathList) { // TODO: implement and improve // http://code.google.com/p/dynatree/issues/detail?id=222 }, @@ -5983,7 +6100,7 @@ var uniqueId = $.fn.extend( { * @param {EventData} ctx * @param {FancytreeNode} childNode dircect child of ctx.node */ - nodeRemoveChild: function(ctx, childNode) { + nodeRemoveChild: function (ctx, childNode) { var idx, node = ctx.node, // opts = ctx.options, @@ -6018,7 +6135,7 @@ var uniqueId = $.fn.extend( { // Notify listeners node.triggerModifyChild("remove", childNode); // Unlink to support GC - childNode.visit(function(n) { + childNode.visit(function (n) { n.parent = null; }, true); this._callHook("treeRegisterNode", this, false, childNode); @@ -6028,7 +6145,7 @@ var uniqueId = $.fn.extend( { /**Remove HTML markup for all descendents of ctx.node. * @param {EventData} ctx */ - nodeRemoveChildMarkup: function(ctx) { + nodeRemoveChildMarkup: function (ctx) { var node = ctx.node; // FT.debug("nodeRemoveChildMarkup()", node.toString()); @@ -6040,7 +6157,7 @@ var uniqueId = $.fn.extend( { $(node.ul).remove(); node.ul = null; } - node.visit(function(n) { + node.visit(function (n) { n.li = n.ul = null; }); } @@ -6048,7 +6165,7 @@ var uniqueId = $.fn.extend( { /**Remove all descendants of ctx.node. * @param {EventData} ctx */ - nodeRemoveChildren: function(ctx) { + nodeRemoveChildren: function (ctx) { var //subCtx, tree = ctx.tree, node = ctx.node, @@ -6071,7 +6188,7 @@ var uniqueId = $.fn.extend( { // TODO: also delete this.children (not possible using visit()) // subCtx = $.extend({}, ctx); node.triggerModifyChild("remove", null); - node.visit(function(n) { + node.visit(function (n) { n.parent = null; tree._callHook("treeRegisterNode", tree, false, n); }); @@ -6089,7 +6206,7 @@ var uniqueId = $.fn.extend( { /**Remove HTML markup for ctx.node and all its descendents. * @param {EventData} ctx */ - nodeRemoveMarkup: function(ctx) { + nodeRemoveMarkup: function (ctx) { var node = ctx.node; // FT.debug("nodeRemoveMarkup()", node.toString()); // TODO: Unlink attr.ftnode to support GC @@ -6129,7 +6246,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed * @param {boolean} [collapsed=false] force root node to be collapsed, so we can apply animated expand later */ - nodeRender: function(ctx, force, deep, collapsed, _recursive) { + nodeRender: function (ctx, force, deep, collapsed, _recursive) { /* This method must take care of all cases where the current data mode * (i.e. node hierarchy) does not match the current markup. * @@ -6317,7 +6434,7 @@ var uniqueId = $.fn.extend( { * @param {EventData} ctx * @param {string} [title] optinal new title */ - nodeRenderTitle: function(ctx, title) { + nodeRenderTitle: function (ctx, title) { // set node connector images, links and text var checkbox, className, @@ -6532,7 +6649,7 @@ var uniqueId = $.fn.extend( { /** Update element classes according to node state. * @param {EventData} ctx */ - nodeRenderStatus: function(ctx) { + nodeRenderStatus: function (ctx) { // Set classes for current status var $ariaElem, node = ctx.node, @@ -6656,7 +6773,7 @@ var uniqueId = $.fn.extend( { * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false} * @returns {$.Promise} */ - nodeSetActive: function(ctx, flag, callOpts) { + nodeSetActive: function (ctx, flag, callOpts) { // Handle user click / [space] / [enter], according to clickFolderMode. callOpts = callOpts || {}; var subCtx, @@ -6754,7 +6871,7 @@ var uniqueId = $.fn.extend( { * @returns {$.Promise} The deferred will be resolved as soon as the (lazy) * data was retrieved, rendered, and the expand animation finished. */ - nodeSetExpanded: function(ctx, flag, callOpts) { + nodeSetExpanded: function (ctx, flag, callOpts) { callOpts = callOpts || {}; var _afterLoad, dfd, @@ -6828,7 +6945,7 @@ var uniqueId = $.fn.extend( { } } // Trigger expand/collapse after expanding - dfd.done(function() { + dfd.done(function () { var lastChild = node.getLastChild(); if ( @@ -6841,7 +6958,7 @@ var uniqueId = $.fn.extend( { // Scroll down to last child, but keep current node visible lastChild .scrollIntoView(true, { topNode: node }) - .always(function() { + .always(function () { if (!noEvents) { ctx.tree._triggerNodeEvent( flag ? "expand" : "collapse", @@ -6859,7 +6976,7 @@ var uniqueId = $.fn.extend( { } }); // vvv Code below is executed after loading finished: - _afterLoad = function(callback) { + _afterLoad = function (callback) { var cn = opts._classNames, isVisible, isExpanded, @@ -6895,11 +7012,11 @@ var uniqueId = $.fn.extend( { // See #716, #717 $(node.li).addClass(cn.animating); // #717 - if ($.isFunction($(node.ul)[effect.effect])) { + if (_isFunction($(node.ul)[effect.effect])) { // tree.debug( "use jquery." + effect.effect + " method" ); $(node.ul)[effect.effect]({ duration: effect.duration, - always: function() { + always: function () { // node.debug("fancytree-animating end: " + node.li.className); $(this).removeClass(cn.animating); // #716 $(node.li).removeClass(cn.animating); // #717 @@ -6928,7 +7045,7 @@ var uniqueId = $.fn.extend( { effect.effect, effect.options, effect.duration, - function() { + function () { // node.debug("fancytree-animating end: " + node.li.className); $(this).removeClass(cn.animating); // #716 $(node.li).removeClass(cn.animating); // #717 @@ -6947,18 +7064,18 @@ var uniqueId = $.fn.extend( { if (flag && node.lazy && node.hasChildren() === undefined) { // node.debug("nodeSetExpanded: load start..."); node.load() - .done(function() { + .done(function () { // node.debug("nodeSetExpanded: load done"); if (dfd.notifyWith) { // requires jQuery 1.6+ dfd.notifyWith(node, ["loaded"]); } - _afterLoad(function() { + _afterLoad(function () { dfd.resolveWith(node); }); }) - .fail(function(errMsg) { - _afterLoad(function() { + .fail(function (errMsg) { + _afterLoad(function () { dfd.rejectWith(node, [ "load failed (" + errMsg + ")", ]); @@ -6979,7 +7096,7 @@ var uniqueId = $.fn.extend( { }); */ } else { - _afterLoad(function() { + _afterLoad(function () { dfd.resolveWith(node); }); } @@ -6990,7 +7107,7 @@ var uniqueId = $.fn.extend( { * @param {EventData} ctx * @param {boolean} [flag=true] */ - nodeSetFocus: function(ctx, flag) { + nodeSetFocus: function (ctx, flag) { // ctx.node.debug("nodeSetFocus(" + flag + ")"); var ctx2, tree = ctx.tree, @@ -7028,9 +7145,7 @@ var uniqueId = $.fn.extend( { if (opts.titlesTabbable) { if (!isInput) { // #621 - $(node.span) - .find(".fancytree-title") - .focus(); + $(node.span).find(".fancytree-title").focus(); } } if (opts.aria) { @@ -7078,7 +7193,7 @@ var uniqueId = $.fn.extend( { * } * @returns {boolean} previous status */ - nodeSetSelected: function(ctx, flag, callOpts) { + nodeSetSelected: function (ctx, flag, callOpts) { callOpts = callOpts || {}; var node = ctx.node, tree = ctx.tree, @@ -7137,7 +7252,7 @@ var uniqueId = $.fn.extend( { node.selected = flag; node.fixSelection3AfterClick(callOpts); } else if (parent && parent.radiogroup) { - node.visitSiblings(function(n) { + node.visitSiblings(function (n) { n._changeSelectStatusAttrs(flag && n === node); }, true); } else { @@ -7158,7 +7273,7 @@ var uniqueId = $.fn.extend( { * @param details * @since 2.3 */ - nodeSetStatus: function(ctx, status, message, details) { + nodeSetStatus: function (ctx, status, message, details) { var node = ctx.node, tree = ctx.tree; @@ -7270,13 +7385,13 @@ var uniqueId = $.fn.extend( { * * @param {EventData} ctx */ - nodeToggleExpanded: function(ctx) { + nodeToggleExpanded: function (ctx) { return this.nodeSetExpanded(ctx, !ctx.node.expanded); }, /** * @param {EventData} ctx */ - nodeToggleSelected: function(ctx) { + nodeToggleSelected: function (ctx) { var node = ctx.node, flag = !node.selected; @@ -7297,7 +7412,7 @@ var uniqueId = $.fn.extend( { /** Remove all nodes. * @param {EventData} ctx */ - treeClear: function(ctx) { + treeClear: function (ctx) { var tree = ctx.tree; tree.activeNode = null; tree.focusNode = null; @@ -7309,11 +7424,11 @@ var uniqueId = $.fn.extend( { /** Widget was created (called only once, even it re-initialized). * @param {EventData} ctx */ - treeCreate: function(ctx) {}, + treeCreate: function (ctx) {}, /** Widget was destroyed. * @param {EventData} ctx */ - treeDestroy: function(ctx) { + treeDestroy: function (ctx) { this.$div.find(">ul.fancytree-container").remove(); if (this.$source) { this.$source.removeClass("fancytree-helper-hidden"); @@ -7322,7 +7437,7 @@ var uniqueId = $.fn.extend( { /** Widget was (re-)initialized. * @param {EventData} ctx */ - treeInit: function(ctx) { + treeInit: function (ctx) { var tree = ctx.tree, opts = tree.options; @@ -7333,7 +7448,7 @@ var uniqueId = $.fn.extend( { tree.$container.attr("tabindex", opts.tabindex); // Copy some attributes to tree.data - $.each(TREE_ATTRS, function(i, attr) { + $.each(TREE_ATTRS, function (i, attr) { if (opts[attr] !== undefined) { tree.info("Move option " + attr + " to tree"); tree[attr] = opts[attr]; @@ -7365,7 +7480,7 @@ var uniqueId = $.fn.extend( { * @param {EventData} ctx * @param {object} [source] optional new source (use last data otherwise) */ - treeLoad: function(ctx, source) { + treeLoad: function (ctx, source) { var metaData, type, $ul, @@ -7415,21 +7530,21 @@ var uniqueId = $.fn.extend( { // $container.empty(); $container .contents() - .filter(function() { + .filter(function () { return this.nodeType === 3; }) .remove(); if ($.isPlainObject(source)) { // We got {foo: 'abc', children: [...]} _assert( - $.isArray(source.children), + _isArray(source.children), "if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')" ); metaData = source; source = source.children; delete metaData.children; // Copy some attributes to tree.data - $.each(TREE_ATTRS, function(i, attr) { + $.each(TREE_ATTRS, function (i, attr) { if (metaData[attr] !== undefined) { tree[attr] = metaData[attr]; delete metaData[attr]; @@ -7453,7 +7568,7 @@ var uniqueId = $.fn.extend( { // Trigger fancytreeinit after nodes have been loaded dfd = this.nodeLoadChildren(rootCtx, source) - .done(function() { + .done(function () { tree._callHook( "treeStructureChanged", ctx, @@ -7468,7 +7583,7 @@ var uniqueId = $.fn.extend( { } tree._triggerTreeEvent("init", null, { status: true }); }) - .fail(function() { + .fail(function () { tree.render(); tree._triggerTreeEvent("init", null, { status: false }); }); @@ -7479,7 +7594,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} add * @param {FancytreeNode} node */ - treeRegisterNode: function(ctx, add, node) { + treeRegisterNode: function (ctx, add, node) { ctx.tree._callHook( "treeStructureChanged", ctx, @@ -7490,7 +7605,7 @@ var uniqueId = $.fn.extend( { * @param {EventData} ctx * @param {boolean} [flag=true] */ - treeSetFocus: function(ctx, flag, callOpts) { + treeSetFocus: function (ctx, flag, callOpts) { var targetNode; flag = flag !== false; @@ -7529,7 +7644,7 @@ var uniqueId = $.fn.extend( { * @param {string} key option name * @param {any} value option value */ - treeSetOption: function(ctx, key, value) { + treeSetOption: function (ctx, key, value) { var tree = ctx.tree, callDefault = true, callCreate = false, @@ -7605,7 +7720,7 @@ var uniqueId = $.fn.extend( { /** A Node was added, removed, moved, or it's visibility changed. * @param {EventData} ctx */ - treeStructureChanged: function(ctx, type) {}, + treeStructureChanged: function (ctx, type) {}, } ); @@ -7715,7 +7830,7 @@ var uniqueId = $.fn.extend( { lazyLoad: null, postProcess: null, }, - _deprecationWarning: function(name) { + _deprecationWarning: function (name) { var tree = this.tree; if (tree && tree.options.debugLevel >= 3) { @@ -7727,7 +7842,7 @@ var uniqueId = $.fn.extend( { } }, /* Set up the widget, Called on first $().fancytree() */ - _create: function() { + _create: function () { this.tree = new Fancytree(this); this.$source = @@ -7824,7 +7939,7 @@ var uniqueId = $.fn.extend( { }, /* Called on every $().fancytree() */ - _init: function() { + _init: function () { this.tree._callHook("treeInit", this.tree); // TODO: currently we call bind after treeInit, because treeInit // might change tree.$container. @@ -7833,7 +7948,7 @@ var uniqueId = $.fn.extend( { }, /* Use the _setOption method to respond to changes to options. */ - _setOption: function(key, value) { + _setOption: function (key, value) { return this.tree._callHook( "treeSetOption", this.tree, @@ -7843,7 +7958,7 @@ var uniqueId = $.fn.extend( { }, /** Use the destroy method to clean up any modifications your widget has made to the DOM */ - _destroy: function() { + _destroy: function () { this._unbind(); this.tree._callHook("treeDestroy", this.tree); // In jQuery UI 1.8, you must invoke the destroy method from the base widget @@ -7855,14 +7970,14 @@ var uniqueId = $.fn.extend( { // ------------------------------------------------------------------------- /* Remove all event handlers for our namespace */ - _unbind: function() { + _unbind: function () { var ns = this.tree._ns; this.element.off(ns); this.tree.$container.off(ns); $(document).off(ns); }, /* Add mouse and kyboard handlers to the container */ - _bind: function() { + _bind: function () { var self = this, opts = this.options, tree = this.tree, @@ -7875,7 +7990,7 @@ var uniqueId = $.fn.extend( { //alert("keydown" + ns + "foc=" + tree.hasFocus() + tree.$container); // tree.debug("bind events; container: ", tree.$container); tree.$container - .on("focusin" + ns + " focusout" + ns, function(event) { + .on("focusin" + ns + " focusout" + ns, function (event) { var node = FT.getNode(event), flag = event.type === "focusin"; @@ -7930,14 +8045,16 @@ var uniqueId = $.fn.extend( { } } }) - .on("selectstart" + ns, "span.fancytree-title", function( - event - ) { - // prevent mouse-drags to select text ranges - // tree.debug(" got event " + event.type); - event.preventDefault(); - }) - .on("keydown" + ns, function(event) { + .on( + "selectstart" + ns, + "span.fancytree-title", + function (event) { + // prevent mouse-drags to select text ranges + // tree.debug(" got event " + event.type); + event.preventDefault(); + } + ) + .on("keydown" + ns, function (event) { // TODO: also bind keyup and keypress // tree.debug("got event " + event.type + ", hasFocus:" + tree.hasFocus()); // if(opts.disabled || opts.keyboard === false || !tree.hasFocus() ){ @@ -7972,7 +8089,7 @@ var uniqueId = $.fn.extend( { tree.phase = prevPhase; } }) - .on("mousedown" + ns, function(event) { + .on("mousedown" + ns, function (event) { var et = FT.getEventTarget(event); // self.tree.debug("event(" + event.type + "): node: ", et.node); // #712: Store the clicked node, so we can use it when we get a focusin event @@ -7986,7 +8103,7 @@ var uniqueId = $.fn.extend( { tree._lastMousedownNode ); }) - .on("click" + ns + " dblclick" + ns, function(event) { + .on("click" + ns + " dblclick" + ns, function (event) { if (opts.disabled) { return true; } @@ -8042,7 +8159,7 @@ var uniqueId = $.fn.extend( { * @returns {FancytreeNode} * @deprecated Use methods of the Fancytree instance instead (example above). */ - getActiveNode: function() { + getActiveNode: function () { this._deprecationWarning("getActiveNode"); return this.tree.activeNode; }, @@ -8051,7 +8168,7 @@ var uniqueId = $.fn.extend( { * @returns {FancytreeNode} * @deprecated Use methods of the Fancytree instance instead (example above). */ - getNodeByKey: function(key) { + getNodeByKey: function (key) { this._deprecationWarning("getNodeByKey"); return this.tree.getNodeByKey(key); }, @@ -8059,7 +8176,7 @@ var uniqueId = $.fn.extend( { * @returns {FancytreeNode} * @deprecated Use methods of the Fancytree instance instead (example above). */ - getRootNode: function() { + getRootNode: function () { this._deprecationWarning("getRootNode"); return this.tree.rootNode; }, @@ -8067,7 +8184,7 @@ var uniqueId = $.fn.extend( { * @returns {Fancytree} * @deprecated Use `$.ui.fancytree.getTree()` instead (example above). */ - getTree: function() { + getTree: function () { this._deprecationWarning("getTree"); return this.tree; }, @@ -8095,7 +8212,7 @@ var uniqueId = $.fn.extend( { { /** Version number `"MAJOR.MINOR.PATCH"` * @type {string} */ - version: "2.38.0", // Set to semver by 'grunt release' + version: "2.38.1", // Set to semver by 'grunt release' /** @type {string} * @description `"production" for release builds` */ buildType: "production", // Set to 'production' by 'grunt build' @@ -8128,7 +8245,7 @@ var uniqueId = $.fn.extend( { * @param {boolean} cond * @param {string} msg */ - assert: function(cond, msg) { + assert: function (cond, msg) { return _assert(cond, msg); }, /** Create a new Fancytree instance on a target element. @@ -8143,7 +8260,7 @@ var uniqueId = $.fn.extend( { * * @since 2.25 */ - createTree: function(el, opts) { + createTree: function (el, opts) { var $tree = $(el).fancytree(opts); return FT.getTree($tree); }, @@ -8153,19 +8270,19 @@ var uniqueId = $.fn.extend( { * @param {boolean} [invokeAsap=false] * @param {any} [ctx] */ - debounce: function(timeout, fn, invokeAsap, ctx) { + debounce: function (timeout, fn, invokeAsap, ctx) { var timer; if (arguments.length === 3 && typeof invokeAsap !== "boolean") { ctx = invokeAsap; invokeAsap = false; } - return function() { + return function () { var args = arguments; ctx = ctx || this; // eslint-disable-next-line no-unused-expressions invokeAsap && !timer && fn.apply(ctx, args); clearTimeout(timer); - timer = setTimeout(function() { + timer = setTimeout(function () { // eslint-disable-next-line no-unused-expressions invokeAsap || fn.apply(ctx, args); timer = null; @@ -8175,7 +8292,7 @@ var uniqueId = $.fn.extend( { /** Write message to console if debugLevel >= 4 * @param {string} msg */ - debug: function(msg) { + debug: function (msg) { if ($.ui.fancytree.debugLevel >= 4) { consoleApply("log", arguments); } @@ -8183,7 +8300,7 @@ var uniqueId = $.fn.extend( { /** Write error message to console if debugLevel >= 1. * @param {string} msg */ - error: function(msg) { + error: function (msg) { if ($.ui.fancytree.debugLevel >= 1) { consoleApply("error", arguments); } @@ -8193,8 +8310,8 @@ var uniqueId = $.fn.extend( { * @param {string} s * @returns {string} */ - escapeHtml: function(s) { - return ("" + s).replace(REX_HTML, function(s) { + escapeHtml: function (s) { + return ("" + s).replace(REX_HTML, function (s) { return ENTITY_MAP[s]; }); }, @@ -8210,7 +8327,7 @@ var uniqueId = $.fn.extend( { * @param {object} opts * @returns {object} the (potentially modified) original opts hash object */ - fixPositionOptions: function(opts) { + fixPositionOptions: function (opts) { if (opts.offset || ("" + opts.my + opts.at).indexOf("%") >= 0) { $.error( "expected new position syntax (but '%' is not supported)" @@ -8249,7 +8366,7 @@ var uniqueId = $.fn.extend( { * @returns {object} Return a {node: FancytreeNode, type: TYPE} object * TYPE: 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined */ - getEventTarget: function(event) { + getEventTarget: function (event) { var $target, tree, tcn = event && event.target ? event.target.className : "", @@ -8295,7 +8412,7 @@ var uniqueId = $.fn.extend( { * @param {Event} event Mouse event, e.g. click, mousemove, ... * @returns {string} 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined */ - getEventTargetType: function(event) { + getEventTargetType: function (event) { return this.getEventTarget(event).type; }, /** Return a FancytreeNode instance from element, event, or jQuery object. @@ -8303,7 +8420,7 @@ var uniqueId = $.fn.extend( { * @param {Element | jQueryObject | Event} el * @returns {FancytreeNode} matching node or null */ - getNode: function(el) { + getNode: function (el) { if (el instanceof FancytreeNode) { return el; // el already was a FancytreeNode } else if (el instanceof $) { @@ -8332,7 +8449,7 @@ var uniqueId = $.fn.extend( { * * @since 2.13 */ - getTree: function(el) { + getTree: function (el) { var widget, orgEl = el; @@ -8390,7 +8507,7 @@ var uniqueId = $.fn.extend( { * * @since 2.22 */ - evalOption: function( + evalOption: function ( optionName, node, nodeObject, @@ -8403,7 +8520,7 @@ var uniqueId = $.fn.extend( { treeOpt = treeOptions[optionName], nodeOpt = nodeObject[optionName]; - if ($.isFunction(treeOpt)) { + if (_isFunction(treeOpt)) { ctx = { node: node, tree: tree, @@ -8430,7 +8547,7 @@ var uniqueId = $.fn.extend( { * @param {string | object} icon * @since 2.27 */ - setSpanIcon: function(span, baseClass, icon) { + setSpanIcon: function (span, baseClass, icon) { var $span = $(span); if (typeof icon === "string") { @@ -8475,7 +8592,7 @@ var uniqueId = $.fn.extend( { event.preventDefault(); } */ - eventToString: function(event) { + eventToString: function (event) { // Poor-man's hotkeys. See here for a complete implementation: // https://github.com/jeresig/jquery.hotkeys var which = event.which, @@ -8510,14 +8627,14 @@ var uniqueId = $.fn.extend( { /** Write message to console if debugLevel >= 3 * @param {string} msg */ - info: function(msg) { + info: function (msg) { if ($.ui.fancytree.debugLevel >= 3) { consoleApply("info", arguments); } }, /* @deprecated: use eventToString(event) instead. */ - keyEventToString: function(event) { + keyEventToString: function (event) { this.warn( "keyEventToString() is deprecated: use eventToString()" ); @@ -8539,11 +8656,11 @@ var uniqueId = $.fn.extend( { * @param {function} handler * @param {object} [context] optional context */ - overrideMethod: function(instance, methodName, handler, context) { + overrideMethod: function (instance, methodName, handler, context) { var prevSuper, _super = instance[methodName] || $.noop; - instance[methodName] = function() { + instance[methodName] = function () { var self = context || this; try { @@ -8561,7 +8678,7 @@ var uniqueId = $.fn.extend( { * @param {jQueryObject} $ul * @returns {NodeData[]} */ - parseHtml: function($ul) { + parseHtml: function ($ul) { var classes, className, extraClasses, @@ -8573,7 +8690,7 @@ var uniqueId = $.fn.extend( { $children = $ul.find(">li"), children = []; - $children.each(function() { + $children.each(function () { var allData, lowerCaseAttr, $li = $(this), @@ -8598,7 +8715,7 @@ var uniqueId = $.fn.extend( { d.title = d.title.substring(0, iPos); } } - d.title = $.trim(d.title); + d.title = _trim(d.title); // Make sure all fields exist for (i = 0, l = CLASS_ATTRS.length; i < l; i++) { @@ -8635,7 +8752,7 @@ var uniqueId = $.fn.extend( { if (allData && !$.isEmptyObject(allData)) { // #507: convert data-hidecheckbox (lower case) to hideCheckbox for (lowerCaseAttr in NODE_ATTR_LOWERCASE_MAP) { - if (allData.hasOwnProperty(lowerCaseAttr)) { + if (_hasProp(allData, lowerCaseAttr)) { allData[ NODE_ATTR_LOWERCASE_MAP[lowerCaseAttr] ] = allData[lowerCaseAttr]; @@ -8670,7 +8787,7 @@ var uniqueId = $.fn.extend( { * * @param {object} definition */ - registerExtension: function(definition) { + registerExtension: function (definition) { _assert( definition.name != null, "extensions must have a `name` property." @@ -8681,12 +8798,17 @@ var uniqueId = $.fn.extend( { ); $.ui.fancytree._extensions[definition.name] = definition; }, + /** Replacement for the deprecated `jQuery.trim()`. + * + * @param {string} text + */ + trim: _trim, /** Inverse of escapeHtml(). * * @param {string} s * @returns {string} */ - unescapeHtml: function(s) { + unescapeHtml: function (s) { var e = document.createElement("div"); e.innerHTML = s; return e.childNodes.length === 0 @@ -8696,7 +8818,7 @@ var uniqueId = $.fn.extend( { /** Write warning message to console if debugLevel >= 2. * @param {string} msg */ - warn: function(msg) { + warn: function (msg) { if ($.ui.fancytree.debugLevel >= 2) { consoleApply("warn", arguments); } @@ -8730,8 +8852,8 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ // To keep the global namespace clean, we wrap everything in a closure. @@ -8739,7 +8861,7 @@ var uniqueId = $.fn.extend( { // Fancytree core module, and makes sure that we can use the `require()` // syntax with package loaders. -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -8751,7 +8873,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { // Consider to use [strict mode](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/) "use strict"; @@ -8770,7 +8892,9 @@ var uniqueId = $.fn.extend( { // var tree = $.ui.fancytree.getTree("#tree"); // tree.countSelected(false); - $.ui.fancytree._FancytreeClass.prototype.countSelected = function(topOnly) { + $.ui.fancytree._FancytreeClass.prototype.countSelected = function ( + topOnly + ) { var tree = this, treeOptions = tree.options; @@ -8789,7 +8913,7 @@ var uniqueId = $.fn.extend( { * @alias FancytreeNode#updateCounters * @requires jquery.fancytree.childcounters.js */ - $.ui.fancytree._FancytreeNodeClass.prototype.updateCounters = function() { + $.ui.fancytree._FancytreeNodeClass.prototype.updateCounters = function () { var node = this, $badge = $("span.fancytree-childcounter", node.span), extOpts = node.tree.options.childcounter, @@ -8822,7 +8946,7 @@ var uniqueId = $.fn.extend( { // // $("#tree").fancytree("widgetMethod1", "abc"); - $.ui.fancytree.prototype.widgetMethod1 = function(arg1) { + $.ui.fancytree.prototype.widgetMethod1 = function (arg1) { var tree = this.tree; return arg1; }; @@ -8850,7 +8974,7 @@ var uniqueId = $.fn.extend( { // Every extension must be registered by a unique name. name: "childcounter", // Version information should be compliant with [semver](http://semver.org) - version: "2.38.0", + version: "2.38.1", // Extension specific options and their defaults. // This options will be available as `tree.options.childcounter.hideExpanded` @@ -8870,7 +8994,7 @@ var uniqueId = $.fn.extend( { // Local functions are prefixed with an underscore '_'. // Callable as `this._local._appendCounter()`. - _appendCounter: function(bar) { + _appendCounter: function (bar) { var tree = this; }, @@ -8888,7 +9012,7 @@ var uniqueId = $.fn.extend( { /* Init */ // `treeInit` is triggered when a tree is initalized. We can set up classes or // bind event handlers here... - treeInit: function(ctx) { + treeInit: function (ctx) { var tree = this, // same as ctx.tree, opts = ctx.options, extOpts = ctx.options.childcounter; @@ -8903,12 +9027,12 @@ var uniqueId = $.fn.extend( { // Destroy this tree instance (we only call the default implementation, so // this method could as well be omitted). - treeDestroy: function(ctx) { + treeDestroy: function (ctx) { this._superApply(arguments); }, // Overload the `renderTitle` hook, to append a counter badge - nodeRenderTitle: function(ctx, title) { + nodeRenderTitle: function (ctx, title) { var node = ctx.node, extOpts = ctx.options.childcounter, count = @@ -8933,12 +9057,12 @@ var uniqueId = $.fn.extend( { } }, // Overload the `setExpanded` hook, so the counters are updated - nodeSetExpanded: function(ctx, flag, callOpts) { + nodeSetExpanded: function (ctx, flag, callOpts) { var tree = ctx.tree, node = ctx.node; // Let the base implementation expand/collapse the node, then redraw the title // after the animation has finished - return this._superApply(arguments).always(function() { + return this._superApply(arguments).always(function () { tree.nodeRenderTitle(ctx); }); }, @@ -8961,11 +9085,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -8977,7 +9101,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /******************************************************************************* @@ -9102,7 +9226,7 @@ var uniqueId = $.fn.extend( { function calcUniqueKey(node) { var key, h1, - path = $.map(node.getParentList(false, true), function(e) { + path = $.map(node.getParentList(false, true), function (e) { return e.refKey || e.key; }); @@ -9124,7 +9248,7 @@ var uniqueId = $.fn.extend( { * @alias FancytreeNode#getCloneList * @requires jquery.fancytree.clones.js */ - $.ui.fancytree._FancytreeNodeClass.prototype.getCloneList = function( + $.ui.fancytree._FancytreeNodeClass.prototype.getCloneList = function ( includeSelf ) { var key, @@ -9136,11 +9260,11 @@ var uniqueId = $.fn.extend( { key = this.key; // Convert key list to node list if (includeSelf) { - refList = $.map(refList, function(val) { + refList = $.map(refList, function (val) { return keyMap[val]; }); } else { - refList = $.map(refList, function(val) { + refList = $.map(refList, function (val) { return val === key ? null : keyMap[val]; }); if (refList.length < 1) { @@ -9158,7 +9282,7 @@ var uniqueId = $.fn.extend( { * @alias FancytreeNode#isClone * @requires jquery.fancytree.clones.js */ - $.ui.fancytree._FancytreeNodeClass.prototype.isClone = function() { + $.ui.fancytree._FancytreeNodeClass.prototype.isClone = function () { var refKey = this.refKey || null, refList = (refKey && this.tree.refMap[refKey]) || null; return !!(refList && refList.length > 1); @@ -9173,7 +9297,7 @@ var uniqueId = $.fn.extend( { * @alias FancytreeNode#reRegister * @requires jquery.fancytree.clones.js */ - $.ui.fancytree._FancytreeNodeClass.prototype.reRegister = function( + $.ui.fancytree._FancytreeNodeClass.prototype.reRegister = function ( key, refKey ) { @@ -9205,7 +9329,7 @@ var uniqueId = $.fn.extend( { keyMap[key] = this; // Update refMap if (refList) { - refMap[prevRefKey] = $.map(refList, function(e) { + refMap[prevRefKey] = $.map(refList, function (e) { return e === prevKey ? key : e; }); } @@ -9220,7 +9344,7 @@ var uniqueId = $.fn.extend( { if (refList.length === 1) { delete refMap[prevRefKey]; } else { - refMap[prevRefKey] = $.map(refList, function(e) { + refMap[prevRefKey] = $.map(refList, function (e) { return e === prevKey ? null : e; }); } @@ -9246,7 +9370,7 @@ var uniqueId = $.fn.extend( { * @requires jquery.fancytree.clones.js * @since 2.16 */ - $.ui.fancytree._FancytreeNodeClass.prototype.setRefKey = function(refKey) { + $.ui.fancytree._FancytreeNodeClass.prototype.setRefKey = function (refKey) { return this.reRegister(null, refKey); }; @@ -9258,7 +9382,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#getNodesByRef * @requires jquery.fancytree.clones.js */ - $.ui.fancytree._FancytreeClass.prototype.getNodesByRef = function( + $.ui.fancytree._FancytreeClass.prototype.getNodesByRef = function ( refKey, rootNode ) { @@ -9268,12 +9392,12 @@ var uniqueId = $.fn.extend( { if (refList) { // Convert key list to node list if (rootNode) { - refList = $.map(refList, function(val) { + refList = $.map(refList, function (val) { var node = keyMap[val]; return node.isDescendantOf(rootNode) ? node : null; }); } else { - refList = $.map(refList, function(val) { + refList = $.map(refList, function (val) { return keyMap[val]; }); } @@ -9291,7 +9415,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#changeRefKey * @requires jquery.fancytree.clones.js */ - $.ui.fancytree._FancytreeClass.prototype.changeRefKey = function( + $.ui.fancytree._FancytreeClass.prototype.changeRefKey = function ( oldRefKey, newRefKey ) { @@ -9315,34 +9439,34 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "clones", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers highlightClones: false, // set 'fancytree-clone' class on any node that has at least one clone }, - treeCreate: function(ctx) { + treeCreate: function (ctx) { this._superApply(arguments); ctx.tree.refMap = {}; ctx.tree.keyMap = {}; }, - treeInit: function(ctx) { + treeInit: function (ctx) { this.$container.addClass("fancytree-ext-clones"); _assert(ctx.options.defaultKey == null); // Generate unique / reproducible default keys - ctx.options.defaultKey = function(node) { + ctx.options.defaultKey = function (node) { return calcUniqueKey(node); }; // The default implementation loads initial data this._superApply(arguments); }, - treeClear: function(ctx) { + treeClear: function (ctx) { ctx.tree.refMap = {}; ctx.tree.keyMap = {}; return this._superApply(arguments); }, - treeRegisterNode: function(ctx, add, node) { + treeRegisterNode: function (ctx, add, node) { var refList, len, tree = ctx.tree, @@ -9425,7 +9549,7 @@ var uniqueId = $.fn.extend( { } return this._super(ctx, add, node); }, - nodeRenderStatus: function(ctx) { + nodeRenderStatus: function (ctx) { var $span, res, node = ctx.node; @@ -9442,7 +9566,7 @@ var uniqueId = $.fn.extend( { } return res; }, - nodeSetActive: function(ctx, flag, callOpts) { + nodeSetActive: function (ctx, flag, callOpts) { var res, scpn = ctx.tree.statusClassPropName, node = ctx.node; @@ -9450,7 +9574,7 @@ var uniqueId = $.fn.extend( { res = this._superApply(arguments); if (ctx.options.clones.highlightActiveClones && node.isClone()) { - $.each(node.getCloneList(true), function(idx, n) { + $.each(node.getCloneList(true), function (idx, n) { // n.debug("clones.nodeSetActive: ", flag !== false); $(n[scpn]).toggleClass( "fancytree-active-clone", @@ -9477,8 +9601,8 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ /* @@ -9494,7 +9618,7 @@ var uniqueId = $.fn.extend( { */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -9506,7 +9630,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /****************************************************************************** @@ -9583,7 +9707,7 @@ var uniqueId = $.fn.extend( { before: !!r.before, after: !!r.after, }; - } else if ($.isArray(r)) { + } else if (Array.isArray(r)) { res = { over: $.inArray("over", r) >= 0, before: $.inArray("before", r) >= 0, @@ -10062,7 +10186,7 @@ var uniqueId = $.fn.extend( { } // Cache as array of jQuery objects for faster access: $sourceList = $( - $.map(SOURCE_NODE_LIST, function(n) { + $.map(SOURCE_NODE_LIST, function (n) { return n.span; }) ); @@ -10470,7 +10594,7 @@ var uniqueId = $.fn.extend( { * @requires jquery.fancytree.dnd5.js * @since 2.31 */ - $.ui.fancytree.getDragNodeList = function() { + $.ui.fancytree.getDragNodeList = function () { return SOURCE_NODE_LIST || []; }; @@ -10486,7 +10610,7 @@ var uniqueId = $.fn.extend( { * @requires jquery.fancytree.dnd5.js * @since 2.31 */ - $.ui.fancytree.getDragNode = function() { + $.ui.fancytree.getDragNode = function () { return SOURCE_NODE; }; @@ -10496,7 +10620,7 @@ var uniqueId = $.fn.extend( { $.ui.fancytree.registerExtension({ name: "dnd5", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { autoExpandMS: 1500, // Expand nodes after n milliseconds of hovering @@ -10531,7 +10655,7 @@ var uniqueId = $.fn.extend( { dragLeave: $.noop, // Callback(targetNode, data) }, - treeInit: function(ctx) { + treeInit: function (ctx) { var $temp, tree = ctx.tree, opts = ctx.options, @@ -10555,18 +10679,21 @@ var uniqueId = $.fn.extend( { // Implement `opts.createNode` event to add the 'draggable' attribute // #680: this must happen before calling super.treeInit() if (dndOpts.dragStart) { - FT.overrideMethod(ctx.options, "createNode", function( - event, - data - ) { - // Default processing if any - this._super.apply(this, arguments); - if (data.node.span) { - data.node.span.draggable = true; - } else { - data.node.warn("Cannot add `draggable`: no span tag"); + FT.overrideMethod( + ctx.options, + "createNode", + function (event, data) { + // Default processing if any + this._super.apply(this, arguments); + if (data.node.span) { + data.node.span.draggable = true; + } else { + data.node.warn( + "Cannot add `draggable`: no span tag" + ); + } } - }); + ); } this._superApply(arguments); @@ -10633,11 +10760,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -10649,7 +10776,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /******************************************************************************* @@ -10658,6 +10785,7 @@ var uniqueId = $.fn.extend( { var isMac = /Mac/.test(navigator.platform), escapeHtml = $.ui.fancytree.escapeHtml, + trim = $.ui.fancytree.trim, unescapeHtml = $.ui.fancytree.unescapeHtml; /** @@ -10666,7 +10794,7 @@ var uniqueId = $.fn.extend( { * @alias FancytreeNode#editStart * @requires Fancytree */ - $.ui.fancytree._FancytreeNodeClass.prototype.editStart = function() { + $.ui.fancytree._FancytreeNodeClass.prototype.editStart = function () { var $input, node = this, tree = this.tree, @@ -10708,7 +10836,7 @@ var uniqueId = $.fn.extend( { } // #116: ext-dnd prevents the blur event, so we have to catch outer clicks - $(document).on("mousedown.fancytree-edit", function(event) { + $(document).on("mousedown.fancytree-edit", function (event) { if (!$(event.target).hasClass("fancytree-edit-input")) { node.editEnd(true, event); } @@ -10735,10 +10863,10 @@ var uniqueId = $.fn.extend( { // Focus and bind keyboard handler $input .focus() - .change(function(event) { + .change(function (event) { $input.addClass("fancytree-edit-dirty"); }) - .on("keydown", function(event) { + .on("keydown", function (event) { switch (event.which) { case $.ui.keyCode.ESCAPE: node.editEnd(false, event); @@ -10749,7 +10877,7 @@ var uniqueId = $.fn.extend( { } event.stopPropagation(); }) - .blur(function(event) { + .blur(function (event) { return node.editEnd(true, event); }); @@ -10762,7 +10890,7 @@ var uniqueId = $.fn.extend( { * @alias FancytreeNode#editEnd * @requires jquery.fancytree.edit.js */ - $.ui.fancytree._FancytreeNodeClass.prototype.editEnd = function( + $.ui.fancytree._FancytreeNodeClass.prototype.editEnd = function ( applyChanges, _event ) { @@ -10776,7 +10904,7 @@ var uniqueId = $.fn.extend( { $input = $title.find("input.fancytree-edit-input"); if (instOpts.trim) { - $input.val($.trim($input.val())); + $input.val(trim($input.val())); } newVal = $input.val(); @@ -10856,7 +10984,7 @@ var uniqueId = $.fn.extend( { * @requires jquery.fancytree.edit.js * @since 2.4 */ - $.ui.fancytree._FancytreeNodeClass.prototype.editCreateNode = function( + $.ui.fancytree._FancytreeNodeClass.prototype.editCreateNode = function ( mode, init ) { @@ -10878,7 +11006,7 @@ var uniqueId = $.fn.extend( { !this.isExpanded() && this.hasChildren() !== false ) { - this.setExpanded().done(function() { + this.setExpanded().done(function () { self.editCreateNode(mode, init); }); return; @@ -10891,7 +11019,7 @@ var uniqueId = $.fn.extend( { .removeClass("fancytree-hide") .addClass("fancytree-match"); - newNode.makeVisible(/*{noAnimation: true}*/).done(function() { + newNode.makeVisible(/*{noAnimation: true}*/).done(function () { $(newNode[tree.statusClassPropName]).addClass("fancytree-edit-new"); self.tree.ext.edit.relatedNode = self; newNode.editStart(); @@ -10905,7 +11033,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#isEditing * @requires jquery.fancytree.edit.js */ - $.ui.fancytree._FancytreeClass.prototype.isEditing = function() { + $.ui.fancytree._FancytreeClass.prototype.isEditing = function () { return this.ext.edit ? this.ext.edit.currentNode : null; }; @@ -10915,7 +11043,7 @@ var uniqueId = $.fn.extend( { * @alias FancytreeNode#isEditing * @requires jquery.fancytree.edit.js */ - $.ui.fancytree._FancytreeNodeClass.prototype.isEditing = function() { + $.ui.fancytree._FancytreeNodeClass.prototype.isEditing = function () { return this.tree.ext.edit ? this.tree.ext.edit.currentNode === this : false; @@ -10926,7 +11054,7 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "edit", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { adjustWidthOfs: 4, // null: don't adjust input size to content @@ -10946,14 +11074,14 @@ var uniqueId = $.fn.extend( { // Local attributes currentNode: null, - treeInit: function(ctx) { + treeInit: function (ctx) { var tree = ctx.tree; this._superApply(arguments); this.$container .addClass("fancytree-ext-edit") - .on("fancytreebeforeupdateviewport", function(event, data) { + .on("fancytreebeforeupdateviewport", function (event, data) { var editNode = tree.isEditing(); // When scrolling, the TR may be re-used by another node, so the // active cell marker an @@ -10963,7 +11091,7 @@ var uniqueId = $.fn.extend( { } }); }, - nodeClick: function(ctx) { + nodeClick: function (ctx) { var eventStr = $.ui.fancytree.eventToString(ctx.originalEvent), triggerStart = ctx.options.edit.triggerStart; @@ -10992,14 +11120,14 @@ var uniqueId = $.fn.extend( { } return this._superApply(arguments); }, - nodeDblclick: function(ctx) { + nodeDblclick: function (ctx) { if ($.inArray("dblclick", ctx.options.edit.triggerStart) >= 0) { ctx.node.editStart(); return false; } return this._superApply(arguments); }, - nodeKeydown: function(ctx) { + nodeKeydown: function (ctx) { switch (ctx.originalEvent.which) { case 113: // [F2] if ($.inArray("f2", ctx.options.edit.triggerStart) >= 0) { @@ -11037,11 +11165,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -11053,7 +11181,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /******************************************************************************* @@ -11070,9 +11198,7 @@ var uniqueId = $.fn.extend( { function extractHtmlText(s) { if (s.indexOf(">") >= 0) { - return $("
") - .html(s) - .text(); + return $("
").html(s).text(); } return s; } @@ -11106,19 +11232,19 @@ var uniqueId = $.fn.extend( { var textPoses = text.split(""); if (escapeTitles) { // If escaping the title, then wrap the matchng char within exotic chars - matchingIndices.forEach(function(v) { + matchingIndices.forEach(function (v) { textPoses[v] = exoticStartChar + textPoses[v] + exoticEndChar; }); } else { // Otherwise, Wrap the matching chars within `mark`. - matchingIndices.forEach(function(v) { + matchingIndices.forEach(function (v) { textPoses[v] = "" + textPoses[v] + ""; }); } // Join back the modified `textPoses` to create final highlight markup. return textPoses.join(""); } - $.ui.fancytree._FancytreeClass.prototype._applyFilterImpl = function( + $.ui.fancytree._FancytreeClass.prototype._applyFilterImpl = function ( filter, branchMode, _opts @@ -11158,7 +11284,7 @@ var uniqueId = $.fn.extend( { // it gets further split into individual characters. So, // escape each character after splitting .map(_escapeRegex) - .reduce(function(a, b) { + .reduce(function (a, b) { // create capture groups for parts that comes before // the character return a + "([^" + b + "]*)" + b; @@ -11175,7 +11301,7 @@ var uniqueId = $.fn.extend( { ); reExoticEndChar = new RegExp(_escapeRegex(exoticEndChar), "g"); } - filter = function(node) { + filter = function (node) { if (!node.title) { return false; } @@ -11195,7 +11321,7 @@ var uniqueId = $.fn.extend( { } else { // #740: we must not apply the marks to escaped entity names, e.g. `"` // Use some exotic characters to mark matches: - temp = text.replace(reHighlight, function(s) { + temp = text.replace(reHighlight, function (s) { return exoticStartChar + s + exoticEndChar; }); } @@ -11213,7 +11339,7 @@ var uniqueId = $.fn.extend( { } else { node.titleWithHighlight = text.replace( reHighlight, - function(s) { + function (s) { return "" + s + ""; } ); @@ -11242,7 +11368,7 @@ var uniqueId = $.fn.extend( { ); // Reset current filter this.rootNode.subMatchCount = 0; - this.visit(function(node) { + this.visit(function (node) { delete node.match; delete node.titleWithHighlight; node.subMatchCount = 0; @@ -11255,7 +11381,7 @@ var uniqueId = $.fn.extend( { // Adjust node.hide, .match, and .subMatchCount properties treeOpts.autoCollapse = false; // #528 - this.visit(function(node) { + this.visit(function (node) { if (leavesOnly && node.children != null) { return; } @@ -11263,7 +11389,7 @@ var uniqueId = $.fn.extend( { matchedByBranch = false; if (res === "skip") { - node.visit(function(c) { + node.visit(function (c) { c.match = false; }, true); return "skip"; @@ -11275,7 +11401,7 @@ var uniqueId = $.fn.extend( { if (res) { count++; node.match = true; - node.visitParents(function(p) { + node.visitParents(function (p) { if (p !== node) { p.subMatchCount += 1; } @@ -11295,7 +11421,7 @@ var uniqueId = $.fn.extend( { if (count === 0 && opts.nodata && hideMode) { statusNode = opts.nodata; - if ($.isFunction(statusNode)) { + if (typeof statusNode === "function") { statusNode = statusNode(); } if (statusNode === true) { @@ -11330,7 +11456,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#filterNodes * @requires jquery.fancytree.filter.js */ - $.ui.fancytree._FancytreeClass.prototype.filterNodes = function( + $.ui.fancytree._FancytreeClass.prototype.filterNodes = function ( filter, opts ) { @@ -11352,7 +11478,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#filterBranches * @requires jquery.fancytree.filter.js */ - $.ui.fancytree._FancytreeClass.prototype.filterBranches = function( + $.ui.fancytree._FancytreeClass.prototype.filterBranches = function ( filter, opts ) { @@ -11367,7 +11493,7 @@ var uniqueId = $.fn.extend( { * @requires jquery.fancytree.filter.js * @since 2.38 */ - $.ui.fancytree._FancytreeClass.prototype.updateFilter = function() { + $.ui.fancytree._FancytreeClass.prototype.updateFilter = function () { if ( this.enableFilter && this.lastFilterArgs && @@ -11385,7 +11511,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#clearFilter * @requires jquery.fancytree.filter.js */ - $.ui.fancytree._FancytreeClass.prototype.clearFilter = function() { + $.ui.fancytree._FancytreeClass.prototype.clearFilter = function () { var $title, statusNode = this.getRootNode()._findDirectChild(KeyNoData), escapeTitles = this.options.escapeTitles, @@ -11399,7 +11525,7 @@ var uniqueId = $.fn.extend( { delete this.rootNode.match; delete this.rootNode.subMatchCount; - this.visit(function(node) { + this.visit(function (node) { if (node.match && node.span) { // #491, #601 $title = $(node.span).find(">span.fancytree-title"); @@ -11449,7 +11575,7 @@ var uniqueId = $.fn.extend( { * @requires jquery.fancytree.filter.js * @since 2.13 */ - $.ui.fancytree._FancytreeClass.prototype.isFilterActive = function() { + $.ui.fancytree._FancytreeClass.prototype.isFilterActive = function () { return !!this.enableFilter; }; @@ -11461,7 +11587,7 @@ var uniqueId = $.fn.extend( { * @requires jquery.fancytree.filter.js * @since 2.13 */ - $.ui.fancytree._FancytreeNodeClass.prototype.isMatched = function() { + $.ui.fancytree._FancytreeNodeClass.prototype.isMatched = function () { return !(this.tree.enableFilter && !this.match); }; @@ -11470,7 +11596,7 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "filter", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { autoApply: true, // Re-apply last filter if lazy data is loaded @@ -11484,10 +11610,10 @@ var uniqueId = $.fn.extend( { nodata: true, // Display a 'no data' status node if result is empty mode: "dimm", // Grayout unmatched nodes (pass "hide" to remove unmatched node instead) }, - nodeLoadChildren: function(ctx, source) { + nodeLoadChildren: function (ctx, source) { var tree = ctx.tree; - return this._superApply(arguments).done(function() { + return this._superApply(arguments).done(function () { if ( tree.enableFilter && tree.lastFilterArgs && @@ -11497,7 +11623,7 @@ var uniqueId = $.fn.extend( { } }); }, - nodeSetExpanded: function(ctx, flag, callOpts) { + nodeSetExpanded: function (ctx, flag, callOpts) { var node = ctx.node; delete node._filterAutoExpanded; @@ -11511,7 +11637,7 @@ var uniqueId = $.fn.extend( { } return this._superApply(arguments); }, - nodeRenderStatus: function(ctx) { + nodeRenderStatus: function (ctx) { // Set classes for current status var res, node = ctx.node, @@ -11590,11 +11716,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -11606,7 +11732,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /****************************************************************************** @@ -11755,7 +11881,7 @@ var uniqueId = $.fn.extend( { setClass = baseClass + " " + (map._addClass || ""); // #871 Allow a callback - if ($.isFunction(icon)) { + if (typeof icon === "function") { icon = icon.call(this, node, span, type); } // node.debug( "setIcon(" + baseClass + ", " + type + "): " + "oldIcon" + " -> " + icon ); @@ -11793,14 +11919,14 @@ var uniqueId = $.fn.extend( { $.ui.fancytree.registerExtension({ name: "glyph", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material' map: {}, }, - treeInit: function(ctx) { + treeInit: function (ctx) { var tree = ctx.tree, opts = ctx.options.glyph; @@ -11816,7 +11942,7 @@ var uniqueId = $.fn.extend( { this._superApply(arguments); tree.$container.addClass("fancytree-ext-glyph"); }, - nodeRenderStatus: function(ctx) { + nodeRenderStatus: function (ctx) { var checkbox, icon, res, @@ -11848,9 +11974,7 @@ var uniqueId = $.fn.extend( { } if (node.tr) { - span = $("td", node.tr) - .find(".fancytree-checkbox") - .get(0); + span = $("td", node.tr).find(".fancytree-checkbox").get(0); } else { span = $span.children(".fancytree-checkbox").get(0); } @@ -11898,7 +12022,7 @@ var uniqueId = $.fn.extend( { } return res; }, - nodeSetStatus: function(ctx, status, message, details) { + nodeSetStatus: function (ctx, status, message, details) { var res, span, opts = ctx.options.glyph, @@ -11948,11 +12072,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define([ @@ -11968,7 +12092,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /******************************************************************************* @@ -11995,7 +12119,7 @@ var uniqueId = $.fn.extend( { td = $td.get(0), idx = 0; - $tr.children().each(function() { + $tr.children().each(function () { if (this === td) { return false; } @@ -12011,7 +12135,7 @@ var uniqueId = $.fn.extend( { res = null, idx = 0; - $tr.children().each(function() { + $tr.children().each(function () { if (idx >= colIdx) { res = $(this); return false; @@ -12066,14 +12190,14 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "gridnav", - version: "2.38.0", + version: "2.38.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 }, - treeInit: function(ctx) { + treeInit: function (ctx) { // gridnav requires the table extension to be loaded before itself this._requireExtension("table", true, true); this._superApply(arguments); @@ -12081,7 +12205,7 @@ var uniqueId = $.fn.extend( { this.$container.addClass("fancytree-ext-gridnav"); // Activate node if embedded input gets focus (due to a click) - this.$container.on("focusin", function(event) { + this.$container.on("focusin", function (event) { var ctx2, node = $.ui.fancytree.getNode(event.target); @@ -12092,7 +12216,7 @@ var uniqueId = $.fn.extend( { } }); }, - nodeSetActive: function(ctx, flag, callOpts) { + nodeSetActive: function (ctx, flag, callOpts) { var $outer, opts = ctx.options.gridnav, node = ctx.node, @@ -12106,9 +12230,7 @@ var uniqueId = $.fn.extend( { if (flag) { if (ctx.options.titlesTabbable) { if (!triggeredByInput) { - $(node.span) - .find("span.fancytree-title") - .focus(); + $(node.span).find("span.fancytree-title").focus(); node.setFocus(); } // If one node is tabbable, the container no longer needs to be @@ -12118,14 +12240,11 @@ var uniqueId = $.fn.extend( { // Set focus to input sub input (if node was clicked, but not // when TAB was pressed ) $outer = $(node.tr || node.span); - $outer - .find(":input:enabled") - .first() - .focus(); + $outer.find(":input:enabled").first().focus(); } } }, - nodeKeydown: function(ctx) { + nodeKeydown: function (ctx) { var inputType, handleKeys, $td, @@ -12173,11 +12292,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -12189,7 +12308,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /******************************************************************************* @@ -12203,7 +12322,7 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "multi", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { allowNoSelect: false, // @@ -12212,7 +12331,7 @@ var uniqueId = $.fn.extend( { // beforeSelect: $.noop // Return false to prevent cancel/save (data.input is available) }, - treeInit: function(ctx) { + treeInit: function (ctx) { this._superApply(arguments); this.$container.addClass("fancytree-ext-multi"); if (ctx.options.selectMode === 1) { @@ -12221,7 +12340,7 @@ var uniqueId = $.fn.extend( { ); } }, - nodeClick: function(ctx) { + nodeClick: function (ctx) { var //pluginOpts = ctx.options.multi, tree = ctx.tree, node = ctx.node, @@ -12245,7 +12364,7 @@ var uniqueId = $.fn.extend( { case "shift+click": // node.debug("click") tree.visitRows( - function(n) { + function (n) { // n.debug("click2", n===node, node) n.setSelected(); if (n === node) { @@ -12265,7 +12384,7 @@ var uniqueId = $.fn.extend( { } return this._superApply(arguments); }, - nodeKeydown: function(ctx) { + nodeKeydown: function (ctx) { var tree = ctx.tree, node = ctx.node, event = ctx.originalEvent, @@ -12305,11 +12424,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -12321,7 +12440,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /* global Cookies:false */ @@ -12341,13 +12460,13 @@ var uniqueId = $.fn.extend( { try { _assert(window.localStorage && window.localStorage.getItem); localStorageStore = { - get: function(key) { + get: function (key) { return window.localStorage.getItem(key); }, - set: function(key, value) { + set: function (key, value) { window.localStorage.setItem(key, value); }, - remove: function(key) { + remove: function (key) { window.localStorage.removeItem(key); }, }; @@ -12358,13 +12477,13 @@ var uniqueId = $.fn.extend( { try { _assert(window.sessionStorage && window.sessionStorage.getItem); sessionStorageStore = { - get: function(key) { + get: function (key) { return window.sessionStorage.getItem(key); }, - set: function(key, value) { + set: function (key, value) { window.sessionStorage.setItem(key, value); }, - remove: function(key) { + remove: function (key) { window.sessionStorage.removeItem(key); }, }; @@ -12376,7 +12495,7 @@ var uniqueId = $.fn.extend( { // Assume https://github.com/js-cookie/js-cookie cookieStore = { get: Cookies.get, - set: function(key, value) { + set: function (key, value) { Cookies.set(key, value, this.options.persist.cookie); }, remove: Cookies.remove, @@ -12385,7 +12504,7 @@ var uniqueId = $.fn.extend( { // Fall back to https://github.com/carhartl/jquery-cookie cookieStore = { get: $.cookie, - set: function(key, value) { + set: function (key, value) { $.cookie.set(key, value, this.options.persist.cookie); }, remove: $.removeCookie, @@ -12432,7 +12551,7 @@ var uniqueId = $.fn.extend( { } } - $.when.apply($, deferredList).always(function() { + $.when.apply($, deferredList).always(function () { // All lazy-expands have finished if (foundOne && missingKeyList.length > 0) { // If we read new nodes from server, try to resolve yet-missing keys @@ -12462,7 +12581,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#clearPersistData * @requires jquery.fancytree.persist.js */ - $.ui.fancytree._FancytreeClass.prototype.clearPersistData = function( + $.ui.fancytree._FancytreeClass.prototype.clearPersistData = function ( types ) { var local = this.ext.persist, @@ -12483,7 +12602,7 @@ var uniqueId = $.fn.extend( { } }; - $.ui.fancytree._FancytreeClass.prototype.clearCookies = function(types) { + $.ui.fancytree._FancytreeClass.prototype.clearCookies = function (types) { this.warn( "'tree.clearCookies()' is deprecated since v2.27.0: use 'clearPersistData()' instead." ); @@ -12499,7 +12618,7 @@ var uniqueId = $.fn.extend( { * @alias Fancytree#getPersistData * @requires jquery.fancytree.persist.js */ - $.ui.fancytree._FancytreeClass.prototype.getPersistData = function() { + $.ui.fancytree._FancytreeClass.prototype.getPersistData = function () { var local = this.ext.persist, prefix = local.cookiePrefix, delim = local.cookieDelimiter, @@ -12517,7 +12636,7 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "persist", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { cookieDelimiter: "~", @@ -12538,7 +12657,7 @@ var uniqueId = $.fn.extend( { }, /* Generic read/write string data to cookie, sessionStorage or localStorage. */ - _data: function(key, value) { + _data: function (key, value) { var store = this._local.store; if (value === undefined) { @@ -12551,7 +12670,7 @@ var uniqueId = $.fn.extend( { }, /* Append `key` to a cookie. */ - _appendKey: function(type, key, flag) { + _appendKey: function (type, key, flag) { key = "" + key; // #90 var local = this._local, instOpts = this.options.persist, @@ -12571,7 +12690,7 @@ var uniqueId = $.fn.extend( { local._data(cookieName, keyList.join(delim)); }, - treeInit: function(ctx) { + treeInit: function (ctx) { var tree = ctx.tree, opts = ctx.options, local = this._local, @@ -12610,7 +12729,7 @@ var uniqueId = $.fn.extend( { _assert(local.store, "Need a valid store."); // Bind init-handler to apply cookie state - tree.$div.on("fancytreeinit", function(event) { + tree.$div.on("fancytreeinit", function (event) { if ( tree._triggerTreeEvent("beforeRestore", null, {}) === false ) { @@ -12645,7 +12764,7 @@ var uniqueId = $.fn.extend( { dfd = new $.Deferred().resolve(); } - dfd.done(function() { + dfd.done(function () { if (local.storeSelected) { cookie = local._data(local.cookiePrefix + SELECTED); if (cookie) { @@ -12675,7 +12794,7 @@ var uniqueId = $.fn.extend( { // In selectMode 3 we have to fix the child nodes, since we // only stored the selected *top* nodes if (tree.options.selectMode === 3) { - tree.visit(function(n) { + tree.visit(function (n) { if (n.selected) { n.fixSelection3AfterClick(); return "skip"; @@ -12706,9 +12825,7 @@ var uniqueId = $.fn.extend( { if (node) { // node.debug("persist: set focus", cookie); if (tree.options.titlesTabbable) { - $(node.span) - .find(".fancytree-title") - .focus(); + $(node.span).find(".fancytree-title").focus(); } else { $(tree.$container).focus(); } @@ -12721,7 +12838,7 @@ var uniqueId = $.fn.extend( { // Init the tree return this._superApply(arguments); }, - nodeSetActive: function(ctx, flag, callOpts) { + nodeSetActive: function (ctx, flag, callOpts) { var res, local = this._local; @@ -12736,7 +12853,7 @@ var uniqueId = $.fn.extend( { } return res; }, - nodeSetExpanded: function(ctx, flag, callOpts) { + nodeSetExpanded: function (ctx, flag, callOpts) { var res, node = ctx.node, local = this._local; @@ -12749,7 +12866,7 @@ var uniqueId = $.fn.extend( { } return res; }, - nodeSetFocus: function(ctx, flag) { + nodeSetFocus: function (ctx, flag) { var res, local = this._local; @@ -12764,7 +12881,7 @@ var uniqueId = $.fn.extend( { } return res; }, - nodeSetSelected: function(ctx, flag, callOpts) { + nodeSetSelected: function (ctx, flag, callOpts) { var res, selNodes, tree = ctx.tree, @@ -12779,7 +12896,7 @@ var uniqueId = $.fn.extend( { // In selectMode 3 we only store the the selected *top* nodes. // De-selecting a node may also de-select some parents, so we // calculate the current status again - selNodes = $.map(tree.getSelectedNodes(true), function(n) { + selNodes = $.map(tree.getSelectedNodes(true), function (n) { return n.key; }); selNodes = selNodes.join( @@ -12810,11 +12927,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -12826,7 +12943,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /****************************************************************************** @@ -12847,7 +12964,7 @@ var uniqueId = $.fn.extend( { /* Show/hide all rows that are structural descendants of `parent`. */ function setChildRowVisibility(parent, flag) { - parent.visit(function(node) { + parent.visit(function (node) { var tr = node.tr; // currentFlag = node.hide ? false : flag; // fix for ext-filter if (tr) { @@ -12889,7 +13006,7 @@ var uniqueId = $.fn.extend( { $.ui.fancytree.registerExtension({ name: "table", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { checkboxColumnIdx: null, // render the checkboxes into the this column index (default: nodeColumnIdx) @@ -12900,7 +13017,7 @@ var uniqueId = $.fn.extend( { // Overide virtual methods for this extension. // `this` : is this extension object // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) - treeInit: function(ctx) { + treeInit: function (ctx) { var i, n, $row, @@ -13021,17 +13138,17 @@ var uniqueId = $.fn.extend( { .attr("aria-readonly", true); } }, - nodeRemoveChildMarkup: function(ctx) { + nodeRemoveChildMarkup: function (ctx) { var node = ctx.node; // node.debug("nodeRemoveChildMarkup()"); - node.visit(function(n) { + node.visit(function (n) { if (n.tr) { $(n.tr).remove(); n.tr = null; } }); }, - nodeRemoveMarkup: function(ctx) { + nodeRemoveMarkup: function (ctx) { var node = ctx.node; // node.debug("nodeRemoveMarkup()"); if (node.tr) { @@ -13041,7 +13158,7 @@ var uniqueId = $.fn.extend( { this.nodeRemoveChildMarkup(ctx); }, /* Override standard render. */ - nodeRender: function(ctx, force, deep, collapsed, _recursive) { + nodeRender: function (ctx, force, deep, collapsed, _recursive) { var children, firstTr, i, @@ -13149,7 +13266,7 @@ var uniqueId = $.fn.extend( { prevTr = node.tr || null; firstTr = tree.tbody.firstChild; // Iterate over all descendants - node.visit(function(n) { + node.visit(function (n) { if (n.tr) { if ( !n.parent.expanded && @@ -13173,7 +13290,7 @@ var uniqueId = $.fn.extend( { // this.nodeRenderStatus(ctx); // } }, - nodeRenderTitle: function(ctx, title) { + nodeRenderTitle: function (ctx, title) { var $cb, res, tree = ctx.tree, @@ -13224,7 +13341,7 @@ var uniqueId = $.fn.extend( { } return res; }, - nodeRenderStatus: function(ctx) { + nodeRenderStatus: function (ctx) { var indent, node = ctx.node, opts = ctx.options; @@ -13241,7 +13358,7 @@ var uniqueId = $.fn.extend( { } }, /* Expand node, return Deferred.promise. */ - nodeSetExpanded: function(ctx, flag, callOpts) { + nodeSetExpanded: function (ctx, flag, callOpts) { // flag defaults to true flag = flag !== false; @@ -13271,7 +13388,7 @@ var uniqueId = $.fn.extend( { ctx.node .getLastChild() .scrollIntoView(true, { topNode: ctx.node }) - .always(function() { + .always(function () { if (!callOpts.noEvents) { ctx.tree._triggerNodeEvent( flag ? "expand" : "collapse", @@ -13301,15 +13418,15 @@ var uniqueId = $.fn.extend( { } // Call base-expand with disabled events and animation this._super(ctx, flag, subOpts) - .done(function() { + .done(function () { _afterExpand(true); }) - .fail(function() { + .fail(function () { _afterExpand(false); }); return dfd.promise(); }, - nodeSetStatus: function(ctx, status, message, details) { + nodeSetStatus: function (ctx, status, message, details) { if (status === "ok") { var node = ctx.node, firstChild = node.children ? node.children[0] : null; @@ -13319,11 +13436,11 @@ var uniqueId = $.fn.extend( { } return this._superApply(arguments); }, - treeClear: function(ctx) { + treeClear: function (ctx) { this.nodeRemoveChildMarkup(this._makeHookContext(this.rootNode)); return this._superApply(arguments); }, - treeDestroy: function(ctx) { + treeDestroy: function (ctx) { this.$container.find("tbody").empty(); if (this.$source) { this.$source.removeClass("fancytree-helper-hidden"); @@ -13355,11 +13472,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -13371,7 +13488,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; /******************************************************************************* @@ -13379,7 +13496,7 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "themeroller", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { activeClass: "ui-state-active", // Class added to active node @@ -13391,7 +13508,7 @@ var uniqueId = $.fn.extend( { // selectedClass: "ui-state-active" }, - treeInit: function(ctx) { + treeInit: function (ctx) { var $el = ctx.widget.element, opts = ctx.options.themeroller; @@ -13405,23 +13522,27 @@ var uniqueId = $.fn.extend( { $el.addClass("ui-widget ui-widget-content ui-corner-all"); } - $el.on("mouseenter mouseleave", ".fancytree-node", function(event) { - var node = $.ui.fancytree.getNode(event.target), - flag = event.type === "mouseenter"; + $el.on( + "mouseenter mouseleave", + ".fancytree-node", + function (event) { + var node = $.ui.fancytree.getNode(event.target), + flag = event.type === "mouseenter"; - $(node.tr ? node.tr : node.span).toggleClass( - opts.hoverClass + " " + opts.addClass, - flag - ); - }); + $(node.tr ? node.tr : node.span).toggleClass( + opts.hoverClass + " " + opts.addClass, + flag + ); + } + ); }, - treeDestroy: function(ctx) { + treeDestroy: function (ctx) { this._superApply(arguments); ctx.widget.element.removeClass( "ui-widget ui-widget-content ui-corner-all" ); }, - nodeRenderStatus: function(ctx) { + nodeRenderStatus: function (ctx) { var classes = {}, node = ctx.node, $el = $(node.tr ? node.tr : node.span), @@ -13475,11 +13596,11 @@ var uniqueId = $.fn.extend( { * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.38.0 - * @date 2021-02-09T20:03:49Z + * @version 2.38.1 + * @date 2022-01-14T18:41:36Z */ -(function(factory) { +(function (factory) { if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery", "./jquery.fancytree"], factory); @@ -13491,7 +13612,7 @@ var uniqueId = $.fn.extend( { // Browser globals factory(jQuery); } -})(function($) { +})(function ($) { "use strict"; var reNumUnit = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; // split "1.5em" to ["1.5", "em"] @@ -13561,11 +13682,11 @@ var uniqueId = $.fn.extend( { // This breaks the left:0 and padding-left:nn settings of the title rules.push( "#" + - containerId + - " div.ui-effects-wrapper ul li span.fancytree-title, " + - "#" + - containerId + - " li.fancytree-animating span.fancytree-title " + // #716 + containerId + + " div.ui-effects-wrapper ul li span.fancytree-title, " + + "#" + + containerId + + " li.fancytree-animating span.fancytree-title " + // #716 "{ padding-left: " + labelOfs + measureUnit + @@ -13606,7 +13727,7 @@ var uniqueId = $.fn.extend( { */ $.ui.fancytree.registerExtension({ name: "wide", - version: "2.38.0", + version: "2.38.1", // Default options for this extension. options: { iconWidth: null, // Adjust this if @fancy-icon-width != "16px" @@ -13615,7 +13736,7 @@ var uniqueId = $.fn.extend( { levelOfs: null, // Adjust this if ul padding != "16px" }, - treeCreate: function(ctx) { + treeCreate: function (ctx) { this._superApply(arguments); this.$container.addClass("fancytree-ext-wide"); @@ -13681,12 +13802,12 @@ var uniqueId = $.fn.extend( { ); defineHeadStyleElement(containerId, cssText); }, - treeDestroy: function(ctx) { + treeDestroy: function (ctx) { // Remove generated css rules defineHeadStyleElement(this.$container.attr("id"), null); return this._superApply(arguments); }, - nodeRenderStatus: function(ctx) { + nodeRenderStatus: function (ctx) { var containerId, cssText, res, diff --git a/dist/jquery.fancytree-all-deps.min.js b/dist/jquery.fancytree-all-deps.min.js index 60172ba6..c5d686ab 100644 --- a/dist/jquery.fancytree-all-deps.min.js +++ b/dist/jquery.fancytree-all-deps.min.js @@ -1,2 +1,2 @@ -!function(_){_.ui=_.ui||{},_.ui.version="1.12.1";var r,i,k,w,o,s,a,l,d,n,e,c=0,u=Array.prototype.slice;function N(e,t,n){return[parseFloat(e[0])*(d.test(e[0])?t/100:1),parseFloat(e[1])*(d.test(e[1])?n/100:1)]}function S(e,t){return parseInt(_.css(e,t),10)||0}_.cleanData=(r=_.cleanData,function(e){for(var t,n,i=0;null!=(n=e[i]);i++)try{(t=_._data(n,"events"))&&t.remove&&_(n).triggerHandler("remove")}catch(e){}r(e)}),_.widget=function(e,n,t){var i,r,o,s={},a=e.split(".")[0],l=a+"-"+(e=e.split(".")[1]);return t||(t=n,n=_.Widget),_.isArray(t)&&(t=_.extend.apply(null,[{}].concat(t))),_.expr[":"][l.toLowerCase()]=function(e){return!!_.data(e,l)},_[a]=_[a]||{},i=_[a][e],r=_[a][e]=function(e,t){if(!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},_.extend(r,i,{version:t.version,_proto:_.extend({},t),_childConstructors:[]}),(o=new n).options=_.widget.extend({},o.options),_.each(t,function(t,i){function r(){return n.prototype[t].apply(this,arguments)}function o(e){return n.prototype[t].apply(this,e)}_.isFunction(i)?s[t]=function(){var e,t=this._super,n=this._superApply;return this._super=r,this._superApply=o,e=i.apply(this,arguments),this._super=t,this._superApply=n,e}:s[t]=i}),r.prototype=_.widget.extend(o,{widgetEventPrefix:i&&o.widgetEventPrefix||e},s,{constructor:r,namespace:a,widgetName:e,widgetFullName:l}),i?(_.each(i._childConstructors,function(e,t){var n=t.prototype;_.widget(n.namespace+"."+n.widgetName,r,t._proto)}),delete i._childConstructors):n._childConstructors.push(r),_.widget.bridge(e,r),r},_.widget.extend=function(e){for(var t,n,i=u.call(arguments,1),r=0,o=i.length;r",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,t){t=_(t||this.defaultElement||this)[0],this.element=_(t),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=_(),this.hoverable=_(),this.focusable=_(),this.classesElementLookup={},t!==this&&(_.data(t,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===t&&this.destroy()}}),this.document=_(t.style?t.ownerDocument:t.document||t),this.window=_(this.document[0].defaultView||this.document[0].parentWindow)),this.options=_.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:_.noop,_create:_.noop,_init:_.noop,destroy:function(){var n=this;this._destroy(),_.each(this.classesElementLookup,function(e,t){n._removeClass(t,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:_.noop,widget:function(){return this.element},option:function(e,t){var n,i,r,o=e;if(0===arguments.length)return _.widget.extend({},this.options);if("string"==typeof e)if(o={},e=(n=e.split(".")).shift(),n.length){for(i=o[e]=_.widget.extend({},this.options[e]),r=0;r
"),n=t.children()[0];return _("body").append(t),e=n.offsetWidth,t.css("overflow","scroll"),e===(n=n.offsetWidth)&&(n=t[0].clientWidth),t.remove(),i=e-n},getScrollInfo:function(e){var t=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),n=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),t="scroll"===t||"auto"===t&&e.widthk(w(i),w(r))?o.important="horizontal":o.important="vertical",u.using.call(this,e,o)}),s.offset(_.extend(d,{using:e}))})},_.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,r=n.width,o=e.left-t.collisionPosition.marginLeft,s=i-o,a=o+t.collisionWidth-r-i;t.collisionWidth>r?0r?0"'/]/g,n=/[<>"'/]/g,f="$recursive_request",p="$request_target_invalid",i={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},r={16:!0,17:!0,18:!0},u={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:"'"},g={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},o={0:"",1:"left",2:"middle",3:"right"},y="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),v={},m="columns types".split(" "),b="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),s={},x={},a={active:!0,children:!0,data:!0,focus:!0},l=0;le.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(e){if(!e||e.tree!==this.tree)return!1;for(var t=this.parent;t;){if(t===e)return!0;t===t.parent&&C.error("Recursive parent link: "+t),t=t.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.tree.enableFilter,i=this.getParentList(!1,!1);if(n&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=i.length;eDate.now()?t.value:(delete this._tempCache[e],null)},_usesExtension:function(e){return 0<=C.inArray(e,this.options.extensions)},_requireExtension:function(e,t,n,i){null!=n&&(n=!!n);var r=this._local.name,o=this.options.extensions,s=C.inArray(e,o)",{type:"checkbox",name:i,value:e.key,checked:!0}))}s.length?s.empty():s=C("
",{id:o}).hide().insertAfter(this.$container),!1!==t&&this.activeNode&&s.append(C("",{type:"radio",name:r,value:this.activeNode.key,checked:!0})),n.filter?this.visit(function(e){var t=n.filter(e);if("skip"===t)return t;!1!==t&&l(e)}):!1!==e&&(a=this.getSelectedNodes(a),C.each(a,function(e,t){l(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(t,e){var n,i;return!e&&(n=document.getElementById(this.options.idPrefix+t))?n.ftnode||null:(e=e||this.rootNode,i=null,t=""+t,e.visit(function(e){if(e.key===t)return i=e,!1},!0),i)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){3<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),d("info",arguments))},isLoading:function(){var t=!1;return this.rootNode.visit(function(e){if(e._isLoading||e._requestId)return!(t=!0)},!0),t},loadKeyPath:function(e,t){var i,n,r,o=this,s=new C.Deferred,a=this.getRootNode(),l=this.options.keyPathSeparator,d=[],c=C.extend({},t);for("function"==typeof t?i=t:t&&t.callback&&(i=t.callback),c.callback=function(e,t,n){i&&i.call(e,t,n),s.notifyWith(e,[{node:t,status:n}])},null==c.matchKey&&(c.matchKey=function(e,t){return e.key===t}),C.isArray(e)||(e=[e]),n=0;nu)a.rejectWith(this,[f]);else if(null!==d.parent||null===c){if(o.options.postProcess){try{(r=l._triggerNodeEvent("postProcess",o,o.originalEvent,{response:e,error:null,dataType:s.dataType})).error&&l.warn("postProcess returned error:",r)}catch(e){r={error:e,message:""+e,details:"postProcess failed"}}if(r.error)return i=C.isPlainObject(r.error)?r.error:{message:r.error},i=l._makeHookContext(d,null,i),void a.rejectWith(this,[i]);(C.isArray(r)||C.isPlainObject(r)&&C.isArray(r.children))&&(e=r)}else e&&e.hasOwnProperty("d")&&o.options.enableAspx&&(42===o.options.enableAspx&&l.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),e="string"==typeof e.d?C.parseJSON(e.d):e.d);a.resolveWith(this,[e])}else a.rejectWith(this,[p])},function(e,t,n){n=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});a.rejectWith(this,[n])}),a.done(function(e){var t,n,i;l.nodeSetStatus(o,"ok"),C.isPlainObject(e)?(_(d.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),_(C.isArray(e.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),t=(n=e).children,delete n.children,C.each(m,function(e,t){void 0!==n[t]&&(l[t]=n[t],delete n[t])}),C.extend(l.data,n)):t=e,_(C.isArray(t),"expected array of children"),d._setChildren(t),l.options.nodata&&0===t.length&&(C.isFunction(l.options.nodata)?i=l.options.nodata.call(l,{type:"nodata"},o):!0===l.options.nodata&&d.isRootNode()?i=l.options.strings.noData:"string"==typeof l.options.nodata&&d.isRootNode()&&(i=l.options.nodata),i&&d.setStatus("nodata",i)),l._triggerNodeEvent("loadChildren",d)}).fail(function(e){var t;e!==f?e!==p?(e.node&&e.error&&e.message?t=e:"[object Object]"===(t=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(t.message=""),d.warn("Load children failed ("+t.message+")",t),!1!==l._triggerNodeEvent("loadError",t,null)&&l.nodeSetStatus(o,"error",t.message,t.details)):d.warn("Lazy parent node was removed while loading: discarding response."):d.warn("Ignored response for obsolete load request #"+u+" (expected #"+d._requestId+")")}).always(function(){d._requestId=null,i&&l.debugTimeEnd(r)}),a.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(e,t){var n=e.node,i=C.extend({},e,{node:t}),r=n.children;if(1===r.length)return _(t===r[0],"invalid single child"),this.nodeRemoveChildren(e);this.activeNode&&(t===this.activeNode||this.activeNode.isDescendantOf(t))&&this.activeNode.setActive(!1),this.focusNode&&(t===this.focusNode||this.focusNode.isDescendantOf(t))&&(this.focusNode=null),this.nodeRemoveMarkup(i),this.nodeRemoveChildren(i),_(0<=(i=C.inArray(t,r)),"invalid child"),n.triggerModifyChild("remove",t),t.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,t),r.splice(i,1)},nodeRemoveChildMarkup:function(e){e=e.node;e.ul&&(e.isRootNode()?C(e.ul).empty():(C(e.ul).remove(),e.ul=null),e.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(e){var t=e.tree,n=e.node;n.children&&(this.activeNode&&this.activeNode.isDescendantOf(n)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(n)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),n.triggerModifyChild("remove",null),n.visit(function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)}),n.lazy?n.children=[]:n.children=null,n.isRootNode()||(n.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(e){var t=e.node;t.li&&(C(t.li).remove(),t.li=null),this.nodeRemoveChildMarkup(e)},nodeRender:function(e,t,n,i,r){var o,s,a,l,d,c,u,h=e.node,f=e.tree,p=e.options,g=p.aria,y=!1,v=h.parent,m=!v,b=h.children,x=null;if(!1!==f._enableUpdate&&(m||v.ul)){if(_(m||v.ul,"parent UL must exist"),m||(h.li&&(t||h.li.parentNode!==h.parent.ul)&&(h.li.parentNode===h.parent.ul?x=h.li.nextSibling:this.debug("Unlinking "+h+" (must be child of "+h.parent+")"),this.nodeRemoveMarkup(e)),h.li?this.nodeRenderStatus(e):(y=!0,h.li=document.createElement("li"),(h.li.ftnode=h).key&&p.generateIds&&(h.li.id=p.idPrefix+h.key),h.span=document.createElement("span"),h.span.className="fancytree-node",g&&!h.tr&&C(h.li).attr("role","treeitem"),h.li.appendChild(h.span),this.nodeRenderTitle(e),p.createNode&&p.createNode.call(f,{type:"createNode"},e)),p.renderNode&&p.renderNode.call(f,{type:"renderNode"},e)),b){if(m||h.expanded||!0===n){for(h.ul||(h.ul=document.createElement("ul"),(!0!==i||r)&&h.expanded||(h.ul.style.display="none"),g&&C(h.ul).attr("role","group"),h.li?h.li.appendChild(h.ul):h.tree.$div.append(h.ul)),l=0,d=b.length;l")):d.push(""),(l=h.evalOption("checkbox",r,r,s,!1))&&!r.isStatusNode()&&(t=a?" role='checkbox'":"",n="fancytree-checkbox",("radio"===l||r.parent&&r.parent.radiogroup)&&(n+=" fancytree-radio"),d.push("")),void 0!==r.data.iconClass&&(r.icon?C.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(r.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),r.icon=r.data.iconClass)),!1!==(n=h.evalOption("icon",r,r,s,!0))&&(t=a?" role='presentation'":"",i=(i=h.evalOption("iconTooltip",r,r,s,null))?" title='"+T(i)+"'":"","string"==typeof n?c.test(n)?(n="/"===n.charAt(0)?n:(s.imagePath||"")+n,d.push("")):d.push(""):n.text?d.push(""+h.escapeHtml(n.text)+""):n.html?d.push(""+n.html+""):d.push("")),t="",t=(t=s.renderTitle?s.renderTitle.call(o,{type:"renderTitle"},e)||"":t)||""+(s.escapeTitles?h.escapeHtml(r.title):r.title)+"",d.push(t),r.span.innerHTML=d.join(""),this.nodeRenderStatus(e),s.enhanceTitle&&(e.$title=C(">span.fancytree-title",r.span),t=s.enhanceTitle.call(o,{type:"enhanceTitle"},e)||""))},nodeRenderStatus:function(e){var t,n=e.node,i=e.tree,r=e.options,o=n.hasChildren(),s=n.isLastSibling(),a=r.aria,l=r._classNames,d=[],e=n[i.statusClassPropName];e&&!1!==i._enableUpdate&&(a&&(t=C(n.tr||n.li)),d.push(l.node),i.activeNode===n&&d.push(l.active),i.focusNode===n&&d.push(l.focused),n.expanded&&d.push(l.expanded),a&&(!1===o?t.removeAttr("aria-expanded"):t.attr("aria-expanded",Boolean(n.expanded))),n.folder&&d.push(l.folder),!1!==o&&d.push(l.hasChildren),s&&d.push(l.lastsib),n.lazy&&null==n.children&&d.push(l.lazy),n.partload&&d.push(l.partload),n.partsel&&d.push(l.partsel),h.evalOption("unselectable",n,n,r,!1)&&d.push(l.unselectable),n._isLoading&&d.push(l.loading),n._error&&d.push(l.error),n.statusNodeType&&d.push(l.statusNodePrefix+n.statusNodeType),n.selected?(d.push(l.selected),a&&t.attr("aria-selected",!0)):a&&t.attr("aria-selected",!1),n.extraClasses&&d.push(n.extraClasses),!1===o?d.push(l.combinedExpanderPrefix+"n"+(s?"l":"")):d.push(l.combinedExpanderPrefix+(n.expanded?"e":"c")+(n.lazy&&null==n.children?"d":"")+(s?"l":"")),d.push(l.combinedIconPrefix+(n.expanded?"e":"c")+(n.folder?"f":"")),e.className=d.join(" "),n.li&&C(n.li).toggleClass(l.lastsib,s))},nodeSetActive:function(e,t,n){n=n||{};var i=e.node,r=e.tree,o=e.options,s=!0===n.noEvents,a=!0===n.noFocus,n=!1!==n.scrollIntoView;return i===r.activeNode===(t=!1!==t)?w(i):(n&&e.originalEvent&&C(e.originalEvent.target).is("a,:checkbox")&&(i.info("Not scrolling while clicking an embedded link."),n=!1),t&&!s&&!1===this._triggerNodeEvent("beforeActivate",i,e.originalEvent)?N(i,["rejected"]):(t?(r.activeNode&&(_(r.activeNode!==i,"node was active (inconsistency)"),t=C.extend({},e,{node:r.activeNode}),r.nodeSetActive(t,!1),_(null===r.activeNode,"deactivate was out of sync?")),o.activeVisible&&i.makeVisible({scrollIntoView:n}),r.activeNode=i,r.nodeRenderStatus(e),a||r.nodeSetFocus(e),s||r._triggerNodeEvent("activate",i,e.originalEvent)):(_(r.activeNode===i,"node was not active (inconsistency)"),r.activeNode=null,this.nodeRenderStatus(e),s||e.tree._triggerNodeEvent("deactivate",i,e.originalEvent)),w(i)))},nodeSetExpanded:function(i,r,e){e=e||{};var t,n,o,s,a,l,d=i.node,c=i.tree,u=i.options,h=!0===e.noAnimation,f=!0===e.noEvents;if(r=!1!==r,C(d.li).hasClass(u._classNames.animating))return d.warn("setExpanded("+r+") while animating: ignored."),N(d,["recursion"]);if(d.expanded&&r||!d.expanded&&!r)return w(d);if(r&&!d.lazy&&!d.hasChildren())return w(d);if(!r&&d.getLevel()ul.fancytree-container").empty(),t.rootNode.children=null,t._callHook("treeStructureChanged",e,"clear")},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(e){var n=e.tree,i=n.options;n.$container.attr("tabindex",i.tabindex),C.each(m,function(e,t){void 0!==i[t]&&(n.info("Move option "+t+" to tree"),n[t]=i[t],delete i[t])}),i.checkboxAutoHide&&n.$container.addClass("fancytree-checkbox-auto-hide"),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(e)},treeLoad:function(e,t){var n,i,r,o=e.tree,s=e.widget.element,a=C.extend({},e,{node:this.rootNode});if(o.rootNode.children&&this.treeClear(e),t=t||this.options.source)"string"==typeof t&&C.error("Not implemented");else switch(i=s.data("type")||"html"){case"html":(r=s.find(">ul").not(".fancytree-container").first()).length?(r.addClass("ui-fancytree-source fancytree-helper-hidden"),t=C.ui.fancytree.parseHtml(r),this.data=C.extend(this.data,E(r))):(h.warn("No `source` option was passed and container does not contain `
    `: assuming `source: []`."),t=[]);break;case"json":t=C.parseJSON(s.text()),s.contents().filter(function(){return 3===this.nodeType}).remove(),C.isPlainObject(t)&&(_(C.isArray(t.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),t=(n=t).children,delete n.children,C.each(m,function(e,t){void 0!==n[t]&&(o[t]=n[t],delete n[t])}),C.extend(o.data,n));break;default:C.error("Invalid data-type: "+i)}return o._triggerTreeEvent("preInit",null),this.nodeLoadChildren(a,t).done(function(){o._callHook("treeStructureChanged",e,"loadChildren"),o.render(),3===e.options.selectMode&&o.rootNode.fixSelection3FromEndNodes(),o.activeNode&&o.options.activeVisible&&o.activeNode.makeVisible(),o._triggerTreeEvent("init",null,{status:!0})}).fail(function(){o.render(),o._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(e,t,n){var i;(t=!1!==t)!==this.hasFocus()&&(!(this._hasFocus=t)&&this.focusNode?this.focusNode.setFocus(!1):!t||n&&n.calledByNode||C(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",t),this._triggerTreeEvent(t?"focusTree":"blurTree"),t&&!this.activeNode&&(i=this._lastMousedownNode||this.getFirstChild())&&i.setFocus())},treeSetOption:function(e,t,n){var i=e.tree,r=!0,o=!1,s=!1;switch(t){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":s=o=!0;break;case"checkboxAutoHide":i.$container.toggleClass("fancytree-checkbox-auto-hide",!!n);break;case"escapeTitles":case"tooltip":s=!0;break;case"rtl":!1===n?i.$container.removeAttr("DIR").removeClass("fancytree-rtl"):i.$container.attr("DIR","RTL").addClass("fancytree-rtl"),s=!0;break;case"source":r=!1,i._callHook("treeLoad",i,n),s=!0}i.debug("set option "+t+"="+n+" <"+typeof n+">"),r&&(this.widget._super||C.Widget.prototype._setOption).call(this.widget,t,n),o&&i._callHook("treeCreate",i),s&&i.render(!0,!1)},treeStructureChanged:function(e,t){}}),C.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,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,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,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(e){var t=this.tree;t&&3<=t.options.debugLevel&&t.warn("$().fancytree('"+e+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new P(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();for(var e,t,n=this.options,i=n.extensions,r=(this.tree,0);r element.");else{if(n){if(o._getExpiringValue("focusin"))return void o.debug("Ignored double focusin.");o._setExpiringValue("focusin",!0,50),t||(t=o._getExpiringValue("mouseDownNode"))&&o.debug("Reconstruct mouse target for focusin from recent event.")}t?o._callHook("nodeSetFocus",o._makeHookContext(t,e),n):o.tbody&&C(e.target).parents("table.fancytree-container > thead").length?o.debug("Ignore focus event outside table body.",e):o._callHook("treeSetFocus",o,n)}}).on("selectstart"+e,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+e,function(e){if(a.disabled||!1===a.keyboard)return!0;var t,n=o.focusNode,i=o._makeHookContext(n||o,e),r=o.phase;try{return o.phase="userEvent","preventNav"===(t=n?o._triggerNodeEvent("keydown",n,e):o._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=o._callHook("nodeKeydown",i)),t}finally{o.phase=r}}).on("mousedown"+e,function(e){e=h.getEventTarget(e);o._lastMousedownNode=e?e.node:null,o._setExpiringValue("mouseDownNode",o._lastMousedownNode)}).on("click"+e+" dblclick"+e,function(e){if(a.disabled)return!0;var t,n=h.getEventTarget(e),i=n.node,r=s.tree,o=r.phase;if(!i)return!0;t=r._makeHookContext(i,e);try{switch(r.phase="userEvent",e.type){case"click":return t.targetType=n.type,i.isPagingNode()?!0===r._triggerNodeEvent("clickPaging",t,e):!1!==r._triggerNodeEvent("click",t,e)&&r._callHook("nodeClick",t);case"dblclick":return t.targetType=n.type,!1!==r._triggerNodeEvent("dblclick",t,e)&&r._callHook("nodeDblclick",t)}}finally{r.phase=o}})},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),h=C.ui.fancytree,C.extend(C.ui.fancytree,{version:"2.38.0",buildType: "production",debugLevel: 3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:P,_FancytreeNodeClass:O,jquerySupports:{positionMyOfs:function(e){for(var t,n,i=C.map(C.trim(e).split("."),function(e){return parseInt(e,10)}),r=C.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)}),o=0;oli"),g=[];return e.each(function(){var e,t,n=C(this),i=n.find(">span",this).first(),r=i.length?null:n.find(">a").first(),o={tooltip:null,data:{}};for(i.length?o.title=i.html():r&&r.length?(o.title=r.html(),o.data.href=r.attr("href"),o.data.target=r.attr("target"),o.tooltip=r.attr("title")):(o.title=n.html(),0<=(u=o.title.search(/
      ul").first()).length?o.children=C.ui.fancytree.parseHtml(s):o.children=o.lazy?void 0:null,g.push(o)}),g},registerExtension:function(e){_(null!=e.name,"extensions must have a `name` property."),_(null!=e.version,"extensions must have a `version` property."),C.ui.fancytree._extensions[e.name]=e},unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(e){2<=C.ui.fancytree.debugLevel&&d("warn",arguments)}}),C.ui.fancytree}function _(e,t){e||(t="Fancytree assertion failed"+(t=t?": "+t:""),C.ui.fancytree.error(t),C.error(t))}function d(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;nul.fancytree-container").remove();e={tree:this};this.rootNode=new O(e,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,e=C("
        ",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=e,this.rootNode.ul=e[0],null==this.options.debugLevel&&(this.options.debugLevel=h.debugLevel)}C.ui.fancytree.warn("Fancytree: ignored duplicate include")},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree.ui-deps"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree.ui-deps"),module.exports=t(require("jquery"))):t(jQuery),t=function(o){"use strict";return o.ui.fancytree._FancytreeClass.prototype.countSelected=function(e){this.options;return this.getSelectedNodes(e).length},o.ui.fancytree._FancytreeNodeClass.prototype.updateCounters=function(){var e=this,t=o("span.fancytree-childcounter",e.span),n=e.tree.options.childcounter,i=e.countChildren(n.deep);!(e.data.childCounter=i)&&n.hideZeros||e.isExpanded()&&n.hideExpanded?t.remove():(t=!t.length?o("").appendTo(o("span.fancytree-icon,span.fancytree-custom-icon",e.span)):t).text(i),!n.deep||e.isTopLevel()||e.isRootNode()||e.parent.updateCounters()},o.ui.fancytree.prototype.widgetMethod1=function(e){this.tree;return e},o.ui.fancytree.registerExtension({name:"childcounter",version:"2.38.0",options:{deep:!0,hideZeros:!0,hideExpanded:!1},foo:42,_appendCounter:function(e){},treeInit:function(e){e.options,e.options.childcounter;this._superApply(arguments),this.$container.addClass("fancytree-ext-childcounter")},treeDestroy:function(e){this._superApply(arguments)},nodeRenderTitle:function(e,t){var n=e.node,i=e.options.childcounter,r=null==n.data.childCounter?n.countChildren(i.deep):+n.data.childCounter;this._super(e,t),!r&&i.hideZeros||n.isExpanded()&&i.hideExpanded||o("span.fancytree-icon,span.fancytree-custom-icon",n.span).append(o("").text(r))},nodeSetExpanded:function(e,t,n){var i=e.tree;e.node;return this._superApply(arguments).always(function(){i.nodeRenderTitle(e)})}}),o.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(c){"use strict";var u=c.ui.fancytree.assert;function n(e,t,n){for(var i,r,o=3&e.length,s=e.length-o,a=n,l=3432918353,d=461845907,c=0;c>>16)*l&65535)<<16)&4294967295)<<15|r>>>17))*d+(((r>>>16)*d&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(r=0,o){case 3:r^=(255&e.charCodeAt(c+2))<<16;case 2:r^=(255&e.charCodeAt(c+1))<<8;case 1:a^=r=(65535&(r=(r=(65535&(r^=255&e.charCodeAt(c)))*l+(((r>>>16)*l&65535)<<16)&4294967295)<<15|r>>>17))*d+(((r>>>16)*d&65535)<<16)&4294967295}return a^=e.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,a^=a>>>16,t?("0000000"+(a>>>0).toString(16)).substr(-8):a>>>0}return c.ui.fancytree._FancytreeNodeClass.prototype.getCloneList=function(e){var t,n=this.tree,i=n.refMap[this.refKey]||null,r=n.keyMap;return i&&(t=this.key,e?i=c.map(i,function(e){return r[e]}):(i=c.map(i,function(e){return e===t?null:r[e]})).length<1&&(i=null)),i},c.ui.fancytree._FancytreeNodeClass.prototype.isClone=function(){var e=this.refKey||null,e=e&&this.tree.refMap[e]||null;return!!(e&&1 "+r.getPath(!0),o.error(r),c.error(r)),s[l]=n,d&&((i=a[d])?(i.push(l),2===i.length&&e.options.clones.highlightClones&&s[i[0]].renderStatus()):a[d]=[l])):(null==s[l]&&c.error("clones.treeRegisterNode: node.key not registered: "+n.key),delete s[l],d&&(i=a[d])&&((r=i.length)<=1?(u(1===r),u(i[0]===l),delete a[d]):(function(e,t){for(var n=e.length-1;0<=n;n--)if(e[n]===t)return e.splice(n,1)}(i,l),2===r&&e.options.clones.highlightClones&&s[i[0]].renderStatus())))),this._super(e,t,n)},nodeRenderStatus:function(e){var t,n=e.node,i=this._super(e);return e.options.clones.highlightClones&&(t=c(n[e.tree.statusClassPropName])).length&&n.isClone()&&t.addClass("fancytree-clone"),i},nodeSetActive:function(e,n,t){var i=e.tree.statusClassPropName,r=e.node,o=this._superApply(arguments);return e.options.clones.highlightActiveClones&&r.isClone()&&c.each(r.getCloneList(!0),function(e,t){c(t[i]).toggleClass("fancytree-active-clone",!1!==n)}),o}}),c.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(f){"use strict";var l,d,p=f.ui.fancytree,o=/Mac/.test(navigator.platform),c="fancytree-drag-source",u="fancytree-drag-remove",g="fancytree-drop-accept",y="fancytree-drop-after",v="fancytree-drop-before",m="fancytree-drop-over",b="fancytree-drop-reject",x="fancytree-drop-target",h="application/x-fancytree-node",C=null,_=null,k=null,w=null,N=null,s=null,a=null,S=null,E=null,T=null;function A(){k=_=s=S=a=T=N=null,w&&w.removeClass(c+" "+u),w=null,C&&C.hide(),d&&(d.remove(),d=null)}function O(e){return 0===e?"":0 "+i),s=i),t.isMove="move"===t.dropEffect,t.files=r.files||[]}function F(e,t,n){var i=t.tree,r=t.dataTransfer;return"dragstart"!==e.type&&S!==t.effectAllowed&&i.warn("effectAllowed should only be changed in dragstart event: "+e.type+": data.effectAllowed changed from "+S+" -> "+t.effectAllowed),!1===n&&(i.info("applyDropEffectCallback: allowDrop === false"),t.effectAllowed="none",t.dropEffect="none"),t.isMove="move"===t.dropEffect,"dragstart"===e.type&&(S=t.effectAllowed,a=t.dropEffect),r.effectAllowed=S,r.dropEffect=a}function D(e,t){if(t.options.dnd5.scroll&&(h=t.tree,s=e,r=h.options.dnd5,o=h.$scrollParent[0],l=r.scrollSensitivity,u=r.scrollSpeed,i=0,o!==document&&"HTML"!==o.tagName?(r=h.$scrollParent.offset(),d=o.scrollTop,r.top+o.offsetHeight-s.pageYo.autoExpandMS)||a.isLoading()||o.dragExpand&&!1===o.dragExpand(a,d)||a.setExpanded():T=Date.now():T=null;break;case"dragleave":if(!a){r.debug("Ignore non-node "+e.type+": "+e.target.tagName+"."+e.target.className);break}if(!f(a.span).hasClass(m)){a.debug("Ignore dragleave (multi).");break}f(a.span).removeClass(m+" "+g+" "+b),a.scheduleAction("cancel"),o.dragLeave(a,d),C.hide();break;case"drop":if(0<=f.inArray(h,l.types)&&(n=l.getData(h),r.info(e.type+": getData('application/x-fancytree-node'): '"+n+"'")),n||(n=l.getData("text"),r.info(e.type+": getData('text'): '"+n+"'")),n)try{void 0!==(t=JSON.parse(n)).title&&(d.otherNodeData=t)}catch(e){}r.debug(e.type+": nodeData: '"+n+"', otherNodeData: ",d.otherNodeData),f(a.span).removeClass(m+" "+g+" "+b),d.hitMode=E,P(e,d),d.isCancelled=!E;var c=_&&_.span,u=_&&_.tree;o.dragDrop(a,d),e.preventDefault(),c&&!document.body.contains(c)&&(u===r?(r.debug("Drop handler removed source element: generating dragEnd."),o.dragEnd(_,d)):r.warn("Drop handler removed source element: dragend event may be lost.")),A()}if(s)return e.preventDefault(),!1}return f.ui.fancytree.getDragNodeList=function(){return k||[]},f.ui.fancytree.getDragNode=function(){return _},f.ui.fancytree.registerExtension({name:"dnd5",version:"2.38.0",options:{autoExpandMS:1500,dropMarkerInsertOffsetX:-16,dropMarkerOffsetX:-24,dropMarkerParent:"body",multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,setTextTypeJson:!1,sourceCopyHook:null,dragStart:null,dragDrag:f.noop,dragEnd:f.noop,dragEnter:null,dragOver:f.noop,dragExpand:f.noop,dragDrop:f.noop,dragLeave:f.noop},treeInit:function(e){var t=e.tree,n=e.options,i=n.glyph||null,r=n.dnd5;0<=f.inArray("dnd",n.extensions)&&f.error("Extensions 'dnd' and 'dnd5' are mutually exclusive."),r.dragStop&&f.error("dragStop is not used by ext-dnd5. Use dragEnd instead."),null!=r.preventRecursiveMoves&&f.error("preventRecursiveMoves was renamed to preventRecursion."),r.dragStart&&p.overrideMethod(e.options,"createNode",function(e,t){this._super.apply(this,arguments),t.node.span?t.node.span.draggable=!0:t.node.warn("Cannot add `draggable`: no span tag")}),this._superApply(arguments),this.$container.addClass("fancytree-ext-dnd5"),e=f("").appendTo(this.$container),this.$scrollParent=e.scrollParent(),e.remove(),(C=f("#fancytree-drop-marker")).length||(C=f("
        ").hide().css({"z-index":1e3,"pointer-events":"none"}).prependTo(r.dropMarkerParent),i&&p.setSpanIcon(C[0],i.map._addClass,i.map.dropMarker)),C.toggleClass("fancytree-rtl",!!n.rtl),r.dragStart&&t.$container.on("dragstart drag dragend",function(e){var t,n=this,i=n.options.dnd5,r=p.getNode(e),o=e.dataTransfer||e.originalEvent.dataTransfer,s={tree:n,node:r,options:n.options,originalEvent:e.originalEvent,widget:n.widget,dataTransfer:o,useDefaultImage:!0,dropEffect:void 0,dropEffectSuggested:void 0,effectAllowed:void 0,files:void 0,isCancelled:void 0,isMove:void 0};switch(e.type){case"dragstart":if(!r)return n.info("Ignored dragstart on a non-node."),!1;_=r,k=!1===i.multiSource?[r]:!0===i.multiSource?r.isSelected()?n.getSelectedNodes():[r]:i.multiSource(r,s),(w=f(f.map(k,function(e){return e.span}))).addClass(c);var a=r.toDict(!0,i.sourceCopyHook);a.treeId=r.tree._id,t=JSON.stringify(a);try{o.setData(h,t),o.setData("text/html",f(r.span).html()),o.setData("text/plain",r.title)}catch(e){n.warn("Could not set data (IE only accepts 'text') - "+e)}return(i.setTextTypeJson?o.setData("text",t):o.setData("text",r.title),P(e,s),!1===i.dragStart(r,s))?(A(),!1):(F(e,s),d=null,s.useDefaultImage&&(l=f(r.span).find(".fancytree-title"),k&&1").text("+"+(k.length-1)).appendTo(l)),o.setDragImage&&o.setDragImage(l[0],-10,-10)),!0);case"drag":P(e,s),i.dragDrag(r,s),F(e,s),w.toggleClass(u,s.isMove);break;case"dragend":P(e,s),A(),s.isCancelled=!E,i.dragEnd(r,s,!E)}}.bind(t)),r.dragEnter&&t.$container.on("dragenter dragover dragleave drop",L.bind(t))}}),f.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(d){"use strict";var t=/Mac/.test(navigator.platform),c=d.ui.fancytree.escapeHtml,a=d.ui.fancytree.unescapeHtml;return d.ui.fancytree._FancytreeNodeClass.prototype.editStart=function(){var t,n=this,e=this.tree,i=e.ext.edit,r=e.options.edit,o=d(".fancytree-title",n.span),s={node:n,tree:e,options:e.options,isNew:d(n[e.statusClassPropName]).hasClass("fancytree-edit-new"),orgTitle:n.title,input:null,dirty:!1};if(!1===r.beforeEdit.call(n,{type:"beforeEdit"},s))return!1;d.ui.fancytree.assert(!i.currentNode,"recursive edit"),i.currentNode=this,i.eventData=s,e.widget._unbind(),i.lastDraggableAttrValue=n.span.draggable,i.lastDraggableAttrValue&&(n.span.draggable=!1),d(document).on("mousedown.fancytree-edit",function(e){d(e.target).hasClass("fancytree-edit-input")||n.editEnd(!0,e)}),t=d("",{class:"fancytree-edit-input",type:"text",value:e.options.escapeTitles?s.orgTitle:a(s.orgTitle)}),i.eventData.input=t,null!=r.adjustWidthOfs&&t.width(o.width()+r.adjustWidthOfs),null!=r.inputCss&&t.css(r.inputCss),o.html(t),t.focus().change(function(e){t.addClass("fancytree-edit-dirty")}).on("keydown",function(e){switch(e.which){case d.ui.keyCode.ESCAPE:n.editEnd(!1,e);break;case d.ui.keyCode.ENTER:return n.editEnd(!0,e),!1}e.stopPropagation()}).blur(function(e){return n.editEnd(!0,e)}),r.edit.call(n,{type:"edit"},s)},d.ui.fancytree._FancytreeNodeClass.prototype.editEnd=function(e,t){var n,i=this,r=this.tree,o=r.ext.edit,s=o.eventData,a=r.options.edit,l=d(".fancytree-title",i.span).find("input.fancytree-edit-input");return a.trim&&l.val(d.trim(l.val())),n=l.val(),s.dirty=n!==i.title,s.originalEvent=t,!1===e?s.save=!1:s.isNew?s.save=""!==n:s.save=s.dirty&&""!==n,!1!==a.beforeClose.call(i,{type:"beforeClose"},s)&&((!s.save||!1!==a.save.call(i,{type:"save"},s))&&(l.removeClass("fancytree-edit-dirty").off(),d(document).off(".fancytree-edit"),s.save?(i.setTitle(r.options.escapeTitles?n:c(n)),i.setFocus()):s.isNew?(i.remove(),i=s.node=null,o.relatedNode.setFocus()):(i.renderTitle(),i.setFocus()),o.eventData=null,o.currentNode=null,o.relatedNode=null,r.widget._bind(),i&&o.lastDraggableAttrValue&&(i.span.draggable=!0),r.$container.get(0).focus({preventScroll:!0}),s.input=null,a.close.call(i,{type:"close"},s),!0))},d.ui.fancytree._FancytreeNodeClass.prototype.editCreateNode=function(e,t){var n,i=this.tree,r=this;e=e||"child",null==t?t={title:""}:"string"==typeof t?t={title:t}:d.ui.fancytree.assert(d.isPlainObject(t)),"child"!==e||this.isExpanded()||!1===this.hasChildren()?((n=this.addNode(t,e)).match=!0,d(n[i.statusClassPropName]).removeClass("fancytree-hide").addClass("fancytree-match"),n.makeVisible().done(function(){d(n[i.statusClassPropName]).addClass("fancytree-edit-new"),r.tree.ext.edit.relatedNode=r,n.editStart()})):this.setExpanded().done(function(){r.editCreateNode(e,t)})},d.ui.fancytree._FancytreeClass.prototype.isEditing=function(){return this.ext.edit?this.ext.edit.currentNode:null},d.ui.fancytree._FancytreeNodeClass.prototype.isEditing=function(){return!!this.tree.ext.edit&&this.tree.ext.edit.currentNode===this},d.ui.fancytree.registerExtension({name:"edit",version:"2.38.0",options:{adjustWidthOfs:4,allowEmpty:!1,inputCss:{minWidth:"3em"},triggerStart:["f2","mac+enter","shift+click"],trim:!0,beforeClose:d.noop,beforeEdit:d.noop,close:d.noop,edit:d.noop,save:d.noop},currentNode:null,treeInit:function(e){var i=e.tree;this._superApply(arguments),this.$container.addClass("fancytree-ext-edit").on("fancytreebeforeupdateviewport",function(e,t){var n=i.isEditing();n&&(n.info("Cancel edit due to scroll event."),n.editEnd(!1,e))})},nodeClick:function(e){var t=d.ui.fancytree.eventToString(e.originalEvent),n=e.options.edit.triggerStart;return"shift+click"===t&&0<=d.inArray("shift+click",n)&&e.originalEvent.shiftKey||"click"===t&&0<=d.inArray("clickActive",n)&&e.node.isActive()&&!e.node.isEditing()&&d(e.originalEvent.target).hasClass("fancytree-title")?(e.node.editStart(),!1):this._superApply(arguments)},nodeDblclick:function(e){return 0<=d.inArray("dblclick",e.options.edit.triggerStart)?(e.node.editStart(),!1):this._superApply(arguments)},nodeKeydown:function(e){switch(e.originalEvent.which){case 113:if(0<=d.inArray("f2",e.options.edit.triggerStart))return e.node.editStart(),!1;break;case d.ui.keyCode.ENTER:if(0<=d.inArray("mac+enter",e.options.edit.triggerStart)&&t)return e.node.editStart(),!1}return this._superApply(arguments)}}),d.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(y){"use strict";var v="__not_found__",m=y.ui.fancytree.escapeHtml;function b(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function x(e,t,n){for(var i=[],r=1;r"}),s.join("")}return y.ui.fancytree._FancytreeClass.prototype._applyFilterImpl=function(i,r,e){var t,o,s,a,l,d,c=0,n=this.options,u=n.escapeTitles,h=n.autoCollapse,f=y.extend({},n.filter,e),p="hide"===f.mode,g=!!f.leavesOnly&&!r;if("string"==typeof i){if(""===i)return this.warn("Fancytree passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();t=f.fuzzy?i.split("").map(b).reduce(function(e,t){return e+"([^"+t+"]*)"+t},""):b(i),o=new RegExp(t,"i"),s=new RegExp(b(i),"gi"),u&&(a=new RegExp(b("\ufff7"),"g"),l=new RegExp(b("\ufff8"),"g")),i=function(e){if(!e.title)return!1;var t,n=u?e.title:0<=(t=e.title).indexOf(">")?y("
        ").html(t).text():t,t=n.match(o);return t&&f.highlight&&(u?(d=f.fuzzy?x(n,t,u):n.replace(s,function(e){return"\ufff7"+e+"\ufff8"}),e.titleWithHighlight=m(d).replace(a,"").replace(l,"")):f.fuzzy?e.titleWithHighlight=x(n,t):e.titleWithHighlight=n.replace(s,function(e){return""+e+""})),!!t}}return this.enableFilter=!0,this.lastFilterArgs=arguments,e=this.enableUpdate(!1),this.$div.addClass("fancytree-ext-filter"),p?this.$div.addClass("fancytree-ext-filter-hide"):this.$div.addClass("fancytree-ext-filter-dimm"),this.$div.toggleClass("fancytree-ext-filter-hide-expanders",!!f.hideExpanders),this.rootNode.subMatchCount=0,this.visit(function(e){delete e.match,delete e.titleWithHighlight,e.subMatchCount=0}),(t=this.getRootNode()._findDirectChild(v))&&t.remove(),n.autoCollapse=!1,this.visit(function(t){if(!g||null==t.children){var e=i(t),n=!1;if("skip"===e)return t.visit(function(e){e.match=!1},!0),"skip";e||!r&&"branch"!==e||!t.parent.match||(n=e=!0),e&&(c++,t.match=!0,t.visitParents(function(e){e!==t&&(e.subMatchCount+=1),!f.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),e._filterAutoExpanded=!0)},!0))}}),n.autoCollapse=h,0===c&&f.nodata&&p&&(t=f.nodata,!0===(t=y.isFunction(t)?t():t)?t={}:"string"==typeof t&&(t={title:t}),t=y.extend({statusNodeType:"nodata",key:v,title:this.options.strings.noData},t),this.getRootNode().addNode(t).match=!0),this._callHook("treeStructureChanged",this,"applyFilter"),this.enableUpdate(e),c},y.ui.fancytree._FancytreeClass.prototype.filterNodes=function(e,t){return"boolean"==typeof t&&(t={leavesOnly:t},this.warn("Fancytree.filterNodes() leavesOnly option is deprecated since 2.9.0 / 2015-04-19. Use opts.leavesOnly instead.")),this._applyFilterImpl(e,!1,t)},y.ui.fancytree._FancytreeClass.prototype.filterBranches=function(e,t){return this._applyFilterImpl(e,!0,t)},y.ui.fancytree._FancytreeClass.prototype.updateFilter=function(){this.enableFilter&&this.lastFilterArgs&&this.options.filter.autoApply?this._applyFilterImpl.apply(this,this.lastFilterArgs):this.warn("updateFilter(): no filter active.")},y.ui.fancytree._FancytreeClass.prototype.clearFilter=function(){var t,e=this.getRootNode()._findDirectChild(v),n=this.options.escapeTitles,i=this.options.enhanceTitle,r=this.enableUpdate(!1);e&&e.remove(),delete this.rootNode.match,delete this.rootNode.subMatchCount,this.visit(function(e){e.match&&e.span&&(t=y(e.span).find(">span.fancytree-title"),n?t.text(e.title):t.html(e.title),i&&i({type:"enhanceTitle"},{node:e,$title:t})),delete e.match,delete e.subMatchCount,delete e.titleWithHighlight,e.$subMatchBadge&&(e.$subMatchBadge.remove(),delete e.$subMatchBadge),e._filterAutoExpanded&&e.expanded&&e.setExpanded(!1,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),delete e._filterAutoExpanded}),this.enableFilter=!1,this.lastFilterArgs=null,this.$div.removeClass("fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"),this._callHook("treeStructureChanged",this,"clearFilter"),this.enableUpdate(r)},y.ui.fancytree._FancytreeClass.prototype.isFilterActive=function(){return!!this.enableFilter},y.ui.fancytree._FancytreeNodeClass.prototype.isMatched=function(){return!(this.tree.enableFilter&&!this.match)},y.ui.fancytree.registerExtension({name:"filter",version:"2.38.0",options:{autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,nodata:!0,mode:"dimm"},nodeLoadChildren:function(e,t){var n=e.tree;return this._superApply(arguments).done(function(){n.enableFilter&&n.lastFilterArgs&&e.options.filter.autoApply&&n._applyFilterImpl.apply(n,n.lastFilterArgs)})},nodeSetExpanded:function(e,t,n){var i=e.node;return delete i._filterAutoExpanded,!t&&e.options.filter.hideExpandedCounter&&i.$subMatchBadge&&i.$subMatchBadge.show(),this._superApply(arguments)},nodeRenderStatus:function(e){var t=e.node,n=e.tree,i=e.options.filter,r=y(t.span).find("span.fancytree-title"),o=y(t[n.statusClassPropName]),s=e.options.enhanceTitle,a=e.options.escapeTitles,e=this._super(e);return o.length&&n.enableFilter&&(o.toggleClass("fancytree-match",!!t.match).toggleClass("fancytree-submatch",!!t.subMatchCount).toggleClass("fancytree-hide",!(t.match||t.subMatchCount)),!i.counter||!t.subMatchCount||t.isExpanded()&&i.hideExpandedCounter?t.$subMatchBadge&&t.$subMatchBadge.hide():(t.$subMatchBadge||(t.$subMatchBadge=y(""),y("span.fancytree-icon, span.fancytree-custom-icon",t.span).append(t.$subMatchBadge)),t.$subMatchBadge.show().text(t.subMatchCount)),!t.span||t.isEditing&&t.isEditing.call(t)||(t.titleWithHighlight?r.html(t.titleWithHighlight):a?r.text(t.title):r.html(t.title),s&&s({type:"enhanceTitle"},{node:t,$title:r}))),e}}),y.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(l){"use strict";var a=l.ui.fancytree,n={awesome3:{_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",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 fancytree-helper-indeterminate-cb",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:{html:""},nodata:"fa-meh-o",noExpander:"",radio:"fa-circle-thin",radioSelected:"fa-circle",doc:"fa-file-o",docOpen:"fa-file-o",folder:"fa-folder-o",folderOpen:"fa-folder-open-o"},awesome5:{_addClass:"",checkbox:"far fa-square",checkboxSelected:"far fa-check-square",checkboxUnknown:"fas fa-square fancytree-helper-indeterminate-cb",radio:"far fa-circle",radioSelected:"fas fa-circle",radioUnknown:"far fa-dot-circle",dragHelper:"fas fa-arrow-right",dropMarker:"fas fa-long-arrow-alt-right",error:"fas fa-exclamation-triangle",expanderClosed:"fas fa-caret-right",expanderLazy:"fas fa-angle-right",expanderOpen:"fas fa-caret-down",loading:"fas fa-spinner fa-pulse",nodata:"far fa-meh",noExpander:"",doc:"far fa-file",docOpen:"far fa-file",folder:"far fa-folder",folderOpen:"far fa-folder-open"},bootstrap3:{_addClass:"glyphicon",checkbox:"glyphicon-unchecked",checkboxSelected:"glyphicon-check",checkboxUnknown:"glyphicon-expand fancytree-helper-indeterminate-cb",dragHelper:"glyphicon-play",dropMarker:"glyphicon-arrow-right",error:"glyphicon-warning-sign",expanderClosed:"glyphicon-menu-right",expanderLazy:"glyphicon-menu-right",expanderOpen:"glyphicon-menu-down",loading:"glyphicon-refresh fancytree-helper-spin",nodata:"glyphicon-info-sign",noExpander:"",radio:"glyphicon-remove-circle",radioSelected:"glyphicon-ok-circle",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:"fancytree-helper-spin"},nodata:{text:"info"},noExpander:{text:""},radio:{text:"radio_button_unchecked"},radioSelected:{text:"radio_button_checked"},doc:{text:"insert_drive_file"},docOpen:{text:"insert_drive_file"},folder:{text:"folder"},folderOpen:{text:"folder_open"}}};function d(e,t,n,i,r){var o=i.map,s=o[r],a=l(t),i=a.find(".fancytree-childcounter"),o=n+" "+(o._addClass||"");"string"==typeof(s=l.isFunction(s)?s.call(this,e,t,r):s)?(t.innerHTML="",a.attr("class",o+" "+s).append(i)):s&&(s.text?t.textContent=""+s.text:s.html?t.innerHTML=s.html:t.innerHTML="",a.attr("class",o+" "+(s.addClass||"")).append(i))}return l.ui.fancytree.registerExtension({name:"glyph",version:"2.38.0",options:{preset:null,map:{}},treeInit:function(e){var t=e.tree,e=e.options.glyph;e.preset?(a.assert(!!n[e.preset],"Invalid value for `options.glyph.preset`: "+e.preset),e.map=l.extend({},n[e.preset],e.map)):t.warn("ext-glyph: missing `preset` option."),this._superApply(arguments),t.$container.addClass("fancytree-ext-glyph")},nodeRenderStatus:function(e){var t,n,i=e.node,r=l(i.span),o=e.options.glyph,s=this._super(e);return i.isRootNode()||((n=r.children(".fancytree-expander").get(0))&&(t=i.expanded&&i.hasChildren()?"expanderOpen":i.isUndefined()?"expanderLazy":i.hasChildren()?"expanderClosed":"noExpander",d(i,n,"fancytree-expander",o,t)),(n=(i.tr?l("td",i.tr).find(".fancytree-checkbox"):r.children(".fancytree-checkbox")).get(0))&&(e=a.evalOption("checkbox",i,i,o,!1),i.parent&&i.parent.radiogroup||"radio"===e?d(i,n,"fancytree-checkbox fancytree-radio",o,t=i.selected?"radioSelected":"radio"):d(i,n,"fancytree-checkbox",o,t=i.selected?"checkboxSelected":i.partsel?"checkboxUnknown":"checkbox")),(n=r.children(".fancytree-icon").get(0))&&(t=i.statusNodeType||(i.folder?i.expanded&&i.hasChildren()?"folderOpen":"folder":i.expanded?"docOpen":"doc"),d(i,n,"fancytree-icon",o,t))),s},nodeSetStatus:function(e,t,n,i){var r,o=e.options.glyph,s=e.node,e=this._superApply(arguments);return"error"!==t&&"loading"!==t&&"nodata"!==t||(s.parent?(r=l(".fancytree-expander",s.span).get(0))&&d(s,r,"fancytree-expander",o,t):(r=l(".fancytree-statusnode-"+t,s[this.nodeContainerAttrName]).find(".fancytree-icon").get(0))&&d(s,r,"fancytree-icon",o,t)),e}}),l.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(c){"use strict";var u=c.ui.keyCode,o={text:[u.UP,u.DOWN],checkbox:[u.UP,u.DOWN,u.LEFT,u.RIGHT],link:[u.UP,u.DOWN,u.LEFT,u.RIGHT],radiobutton:[u.UP,u.DOWN,u.LEFT,u.RIGHT],"select-one":[u.LEFT,u.RIGHT],"select-multiple":[u.LEFT,u.RIGHT]};function s(e,t){var n,i,r,o,s,a,l=e.closest("td"),d=null;switch(t){case u.LEFT:d=l.prev();break;case u.RIGHT:d=l.next();break;case u.UP:case u.DOWN:for(n=l.parent(),r=n,s=l.get(0),a=0,r.children().each(function(){return this!==s&&(o=c(this).prop("colspan"),void(a+=o||1))}),i=a;(n=t===u.UP?n.prev():n.next()).length&&(n.is(":hidden")||!(d=function(e,t){var n,i=null,r=0;return e.children().each(function(){return t<=r?(i=c(this),!1):(n=c(this).prop("colspan"),void(r+=n||1))}),i}(n,i))||!d.find(":input,a").length););}return d}return c.ui.fancytree.registerExtension({name:"gridnav",version:"2.38.0",options:{autofocusInput:!1,handleCursorKeys:!0},treeInit:function(n){this._requireExtension("table",!0,!0),this._superApply(arguments),this.$container.addClass("fancytree-ext-gridnav"),this.$container.on("focusin",function(e){var t=c.ui.fancytree.getNode(e.target);t&&!t.isActive()&&(e=n.tree._makeHookContext(t,e),n.tree._callHook("nodeSetActive",e,!0))})},nodeSetActive:function(e,t,n){var i=e.options.gridnav,r=e.node,o=e.originalEvent||{},o=c(o.target).is(":input");t=!1!==t,this._superApply(arguments),t&&(e.options.titlesTabbable?(o||(c(r.span).find("span.fancytree-title").focus(),r.setFocus()),e.tree.$container.attr("tabindex","-1")):i.autofocusInput&&!o&&c(r.tr||r.span).find(":input:enabled").first().focus())},nodeKeydown:function(e){var t,n,i=e.options.gridnav,r=e.originalEvent,e=c(r.target);return e.is(":input:enabled")?t=e.prop("type"):e.is("a")&&(t="link"),t&&i.handleCursorKeys?!((t=o[t])&&0<=c.inArray(r.which,t)&&(n=s(e,r.which))&&n.length)||(n.find(":input:enabled,a").focus(),!1):this._superApply(arguments)}}),c.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree","./jquery.fancytree.table"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree.table"),module.exports=t(require("jquery"))):t(jQuery),t=function(s){"use strict";return s.ui.fancytree.registerExtension({name:"multi",version:"2.38.0",options:{allowNoSelect:!1,mode:"sameParent"},treeInit:function(e){this._superApply(arguments),this.$container.addClass("fancytree-ext-multi"),1===e.options.selectMode&&s.error("Fancytree ext-multi: selectMode: 1 (single) is not compatible.")},nodeClick:function(e){var t=e.tree,n=e.node,i=t.getActiveNode()||t.getFirstChild(),r="checkbox"===e.targetType,o="expander"===e.targetType;switch(s.ui.fancytree.eventToString(e.originalEvent)){case"click":if(o)break;r||(t.selectAll(!1),n.setSelected());break;case"shift+click":t.visitRows(function(e){if(e.setSelected(),e===n)return!1},{start:i,reverse:i.isBelowOf(n)});break;case"ctrl+click":case"meta+click":return void n.toggleSelected()}return this._superApply(arguments)},nodeKeydown:function(e){var t=e.tree,n=e.node,i=e.originalEvent;switch(s.ui.fancytree.eventToString(i)){case"up":case"down":t.selectAll(!1),n.navigate(i.which,!0),t.getActiveNode().setSelected();break;case"shift+up":case"shift+down":n.navigate(i.which,!0),t.getActiveNode().setSelected()}return this._superApply(arguments)}}),s.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(p){"use strict";var t=null,n=null,i=null,r=p.ui.fancytree.assert,u="active",g="expanded",h="focus",f="selected";try{r(window.localStorage&&window.localStorage.getItem),n={get:function(e){return window.localStorage.getItem(e)},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)}}}catch(e){p.ui.fancytree.warn("Could not access window.localStorage",e)}try{r(window.sessionStorage&&window.sessionStorage.getItem),i={get:function(e){return window.sessionStorage.getItem(e)},set:function(e,t){window.sessionStorage.setItem(e,t)},remove:function(e){window.sessionStorage.removeItem(e)}}}catch(e){p.ui.fancytree.warn("Could not access window.sessionStorage",e)}return"function"==typeof Cookies?t={get:Cookies.get,set:function(e,t){Cookies.set(e,t,this.options.persist.cookie)},remove:Cookies.remove}:p&&"function"==typeof p.cookie&&(t={get:p.cookie,set:function(e,t){p.cookie.set(e,t,this.options.persist.cookie)},remove:p.removeCookie}),p.ui.fancytree._FancytreeClass.prototype.clearPersistData=function(e){var t=this.ext.persist,n=t.cookiePrefix;0<=(e=e||"active expanded focus selected").indexOf(u)&&t._data(n+u,null),0<=e.indexOf(g)&&t._data(n+g,null),0<=e.indexOf(h)&&t._data(n+h,null),0<=e.indexOf(f)&&t._data(n+f,null)},p.ui.fancytree._FancytreeClass.prototype.clearCookies=function(e){return this.warn("'tree.clearCookies()' is deprecated since v2.27.0: use 'clearPersistData()' instead."),this.clearPersistData(e)},p.ui.fancytree._FancytreeClass.prototype.getPersistData=function(){var e=this.ext.persist,t=e.cookiePrefix,n=e.cookieDelimiter,i={};return i[u]=e._data(t+u),i[g]=(e._data(t+g)||"").split(n),i[f]=(e._data(t+f)||"").split(n),i[h]=e._data(t+h),i},p.ui.fancytree.registerExtension({name:"persist",version:"2.38.0",options:{cookieDelimiter:"~",cookiePrefix:void 0,cookie:{raw:!1,expires:"",path:"",domain:"",secure:!1},expandLazy:!1,expandOpts:void 0,fireActivate:!0,overrideSource:!0,store:"auto",types:"active expanded focus selected"},_data:function(e,t){var n=this._local.store;if(void 0===t)return n.get.call(this,e);null===t?n.remove.call(this,e):n.set.call(this,e,t)},_appendKey:function(e,t,n){t=""+t;var i=this._local,r=this.options.persist.cookieDelimiter,o=i.cookiePrefix+e,s=i._data(o),e=s?s.split(r):[],s=p.inArray(t,e);0<=s&&e.splice(s,1),n&&e.push(t),i._data(o,e.join(r))},treeInit:function(e){var a=e.tree,l=e.options,d=this._local,c=this.options.persist;return d.cookiePrefix=c.cookiePrefix||"fancytree-"+a._id+"-",d.storeActive=0<=c.types.indexOf(u),d.storeExpanded=0<=c.types.indexOf(g),d.storeSelected=0<=c.types.indexOf(f),d.storeFocus=0<=c.types.indexOf(h),d.store=null,"auto"===c.store&&(c.store=n?"local":"cookie"),p.isPlainObject(c.store)?d.store=c.store:"cookie"===c.store?d.store=t:"local"!==c.store&&"session"!==c.store||(d.store="local"===c.store?n:i),r(d.store,"Need a valid store."),a.$div.on("fancytreeinit",function(e){var t,n,i,r,o,s;!1!==a._triggerTreeEvent("beforeRestore",null,{})&&(i=d._data(d.cookiePrefix+h),r=!1===c.fireActivate,o=d._data(d.cookiePrefix+g),s=o&&o.split(c.cookieDelimiter),(d.storeExpanded?function e(t,n,i,r,o){var s,a,l,d,c=!1,u=t.options.persist.expandOpts,h=[],f=[];for(i=i||[],o=o||p.Deferred(),s=0,l=i.length;stbody")).length||(a.find(">tr").length&&b.error("Expected table > tbody > tr. If you see this please open an issue."),i=b("").appendTo(a)),r.tbody=i[0],r.columnCount=b("thead >tr",a).last().find(">th",a).length,(n=i.children("tr").first()).length)e=n.children("td").length,r.columnCount&&e!==r.columnCount&&(r.warn("Column count mismatch between thead ("+r.columnCount+") and tbody ("+e+"): using tbody."),r.columnCount=e),n=n.clone();else for(x(1<=r.columnCount,"Need either or with elements to determine column count."),n=b(""),t=0;t");n.find(">td").eq(s.nodeColumnIdx).html(""),o.aria&&(n.attr("role","row"),n.find("td").attr("role","gridcell")),r.rowFragment=document.createDocumentFragment(),r.rowFragment.appendChild(n.get(0)),i.empty(),r.statusClassPropName="tr",r.ariaPropName="tr",this.nodeContainerAttrName="tr",r.$container=a,this._superApply(arguments),b(r.rootNode.ul).remove(),r.rootNode.ul=null,this.$container.attr("tabindex",o.tabindex),o.aria&&r.$container.attr("role","treegrid").attr("aria-readonly",!0)},nodeRemoveChildMarkup:function(e){e.node.visit(function(e){e.tr&&(b(e.tr).remove(),e.tr=null)})},nodeRemoveMarkup:function(e){var t=e.node;t.tr&&(b(t.tr).remove(),t.tr=null),this.nodeRemoveChildMarkup(e)},nodeRender:function(e,t,n,i,r){var o,s,a,l,d,c,u,h,f,p,g=e.tree,y=e.node,v=e.options,m=!y.parent;if(!1!==g._enableUpdate){if(r||(e.hasCollapsedParents=y.parent&&!y.parent.expanded),!m)if(y.tr&&t&&this.nodeRemoveMarkup(e),y.tr)t?this.nodeRenderTitle(e):this.nodeRenderStatus(e);else{if(e.hasCollapsedParents&&!n)return;d=g.rowFragment.firstChild.cloneNode(!0),h=function(e){var t,n,i=e.parent,r=i?i.children:null;if(r&&1td").eq(0).prop("colspan",n.columnCount).text(i.title).addClass("fancytree-status-merged").nextAll().remove():r.renderColumns&&r.renderColumns.call(n,{type:"renderColumns"},e)),s},nodeRenderStatus:function(e){var t=e.node,n=e.options;this._super(e),b(t.tr).removeClass("fancytree-node"),e=(t.getLevel()-1)*n.table.indentation,n.rtl?b(t.span).css({paddingRight:e+"px"}):b(t.span).css({paddingLeft:e+"px"})},nodeSetExpanded:function(t,n,i){if(n=!1!==n,t.node.expanded&&n||!t.node.expanded&&!n)return this._superApply(arguments);var r=new b.Deferred,e=b.extend({},i,{noEvents:!0,noAnimation:!0});function o(e){C(t.node,n),e?n&&t.options.autoScroll&&!i.noAnimation&&t.node.hasChildren()?t.node.getLastChild().scrollIntoView(!0,{topNode:t.node}).always(function(){i.noEvents||t.tree._triggerNodeEvent(n?"expand":"collapse",t),r.resolveWith(t.node)}):(i.noEvents||t.tree._triggerNodeEvent(n?"expand":"collapse",t),r.resolveWith(t.node)):(i.noEvents||t.tree._triggerNodeEvent(n?"expand":"collapse",t),r.rejectWith(t.node))}return i=i||{},this._super(t,n,e).done(function(){o(!0)}).fail(function(){o(!1)}),r.promise()},nodeSetStatus:function(e,t,n,i){return"ok"!==t||(e=(e=e.node).children?e.children[0]:null)&&e.isStatusNode()&&b(e.tr).remove(),this._superApply(arguments)},treeClear:function(e){return this.nodeRemoveChildMarkup(this._makeHookContext(this.rootNode)),this._superApply(arguments)},treeDestroy:function(e){return this.$container.find("tbody").empty(),this.$source&&this.$source.removeClass("fancytree-helper-hidden"),this._superApply(arguments)}}),b.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(o){"use strict";return o.ui.fancytree.registerExtension({name:"themeroller",version:"2.38.0",options:{activeClass:"ui-state-active",addClass:"ui-corner-all",focusClass:"ui-state-focus",hoverClass:"ui-state-hover",selectedClass:"ui-state-highlight"},treeInit:function(e){var t=e.widget.element,n=e.options.themeroller;this._superApply(arguments),"TABLE"===t[0].nodeName?(t.addClass("ui-widget ui-corner-all"),t.find(">thead tr").addClass("ui-widget-header"),t.find(">tbody").addClass("ui-widget-conent")):t.addClass("ui-widget ui-widget-content ui-corner-all"),t.on("mouseenter mouseleave",".fancytree-node",function(e){var t=o.ui.fancytree.getNode(e.target),e="mouseenter"===e.type;o(t.tr||t.span).toggleClass(n.hoverClass+" "+n.addClass,e)})},treeDestroy:function(e){this._superApply(arguments),e.widget.element.removeClass("ui-widget ui-widget-content ui-corner-all")},nodeRenderStatus:function(e){var t={},n=e.node,i=o(n.tr||n.span),r=e.options.themeroller;this._super(e),t[r.activeClass]=!1,t[r.focusClass]=!1,t[r.selectedClass]=!1,n.isActive()&&(t[r.activeClass]=!0),n.hasFocus()&&(t[r.focusClass]=!0),n.isSelected()&&!n.isActive()&&(t[r.selectedClass]=!0),i.toggleClass(r.activeClass,t[r.activeClass]),i.toggleClass(r.focusClass,t[r.focusClass]),i.toggleClass(r.selectedClass,t[r.selectedClass]),i.addClass(r.addClass)}}),o.ui.fancytree},"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery),t=function(d){"use strict";var c=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function u(e,t){var n=d("#"+(e="fancytree-style-"+e));if(t){n.length||(n=d("