Lines Matching +full:top +full:- +full:tech

6  * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
11 * @date 2023-02-01T20:52:50Z
21 define(["jquery", "./jquery.fancytree.ui-deps"], factory);
24 require("./jquery.fancytree.ui-deps");
95 109: "-",
112 173: "-",
116 189: "-",
140 // Top-level Fancytree attributes, that can be set by dict
143 // Top-level FancytreeNode attributes, that can be set by dict
149 // Mapping of lowercase -> real name (because HTML5 data-... attribute only supports lowercase)
269 * Deep-merge a list of objects (but replace array-type options).
274 * of ext-edit). Also `null` values are copied over and not skipped.
299 // Only deal with non-null/undefined values
306 // Prevent never-ending loop
446 // Evaluate 'data-NAME' attributes with special treatment for 'data-json'.
455 // <li data-json='...'> is already returned as object (http://api.jquery.com/data/#data-html5)
507 * Note: Also non-folders may have children.
692 // #708: Fast path -- don't render every child of root, just the new ones!
700 // Different first child -- recompute classes
704 // Different last child -- recompute classes
773 for (i = this.children.length - 1; i >= 0; i--) {
918 * @deprecated since 2014-02-16. Use resetLazy() instead.
922 "FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."
1036 * Fix selection status, after this node was (de)selected in multi-hier mode.
1054 * Fix selection status for multi-hier mode.
1055 * Only end-nodes are considered to update the descendants branch and parents.
1086 // the selection state of a node is not relevant; we need the end-nodes
1105 // eslint-disable-next-line no-nested-ternary
1112 // This is an end-node: simply report the status
1179 // eslint-disable-next-line no-nested-ternary
1246 /** Return the 0-based child index.
1253 /** Return the hierarchical child index (1-based, e.g. '3.2.4').
1266 s = ("0000000" + s).substr(-digits);
1290 ? this.children[this.children.length - 1]
1293 /** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... .
1315 for (i = 0, l = ac.length - 1; i < l; i++) {
1316 // up to length-2, so next(last) = null
1328 // TODO: return null for top-level nodes?
1331 /** Return an array of all parent nodes (top-down).
1383 return ac[i - 1];
1525 return !p || p.children[p.children.length - 1] === this;
1533 /** Return true if node is lazy and loaded. For non-lazy nodes always return true.
1551 /** Return true if node is partially selected (tri-state).
1592 /** Return true if this a top level node, i.e. a direct child of the (invisible) system root node.
1599 /** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false.
1640 * @deprecated since 2014-02-16: use load() instead.
1644 "FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."
1659 // _assert( forceReload || this.isUndefined(), "Pass forceReload=true to re-load a lazy node" );
1706 // Expand bottom-up, so only the top node is animated
1707 for (i = len - 1; i >= 0; i--) {
1829 // Handle cross-tree moves
1832 // _assert(false, "Cross-tree move is not yet implemented.");
1833 this.warn("Cross-tree moveTo is experimental!");
1840 // A collaposed node won't re-render children, so we have to remove it manually
1871 // In multi-hier mode, update the parents selection state
1876 // In multi-hier mode, update the parents selection state
1984 * @param {boolean} [force=false] re-render, even if html markup was already created
2048 * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad
2101 …"scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' inst…
2105 // For ext-table, we choose the nearest parent that has `position: relative`
2122 overflowY = $container.css("overflow-y");
2130 // #922 plain tree in a non-fixed-sized UL scrolls inside its parent
2149 // eslint-disable-next-line one-var
2157 topOfs = opts.scrollOfs.top || 0,
2174 nodeY = $(this.span).offset().top;
2176 topNode && topNode.span ? $(topNode.span).offset().top : 0;
2185 containerOffsetTop = $scrollParent.offset().top;
2187 $(this.span).offset().top - containerOffsetTop + scrollTop; // relative to scroll parent
2189 ? $(topNode.span).offset().top -
2195 $scrollParent.innerHeight() - $scrollParent[0].clientHeight
2197 containerHeight -= horzScrollbarHeight;
2203 newScrollTop = nodeY - topOfs;
2207 scrollTop + containerHeight - bottomOfs
2209 newScrollTop = nodeY + nodeHeight - containerHeight + bottomOfs;
2219 newScrollTop = topNodeY - topOfs;
2220 // this.debug(" scrollIntoView(), TOP newScrollTop=" + newScrollTop);
2249 * The `cell` option requires the ext-table and ext-ariagrid extensions.
2304 …* @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort…
2321 // eslint-disable-next-line no-nested-ternary
2322 return x === y ? 0 : x > y ? 1 : -1;
2425 while (curClasses.indexOf(" " + className + " ") > -1) {
2434 // this.info("-> toggleClass('" + value + "', " + flag + "): '" + this.extraClasses + "'");
2485 /** Call fn(node) for all child nodes in hierarchical order (depth-first).<br>
2520 * programmers to flood the server with requests ;-)
2565 /** Call fn(node) for all parent nodes, bottom-up, including invisible system root.<br>
2638 * @property {string} _ns Automatically generated unique tree namespace, e.g. ".fancytree-1".
2642 * @property {jQueryObject} $container Outer `<ul>` element (or `<table>` element for ext-table).
2656 * @property {object} viewport See ext-vieport. @since v2.31
2666 … "The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."
2671 … "The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."
2676 "The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."
2681 "The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10)."
2688 // allow to init tree.data.foo from <div data-foo=''>
2693 this._ns = ".fancytree-" + this._id; // append for namespaced events
2704 this.viewport = null; // ext-grid
2711 this.$div.find(">ul.fancytree-container").remove();
2726 id: "ft-id-" + this._id,
2727 class: "ui-fancytree fancytree-container fancytree-plain",
2736 // // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant
2737 // // #577: Allow to set tabindex to "0", "-1" and ""
2741 // this.$container.attr("DIR", "RTL").addClass("fancytree-rtl");
2743 // // this.$container.attr("DIR", null).removeClass("fancytree-rtl");
2748 // this.$container.attr("aria-multiselectable", true);
2754 /* Return a context object that can be re-used for _callHook().
2921 * - 'moveUp', 'moveDown'
2922 * - 'indent', 'outdent'
2923 * - 'remove'
2924 * - 'edit', 'addChild', 'addSibling': (reqires ext-edit extension)
2925 * - 'cut', 'copy', 'paste': (use an internal singleton 'clipboard')
2926 * - 'down', 'first', 'last', 'left', 'parent', 'right', 'up': navigate
2983 // Add, edit (requires ext-edit):
3050 "patchList must be an array of length-2-arrays"
3115 /** Temporarily suppress rendering to improve performance on bulk-updates.
3193 * and wrap-around at the end.
3406 /** Return the first top level node if any (not the invisible root node).
3484 // ae && $(ae).closest(".fancytree-container").length
3493 // this.$container.toggleClass("fancytree-treefocus", hasFocus);
3536 * Make sure that a node with a given ID is loaded, by traversing - and
3537 * loading - its parents. This method is meant for lazy hierarchies.
3665 // Collect distinct top-most lazy nodes in a map.
3666 // Note that we can use node.key to de-dupe entries, even if a custom matcher would
3668 // map[node.key] => {node: node, pathList: [list of remaining rest-paths]}
3733 // remainMap contains parent nodes, each with a list of relative sub-paths.
3746 // // matcher is used, because we cannot assume that a single segment-key is unique
3760 /** Re-fire beforeActivate, activate, and (optional) focus events.
3773 this.activeNode = null; // Force re-activating
3788 /**Render tree (i.e. create DOM elements for all top-level nodes).
3828 window.console.time(this + " - " + label);
3838 window.console.timeEnd(this + " - " + label);
3884 /** Call fn(node) for all nodes in hierarchical order (depth-first).
3893 /** Call fn(node) for all nodes in vertical order, top down (or bottom up).<br>
3901 * {start: First top node, reverse: false, includeSelf: true, includeHidden: false}
3956 /*jshint -W083 */
4004 node = children[idx - 1];
4008 // eslint-disable-next-line no-unmodified-loop-condition
4015 node = children[children.length - 1];
4113 // Make sure that clicks stop, otherwise <a href='#'> jumps to the top
4114 // if(event.target.localName === "a" && event.target.className === "fancytree-title"){
4181 // only detect plain ascii alpha-numerics. But we still need
4182 // to ignore modifier-only, whitespace, cursor-keys, etc.
4217 if (stamp - tree.lastQuicksearchTime > 500) {
4238 case "-":
4325 Math.random() * (delay[1] - delay[0]);
4349 // 2020-01-03: refactored.
4353 // So we mock-up a thenable that resolves synchronously:
4426 // - modify `ctx.response` in-place (and leave `ctx.result` undefined)
4428 // - return a replacement in `ctx.result`
4474 // (otherwise use existing data, which may have been modified in-place)
4774 …* <span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fanc…
4775 * <span class="fancytree-expander"></span>
4776 * <span class="fancytree-checkbox"></span> // only present in checkbox mode
4777 * <span class="fancytree-icon"></span>
4778 * <a href="#" class="fancytree-title"> Node 1 </a>
4788 * @param {boolean} [force=false] re-render, even if html markup was already created
4796 * - node was not yet rendered:
4798 * - node was rendered: exit fast
4799 * - children have been added
4800 * - children have been removed
4832 // Discard markup on force-mode, or if it is not linked to parent <ul>
4841 // May happen, when a top-level node was dropped over another
4868 node.span.className = "fancytree-node";
4902 // hide top UL, so we can use an animation to show it later
4938 for (i = 0, l = children.length - 1; i < l; i++) {
4965 // #486: successorLi is set, if we re-rendered (i.e. discarded)
5018 " class='fancytree-expander fancytree-expander-fixed'></span>"
5024 "<span " + role + " class='fancytree-expander'></span>"
5032 className = "fancytree-checkbox";
5037 className += " fancytree-radio";
5045 // 2015-11-16
5091 "' class='fancytree-icon'" +
5099 " class='fancytree-custom-icon " +
5110 " class='fancytree-custom-icon " +
5122 " class='fancytree-custom-icon " +
5135 " class='fancytree-icon'" +
5167 "<span class='fancytree-title'" +
5183 ctx.$title = $(">span.fancytree-title", node.span);
5220 // $(">span.fancytree-title", statusElem).attr("tabindex", "0");
5223 // $(">span.fancytree-title", statusElem).removeAttr("tabindex");
5234 $ariaElem.removeAttr("aria-expanded");
5236 $ariaElem.attr("aria-expanded", Boolean(node.expanded));
5273 $ariaElem.attr("aria-selected", true);
5276 $ariaElem.attr("aria-selected", false);
5339 // #1042: don't scroll between mousedown/-up when clicking an embedded link
5472 // Auto-collapse mode: collapse all siblings
5534 // Create required markup, but make sure the top UL is hidden, so we
5550 // The UI toggle() effect works with the ext-wide extension,
5563 // node.debug("fancytree-animating end: " + node.li.className);
5570 // The UI toggle() effect works with the ext-wide extension,
5584 .find(".ui-effects-placeholder")
5592 // node.debug("fancytree-animating end: " + node.li.className);
5691 $(node.span).find(".fancytree-title").focus();
5697 "aria-activedescendant",
5704 // $(node.span).find(".fancytree-title").focus();
5758 // Remember the user's intent, in case down -> up propagation prevents
5794 // multi-hierarchical selection mode
5962 tree.$div.find(">ul.fancytree-container").empty();
5967 /** Widget was created (called only once, even it re-initialized).
5975 this.$div.find(">ul.fancytree-container").remove();
5977 this.$source.removeClass("fancytree-helper-hidden");
5980 /** Widget was (re-)initialized.
5989 // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant
5990 // #577: Allow to set tabindex to "0", "-1" and ""
6003 tree.$container.addClass("fancytree-checkbox-auto-hide");
6008 .addClass("fancytree-rtl");
6012 .removeClass("fancytree-rtl");
6017 tree.$container.attr("aria-multiselectable", true);
6046 // but another `<ul class='fancytree-container'>` is appended
6050 .not(".fancytree-container")
6055 "ui-fancytree-source fancytree-helper-hidden"
6058 // allow to init tree.data.foo from <ul data-foo=''>
6101 $.error("Invalid data-type: " + type);
6167 this.$container.toggleClass("fancytree-treefocus", flag);
6208 "fancytree-checkbox-auto-hide",
6220 .removeClass("fancytree-rtl");
6224 .addClass("fancytree-rtl");
6260 tree.render(true, false); // force, not-deep
6337 scrollOfs: { top: 0, bottom: 0 }, property
6352 active: "fancytree-active",
6353 animating: "fancytree-animating",
6354 combinedExpanderPrefix: "fancytree-exp-",
6355 combinedIconPrefix: "fancytree-ico-",
6356 error: "fancytree-error",
6357 expanded: "fancytree-expanded",
6358 focused: "fancytree-focused",
6359 folder: "fancytree-folder",
6360 hasChildren: "fancytree-has-children",
6361 lastsib: "fancytree-lastsib",
6362 lazy: "fancytree-lazy",
6363 loading: "fancytree-loading",
6364 node: "fancytree-node",
6365 partload: "fancytree-partload",
6366 partsel: "fancytree-partsel",
6367 radio: "fancytree-radio",
6368 selected: "fancytree-selected",
6369 statusNodePrefix: "fancytree-statusnode-",
6370 unselectable: "fancytree-unselectable",
6383 "') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html"
6417 // issue #876: we want to replace custom array-options, not merge them
6444 // 2015-11-16
6457 // 2015-11-16
6470 // 2016-04-04
6471 opts.tabindex = opts.tabbable ? "0" : "-1";
6513 // -------------------------------------------------------------------------
6578 "table.fancytree-container > thead"
6593 "span.fancytree-title",
6595 // prevent mouse-drags to select text ranges
6784 // http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at
6825 // eslint-disable-next-line no-unused-expressions
6829 // eslint-disable-next-line no-unused-expressions
6867 * See http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at
6881 myParts = /(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(
6884 atParts = /(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(
6918 // See http://jsperf.com/test-for-classname/2
6919 if (/\bfancytree-title\b/.test(tcn)) {
6921 } else if (/\bfancytree-expander\b/.test(tcn)) {
6926 // }else if( /\bfancytree-checkbox\b/.test(tcn) || /\bfancytree-radio\b/.test(tcn) ){
6927 } else if (/\bfancytree-checkbox\b/.test(tcn)) {
6929 } else if (/\bfancytree(-custom)?-icon\b/.test(tcn)) {
6931 } else if (/\bfancytree-node\b/.test(tcn)) {
6941 } else if ($target.closest(".fancytree-title").length) {
6944 } else if ($target.closest(".fancytree-checkbox").length) {
6947 } else if ($target.closest(".fancytree-expander").length) {
6989 * $.ui.fancytree.getTree(event); // Get tree for this mouse- or keyboard event
7006 el = $(".fancytree-container").eq(el); // el was an integer: return nth instance
7009 el = $("#ft-id-" + orgEl).eq(0);
7024 el = el.closest(":ui-fancytree");
7025 …widget = el.data("ui-fancytree") || el.data("fancytree"); // the latter is required by jQuery <= 1…
7114 * This is especially handy for switch-statements in event handlers.
7122 case "-":
7139 // Poor-man's hotkeys. See here for a complete implementation:
7289 // Translate hideCheckbox -> checkbox:false
7293 // Add <li data-NAME='...'> as node.data.NAME
7296 // #507: convert data-hidecheckbox (lower case) to hideCheckbox
7305 // #56: Allow to set special node.attributes from data-...
7314 // All other data-... goes to node.data...
7379 // See also the [live demo](https://wwWendt.de/tech/fancytree/demo/sample-ext-childcounter.html) of…
7392 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
7398 * @date 2023-02-01T20:52:50Z
7419 // Consider to use [strict mode](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/)
7422 // The [coding guidelines](http://contribute.jquery.org/style-guide/js/)
7426 /*eslint-disable no-unused-vars */
7429 // --------------
7452 * [ext-childcounter] Update counter badges for `node` and its parents.
7460 $badge = $("span.fancytree-childcounter", node.span),
7470 $badge = $("<span class='fancytree-childcounter'/>").appendTo(
7472 "span.fancytree-icon,span.fancytree-custom-icon",
7497 // ------------------------------
7499 …// enabled like so (see also the [live demo](https://wwWendt.de/tech/fancytree/demo/sample-ext-chi…
7546 …// with a `ctx` argument (see [EventData](https://wwWendt.de/tech/fancytree/doc/jsdoc/global.html#…
7552 …// See also the [complete list of available hook functions](https://wwWendt.de/tech/fancytree/doc/…
7566 this.$container.addClass("fancytree-ext-childcounter");
7594 "span.fancytree-icon,span.fancytree-custom-icon",
7597 $("<span class='fancytree-childcounter'/>").text(count)
7621 * Support faster lookup of nodes by key and shared ref-ids.
7624 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
7630 * @date 2023-02-01T20:52:50Z
7658 for (i = arr.length - 1; i >= 0; i--) {
7671 * @see http://github.com/garycourt/murmurhash-js
7678 * @return {number} 32-bit positive integer hash
7681 /*eslint-disable no-bitwise */
7685 bytes = key.length - remainder,
7758 return ("0000000" + (h1 >>> 0).toString(16)).substr(-8);
7761 /*eslint-enable no-bitwise */
7765 * Return a unique key for node by calculating the hash of the parents refKey-list.
7775 // 32-bit has a high probability of collisions, so we pump up to 64-bit
7785 * [ext-clones] Return a list of clone-nodes (i.e. same refKey) or null.
7820 * [ext-clones] Return true if this node has at least another clone with same refKey.
7833 * [ext-clones] Update key and/or refKey for an existing node.
7862 "[ext-clones] reRegister(" +
7906 * [ext-clones] Define a refKey for an existing node.
7919 * [ext-clones] Return all nodes with a given refKey (null if not found).
7953 * [ext-clones] Replace a refKey with a new one.
7986 highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers
7987 highlightClones: false, // set 'fancytree-clone' class on any node that has at least one clone
7996 this.$container.addClass("fancytree-ext-clones");
8105 $span.addClass("fancytree-clone");
8121 "fancytree-active-clone",
8136 * Drag-and-drop support (jQuery UI draggable/droppable).
8139 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
8145 * @date 2023-02-01T20:52:50Z
8153 "jquery-ui/ui/widgets/draggable",
8154 "jquery-ui/ui/widgets/droppable",
8172 classDropAccept = "fancytree-drop-accept",
8173 classDropAfter = "fancytree-drop-after",
8174 classDropBefore = "fancytree-drop-before",
8175 classDropOver = "fancytree-drop-over",
8176 classDropReject = "fancytree-drop-reject",
8177 classDropTarget = "fancytree-drop-target";
8179 /* Convert number to string and prepend +/-; return empty string for 0.*/
8181 // eslint-disable-next-line no-nested-ternary
8185 //--- Extend ui.draggable event handling --------------------------------------
8192 // Register proxy-functions for draggable.start/drag/stop
8196 // 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10
8198 $(this).data("ui-draggable") ||
8203 // Adjust helper offset, so cursor is slightly outside top/left corner
8204 draggable.offset.click.top = -2;
8222 // 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10
8224 $(this).data("ui-draggable") ||
8237 // 2. or if a non-fancytree element is dragged
8241 "div.fancytree-drag-helper,#fancytree-drop-marker"
8257 dropMarker: $("#fancytree-drop-marker"),
8310 // 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10:
8312 $(this).data("ui-draggable") ||
8383 scroll: true, // to disable, also set css 'position: inherit' on ul.fancytree-container
8405 "<div class='fancytree-drag-helper'><span class='fancytree-drag-helper-img' /></div>"
8407 .css({ zIndex: 3, position: "relative" }) // so it appears above ext-wide selection bar
8410 .find("span.fancytree-title")
8420 .find(".fancytree-drag-helper-img")
8427 // Allow to modify the helper, e.g. to add multi-node-drag feedback
8463 tree.debug("droppable - activate", event, ui, this);
8466 tree.debug("droppable - create", event, ui);
8469 tree.debug("droppable - deactivate", event, ui);
8472 tree.debug("droppable - drop", event, ui);
8475 tree.debug("droppable - out", event, ui);
8478 tree.debug("droppable - over", event, ui);
8505 …dropMarkerOffsetX: -24, // absolute position offset for .fancytree-drop-marker relatively to ..fan…
8506 … dropMarkerInsertOffsetX: -16, // additional offset for drop-marker with hitMode = "before"/"after"
8532 "Re-enable focus that was prevented by jQuery UI draggable."
8564 $targetTitle = $target.find("span.fancytree-title");
8568 "<div id='fancytree-drop-marker'></div>"
8571 .css({ "z-index": 1000 })
8589 markerAt = "top";
8604 pos.my = "right" + offsetString(-markerOffsetX) + " center";
8611 .toggleClass("fancytree-rtl", !!this.options.rtl)
8642 * A standard jQuery drag-and-drop process may generate these calls:
8664 // this.debug("tree.ext.dnd._onDragEvent(%s, %o, %o) - %o", eventName, node, otherNode, this);
8716 rect.left - parentRect.left
8718 draggable.originalPosition.top = Math.max(
8720 rect.top - parentRect.top
8723 $nodeTag.addClass("fancytree-drag-source");
8726 "keydown.fancytree-dnd,mousedown.fancytree-dnd",
8785 x: event.pageX - nodeOfs.left,
8786 y: event.pageY - nodeOfs.top,
8812 // Prevent no-ops like 'before source node'
8813 // TODO: these are no-ops when moving nodes, but not in copy mode
8850 …// this.debug("hitMode: %s - %s - %s", hitMode, (node.parent === otherNode), node.i…
8853 // Auto-expand node (only when 'over' the node, not 'before', or 'after')
8908 $nodeTag.removeClass("fancytree-drag-source");
8909 $(document).off(".fancytree-dnd");
8935 * Drag-and-drop support (native HTML5).
8938 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
8944 * @date 2023-02-01T20:52:50Z
8980 classDragSource = "fancytree-drag-source",
8981 classDragRemove = "fancytree-drag-remove",
8982 classDropAccept = "fancytree-drop-accept",
8983 classDropAfter = "fancytree-drop-after",
8984 classDropBefore = "fancytree-drop-before",
8985 classDropOver = "fancytree-drop-over",
8986 classDropReject = "fancytree-drop-reject",
8987 classDropTarget = "fancytree-drop-target",
8988 nodeMimeType = "application/x-fancytree-node",
9019 // Take this badge off of me - I can't use it anymore:
9026 /* Convert number to string and prepend +/-; return empty string for 0.*/
9028 // eslint-disable-next-line no-nested-ternary
9090 /* Implement auto scrolling when drag cursor is in top/bottom area of scroll parent. */
9104 if (spOfs.top + sp.offsetHeight - event.pageY < sensitivity) {
9106 sp.scrollHeight -
9107 tree.$scrollParent.innerHeight() -
9110 // + ", spOfs.top: " + spOfs.top
9119 } else if (scrollTop > 0 && event.pageY - spOfs.top < sensitivity) {
9120 sp.scrollTop = scrolled = scrollTop - speed;
9124 if (scrollTop > 0 && event.pageY - scrollTop < sensitivity) {
9125 scrolled = scrollTop - speed;
9128 $(window).height() - (event.pageY - scrollTop) <
9180 " - evalEffectModifiers(): " +
9182 " -> " +
9227 // " -> " +
9256 " -> " +
9293 // " -> " +
9323 * - Auto-scroll when cursor is in border regions
9324 * - Apply restrictioan like 'preventVoidMoves'
9325 * - Calculate hit mode
9326 * - Calculate drop effect
9327 * - Trigger dragOver() callback to let user modify hit mode and drop effect
9328 * - Adjust the drop marker accordingly
9333 // Implement auto-scrolling
9339 data.tree.warn("Ignored dragover for non-node"); //, event, data);
9355 $targetTitle = $target.find("span.fancytree-title");
9365 relPosY = (event.pageY - nodeOfs.top) / $target.height();
9389 // Prevent no-ops like 'before source node'
9390 // TODO: these are no-ops when moving nodes, but not in copy mode
9434 markerAt = "top";
9449 pos.my = "right" + offsetString(-markerOffsetX) + " center";
9508 tree.info("Ignored dragstart on a non-node.");
9552 "Could not set data (IE only accepts 'text') - " + ex
9591 $dragImage = $(node.span).find(".fancytree-title");
9598 // See https://kryogenix.org/code/browser/custom-drag-image.html
9603 "<span class='fancytree-childcounter'/>"
9605 .text("+" + (SOURCE_NODE_LIST.length - 1))
9610 dataTransfer.setDragImage($dragImage[0], -10, -10);
9688 "Ignore non-node " +
9709 node.debug("Reject dropping a non-node.");
9760 "Ignore non-node " +
9794 Date.now() - DRAG_OVER_STAMP > dndOpts.autoExpandMS &&
9811 "Ignore non-node " +
9843 ": getData('application/x-fancytree-node'): '" +
9926 /** [ext-dnd5] Return a Fancytree instance, from element, index, event, or jQueryObject.
9940 /** [ext-dnd5] Return the FancytreeNode that is currently being dragged.
9966 … dropMarkerInsertOffsetX: -16, // Additional offset for drop-marker with hitMode = "before"/"after"
9967 …dropMarkerOffsetX: -24, // Absolute position offset for .fancytree-drop-marker relatively to ..fan…
9980 scroll: true, // Enable auto-scrolling while dragging
9981 scrollSensitivity: 20, // Active top/bottom margin in pixel
10009 "dragStop is not used by ext-dnd5. Use dragEnd instead."
10039 this.$container.addClass("fancytree-ext-dnd5");
10048 $dropMarker = $("#fancytree-drop-marker");
10050 $dropMarker = $("<div id='fancytree-drop-marker'></div>")
10053 "z-index": 1000,
10055 "pointer-events": "none",
10066 $dropMarker.toggleClass("fancytree-rtl", !!opts.rtl);
10096 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
10102 * @date 2023-02-01T20:52:50Z
10130 * [ext-edit] Start inline editing of current node title.
10141 $title = $(".fancytree-title", node.span),
10147 "fancytree-edit-new"
10168 // Disable standard Fancytree mouse- and key handling
10176 // #116: ext-dnd prevents the blur event, so we have to catch outer clicks
10177 $(document).on("mousedown.fancytree-edit", function (event) {
10178 if (!$(event.target).hasClass("fancytree-edit-input")) {
10185 class: "fancytree-edit-input",
10205 $input.addClass("fancytree-edit-dirty");
10226 * [ext-edit] Stop inline editing.
10241 $title = $(".fancytree-title", node.span),
10242 $input = $title.find("input.fancytree-edit-input");
10263 // Allow to break (keep editor open), modify input, or re-define data.save
10279 $input.removeClass("fancytree-edit-dirty").off();
10280 // Unbind outer-click handler
10281 $(document).off(".fancytree-edit");
10302 // Re-enable mouse and keyboard handling
10317 * [ext-edit] Create a new child or sibling node and start edit mode.
10357 .removeClass("fancytree-hide")
10358 .addClass("fancytree-match");
10361 $(newNode[tree.statusClassPropName]).addClass("fancytree-edit-new");
10368 * [ext-edit] Check if any node in this tree in edit mode.
10379 * [ext-edit] Check if this node is in edit mode.
10421 .addClass("fancytree-ext-edit")
10424 // When scrolling, the TR may be re-used by another node, so the
10453 $(ctx.originalEvent.target).hasClass("fancytree-title")
10500 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
10506 * @date 2023-02-01T20:52:50Z
10533 return (str + "").replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
10565 (matchingIndices[matchingIndices.length - 1] || 0);
10615 …https://codereview.stackexchange.com/questions/23899/faster-javascript-fuzzy-string-matching-funct…
10616 // and http://www.quora.com/How-is-the-fuzzy-search-algorithm-in-Sublime-Text-designed
10617 // and http://www.dustindiaz.com/autocomplete-fuzzy-matching
10696 this.$div.addClass("fancytree-ext-filter");
10698 this.$div.addClass("fancytree-ext-filter-hide");
10700 this.$div.addClass("fancytree-ext-filter-dimm");
10703 "fancytree-ext-filter-hide-expanders",
10788 * [ext-filter] Dimm or hide nodes.
10803 …"Fancytree.filterNodes() leavesOnly option is deprecated since 2.9.0 / 2015-04-19. Use opts.leaves…
10810 * [ext-filter] Dimm or hide whole branches.
10826 * [ext-filter] Re-apply current filter.
10846 * [ext-filter] Reset the filter.
10868 $title = $(node.span).find(">span.fancytree-title");
10900 "fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"
10908 * [ext-filter] Return true if a filter is currently applied.
10920 * [ext-filter] Return true if this node is matched by current filter (or no filter is active).
10939 autoApply: true, // Re-apply last filter if lazy data is loaded
10983 $title = $(node.span).find("span.fancytree-title"),
10994 .toggleClass("fancytree-match", !!node.match)
10995 .toggleClass("fancytree-submatch", !!node.subMatchCount)
10997 "fancytree-hide",
11008 "<span class='fancytree-childcounter'/>"
11011 "span.fancytree-icon, span.fancytree-custom-icon",
11047 * Use glyph-fonts, ligature-fonts, or SVG icons instead of icon sprites.
11050 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
11056 * @date 2023-02-01T20:52:50Z
11083 checkbox: "icon-check-empty",
11084 checkboxSelected: "icon-check",
11085 checkboxUnknown: "icon-check icon-muted",
11086 dragHelper: "icon-caret-right",
11087 dropMarker: "icon-caret-right",
11088 error: "icon-exclamation-sign",
11089 expanderClosed: "icon-caret-right",
11090 expanderLazy: "icon-angle-right",
11091 expanderOpen: "icon-caret-down",
11092 loading: "icon-refresh icon-spin",
11093 nodata: "icon-meh",
11095 radio: "icon-circle-blank",
11096 radioSelected: "icon-circle",
11097 // radioUnknown: "icon-circle icon-muted",
11100 doc: "icon-file-alt",
11101 docOpen: "icon-file-alt",
11102 folder: "icon-folder-close-alt",
11103 folderOpen: "icon-folder-open-alt",
11107 checkbox: "fa-square-o",
11108 checkboxSelected: "fa-check-square-o",
11109 checkboxUnknown: "fa-square fancytree-helper-indeterminate-cb",
11110 dragHelper: "fa-arrow-right",
11111 dropMarker: "fa-long-arrow-right",
11112 error: "fa-warning",
11113 expanderClosed: "fa-caret-right",
11114 expanderLazy: "fa-angle-right",
11115 expanderOpen: "fa-caret-down",
11117 loading: { html: "<span class='fa fa-spinner fa-pulse' />" },
11118 nodata: "fa-meh-o",
11120 radio: "fa-circle-thin", // "fa-circle-o"
11121 radioSelected: "fa-circle",
11122 // radioUnknown: "fa-dot-circle-o",
11125 doc: "fa-file-o",
11126 docOpen: "fa-file-o",
11127 folder: "fa-folder-o",
11128 folderOpen: "fa-folder-open-o",
11135 checkbox: "far fa-square",
11136 checkboxSelected: "far fa-check-square",
11137 // checkboxUnknown: "far fa-window-close",
11139 "fas fa-square fancytree-helper-indeterminate-cb",
11140 radio: "far fa-circle",
11141 radioSelected: "fas fa-circle",
11142 radioUnknown: "far fa-dot-circle",
11143 dragHelper: "fas fa-arrow-right",
11144 dropMarker: "fas fa-long-arrow-alt-right",
11145 error: "fas fa-exclamation-triangle",
11146 expanderClosed: "fas fa-caret-right",
11147 expanderLazy: "fas fa-angle-right",
11148 expanderOpen: "fas fa-caret-down",
11149 loading: "fas fa-spinner fa-pulse",
11150 nodata: "far fa-meh",
11154 doc: "far fa-file",
11155 docOpen: "far fa-file",
11156 folder: "far fa-folder",
11157 folderOpen: "far fa-folder-open",
11161 checkbox: "glyphicon-unchecked",
11162 checkboxSelected: "glyphicon-check",
11164 "glyphicon-expand fancytree-helper-indeterminate-cb", // "glyphicon-share",
11165 dragHelper: "glyphicon-play",
11166 dropMarker: "glyphicon-arrow-right",
11167 error: "glyphicon-warning-sign",
11168 expanderClosed: "glyphicon-menu-right", // glyphicon-plus-sign
11169 expanderLazy: "glyphicon-menu-right", // glyphicon-plus-sign
11170 expanderOpen: "glyphicon-menu-down", // glyphicon-minus-sign
11171 loading: "glyphicon-refresh fancytree-helper-spin",
11172 nodata: "glyphicon-info-sign",
11174 radio: "glyphicon-remove-circle", // "glyphicon-unchecked",
11175 radioSelected: "glyphicon-ok-circle", // "glyphicon-check",
11176 // radioUnknown: "glyphicon-ban-circle",
11179 doc: "glyphicon-file",
11180 docOpen: "glyphicon-file",
11181 folder: "glyphicon-folder-close",
11182 folderOpen: "glyphicon-folder-open",
11185 _addClass: "material-icons",
11190 dropMarker: { text: "arrow-forward" },
11197 addClass: "fancytree-helper-spin",
11216 $counter = $span.find(".fancytree-childcounter"),
11223 // node.debug( "setIcon(" + baseClass + ", " + type + "): " + "oldIcon" + " -> " + icon );
11228 // var oldIcon = "fa-" + $span.data("icon");
11229 // // node.debug( "setIcon(" + baseClass + ", " + type + "): " + oldIcon + " -> " + icon );
11276 tree.warn("ext-glyph: missing `preset` option.");
11279 tree.$container.addClass("fancytree-ext-glyph");
11295 span = $span.children(".fancytree-expander").get(0);
11308 // span.className = "fancytree-expander " + map[icon];
11309 setIcon(node, span, "fancytree-expander", opts, icon);
11313 span = $("td", node.tr).find(".fancytree-checkbox").get(0);
11315 span = $span.children(".fancytree-checkbox").get(0);
11327 "fancytree-checkbox fancytree-radio",
11332 // eslint-disable-next-line no-nested-ternary
11338 // span.className = "fancytree-checkbox " + map[icon];
11339 setIcon(node, span, "fancytree-checkbox", opts, icon);
11343 // Standard icon (note that this does not match .fancytree-custom-icon,
11345 span = $span.children(".fancytree-icon").get(0);
11357 setIcon(node, span, "fancytree-icon", opts, icon);
11375 span = $(".fancytree-expander", node.span).get(0);
11377 setIcon(node, span, "fancytree-expander", opts, status);
11382 ".fancytree-statusnode-" + status,
11385 .find(".fancytree-icon")
11388 setIcon(node, span, "fancytree-icon", opts, status);
11405 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
11411 * @date 2023-02-01T20:52:50Z
11447 "select-one": [KC.LEFT, KC.RIGHT],
11448 "select-multiple": [KC.LEFT, KC.RIGHT],
11540 this.$container.addClass("fancytree-ext-gridnav");
11568 $(node.span).find("span.fancytree-title").focus();
11572 ctx.tree.$container.attr("tabindex", "-1");
11595 // ctx.tree.debug("ext-gridnav nodeKeydown", event, inputType);
11610 // ctx.tree.debug("ext-gridnav NOT HANDLED", event, inputType);
11624 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
11630 * @date 2023-02-01T20:52:50Z
11670 this.$container.addClass("fancytree-ext-multi");
11673 "Fancytree ext-multi: selectMode: 1 (single) is not compatible."
11693 // Select clicked node (radio-button mode)
11753 * @depends: js-cookie or jquery-cookie
11755 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
11761 * @date 2023-02-01T20:52:50Z
11828 // Assume https://github.com/js-cookie/js-cookie
11837 // Fall back to https://github.com/carhartl/jquery-cookie
11888 // All lazy-expands have finished
11890 // If we read new nodes from server, try to resolve yet-missing keys
11910 * [ext-persist] Remove persistence data of the given type(s).
11946 * [ext-persist] Return persistence information from cookies
11976 cookiePrefix: undefined, // 'fancytree-<treeId>-' by default
12037 instOpts.cookiePrefix || "fancytree-" + tree._id + "-";
12064 // Bind init-handler to apply cookie state
12087 // Also remove expand-cookies for unmatched nodes
12128 // only stored the selected *top* nodes
12161 $(node.span).find(".fancytree-title").focus();
12229 // In selectMode 3 we only store the the selected *top* nodes.
12230 // De-selecting a node may also de-select some parents, so we
12240 // beforeSelect can prevent the change - flag doesn't reflect the node.selected state
12257 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
12263 * @date 2023-02-01T20:52:50Z
12301 // currentFlag = node.hide ? false : flag; // fix for ext-filter
12322 prev = siblings[i - 1];
12326 last = prev.children[prev.children.length - 1];
12382 $table.addClass("fancytree-container fancytree-ext-table");
12429 .html("<span class='fancytree-node' />");
12454 // #489: make sure $container is set to <table>, even if ext-dnd is listed before ext-table
12464 // #577: Allow to set tabindex to "0", "-1" and ""
12466 // this.$container.attr("tabindex", opts.tabbable ? "0" : "-1");
12470 .attr("aria-readonly", true);
12567 // $(node.tr).attr("aria-labelledby", "ftal_" + opts.idPrefix + node.key);
12569 node.span = $("span.fancytree-node", node.tr).get(0);
12644 $cb = $("span.fancytree-checkbox", node.span); //.detach();
12667 .addClass("fancytree-status-merged")
12683 $(node.tr).removeClass("fancytree-node");
12685 indent = (node.getLevel() - 1) * opts.table.indentation;
12698 // Expanded state isn't changed - just call base implementation
12754 // Call base-expand with disabled events and animation
12781 this.$source.removeClass("fancytree-helper-hidden");
12804 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
12810 * @date 2023-02-01T20:52:50Z
12836 activeClass: "ui-state-active", // Class added to active node
12837 // activeClass: "ui-state-highlight",
12838 addClass: "ui-corner-all", // Class added to all nodes
12839 focusClass: "ui-state-focus", // Class added to focused node
12840 hoverClass: "ui-state-hover", // Class added to hovered node
12841 selectedClass: "ui-state-highlight", // Class added to selected nodes
12842 // selectedClass: "ui-state-active"
12852 $el.addClass("ui-widget ui-corner-all");
12853 $el.find(">thead tr").addClass("ui-widget-header");
12854 $el.find(">tbody").addClass("ui-widget-conent");
12856 $el.addClass("ui-widget ui-widget-content ui-corner-all");
12861 ".fancytree-node",
12876 "ui-widget ui-widget-content ui-corner-all"
12887 ….ui-state-highlight: Class to be applied to highlighted or selected elements. Applies "highlight" …
12888 ….ui-state-error: Class to be applied to error messaging container elements. Applies "error" contai…
12889 ….ui-state-error-text: An additional class that applies just the error text color without backgroun…
12891 ….ui-state-default: Class to be applied to clickable button-like elements. Applies "clickable defau…
12892 ….ui-state-hover: Class to be applied on mouseover to clickable button-like elements. Applies "clic…
12893 ….ui-state-focus: Class to be applied on keyboard focus to clickable button-like elements. Applies …
12894 ….ui-state-active: Class to be applied on mousedown to clickable button-like elements. Applies "cli…
12896 // Set ui-state-* class (handle the case that the same class is assigned
12914 // Additional classes (e.g. 'ui-corner-all')
12927 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
12933 * @date 2023-02-01T20:52:50Z
12951 var reNumUnit = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; // split "1.5em" to ["1.5", "em"]
12960 // // http://blog.jquery.com/2012/08/16/jquery-1-8-box-sizing-width-csswidth-and-outerwidth/
12962 // // 'Client width without scrollbar' - 'padding'
12963 // return $el[0].clientWidth - ($el.innerWidth() - parseFloat($el.css("width"), 10));
12968 id = "fancytree-style-" + id;
12978 .addClass("fancytree-style")
12985 // fix for IE 6-8
13001 prefix = "#" + containerId + " span.fancytree-level-",
13008 " span.fancytree-title { padding-left: " +
13015 // This breaks the left:0 and padding-left:nn settings of the title
13019 " div.ui-effects-wrapper ul li span.fancytree-title, " +
13022 " li.fancytree-animating span.fancytree-title " + // #716
13023 "{ padding-left: " +
13032 // * [ext-wide] Recalculate the width of the selection bar after the tree container
13066 iconWidth: null, // Adjust this if @fancy-icon-width != "16px"
13067 iconSpacing: null, // Adjust this if @fancy-icon-spacing != "3px"
13074 this.$container.addClass("fancytree-ext-wide");
13085 …"<li id='fancytreeTemp'><span class='fancytree-node'><span class='fancytree-icon' /><span class='f…
13087 $dummyIcon = $dummyLI.find(".fancytree-icon"),
13089 // $dummyTitle = $dummyLI.find(".fancytree-title"),
13091 instOpts.iconSpacing || $dummyIcon.css("margin-left"),
13094 levelOfs = instOpts.levelOfs || $dummyUL.css("padding-left");
13151 // Generate some more level-n rules if required
13156 "Define global ext-wide css up to level " +
13169 // Add level-n class to apply indentation padding.
13172 $(node.span).addClass("fancytree-level-" + level);