From 44da1aa0f81d4b4abf62e6592c7e4416aaa4bbef Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Sat, 16 Dec 2017 10:14:38 +0100 Subject: [PATCH] Bump version to 2.27.0 --- bower.json | 2 +- demo/sample-types.html | 2 +- dist/jquery.fancytree-all-deps.js | 763 +++++++++++------ dist/jquery.fancytree-all-deps.min.js | 33 +- dist/jquery.fancytree-all-deps.min.js.map | 2 +- dist/jquery.fancytree-all.js | 774 +++++++++++------ dist/jquery.fancytree-all.min.js | 42 +- dist/jquery.fancytree.min.js | 15 +- dist/modules/jquery.fancytree.ariagrid.js | 8 +- dist/modules/jquery.fancytree.childcounter.js | 8 +- dist/modules/jquery.fancytree.clones.js | 8 +- dist/modules/jquery.fancytree.columnview.js | 8 +- dist/modules/jquery.fancytree.debug.js | 8 +- dist/modules/jquery.fancytree.dnd.js | 13 +- dist/modules/jquery.fancytree.dnd5.js | 19 +- dist/modules/jquery.fancytree.edit.js | 22 +- dist/modules/jquery.fancytree.filter.js | 8 +- dist/modules/jquery.fancytree.fixed.js | 6 +- dist/modules/jquery.fancytree.glyph.js | 234 ++--- dist/modules/jquery.fancytree.gridnav.js | 8 +- dist/modules/jquery.fancytree.js | 325 +++++-- dist/modules/jquery.fancytree.menu.js | 6 +- dist/modules/jquery.fancytree.persist.js | 91 +- dist/modules/jquery.fancytree.select.js | 8 +- dist/modules/jquery.fancytree.table.js | 20 +- dist/modules/jquery.fancytree.themeroller.js | 8 +- dist/modules/jquery.fancytree.ui-deps.js | 10 +- dist/modules/jquery.fancytree.wide.js | 10 +- dist/skin-awesome/ui.fancytree.css | 50 +- dist/skin-awesome/ui.fancytree.less | 71 +- dist/skin-awesome/ui.fancytree.min.css | 2 +- dist/skin-bootstrap-n/ui.fancytree.less | 2 +- dist/skin-material/ui.fancytree.css | 520 +++++++++++ dist/skin-material/ui.fancytree.less | 148 ++++ dist/skin-material/ui.fancytree.min.css | 6 + dist/skin-material/vline-rtl.gif | Bin 0 -> 842 bytes dist/skin-material/vline.gif | Bin 0 -> 844 bytes dist/skin-win8-n/ui.fancytree.css | 14 +- dist/skin-win8-n/ui.fancytree.less | 2 +- dist/skin-win8-n/ui.fancytree.min.css | 2 +- package.json | 4 +- src/jquery.fancytree.js | 6 +- test/unit/test-tools.js | 808 +++++++++--------- 43 files changed, 2735 insertions(+), 1361 deletions(-) create mode 100644 dist/skin-material/ui.fancytree.css create mode 100644 dist/skin-material/ui.fancytree.less create mode 100644 dist/skin-material/ui.fancytree.min.css create mode 100644 dist/skin-material/vline-rtl.gif create mode 100644 dist/skin-material/vline.gif diff --git a/bower.json b/bower.json index d4d410e1..30eca365 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "jquery.fancytree", "description": "jQuery tree view / tree grid plugin with support for keyboard, inline editing, filtering, checkboxes, drag'n'drop, and lazy loading", - "version": "2.26.1-0", + "version": "2.27.0", "main": [ "dist/jquery.fancytree-all-deps.min.js" ], diff --git a/demo/sample-types.html b/demo/sample-types.html index c8cb2772..72b41788 100644 --- a/demo/sample-types.html +++ b/demo/sample-types.html @@ -22,7 +22,7 @@ $("#tree").fancytree({ types: { "book": {"icon": "ft-ico-book", "iconTooltip": "This is a book"}, - "computer": {"icon": "ft-ico-computer", "iconTooltip": "This is a computer."} + "computer": {"icon": "ft-ico-computer", "iconTooltip": "This is a computer."} }, checkbox: true, source: {url: "ajax-tree-products.json"}, diff --git a/dist/jquery.fancytree-all-deps.js b/dist/jquery.fancytree-all-deps.js index d5002fc4..122adacd 100644 --- a/dist/jquery.fancytree-all-deps.js +++ b/dist/jquery.fancytree-all-deps.js @@ -1,4 +1,4 @@ -/*! jQuery Fancytree Plugin - 2.26.0 - 2017-11-04T17:52:53Z +/*! jQuery Fancytree Plugin - 2.27.0 - 2017-12-16T09:14:27Z * https://github.com/mar10/fancytree * Copyright (c) 2017 Martin Wendt; Licensed MIT */ @@ -3045,8 +3045,8 @@ var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, d * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ /** Core Fancytree module. @@ -3059,7 +3059,7 @@ var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, d define( [ "jquery", "./jquery.fancytree.ui-deps" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree.ui-deps"); + require("./jquery.fancytree.ui-deps"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -3084,8 +3084,8 @@ if ( $.ui && $.ui.fancytree ) { var i, attr, FT = null, // initialized below TEST_IMG = new RegExp(/\.|\//), // strings are considered image urls if they contain '.' or '/' - REX_HTML = /[&<>"'\/]/g, - REX_TOOLTIP = /[<>"'\/]/g, + REX_HTML = /[&<>"'\/]/g, // Escape those characters + REX_TOOLTIP = /[<>"'\/]/g, // Don't escape `&` in tooltips RECURSIVE_REQUEST_ERROR = "$recursive_request", ENTITY_MAP = {"&": "&", "<": "<", ">": ">", "\"": """, "'": "'", "/": "/"}, IGNORE_KEYCODES = { 16: true, 17: true, 18: true }, @@ -3107,8 +3107,11 @@ var i, attr, // Note: v2.23: checkbox and hideCheckbox are *not* in this list CLASS_ATTRS = "active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "), CLASS_ATTR_MAP = {}, - // Top-level Fancytree node attributes, that can be set by dict - NODE_ATTRS = "checkbox expanded extraClasses folder icon key lazy radiogroup refKey selected statusNodeType title tooltip unselectable unselectableIgnore unselectableStatus".split(" "), + // 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 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 = {}, @@ -3123,6 +3126,9 @@ for(i=0; i= 0, "insertBefore must be an existing child"); @@ -4999,7 +5008,8 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{ return this.tree._callHook("nodeToggleSelected", this); }, toString: function() { - return ""; + return "FancytreeNode@" + this.key + "[title='" + this.title + "']"; + // return ""; }, /** * Trigger `modifyChild` event on a parent to signal that a child was modified. @@ -5188,6 +5198,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{ * Typically "li", but "tr" for table extension. * @property {jQueryObject} $container Outer <ul> element (or <table> element for ext-table). * @property {jQueryObject} $div A jQuery object containing the element used to instantiate the tree widget (`widget.element`) + * @property {object|array} columns Recommended place to store shared column meta data. @since 2.27 * @property {object} data Metadata, i.e. properties that may be passed to `source` in addition to a children array. * @property {object} ext Hash of all active plugin instances. * @property {FancytreeNode} focusNode Currently focused node or null. @@ -5198,6 +5209,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{ * @property {FancytreeNode} rootNode Invisible system root node. * @property {string} statusClassPropName Property name of FancytreeNode that contains the element which will receive the status classes. * Typically "span", but "tr" for table extension. + * @property {object} types Map for shared type specific meta data, used with node.type attribute. @since 2.27 * @property {object} widget Base widget instance. */ function Fancytree(widget) { @@ -5222,6 +5234,8 @@ function Fancytree(widget) { } } this.ext = {}; // Active extension instances + this.types = {}; + this.columns = {}; // allow to init tree.data.foo from
this.data = _getElementDataAsDict(this.$div); // TODO: use widget.uuid instead? @@ -5234,7 +5248,6 @@ function Fancytree(widget) { this._tempCache = {}; this._lastMousedownNode = null; this._enableUpdate = true; - // this._dirtyRoots = null; this.lastSelectedNode = null; this.systemFocusElement = null; this.lastQuicksearchTerm = ""; @@ -5305,7 +5318,8 @@ Fancytree.prototype = /** @lends Fancytree# */{ }else if(obj.tree){ // obj is a FancytreeNode tree = obj.tree; - ctx = { node: obj, tree: tree, widget: tree.widget, options: tree.widget.options, originalEvent: originalEvent }; + ctx = { node: obj, tree: tree, widget: tree.widget, options: tree.widget.options, originalEvent: originalEvent, + typeInfo: tree.types[obj.type] || {}}; }else if(obj.widget){ // obj is a Fancytree ctx = { node: null, tree: obj, widget: obj.widget, options: obj.widget.options, originalEvent: originalEvent }; @@ -5340,7 +5354,7 @@ Fancytree.prototype = /** @lends Fancytree# */{ }, _getExpiringValue: function(key){ var entry = this._tempCache[key]; - if( entry && entry.expire < Date.now() ) { + if( entry && entry.expire > Date.now() ) { return entry.value; } delete this._tempCache[key]; @@ -5489,6 +5503,14 @@ Fancytree.prototype = /** @lends Fancytree# */{ } return !flag; // return previous value }, + /** Write warning to browser console (prepending tree info) + * + * @param {*} msg string or object or array of such + */ + error: function(msg){ + Array.prototype.unshift.call(arguments, this.toString()); + consoleApply("error", arguments); + }, /**Find all nodes that matches condition. * * @param {string | function(node)} match title string to search for, or a @@ -5519,6 +5541,9 @@ Fancytree.prototype = /** @lends Fancytree# */{ * @returns {FancytreeNode} matching node or null */ findNextNode: function(match, startNode, visibleOnly) { + match = (typeof match === "string") ? _makeNodeTitleStartMatcher(match) : match; + startNode = startNode || this.getFirstChild(); + var stopNode = null, parentChildren = startNode.parent.children, matchingNode = null, @@ -5553,9 +5578,6 @@ Fancytree.prototype = /** @lends Fancytree# */{ } }; - match = (typeof match === "string") ? _makeNodeTitleStartMatcher(match) : match; - startNode = startNode || this.getFirstChild(); - walkVisible(startNode.parent, parentChildren.indexOf(startNode), function(node){ // Stop iteration if we see the start node a second time if( node === stopNode ) { @@ -5742,91 +5764,192 @@ Fancytree.prototype = /** @lends Fancytree# */{ /** * Make sure that a node with a given ID is loaded, by traversing - and - * loading - its parents. This method is ment for lazy hierarchies. + * loading - its parents. This method is meant for lazy hierarchies. * A callback is executed for every node as we go. * @example + * // Resolve using node.key: * tree.loadKeyPath("/_3/_23/_26/_27", function(node, status){ * if(status === "loaded") { - * console.log("loaded intermiediate node " + node); + * console.log("loaded intermediate node " + node); * }else if(status === "ok") { * node.activate(); * } * }); - * + * // Use deferred promise: + * tree.loadKeyPath("/_3/_23/_26/_27").progress(function(data){ + * if(data.status === "loaded") { + * console.log("loaded intermediate node " + data.node); + * }else if(data.status === "ok") { + * node.activate(); + * } + * }).done(function(){ + * ... + * }); + * // Custom path segment resolver: + * tree.loadKeyPath("/321/431/21/2", { + * matchKey: function(node, key){ + * return node.data.refKey === key; + * }, + * callback: function(node, status){ + * if(status === "loaded") { + * console.log("loaded intermediate node " + node); + * }else if(status === "ok") { + * node.activate(); + * } + * } + * }); * @param {string | string[]} keyPathList one or more key paths (e.g. '/3/2_1/7') - * @param {function} callback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error') + * @param {function | object} optsOrCallback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error'). + * Pass an object to define custom key matchers for the path segments: {callback: function, matchKey: function}. * @returns {$.Promise} */ - loadKeyPath: function(keyPathList, callback, _rootNode) { - var deferredList, dfd, i, path, key, loadMap, node, root, segList, + loadKeyPath: function(keyPathList, optsOrCallback) { + var callback, i, path, + self = this, + dfd = new $.Deferred(), + parent = this.getRootNode(), sep = this.options.keyPathSeparator, - self = this; + pathSegList = [], + opts = $.extend({}, optsOrCallback); - callback = callback || $.noop; + // Prepare options + if( typeof optsOrCallback === "function" ) { + callback = optsOrCallback; + } else if ( optsOrCallback && optsOrCallback.callback ) { + callback = optsOrCallback.callback; + } + 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) { return node.key === key; }; + } + // Convert array of path strings to array of segment arrays if(!$.isArray(keyPathList)){ keyPathList = [keyPathList]; } - // Pass 1: handle all path segments for nodes that are already loaded - // Collect distinct top-most lazy nodes in a map - loadMap = {}; - for(i=0; i"; + return "Fancytree@" + this._id; + // return ""; }, /* _trigger a widget event with additional node ctx. * @see EventData @@ -6285,9 +6409,11 @@ $.extend(Fancytree.prototype, } else { if( ctx.options.postProcess ){ // #792: Call postProcess for non-deferred source - tree._triggerNodeEvent("postProcess", ctx, ctx.originalEvent, { + var res = tree._triggerNodeEvent("postProcess", ctx, ctx.originalEvent, { response: source, error: null, dataType: typeof source }); + + source = $.isArray(res) ? res : source; } } // $.when(source) resolves also for non-deferreds @@ -6302,6 +6428,14 @@ $.extend(Fancytree.prototype, metaData = children; children = children.children; delete metaData.children; + // Copy some attributes to tree.data + $.each(TREE_ATTRS, function(i, attr) { + if( metaData[attr] !== undefined ){ + tree[attr] = metaData[attr]; + delete metaData[attr]; + } + }); + // Copy all other attributes to tree.data.NAME $.extend(tree.data, metaData); } _assert($.isArray(children), "expected array of children"); @@ -6619,7 +6753,7 @@ $.extend(Fancytree.prototype, */ nodeRenderTitle: function(ctx, title) { // set node connector images, links and text - var checkbox, className, icon, nodeTitle, role, tabindex, tooltip, + var checkbox, className, icon, nodeTitle, role, tabindex, tooltip, iconTooltip, node = ctx.node, tree = ctx.tree, opts = ctx.options, @@ -6674,23 +6808,30 @@ $.extend(Fancytree.prototype, // else if opts.icon is a boolean or string, use that // else show standard icon (which may be different for folders or documents) icon = FT.evalOption("icon", node, node, opts, true); - if( typeof icon !== "boolean" ) { - // icon is defined, but not true/false: must be a string - icon = "" + icon; - } + // if( typeof icon !== "boolean" ) { + // // icon is defined, but not true/false: must be a string + // icon = "" + icon; + // } if( icon !== false ) { role = aria ? " role='presentation'" : ""; + + iconTooltip = FT.evalOption("iconTooltip", node, node, opts, null); + iconTooltip = iconTooltip ? " title='" + _escapeTooltip(iconTooltip) + "'" : ""; + if ( typeof icon === "string" ) { if( TEST_IMG.test(icon) ) { // node.icon is an image url. Prepend imagePath icon = (icon.charAt(0) === "/") ? icon : ((opts.imagePath || "") + icon); - ares.push(""); + ares.push(""); } else { - ares.push(""); + ares.push(""); } + } else if ( icon.text ) { + ares.push("" + icon.text + ""); } else { // standard icon: theme css will take care of this - ares.push(""); + ares.push(""); } } // Node title @@ -7347,6 +7488,15 @@ $.extend(Fancytree.prototype, // #577: Allow to set tabindex to "0", "-1" and "" tree.$container.attr("tabindex", opts.tabindex); + // Copy some attributes to tree.data + $.each(TREE_ATTRS, function(i, attr) { + if( opts[attr] !== undefined ){ + tree.info("Move option " + attr + " to tree"); + tree[attr] = opts[attr]; + delete opts[attr]; + } + }); + if( opts.rtl ) { tree.$container.attr("DIR", "RTL").addClass("fancytree-rtl"); }else{ @@ -7396,11 +7546,18 @@ $.extend(Fancytree.prototype, }).remove(); if( $.isPlainObject(source) ){ // We got {foo: 'abc', children: [...]} - // Copy extra properties to tree.data.foo _assert($.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) { + if( metaData[attr] !== undefined ){ + tree[attr] = metaData[attr]; + delete metaData[attr]; + } + }); + // Copy extra properties to tree.data.foo $.extend(tree.data, metaData); } break; @@ -7678,7 +7835,7 @@ $.widget("ui.fancytree", this.tree._callHook("treeInit", this.tree); // TODO: currently we call bind after treeInit, because treeInit // might change tree.$container. - // It would be better, to move ebent binding into hooks altogether + // It would be better, to move event binding into hooks altogether this._bind(); }, @@ -7875,7 +8032,7 @@ $.extend($.ui.fancytree, /** @lends Fancytree_Static# */ { /** @type {string} */ - version: "2.26.0", // Set to semver by 'grunt release' + version: "2.27.0", // Set to semver by 'grunt release' /** @type {string} */ buildType: "production", // Set to 'production' by 'grunt build' /** @type {int} */ @@ -8123,7 +8280,10 @@ $.extend($.ui.fancytree, nodeOpt = nodeObject[optionName]; if( $.isFunction(treeOpt) ) { - ctx = { node: node, tree: tree, widget: tree.widget, options: tree.widget.options }; + ctx = { + node: node, tree: tree, widget: tree.widget, options: tree.widget.options, + typeInfo: tree.types[node.type] || {} + }; res = treeOpt.call(tree, {type: optionName}, ctx); if( res == null ) { res = nodeOpt; @@ -8136,6 +8296,25 @@ $.extend($.ui.fancytree, } return res; }, + /** Set expander, checkbox, or node icon, supporting string and object format. + * + * @param {Element | jQueryObject} span + * @param {string} baseClass + * @param {string | object} icon + * @since 2.27 + */ + setSpanIcon: function( span, baseClass, icon ) { + var $span = $( span ); + + if( typeof icon === "string" ) { + $span.attr( "class", baseClass + " " + icon ); + } else { // support object syntax: { text: ligature, addClasse: classname } + if( icon.text ) { + $span.text( "" + icon.text ); + } + $span.attr( "class", baseClass + " " + ( icon.addClass || "" ) ); + } + }, /** Convert a keydown or mouse event to a canonical string like 'ctrl+a', * 'ctrl+shift+f2', 'shift+leftdblclick'. * @@ -8386,8 +8565,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ // To keep the global namespace clean, we wrap everything in a closure. @@ -8401,7 +8580,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -8505,7 +8684,7 @@ $.ui.fancytree.registerExtension({ // Every extension must be registered by a unique name. name: "childcounter", // Version information should be compliant with [semver](http://semver.org) - version: "2.26.0", + version: "2.27.0", // Extension specific options and their defaults. // This options will be available as `tree.options.childcounter.hideExpanded` @@ -8605,8 +8784,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -8615,7 +8794,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -8951,7 +9130,7 @@ $.ui.fancytree._FancytreeClass.prototype.changeRefKey = function(oldRefKey, newR */ $.ui.fancytree.registerExtension({ name: "clones", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers @@ -9087,8 +9266,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ @@ -9111,7 +9290,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -9125,7 +9304,7 @@ return $.ui.fancytree; /* ***************************************************************************** * Private functions and variables */ -var +var FT = $.ui.fancytree, classDragSource = "fancytree-drag-source", classDragRemove = "fancytree-drag-remove", classDropAccept = "fancytree-drop-accept", @@ -9323,7 +9502,7 @@ function handleDragOver(event, data) { .toggleClass(classDropOver, hitMode === "over") .toggleClass(classDropBefore, hitMode === "before") .show() - .position($.ui.fancytree.fixPositionOptions({ + .position(FT.fixPositionOptions({ my: "left" + offsetString(markerOffsetX) + " center", at: "left " + markerAt, of: $targetTitle @@ -9351,7 +9530,7 @@ function handleDragOver(event, data) { $.ui.fancytree.registerExtension({ name: "dnd5", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { autoExpandMS: 1500, // Expand nodes after n milliseconds of hovering @@ -9383,7 +9562,7 @@ $.ui.fancytree.registerExtension({ opts = ctx.options, glyph = opts.glyph || null, dndOpts = opts.dnd5, - getNode = $.ui.fancytree.getNode; + getNode = FT.getNode; if( $.inArray("dnd", opts.extensions) >= 0 ) { $.error("Extensions 'dnd' and 'dnd5' are mutually exclusive."); @@ -9395,7 +9574,7 @@ $.ui.fancytree.registerExtension({ // Implement `opts.createNode` event to add the 'draggable' attribute // #680: this must happen before calling super.treeInit() if( dndOpts.dragStart ) { - $.ui.fancytree.overrideMethod(ctx.options, "createNode", function(event, data) { + FT.overrideMethod(ctx.options, "createNode", function(event, data) { // Default processing if any this._super.apply(this, arguments); @@ -9423,7 +9602,8 @@ $.ui.fancytree.registerExtension({ "pointer-events": "none" }).prependTo("body"); if( glyph ) { - $dropMarker.addClass(glyph.map.dropMarker); + FT.setSpanIcon($dropMarker[0], glyph.map._addClass, glyph.map.dropMarker); + // $dropMarker.addClass(glyph.map._addClass + " " + glyph.map.dropMarker); } } // Enable drag support if dragStart() is specified: @@ -9684,8 +9864,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -9694,7 +9874,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -9822,7 +10002,7 @@ $.ui.fancytree._FancytreeNodeClass.prototype.editEnd = function(applyChanges, _e // If true/false was passed, honor this (except in rename mode, if unchanged) eventData.save = false; } else if( eventData.isNew ) { - // In create mode, we save everyting, except for empty text + // In create mode, we save everything, except for empty text eventData.save = (newVal !== ""); } else { // In rename mode, we save everyting, except for empty or unchanged text @@ -9941,15 +10121,14 @@ $.ui.fancytree._FancytreeNodeClass.prototype.isEditing = function(){ */ $.ui.fancytree.registerExtension({ name: "edit", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { adjustWidthOfs: 4, // null: don't adjust input size to content allowEmpty: false, // Prevent empty input inputCss: {minWidth: "3em"}, // triggerCancel: ["esc", "tab", "click"], - // triggerStart: ["f2", "dblclick", "shift+click", "mac+enter"], - triggerStart: ["f2", "shift+click", "mac+enter"], + triggerStart: ["f2", "mac+enter", "shift+click"], trim: true, // Trim whitespace before save // Events: beforeClose: $.noop, // Return false to prevent cancel/save (data.input is available) @@ -9973,6 +10152,15 @@ $.ui.fancytree.registerExtension({ return false; } } + if( $.inArray("clickActive", ctx.options.edit.triggerStart) >= 0 ){ + // Only when click was inside title text (not aynwhere else in the row) + if( ctx.node.isActive() && !ctx.node.isEditing() && + $(ctx.originalEvent.target).hasClass("fancytree-title") + ){ + ctx.node.editStart(); + return false; + } + } return this._superApply(arguments); }, nodeDblclick: function(ctx) { @@ -10016,8 +10204,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -10026,7 +10214,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -10308,7 +10496,7 @@ $.ui.fancytree._FancytreeNodeClass.prototype.isMatched = function(){ */ $.ui.fancytree.registerExtension({ name: "filter", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { autoApply: true, // Re-apply last filter if lazy data is loaded @@ -10401,8 +10589,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -10411,7 +10599,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -10428,91 +10616,127 @@ return $.ui.fancytree; var FT = $.ui.fancytree, PRESETS = { - "awesome3": { - checkbox: "icon-check-empty", - checkboxSelected: "icon-check", - checkboxUnknown: "icon-check icon-muted", - radio: "icon-circle-blank", - radioSelected: "icon-circle", - radioUnknown: "icon-circle icon-muted", - // radioUnknown: "icon-remove-circle-blank", - dragHelper: "icon-caret-right", - dropMarker: "icon-caret-right", - error: "icon-exclamation-sign", - expanderClosed: "icon-caret-right", - expanderLazy: "icon-angle-right", - expanderOpen: "icon-caret-down", - loading: "icon-refresh icon-spin", - nodata: "icon-meh", - noExpander: "", - // Default node icons. - // (Use tree.options.icon callback to define custom icons based on node data) - doc: "icon-file-alt", - docOpen: "icon-file-alt", - folder: "icon-folder-close-alt", - folderOpen: "icon-folder-open-alt" - }, - "awesome4": { - checkbox: "fa fa-square-o", - checkboxSelected: "fa fa-check-square-o", - // checkboxUnknown: "fa fa-window-close-o", - checkboxUnknown: "fa fa-square", - radio: "fa fa-circle-o", - radioSelected: "fa fa-circle", - radioUnknown: "fa fa-dot-circle-o", - dragHelper: "fa fa-arrow-right", - dropMarker: "fa fa-long-arrow-right", - error: "fa fa-warning", - expanderClosed: "fa fa-caret-right", - expanderLazy: "fa fa-angle-right", - expanderOpen: "fa fa-caret-down", - loading: "fa fa-spinner fa-pulse", - nodata: "fa fa-meh-o", - noExpander: "", - // Default node icons. - // (Use tree.options.icon callback to define custom icons based on node data) - doc: "fa fa-file-o", - docOpen: "fa fa-file-o", - folder: "fa fa-folder-o", - folderOpen: "fa fa-folder-open-o" - }, - "bootstrap3": { - checkbox: "glyphicon glyphicon-unchecked", - checkboxSelected: "glyphicon glyphicon-check", - checkboxUnknown: "glyphicon glyphicon-expand", - radio: "glyphicon glyphicon-remove-circle", - radioSelected: "glyphicon glyphicon-ok-circle", - radioUnknown: "glyphicon glyphicon-ban-circle", - dragHelper: "glyphicon glyphicon-play", - dropMarker: "glyphicon glyphicon-arrow-right", - error: "glyphicon glyphicon-warning-sign", - expanderClosed: "glyphicon glyphicon-menu-right", // glyphicon-plus-sign - expanderLazy: "glyphicon glyphicon-menu-right", // glyphicon-plus-sign - expanderOpen: "glyphicon glyphicon-menu-down", // glyphicon-minus-sign - loading: "glyphicon glyphicon-refresh glyphicon-spin", - nodata: "glyphicon glyphicon-info-sign", - noExpander: "", - // Default node icons. - // (Use tree.options.icon callback to define custom icons based on node data) - doc: "glyphicon glyphicon-file", - docOpen: "glyphicon glyphicon-file", - folder: "glyphicon glyphicon-folder-close", - folderOpen: "glyphicon glyphicon-folder-open" - } + "awesome3": { // Outdated! + _addClass: "", + checkbox: "icon-check-empty", + checkboxSelected: "icon-check", + checkboxUnknown: "icon-check icon-muted", + dragHelper: "icon-caret-right", + dropMarker: "icon-caret-right", + error: "icon-exclamation-sign", + expanderClosed: "icon-caret-right", + expanderLazy: "icon-angle-right", + expanderOpen: "icon-caret-down", + loading: "icon-refresh icon-spin", + nodata: "icon-meh", + noExpander: "", + radio: "icon-circle-blank", + radioSelected: "icon-circle", + // radioUnknown: "icon-circle icon-muted", + // Default node icons. + // (Use tree.options.icon callback to define custom icons based on node data) + doc: "icon-file-alt", + docOpen: "icon-file-alt", + folder: "icon-folder-close-alt", + folderOpen: "icon-folder-open-alt" + }, + "awesome4": { + _addClass: "fa", + checkbox: "fa-square-o", + checkboxSelected: "fa-check-square-o", + checkboxUnknown: "fa-square", + dragHelper: "fa-arrow-right", + dropMarker: "fa-long-arrow-right", + error: "fa-warning", + expanderClosed: "fa-caret-right", + expanderLazy: "fa-angle-right", + expanderOpen: "fa-caret-down", + loading: "fa-spinner fa-pulse", + nodata: "fa-meh-o", + noExpander: "", + radio: "fa-circle-thin", // "fa-circle-o" + radioSelected: "fa-circle", + // radioUnknown: "fa-dot-circle-o", + // Default node icons. + // (Use tree.options.icon callback to define custom icons based on node data) + doc: "fa-file-o", + docOpen: "fa-file-o", + folder: "fa-folder-o", + folderOpen: "fa-folder-open-o" + }, + "bootstrap3": { + _addClass: "glyphicon", + checkbox: "glyphicon-unchecked", + checkboxSelected: "glyphicon-check", + checkboxUnknown: "glyphicon-expand", // "glyphicon-share", + dragHelper: "glyphicon-play", + dropMarker: "glyphicon-arrow-right", + error: "glyphicon-warning-sign", + expanderClosed: "glyphicon-menu-right", // glyphicon-plus-sign + expanderLazy: "glyphicon-menu-right", // glyphicon-plus-sign + expanderOpen: "glyphicon-menu-down", // glyphicon-minus-sign + loading: "glyphicon-refresh glyphicon-spin", + nodata: "glyphicon-info-sign", + noExpander: "", + radio: "glyphicon-remove-circle", // "glyphicon-unchecked", + radioSelected: "glyphicon-ok-circle", // "glyphicon-check", + // radioUnknown: "glyphicon-ban-circle", + // Default node icons. + // (Use tree.options.icon callback to define custom icons based on node data) + doc: "glyphicon-file", + docOpen: "glyphicon-file", + folder: "glyphicon-folder-close", + folderOpen: "glyphicon-folder-open" + }, + "material": { + _addClass: "material-icons", + checkbox: { text: "check_box_outline_blank" }, + checkboxSelected: { text: "check_box" }, + checkboxUnknown: { text: "indeterminate_check_box" }, + dragHelper: { text: "play_arrow" }, + dropMarker: { text: "arrow-forward" }, + error: { text: "warning" }, + expanderClosed: { text: "chevron_right" }, + expanderLazy: { text: "last_page" }, + expanderOpen: { text: "expand_more" }, + loading: { text: "autorenew", addClass: "glyphicon-spin" }, + nodata: { text: "info" }, + noExpander: { text: "" }, + radio: { text: "radio_button_unchecked" }, + radioSelected: { text: "radio_button_checked" }, + // Default node icons. + // (Use tree.options.icon callback to define custom icons based on node data) + doc: { text: "insert_drive_file" }, + docOpen: { text: "insert_drive_file" }, + folder: { text: "folder" }, + folderOpen: { text: "folder_open" } + } }; -function _getIcon(opts, type){ - return opts.map[type]; +function setIcon( span, baseClass, opts, type ) { + var map = opts.map, + icon = map[ type ], + $span = $( span ), + setClass = baseClass + " " + (map._addClass || ""); + + if( typeof icon === "string" ) { + $span.attr( "class", setClass + " " + icon ); + } else { + if( icon.text ) { + $span.text( "" + icon.text ); + } + $span.attr( "class", setClass + " " + ( icon.addClass || "" ) ); + } } $.ui.fancytree.registerExtension({ name: "glyph", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { - preset: null, // 'awesome3', 'awesome4', 'bootstrap3' + preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material' map: { } }, @@ -10532,11 +10756,10 @@ $.ui.fancytree.registerExtension({ tree.$container.addClass("fancytree-ext-glyph"); }, nodeRenderStatus: function(ctx) { - var checkbox, className, icon, res, span, + var checkbox, icon, res, span, node = ctx.node, - $span = $(node.span), - opts = ctx.options.glyph, - map = opts.map; + $span = $( node.span ), + opts = ctx.options.glyph; res = this._super(ctx); @@ -10556,7 +10779,8 @@ $.ui.fancytree.registerExtension({ }else{ icon = "noExpander"; } - span.className = "fancytree-expander " + map[icon]; + // span.className = "fancytree-expander " + map[icon]; + setIcon( span, "fancytree-expander", opts, icon ); } if( node.tr ){ @@ -10564,17 +10788,15 @@ $.ui.fancytree.registerExtension({ }else{ span = $span.children("span.fancytree-checkbox").get(0); } - if( span ){ - checkbox = FT.evalOption("checkbox", node, node, ctx.options, false); - if( checkbox && !node.isStatusNode() ) { - className = "fancytree-checkbox "; - if( checkbox === "radio" || (node.parent && node.parent.radiogroup) ) { - className += "fancytree-radio "; - icon = node.selected ? "radioSelected" : (node.partsel ? "radioUnknown" : "radio"); - } else { - icon = node.selected ? "checkboxSelected" : (node.partsel ? "checkboxUnknown" : "checkbox"); - } - span.className = className + map[icon]; + if( span ) { + checkbox = FT.evalOption("checkbox", node, node, opts, false); + if( (node.parent && node.parent.radiogroup ) || checkbox === "radio" ) { + icon = node.selected ? "radioSelected" : "radio"; + setIcon( span, "fancytree-checkbox fancytree-radio", opts, icon ); + } else { + icon = node.selected ? "checkboxSelected" : (node.partsel ? "checkboxUnknown" : "checkbox"); + // span.className = "fancytree-checkbox " + map[icon]; + setIcon( span, "fancytree-checkbox", opts, icon ); } } @@ -10583,13 +10805,13 @@ $.ui.fancytree.registerExtension({ span = $span.children("span.fancytree-icon").get(0); if( span ){ if( node.statusNodeType ){ - icon = _getIcon(opts, node.statusNodeType); // loading, error + icon = node.statusNodeType; // loading, error }else if( node.folder ){ - icon = node.expanded && node.hasChildren() ? _getIcon(opts, "folderOpen") : _getIcon(opts, "folder"); + icon = ( node.expanded && node.hasChildren() ) ? "folderOpen" : "folder"; }else{ - icon = node.expanded ? _getIcon(opts, "docOpen") : _getIcon(opts, "doc"); + icon = node.expanded ? "docOpen" : "doc"; } - span.className = "fancytree-icon " + icon; + setIcon( span, "fancytree-icon", opts, icon ); } return res; }, @@ -10604,13 +10826,13 @@ $.ui.fancytree.registerExtension({ if(node.parent){ span = $("span.fancytree-expander", node.span).get(0); if( span ) { - span.className = "fancytree-expander " + _getIcon(opts, status); + setIcon( span, "fancytree-expander", opts, status ); } }else{ // span = $(".fancytree-statusnode-" + status, node[this.nodeContainerAttrName]) .find("span.fancytree-icon").get(0); if( span ) { - span.className = "fancytree-icon " + _getIcon(opts, status); + setIcon( span, "fancytree-icon", opts, status ); } } } @@ -10633,8 +10855,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -10647,7 +10869,7 @@ return $.ui.fancytree; ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree.table"); // core + table + require("./jquery.fancytree.table"); // core + table module.exports = factory(require("jquery")); } else { // Browser globals @@ -10757,7 +10979,7 @@ function findNeighbourTd($target, keyCode){ */ $.ui.fancytree.registerExtension({ name: "gridnav", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { autofocusInput: false, // Focus first embedded input if node gets activated @@ -10859,8 +11081,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -10869,7 +11091,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -10884,7 +11106,17 @@ return $.ui.fancytree; /******************************************************************************* * Private functions and variables */ -var cookieGetter, cookieRemover, cookieSetter, +var cookieStore = null, + localStorageStore = window.localStorage ? { + get: function(key){ return window.localStorage.getItem(key); }, + set: function(key, value){ window.localStorage.setItem(key, value); }, + remove: function(key){ window.localStorage.removeItem(key); } + } : null, + sessionStorageStore = window.sessionStorage ? { + get: function(key){ return window.sessionStorage.getItem(key); }, + set: function(key, value){ window.sessionStorage.setItem(key, value); }, + remove: function(key){ window.sessionStorage.removeItem(key); } + } : null, _assert = $.ui.fancytree.assert, ACTIVE = "active", EXPANDED = "expanded", @@ -10893,13 +11125,22 @@ var cookieGetter, cookieRemover, cookieSetter, if( typeof Cookies === "function" ) { // Assume https://github.com/js-cookie/js-cookie - cookieSetter = Cookies.set; - cookieGetter = Cookies.get; - cookieRemover = Cookies.remove; -} else { + cookieStore = { + get: Cookies.get, + set: function(key, value) { + Cookies.set(key, value, this.options.persist.cookie); + }, + remove: Cookies.remove + }; +} else if ( $ && typeof $.cookie === "function" ) { // Fall back to https://github.com/carhartl/jquery-cookie - cookieSetter = cookieGetter = $.cookie; - cookieRemover = $.removeCookie; + cookieStore = { + get: $.cookie, + set: function(key, value) { + $.cookie.set(key, value, this.options.persist.cookie); + }, + remove: $.removeCookie + }; } /* Recursively load lazy nodes @@ -10958,14 +11199,14 @@ function _loadLazyNodes(tree, local, keyList, mode, dfd) { /** - * [ext-persist] Remove persistence cookies of the given type(s). + * [ext-persist] Remove persistence data of the given type(s). * Called like * $("#tree").fancytree("getTree").clearCookies("active expanded focus selected"); * - * @alias Fancytree#clearCookies + * @alias Fancytree#clearData * @requires jquery.fancytree.persist.js */ -$.ui.fancytree._FancytreeClass.prototype.clearCookies = function(types){ +$.ui.fancytree._FancytreeClass.prototype.clearData = function(types){ var local = this.ext.persist, prefix = local.cookiePrefix; @@ -10984,6 +11225,10 @@ $.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 'clearData()' instead."); + return this.clearData(types); +}; /** * [ext-persist] Return persistence information from cookies @@ -11013,7 +11258,7 @@ $.ui.fancytree._FancytreeClass.prototype.getPersistData = function(){ */ $.ui.fancytree.registerExtension({ name: "persist", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { cookieDelimiter: "~", @@ -11035,22 +11280,14 @@ $.ui.fancytree.registerExtension({ /* Generic read/write string data to cookie, sessionStorage or localStorage. */ _data: function(key, value){ - var ls = this._local.localStorage; // null, sessionStorage, or localStorage + var store = this._local.store; if( value === undefined ) { - return ls ? ls.getItem(key) : cookieGetter(key); + return store.get.call(this, key); } else if ( value === null ) { - if( ls ) { - ls.removeItem(key); - } else { - cookieRemover(key); - } + store.remove.call(this, key); } else { - if( ls ) { - ls.setItem(key, value); - } else { - cookieSetter(key, value, this.options.persist.cookie); - } + store.set.call(this, key, value); } }, @@ -11081,20 +11318,30 @@ $.ui.fancytree.registerExtension({ local = this._local, instOpts = this.options.persist; - // For 'auto' or 'cookie' mode, the cookie plugin must be available - _assert((instOpts.store !== "auto" && instOpts.store !== "cookie") || cookieGetter, - "Missing required plugin for 'persist' extension: js.cookie.js or jquery.cookie.js"); + // // For 'auto' or 'cookie' mode, the cookie plugin must be available + // _assert((instOpts.store !== "auto" && instOpts.store !== "cookie") || cookieStore, + // "Missing required plugin for 'persist' extension: js.cookie.js or jquery.cookie.js"); local.cookiePrefix = instOpts.cookiePrefix || ("fancytree-" + tree._id + "-"); local.storeActive = instOpts.types.indexOf(ACTIVE) >= 0; local.storeExpanded = instOpts.types.indexOf(EXPANDED) >= 0; local.storeSelected = instOpts.types.indexOf(SELECTED) >= 0; local.storeFocus = instOpts.types.indexOf(FOCUS) >= 0; - if( instOpts.store === "cookie" || !window.localStorage ) { - local.localStorage = null; - } else { - local.localStorage = (instOpts.store === "local") ? window.localStorage : window.sessionStorage; + local.store = null; + + if( instOpts.store === "auto" ) { + instOpts.store = localStorageStore ? "local" : "cookie"; + } + if( $.isPlainObject(instOpts.store) ) { + local.store = instOpts.store; + } else if( instOpts.store === "cookie" ) { + local.store = cookieStore; + } else if( instOpts.store === "local" ){ + local.store = (instOpts.store === "local") ? localStorageStore : sessionStorageStore; + } else if( instOpts.store === "session" ){ + local.store = (instOpts.store === "local") ? localStorageStore : sessionStorageStore; } + _assert(local.store, "Need a valid store."); // Bind init-handler to apply cookie state tree.$div.on("fancytreeinit", function(event){ @@ -11263,8 +11510,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -11273,7 +11520,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -11355,7 +11602,7 @@ function findPrevRowNode(node){ $.ui.fancytree.registerExtension({ name: "table", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { checkboxColumnIdx: null, // render the checkboxes into the this column index (default: nodeColumnIdx) @@ -11390,8 +11637,16 @@ $.ui.fancytree.registerExtension({ } $table.addClass("fancytree-container fancytree-ext-table"); - tree.tbody = $table.find(">tbody")[0]; - $tbody = $(tree.tbody); + $tbody = $table.find(">tbody"); + if( !$tbody.length ) { + // TODO: not sure if we can rely on browsers to insert missing before s: + if( $table.find(">tr").length ) { + $.error("Expected table > tbody > tr. If you see this please open an issue."); + } + $tbody = $("").appendTo($table); + } + + tree.tbody = $tbody[0]; // Prepare row templates: // Determine column count from table header if any @@ -11728,8 +11983,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -11738,7 +11993,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -11754,7 +12009,7 @@ return $.ui.fancytree; */ $.ui.fancytree.registerExtension({ name: "themeroller", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { activeClass: "ui-state-active", // Class added to active node @@ -11840,8 +12095,8 @@ return $.ui.fancytree; * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * - * @version 2.26.0 - * @date 2017-11-04T17:52:53Z + * @version 2.27.0 + * @date 2017-12-16T09:14:27Z */ ;(function( factory ) { @@ -11850,7 +12105,7 @@ return $.ui.fancytree; define( [ "jquery", "./jquery.fancytree" ], factory ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS - require("jquery.fancytree"); + require("./jquery.fancytree"); module.exports = factory(require("jquery")); } else { // Browser globals @@ -11916,7 +12171,7 @@ function renderLevelCss(containerId, depth, levelOfs, lineOfs, labelOfs, measure // 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 + " ul.fancytree-animating span.fancytree-title " + // #716 + "#" + containerId + " li.fancytree-animating span.fancytree-title " + // #716 "{ padding-left: " + labelOfs + measureUnit + "; position: static; width: auto; }"); return rules.join("\n"); } @@ -11954,7 +12209,7 @@ function renderLevelCss(containerId, depth, levelOfs, lineOfs, labelOfs, measure */ $.ui.fancytree.registerExtension({ name: "wide", - version: "2.26.0", + version: "2.27.0", // Default options for this extension. options: { iconWidth: null, // Adjust this if @fancy-icon-width != "16px" diff --git a/dist/jquery.fancytree-all-deps.min.js b/dist/jquery.fancytree-all-deps.min.js index d494f4bd..e272ea3a 100644 --- a/dist/jquery.fancytree-all-deps.min.js +++ b/dist/jquery.fancytree-all-deps.min.js @@ -1,33 +1,2 @@ -/*! jQuery Fancytree Plugin - 2.26.0 - 2017-11-04T17:52:53Z - * https://github.com/mar10/fancytree - * Copyright (c) 2017 Martin Wendt; Licensed MIT - */ -/*! jQuery UI - v1.12.1 - 2017-02-23 -* http://jqueryui.com -* Includes: widget.js, position.js, keycode.js, scroll-parent.js, unique-id.js, effect.js, effects/effect-blind.js -* Copyright jQuery Foundation and other contributors; Licensed MIT */ -!function(a){a.ui=a.ui||{};var b=(a.ui.version="1.12.1",0),c=Array.prototype.slice;a.cleanData=function(b){return function(c){var d,e,f;for(f=0;null!=(e=c[f]);f++)try{d=a._data(e,"events"),d&&d.remove&&a(e).triggerHandler("remove")}catch(g){}b(c)}}(a.cleanData),a.widget=function(b,c,d){var e,f,g,h={},i=b.split(".")[0];b=b.split(".")[1];var j=i+"-"+b;return d||(d=c,c=a.Widget),a.isArray(d)&&(d=a.extend.apply(null,[{}].concat(d))),a.expr[":"][j.toLowerCase()]=function(b){return!!a.data(b,j)},a[i]=a[i]||{},e=a[i][b],f=a[i][b]=function(a,b){return this._createWidget?void(arguments.length&&this._createWidget(a,b)):new f(a,b)},a.extend(f,e,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),g=new c,g.options=a.widget.extend({},g.options),a.each(d,function(b,d){return a.isFunction(d)?void(h[b]=function(){function a(){return c.prototype[b].apply(this,arguments)}function e(a){return c.prototype[b].apply(this,a)}return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}()):void(h[b]=d)}),f.prototype=a.widget.extend(g,{widgetEventPrefix:e?g.widgetEventPrefix||b:b},h,{constructor:f,namespace:i,widgetName:b,widgetFullName:j}),e?(a.each(e._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,f,c._proto)}),delete e._childConstructors):c._childConstructors.push(f),a.widget.bridge(b,f),f},a.widget.extend=function(b){for(var d,e,f=c.call(arguments,1),g=0,h=f.length;g",options:{classes:{},disabled:!1,create:null},_createWidget:function(c,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=b++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=a(),this.hoverable=a(),this.focusable=a(),this.classesElementLookup={},d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this.options=a.widget.extend({},this.options,this._getCreateOptions(),c),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){var b=this;this._destroy(),a.each(this.classesElementLookup,function(a,c){b._removeClass(c,a)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:a.noop,widget:function(){return this.element},option:function(b,c){var d,e,f,g=b;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof b)if(g={},d=b.split("."),b=d.shift(),d.length){for(e=g[b]=a.widget.extend({},this.options[b]),f=0;f
"),f=d.children()[0];return a("body").append(d),b=f.offsetWidth,d.css("overflow","scroll"),c=f.offsetWidth,b===c&&(c=d[0].clientWidth),d.remove(),e=b-c},getScrollInfo:function(b){var c=b.isWindow||b.isDocument?"":b.element.css("overflow-x"),d=b.isWindow||b.isDocument?"":b.element.css("overflow-y"),e="scroll"===c||"auto"===c&&b.width0?"right":"center",vertical:h<0?"top":d>0?"bottom":"middle"};nf(g(d),g(h))?l.important="horizontal":l.important="vertical",e.using.call(this,a,l)}),i.offset(a.extend(z,{using:h}))})},a.ui.position={fit:{left:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollLeft:d.offset.left,g=d.width,h=a.left-b.collisionPosition.marginLeft,i=e-h,j=h+b.collisionWidth-g-e;b.collisionWidth>g?i>0&&j<=0?(c=a.left+i+b.collisionWidth-g-e,a.left+=i-c):j>0&&i<=0?a.left=e:i>j?a.left=e+g-b.collisionWidth:a.left=e:i>0?a.left+=i:j>0?a.left-=j:a.left=f(a.left-h,a.left)},top:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollTop:d.offset.top,g=b.within.height,h=a.top-b.collisionPosition.marginTop,i=e-h,j=h+b.collisionHeight-g-e;b.collisionHeight>g?i>0&&j<=0?(c=a.top+i+b.collisionHeight-g-e,a.top+=i-c):j>0&&i<=0?a.top=e:i>j?a.top=e+g-b.collisionHeight:a.top=e:i>0?a.top+=i:j>0?a.top-=j:a.top=f(a.top-h,a.top)}},flip:{left:function(a,b){var c,d,e=b.within,f=e.offset.left+e.scrollLeft,h=e.width,i=e.isWindow?e.scrollLeft:e.offset.left,j=a.left-b.collisionPosition.marginLeft,k=j-i,l=j+b.collisionWidth-h-i,m="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,n="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,o=-2*b.offset[0];k<0?(c=a.left+m+n+o+b.collisionWidth-h-f,(c<0||c0&&(d=a.left-b.collisionPosition.marginLeft+m+n+o-i,(d>0||g(d)0&&(c=a.top-b.collisionPosition.marginTop+n+o+p-i,(c>0||g(c)a?0:d.max")[0],o=a.each;n.style.cssText="background-color:rgba(1,1,1,.5)",m.rgba=n.style.backgroundColor.indexOf("rgba")>-1,o(k,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),j.fn=a.extend(j.prototype,{parse:function(e,g,h,i){if(e===b)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=a(e).css(g),g=b);var l=this,m=a.type(e),n=this._rgba=[];return g!==b&&(e=[e,g,h,i],m="array"),"string"===m?this.parse(d(e)||f._default):"array"===m?(o(k.rgba.props,function(a,b){n[b.idx]=c(e[b.idx],b)}),this):"object"===m?(e instanceof j?o(k,function(a,b){e[b.cache]&&(l[b.cache]=e[b.cache].slice())}):o(k,function(b,d){var f=d.cache;o(d.props,function(a,b){if(!l[f]&&d.to){if("alpha"===a||null==e[a])return;l[f]=d.to(l._rgba)}l[f][b.idx]=c(e[a],b,!0)}),l[f]&&a.inArray(null,l[f].slice(0,3))<0&&(l[f][3]=1,d.from&&(l._rgba=d.from(l[f])))}),this):void 0},is:function(a){var b=j(a),c=!0,d=this;return o(k,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],o(e.props,function(a,b){if(null!=g[b.idx])return c=g[b.idx]===f[b.idx]})),c}),c},_space:function(){var a=[],b=this;return o(k,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var d=j(a),e=d._space(),f=k[e],g=0===this.alpha()?j("transparent"):this,h=g[f.cache]||f.to(g._rgba),i=h.slice();return d=d[f.cache],o(f.props,function(a,e){var f=e.idx,g=h[f],j=d[f],k=l[e.type]||{};null!==j&&(null===g?i[f]=j:(k.mod&&(j-g>k.mod/2?g+=k.mod:g-j>k.mod/2&&(g-=k.mod)),i[f]=c((j-g)*b+g,e)))}),this[e](i)},blend:function(b){if(1===this._rgba[3])return this;var c=this._rgba.slice(),d=c.pop(),e=j(b)._rgba;return j(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return null==a?b>2?1:0:a});return 1===c[3]&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return null==a&&(a=b>2?1:0),b&&b<3&&(a=Math.round(100*a)+"%"),a});return 1===c[3]&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(255*d)),"#"+a.map(c,function(a){return a=(a||0).toString(16),1===a.length?"0"+a:a}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),j.fn.parse.prototype=j.fn,k.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b,c,d=a[0]/255,e=a[1]/255,f=a[2]/255,g=a[3],h=Math.max(d,e,f),i=Math.min(d,e,f),j=h-i,k=h+i,l=.5*k;return b=i===h?0:d===h?60*(e-f)/j+360:e===h?60*(f-d)/j+120:60*(d-e)/j+240,c=0===j?0:l<=.5?j/k:j/(2-k),[Math.round(b)%360,c,l,null==g?1:g]},k.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],f=a[3],g=d<=.5?d*(1+c):d+c-d*c,h=2*d-g;return[Math.round(255*e(h,g,b+1/3)),Math.round(255*e(h,g,b)),Math.round(255*e(h,g,b-1/3)),f]},o(k,function(d,e){var f=e.props,g=e.cache,i=e.to,k=e.from;j.fn[d]=function(d){if(i&&!this[g]&&(this[g]=i(this._rgba)),d===b)return this[g].slice();var e,h=a.type(d),l="array"===h||"object"===h?d:arguments,m=this[g].slice();return o(f,function(a,b){var d=l["object"===h?a:b.idx];null==d&&(d=m[b.idx]),m[b.idx]=c(d,b)}),k?(e=j(k(m)),e[g]=m,e):j(m)},o(f,function(b,c){j.fn[b]||(j.fn[b]=function(e){var f,g=a.type(e),i="alpha"===b?this._hsla?"hsla":"rgba":d,j=this[i](),k=j[c.idx];return"undefined"===g?k:("function"===g&&(e=e.call(this,k),g=a.type(e)),null==e&&c.empty?this:("string"===g&&(f=h.exec(e),f&&(e=k+parseFloat(f[2])*("+"===f[1]?1:-1))),j[c.idx]=e,this[i](j)))})})}),j.hook=function(b){var c=b.split(" ");o(c,function(b,c){a.cssHooks[c]={set:function(b,e){var f,g,h="";if("transparent"!==e&&("string"!==a.type(e)||(f=d(e)))){if(e=j(f||e),!m.rgba&&1!==e._rgba[3]){for(g="backgroundColor"===c?b.parentNode:b;(""===h||"transparent"===h)&&g&&g.style;)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(i){}e=e.blend(h&&"transparent"!==h?h:"_default")}e=e.toRgbaString()}try{b.style[c]=e}catch(i){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=j(b.elem,c),b.end=j(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},j.hook(g),a.cssHooks.borderColor={expand:function(a){var b={};return o(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},f=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(g),function(){function b(b){var c,d,e=b.ownerDocument.defaultView?b.ownerDocument.defaultView.getComputedStyle(b,null):b.currentStyle,f={};if(e&&e.length&&e[0]&&e[e[0]])for(d=e.length;d--;)c=e[d],"string"==typeof e[c]&&(f[a.camelCase(c)]=e[c]);else for(c in e)"string"==typeof e[c]&&(f[c]=e[c]);return f}function c(b,c){var d,f,g={};for(d in c)f=c[d],b[d]!==f&&(e[d]||!a.fx.step[d]&&isNaN(parseFloat(f))||(g[d]=f));return g}var d=["add","remove","toggle"],e={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(b,c){a.fx.step[c]=function(a){("none"!==a.end&&!a.setAttr||1===a.pos&&!a.setAttr)&&(g.style(a.elem,c,a.end),a.setAttr=!0)}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a.effects.animateClass=function(e,f,g,h){var i=a.speed(f,g,h);return this.queue(function(){var f,g=a(this),h=g.attr("class")||"",j=i.children?g.find("*").addBack():g;j=j.map(function(){var c=a(this);return{el:c,start:b(this)}}),f=function(){a.each(d,function(a,b){e[b]&&g[b+"Class"](e[b])})},f(),j=j.map(function(){return this.end=b(this.el[0]),this.diff=c(this.start,this.end),this}),g.attr("class",h),j=j.map(function(){var b=this,c=a.Deferred(),d=a.extend({},i,{queue:!1,complete:function(){c.resolve(b)}});return this.el.animate(this.diff,d),c.promise()}),a.when.apply(a,j.get()).done(function(){f(),a.each(arguments,function(){var b=this.el;a.each(this.diff,function(a){b.css(a,"")})}),i.complete.call(g[0])})})},a.fn.extend({addClass:function(b){return function(c,d,e,f){return d?a.effects.animateClass.call(this,{add:c},d,e,f):b.apply(this,arguments)}}(a.fn.addClass),removeClass:function(b){return function(c,d,e,f){return arguments.length>1?a.effects.animateClass.call(this,{remove:c},d,e,f):b.apply(this,arguments)}}(a.fn.removeClass),toggleClass:function(b){return function(c,d,e,f,g){return"boolean"==typeof d||void 0===d?e?a.effects.animateClass.call(this,d?{add:c}:{remove:c},e,f,g):b.apply(this,arguments):a.effects.animateClass.call(this,{toggle:c},d,e,f)}}(a.fn.toggleClass),switchClass:function(b,c,d,e,f){return a.effects.animateClass.call(this,{add:c,remove:b},d,e,f)}})}(),function(){function b(b,c,d,e){return a.isPlainObject(b)&&(c=b,b=b.effect),b={effect:b},null==c&&(c={}),a.isFunction(c)&&(e=c,d=null,c={}),("number"==typeof c||a.fx.speeds[c])&&(e=d,d=c,c={}),a.isFunction(d)&&(e=d,d=null),c&&a.extend(b,c),d=d||c.duration,b.duration=a.fx.off?0:"number"==typeof d?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,b.complete=e||c.complete,b}function c(b){return!(b&&"number"!=typeof b&&!a.fx.speeds[b])||("string"==typeof b&&!a.effects.effect[b]||(!!a.isFunction(b)||"object"==typeof b&&!b.effect))}function g(a,b){var c=b.outerWidth(),d=b.outerHeight(),e=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,f=e.exec(a)||["",0,c,d,0];return{top:parseFloat(f[1])||0,right:"auto"===f[2]?c:parseFloat(f[2]),bottom:"auto"===f[3]?d:parseFloat(f[3]),left:parseFloat(f[4])||0}}a.expr&&a.expr.filters&&a.expr.filters.animated&&(a.expr.filters.animated=function(b){return function(c){return!!a(c).data(f)||b(c)}}(a.expr.filters.animated)),a.uiBackCompat!==!1&&a.extend(a.effects,{save:function(a,b){for(var c=0,e=b.length;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;try{f.id}catch(g){f=document.body}return b.wrap(d),(b[0]===f||a.contains(b[0],f))&&a(f).trigger("focus"),d=b.parent(),"static"===b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),b.css(e),d.css(c).show()},removeWrapper:function(b){var c=document.activeElement;return b.parent().is(".ui-effects-wrapper")&&(b.parent().replaceWith(b),(b[0]===c||a.contains(b[0],c))&&a(c).trigger("focus")),b}}),a.extend(a.effects,{version:"1.12.1",define:function(b,c,d){return d||(d=c,c="effect"),a.effects.effect[b]=d,a.effects.effect[b].mode=c,d},scaledDimensions:function(a,b,c){if(0===b)return{height:0,width:0,outerHeight:0,outerWidth:0};var d="horizontal"!==c?(b||100)/100:1,e="vertical"!==c?(b||100)/100:1;return{height:a.height()*e,width:a.width()*d,outerHeight:a.outerHeight()*e,outerWidth:a.outerWidth()*d}},clipToBox:function(a){return{width:a.clip.right-a.clip.left,height:a.clip.bottom-a.clip.top,left:a.clip.left,top:a.clip.top}},unshift:function(a,b,c){var d=a.queue();b>1&&d.splice.apply(d,[1,0].concat(d.splice(b,c))),a.dequeue()},saveStyle:function(a){a.data(e,a[0].style.cssText)},restoreStyle:function(a){a[0].style.cssText=a.data(e)||"",a.removeData(e)},mode:function(a,b){var c=a.is(":hidden");return"toggle"===b&&(b=c?"show":"hide"),(c?"hide"===b:"show"===b)&&(b="none"),b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createPlaceholder:function(b){var c,e=b.css("position"),f=b.position();return b.css({marginTop:b.css("marginTop"),marginBottom:b.css("marginBottom"),marginLeft:b.css("marginLeft"),marginRight:b.css("marginRight")}).outerWidth(b.outerWidth()).outerHeight(b.outerHeight()),/^(static|relative)/.test(e)&&(e="absolute",c=a("<"+b[0].nodeName+">").insertAfter(b).css({display:/^(inline|ruby)/.test(b.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:b.css("marginTop"),marginBottom:b.css("marginBottom"),marginLeft:b.css("marginLeft"),marginRight:b.css("marginRight"),"float":b.css("float")}).outerWidth(b.outerWidth()).outerHeight(b.outerHeight()).addClass("ui-effects-placeholder"),b.data(d+"placeholder",c)),b.css({position:e,left:f.left,top:f.top}),c},removePlaceholder:function(a){var b=d+"placeholder",c=a.data(b);c&&(c.remove(),a.removeData(b))},cleanUp:function(b){a.effects.restoreStyle(b),a.effects.removePlaceholder(b)},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(){function c(b){function c(){i.removeData(f),a.effects.cleanUp(i),"hide"===d.mode&&i.hide(),h()}function h(){a.isFunction(j)&&j.call(i[0]),a.isFunction(b)&&b()}var i=a(this);d.mode=l.shift(),a.uiBackCompat===!1||g?"none"===d.mode?(i[k](),h()):e.call(i[0],d,c):(i.is(":hidden")?"hide"===k:"show"===k)?(i[k](),h()):e.call(i[0],d,h)}var d=b.apply(this,arguments),e=a.effects.effect[d.effect],g=e.mode,h=d.queue,i=h||"fx",j=d.complete,k=d.mode,l=[],m=function(b){var c=a(this),d=a.effects.mode(c,k)||g;c.data(f,!0),l.push(d),g&&("show"===d||d===g&&"hide"===d)&&c.show(),g&&"none"===d||a.effects.saveStyle(c),a.isFunction(b)&&b()};return a.fx.off||!e?k?this[k](d.duration,j):this.each(function(){j&&j.call(this)}):h===!1?this.each(m).each(c):this.queue(i,m).queue(i,c)},show:function(a){return function(d){if(c(d))return a.apply(this,arguments);var e=b.apply(this,arguments);return e.mode="show",this.effect.call(this,e)}}(a.fn.show),hide:function(a){return function(d){if(c(d))return a.apply(this,arguments);var e=b.apply(this,arguments);return e.mode="hide",this.effect.call(this,e)}}(a.fn.hide),toggle:function(a){return function(d){if(c(d)||"boolean"==typeof d)return a.apply(this,arguments);var e=b.apply(this,arguments);return e.mode="toggle",this.effect.call(this,e)}}(a.fn.toggle),cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d},cssClip:function(a){return a?this.css("clip","rect("+a.top+"px "+a.right+"px "+a.bottom+"px "+a.left+"px)"):g(this.css("clip"),this)},transfer:function(b,c){var d=a(this),e=a(b.to),f="fixed"===e.css("position"),g=a("body"),h=f?g.scrollTop():0,i=f?g.scrollLeft():0,j=e.offset(),k={top:j.top-h,left:j.left-i,height:e.innerHeight(),width:e.innerWidth()},l=d.offset(),m=a("
").appendTo("body").addClass(b.className).css({top:l.top-h,left:l.left-i,height:d.innerHeight(),width:d.innerWidth(),position:f?"fixed":"absolute"}).animate(k,b.duration,b.easing,function(){m.remove(),a.isFunction(c)&&c()})}}),a.fx.step.clip=function(b){b.clipInit||(b.start=a(b.elem).cssClip(),"string"==typeof b.end&&(b.end=g(b.end,b.elem)),b.clipInit=!0),a(b.elem).cssClip({top:b.pos*(b.end.top-b.start.top)+b.start.top,right:b.pos*(b.end.right-b.start.right)+b.start.right,bottom:b.pos*(b.end.bottom-b.start.bottom)+b.start.bottom,left:b.pos*(b.end.left-b.start.left)+b.start.left})}}(),function(){var b={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,c){b[c]=function(b){return Math.pow(b,a+2)}}),a.extend(b,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}),a.each(b,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(2*a)/2:1-c(a*-2+2)/2}})}();a.effects,a.effects.define("blind","hide",function(b,c){var d={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},e=a(this),f=b.direction||"up",g=e.cssClip(),h={clip:a.extend({},g)},i=a.effects.createPlaceholder(e);h.clip[d[f][0]]=h.clip[d[f][1]],"show"===b.mode&&(e.cssClip(h.clip),i&&i.css(a.effects.clipToBox(h)),h.clip=g),i&&i.animate(a.effects.clipToBox(h),b.duration,b.easing),e.animate(h,{queue:!1,duration:b.duration,easing:b.easing,complete:c})})}(jQuery),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree.ui-deps"],a):"object"==typeof module&&module.exports?(require("jquery.fancytree.ui-deps"),module.exports=a(require("jquery"))):a(jQuery)}(function(a){"use strict";function b(b,c){b||(c=c?": "+c:"",a.error("Fancytree assertion failed"+c))}function c(a,b){var c,d,e=window.console?window.console[a]:null;if(e)try{e.apply(window.console,b)}catch(f){for(d="",c=0;ch;return!0}function f(a,b,c,d,e){var f=function(){var c=b[a],f=d[a],g=b.ext[e],h=function(){return c.apply(b,arguments)},i=function(a){return c.apply(b,a)};return function(){var a=b._local,c=b._super,d=b._superApply;try{return b._local=g,b._super=h,b._superApply=i,f.apply(b,arguments)}finally{b._local=a,b._super=c,b._superApply=d}}}();return f}function g(b,c,d,e){for(var g in d)"function"==typeof d[g]?"function"==typeof b[g]?b[g]=f(g,b,c,d,e):"_"===g.charAt(0)?b.ext[e][g]=f(g,b,c,d,e):a.error("Could not override tree."+g+". Use prefix '_' to create tree."+e+"._"+g):"options"!==g&&(b.ext[e][g]=d[g])}function h(b,c){return void 0===b?a.Deferred(function(){this.resolve()}).promise():a.Deferred(function(){this.resolveWith(b,c)}).promise()}function i(b,c){return void 0===b?a.Deferred(function(){this.reject()}).promise():a.Deferred(function(){this.rejectWith(b,c)}).promise()}function j(a,b){return function(){a.resolveWith(b)}}function k(b){var c=a.extend({},b.data()),d=c.json;return delete c.fancytree,delete c.uiFancytree,d&&(delete c.json,c=a.extend(c,d)),c}function l(a){return(""+a).replace(v,function(a){return x[a]})}function m(a){return a=a.toLowerCase(),function(b){return b.title.toLowerCase().indexOf(a)>=0}}function n(a){var b=new RegExp("^"+a,"i");return function(a){return b.test(a.title)}}function o(c,d){var e,f,g,h;for(this.parent=c,this.tree=c.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},e=0,f=D.length;eul.fancytree-container").remove();var c,d={tree:this};this.rootNode=new o(d,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,c=a("
    ",{"class":"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=c,this.rootNode.ul=c[0],null==this.options.debugLevel&&(this.options.debugLevel=s.debugLevel)}if(a.ui&&a.ui.fancytree)return void a.ui.fancytree.warn("Fancytree: ignored duplicate include");var q,r,s=null,t=new RegExp(/\.|\//),u=/[&<>"'\/]/g,v=/[<>"'\/]/g,w="$recursive_request",x={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},y={16:!0,17:!0,18:!0},z={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},A={0:"",1:"left",2:"middle",3:"right"},B="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),C={},D="checkbox expanded extraClasses folder icon key lazy radiogroup refKey selected statusNodeType title tooltip unselectable unselectableIgnore unselectableStatus".split(" "),E={},F={},G={active:!0,children:!0,data:!0,focus:!0};for(q=0;q=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[g,0].concat(k))),h&&!d){for(e=0,f=k.length;e=0;d--)e=this.children[d],"paging"===e.statusNodeType&&this.removeChild(e);return void(this.partload=!1)}return b=a.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},b),this.partload=!0,this.addNode(b,c)},appendSibling:function(a){return this.addNode(a,"after")},applyPatch:function(b){if(null===b)return this.remove(),h(this);var c,d,e,f={children:!0,expanded:!0,parent:!0};for(c in b)e=b[c],f[c]||a.isFunction(e)||(E[c]?this[c]=e:this.data[c]=e);return b.hasOwnProperty("children")&&(this.removeChildren(),b.children&&this._setChildren(b.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),d=b.hasOwnProperty("expanded")?this.setExpanded(b.expanded):h(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(a,b,c){return a.addNode(this.toDict(!0,c),b)},countChildren:function(a){var b,c,d,e=this.children;if(!e)return 0;if(d=e.length,a!==!1)for(b=0,c=d;b=2&&(Array.prototype.unshift.call(arguments,this.toString()),c("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(a){var b=a?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(b,this)},findAll:function(b){b=a.isFunction(b)?b:m(b);var c=[];return this.visit(function(a){b(a)&&c.push(a)}),c},findFirst:function(b){b=a.isFunction(b)?b:m(b);var c=null;return this.visit(function(a){if(b(a))return c=a,!1}),c},_changeSelectStatusAttrs:function(a){var c=!1,d=this.tree.options,e=s.evalOption("unselectable",this,this,d,!1),f=s.evalOption("unselectableStatus",this,this,d,void 0);switch(e&&null!=f&&(a=f),a){case!1:c=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:c=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:c=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:b(!1,"invalid state: "+a)}return c&&this.renderStatus(),c},fixSelection3AfterClick:function(a){var b=this.isSelected();this.visit(function(a){a._changeSelectStatusAttrs(b)}),this.fixSelection3FromEndNodes(a)},fixSelection3FromEndNodes:function(a){function c(a){var b,e,f,g,h,i,j,k,l,m=a.children;if(m&&m.length){for(i=!0,j=!1,b=0,e=m.length;b=1&&(Array.prototype.unshift.call(arguments,this.toString()),c("info",arguments))},isActive:function(){return this.tree.activeNode===this},isChildOf:function(a){return this.parent&&this.parent===a},isDescendantOf:function(b){if(!b||b.tree!==this.tree)return!1;for(var c=this.parent;c;){if(c===b)return!0;c===c.parent&&a.error("Recursive parent link: "+c),c=c.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var a=this.parent;return!a||a.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var a=this.parent;return!a||a.children[a.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var a,b,c=this.getParentList(!1,!1);for(a=0,b=c.length;a=0;c--)e.push(g[c].setExpanded(!0,b));return a.when.apply(a,e).done(function(){j?d.scrollIntoView(i).done(function(){f.resolve(); -}):f.resolve()}),f.promise()},moveTo:function(c,d,e){void 0===d||"over"===d?d="child":"firstChild"===d&&(c.children&&c.children.length?(d="before",c=c.children[0]):d="child");var f,g=this.parent,h="child"===d?c:c.parent;if(this!==c){if(this.parent?h.isDescendantOf(this)&&a.error("Cannot move a node to its own descendant"):a.error("Cannot move system root"),h!==g&&g.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===h)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else f=a.inArray(this,this.parent.children),b(f>=0,"invalid source parent"),this.parent.children.splice(f,1);if(this.parent=h,h.hasChildren())switch(d){case"child":h.children.push(this);break;case"before":f=a.inArray(c,h.children),b(f>=0,"invalid target parent"),h.children.splice(f,0,this);break;case"after":f=a.inArray(c,h.children),b(f>=0,"invalid target parent"),h.children.splice(f+1,0,this);break;default:a.error("Invalid mode "+d)}else h.children=[this];e&&c.visit(e,!0),h===g?h.triggerModifyChild("move",this):h.triggerModifyChild("add",this),this.tree!==c.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(a){a.tree=c.tree},!0)),g.isDescendantOf(h)||g.render(),h.isDescendantOf(g)||h===g||h.render()}},navigate:function(b,c){function d(d){if(d){try{d.makeVisible({scrollIntoView:!1})}catch(e){}return a(d.span).is(":visible")?c===!1?d.setFocus():d.setActive():(d.debug("Navigate: skipping hidden node"),void d.navigate(b,c))}}var e,f,g,i=!0,j=a.ui.keyCode,k=null;switch(b){case j.BACKSPACE:this.parent&&this.parent.parent&&(g=d(this.parent));break;case j.HOME:this.tree.visit(function(b){if(a(b.span).is(":visible"))return g=d(b),!1});break;case j.END:this.tree.visit(function(b){a(b.span).is(":visible")&&(g=b)}),g&&(g=d(g));break;case j.LEFT:this.expanded?(this.setExpanded(!1),g=d(this)):this.parent&&this.parent.parent&&(g=d(this.parent));break;case j.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&(g=d(this.children[0])):(this.setExpanded(),g=d(this));break;case j.UP:for(k=this.getPrevSibling();k&&!a(k.span).is(":visible");)k=k.getPrevSibling();for(;k&&k.expanded&&k.children&&k.children.length;)k=k.children[k.children.length-1];!k&&this.parent&&this.parent.parent&&(k=this.parent),g=d(k);break;case j.DOWN:if(this.expanded&&this.children&&this.children.length)k=this.children[0];else for(f=this.getParentList(!1,!0),e=f.length-1;e>=0;e--){for(k=f[e].getNextSibling();k&&!a(k.span).is(":visible");)k=k.getNextSibling();if(k)break}g=d(k);break;default:i=!1}return g||h()},remove:function(){return this.parent.removeChild(this)},removeChild:function(a){return this.tree._callHook("nodeRemoveChild",this,a)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(a){return this.toggleClass(a,!1)},render:function(a,b){return this.tree._callHook("nodeRender",this,a,b)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(c){var d,e=this.parent,f=a.inArray(this,e.children),g=this;return b(this.isPagingNode(),"replaceWith() currently requires a paging status node"),d=this.tree._callHook("nodeLoadChildren",this,c),d.done(function(a){var b=g.children;for(q=0;qs+r-q&&(w=g+n-r+q,v&&(b(v.isRootNode()||a(v.span).is(":visible"),"topNode must be visible"),fd?1:-1},e.sort(a),b)for(c=0,d=e.length;c=0,c=void 0===c?!e:!!c)e||(k+=d+" ",i=!0);else for(;k.indexOf(" "+d+" ")>-1;)k=k.replace(" "+d+" "," ");return this.extraClasses=a.trim(k),i},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return""},triggerModifyChild:function(b,c,d){var e,f=this.tree.options.modifyChild;f&&(c&&c.parent!==this&&a.error("childNode "+c+" is not a child of "+this),e={node:this,tree:this.tree,operation:b,childNode:c||null},d&&a.extend(e,d),f({type:"modifyChild"},e))},triggerModify:function(a,b){this.parent.triggerModifyChild(a,this,b)},visit:function(a,b){var c,d,e=!0,f=this.children;if(b===!0&&(e=a(this),e===!1||"skip"===e))return e;if(f)for(c=0,d=f.length;c=2&&(Array.prototype.unshift.call(arguments,this.toString()),c("log",arguments))},enableUpdate:function(a){return a=a!==!1,!!this._enableUpdate==!!a?a:(this._enableUpdate=a,a?(this.debug("enableUpdate(true): redraw "),this.render()):this.debug("enableUpdate(false)..."),!a)},findAll:function(a){return this.rootNode.findAll(a)},findFirst:function(a){return this.rootNode.findFirst(a)},findNextNode:function(b,c,d){var e=null,f=c.parent.children,g=null,h=function(a,b,c){var d,e,f=a.children,g=f.length,i=f[b];if(i&&c(i)===!1)return!1;if(i&&i.children&&i.expanded&&h(i,0,c)===!1)return!1;for(d=b+1;d