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

1 /*! jQuery Fancytree Plugin - 2.38.3 - 2023-02-01T20:52:50Z
5 /*! jQuery UI - v1.13.0 - 2021-11-09
7 * Includes: widget.js, position.js, jquery-patch.js, keycode.js, scroll-parent.js, unique-id.js
12 See README-Fancytree.md
65 var fullName = namespace + "-" + name;
151 // don't prefix for widgets that aren't DOM-based
371 .removeAttr( "aria-disabled" );
403 for ( i = 0; i < parts.length - 1; i++ ) {
481 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
485 this._removeClass( this.hoverable, null, "ui-state-hover" );
486 this._removeClass( this.focusable, null, "ui-state-focus" );
559 if ( $.inArray( event.target, value ) !== -1 ) {
613 // - disabled as an array instead of boolean
614 // - disabled class as method for disabling individual parts
617 $( this ).hasClass( "ui-state-disabled" ) ) ) {
630 var match = event.match( /^([\w:-]*)\s*(.*)$/ );
666 this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
669 this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
678 this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
681 this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
786 rvertical = /top|center|bottom/,
787 roffset = /[\+\-]\d+(\.[\d]+)?%?/,
813 offset: { top: 0, left: 0 }
820 offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
827 offset: { top: raw.pageY, left: raw.pageX }
860 return ( cachedScrollbarWidth = w1 - w2 );
864 within.element.css( "overflow-x" ),
866 within.element.css( "overflow-y" ),
885 offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
917 // Force left top to allow flipping
918 options.at = "left top";
971 basePosition.top += targetHeight;
973 basePosition.top += targetHeight / 2;
978 basePosition.top += atOffset[ 1 ];
995 position.left -= elemWidth;
997 position.left -= elemWidth / 2;
1001 position.top -= elemHeight;
1003 position.top -= elemHeight / 2;
1007 position.top += myOffset[ 1 ];
1014 $.each( [ "left", "top" ], function( i, dir ) {
1037 var left = targetOffset.left - position.left,
1038 right = left + targetWidth - elemWidth,
1039 top = targetOffset.top - position.top,
1040 bottom = top + targetHeight - elemHeight,
1045 top: targetOffset.top, property
1052 top: position.top, property
1057 vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1062 if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1065 if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1084 collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1085 overLeft = withinOffset - collisionPosLeft,
1086 overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1094 newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
1096 position.left += overLeft - newOverRight;
1105 position.left = withinOffset + outerWidth - data.collisionWidth;
1111 // Too far left -> align with left edge
1115 // Too far right -> align with right edge
1117 position.left -= overRight;
1121 position.left = max( position.left - collisionPosLeft, position.left );
1124 top: function( position, data ) { method
1126 withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1128 collisionPosTop = position.top - data.collisionPosition.marginTop,
1129 overTop = withinOffset - collisionPosTop,
1130 overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1136 // Element is initially over the top of within
1138 newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
1140 position.top += overTop - newOverBottom;
1144 position.top = withinOffset;
1146 // Element is initially over both top and bottom of within
1149 position.top = withinOffset + outerHeight - data.collisionHeight;
1151 position.top = withinOffset;
1155 // Too far up -> align with top
1157 position.top += overTop;
1159 // Too far down -> align with bottom edge
1161 position.top -= overBottom;
1165 position.top = max( position.top - collisionPosTop, position.top );
1175 collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1176 overLeft = collisionPosLeft - offsetLeft,
1177 overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1179 -data.elemWidth :
1186 -data.targetWidth :
1188 offset = -2 * data.offset[ 0 ],
1193 newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
1194 outerWidth - withinOffset;
1199 newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
1200 atOffset + offset - offsetLeft;
1206 top: function( position, data ) {
1208 withinOffset = within.offset.top + within.scrollTop,
1210 offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1211 collisionPosTop = position.top - data.collisionPosition.marginTop,
1212 overTop = collisionPosTop - offsetTop,
1213 overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1214 top = data.my[ 1 ] === "top",
1215 myOffset = top ?
1216 -data.elemHeight :
1220 atOffset = data.at[ 1 ] === "top" ?
1223 -data.targetHeight :
1225 offset = -2 * data.offset[ 1 ],
1229 newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
1230 outerHeight - withinOffset;
1232 position.top += myOffset + atOffset + offset;
1235 newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
1236 offset - offsetTop;
1238 position.top += myOffset + atOffset + offset;
1248 top: function() {
1249 $.ui.position.flip.top.apply( this, arguments );
1250 $.ui.position.fit.top.apply( this, arguments );
1293 // https://drafts.csswg.org/cssom/#common-serializing-idioms
1294 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
1305 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
1308 // Other potentially-special ASCII characters get backslash-escaped
1394 return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
1395 parent.css( "overflow-x" ) );
1426 this.id = "ui-id-" + ( ++uuid );
1434 if ( /^ui-id-\d+$/.test( this.id ) ) {
1444 // NOTE: Original jQuery UI wrapper was replaced. See README-Fancytree.md
1467 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
1472 * @date 2023-02-01T20:52:50Z
1482 define(["jquery", "./jquery.fancytree.ui-deps"], factory);
1485 require("./jquery.fancytree.ui-deps");
1556 109: "-",
1573 173: "-",
1577 189: "-",
1601 // Top-level Fancytree attributes, that can be set by dict
1604 // Top-level FancytreeNode attributes, that can be set by dict
1610 // Mapping of lowercase -> real name (because HTML5 data-... attribute only supports lowercase)
1730 * Deep-merge a list of objects (but replace array-type options).
1735 * of ext-edit). Also `null` values are copied over and not skipped.
1760 // Only deal with non-null/undefined values
1767 // Prevent never-ending loop
1907 // Evaluate 'data-NAME' attributes with special treatment for 'data-json'.
1916 // <li data-json='...'> is already returned as object (http://api.jquery.com/data/#data-html5)
1968 * Note: Also non-folders may have children.
2153 // #708: Fast path -- don't render every child of root, just the new ones!
2161 // Different first child -- recompute classes
2165 // Different last child -- recompute classes
2234 for (i = this.children.length - 1; i >= 0; i--) {
2379 * @deprecated since 2014-02-16. Use resetLazy() instead.
2383 "FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."
2497 * Fix selection status, after this node was (de)selected in multi-hier mode.
2515 * Fix selection status for multi-hier mode.
2516 * Only end-nodes are considered to update the descendants branch and parents.
2547 // the selection state of a node is not relevant; we need the end-nodes
2566 // eslint-disable-next-line no-nested-ternary
2573 // This is an end-node: simply report the status
2640 // eslint-disable-next-line no-nested-ternary
2707 /** Return the 0-based child index.
2714 /** Return the hierarchical child index (1-based, e.g. '3.2.4').
2727 s = ("0000000" + s).substr(-digits);
2751 ? this.children[this.children.length - 1]
2754 /** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... .
2776 for (i = 0, l = ac.length - 1; i < l; i++) {
2777 // up to length-2, so next(last) = null
2789 // TODO: return null for top-level nodes?
2792 /** Return an array of all parent nodes (top-down).
2844 return ac[i - 1];
2986 return !p || p.children[p.children.length - 1] === this;
2994 /** Return true if node is lazy and loaded. For non-lazy nodes always return true.
3012 /** Return true if node is partially selected (tri-state).
3053 /** Return true if this a top level node, i.e. a direct child of the (invisible) system root node.
3060 /** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false.
3101 * @deprecated since 2014-02-16: use load() instead.
3105 "FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."
3120 // _assert( forceReload || this.isUndefined(), "Pass forceReload=true to re-load a lazy node" );
3167 // Expand bottom-up, so only the top node is animated
3168 for (i = len - 1; i >= 0; i--) {
3290 // Handle cross-tree moves
3293 // _assert(false, "Cross-tree move is not yet implemented.");
3294 this.warn("Cross-tree moveTo is experimental!");
3301 // A collaposed node won't re-render children, so we have to remove it manually
3332 // In multi-hier mode, update the parents selection state
3337 // In multi-hier mode, update the parents selection state
3445 * @param {boolean} [force=false] re-render, even if html markup was already created
3509 * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad
3562 …"scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' inst…
3566 // For ext-table, we choose the nearest parent that has `position: relative`
3583 overflowY = $container.css("overflow-y");
3591 // #922 plain tree in a non-fixed-sized UL scrolls inside its parent
3610 // eslint-disable-next-line one-var
3618 topOfs = opts.scrollOfs.top || 0,
3635 nodeY = $(this.span).offset().top;
3637 topNode && topNode.span ? $(topNode.span).offset().top : 0;
3646 containerOffsetTop = $scrollParent.offset().top;
3648 $(this.span).offset().top - containerOffsetTop + scrollTop; // relative to scroll parent
3650 ? $(topNode.span).offset().top -
3656 $scrollParent.innerHeight() - $scrollParent[0].clientHeight
3658 containerHeight -= horzScrollbarHeight;
3664 newScrollTop = nodeY - topOfs;
3668 scrollTop + containerHeight - bottomOfs
3670 newScrollTop = nodeY + nodeHeight - containerHeight + bottomOfs;
3680 newScrollTop = topNodeY - topOfs;
3681 // this.debug(" scrollIntoView(), TOP newScrollTop=" + newScrollTop);
3710 * The `cell` option requires the ext-table and ext-ariagrid extensions.
3765 …* @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort…
3782 // eslint-disable-next-line no-nested-ternary
3783 return x === y ? 0 : x > y ? 1 : -1;
3886 while (curClasses.indexOf(" " + className + " ") > -1) {
3895 // this.info("-> toggleClass('" + value + "', " + flag + "): '" + this.extraClasses + "'");
3946 /** Call fn(node) for all child nodes in hierarchical order (depth-first).<br>
3981 * programmers to flood the server with requests ;-)
4026 /** Call fn(node) for all parent nodes, bottom-up, including invisible system root.<br>
4099 * @property {string} _ns Automatically generated unique tree namespace, e.g. ".fancytree-1".
4103 * @property {jQueryObject} $container Outer `<ul>` element (or `<table>` element for ext-table).
4117 * @property {object} viewport See ext-vieport. @since v2.31
4127 … "The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."
4132 … "The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."
4137 "The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."
4142 "The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10)."
4149 // allow to init tree.data.foo from <div data-foo=''>
4154 this._ns = ".fancytree-" + this._id; // append for namespaced events
4165 this.viewport = null; // ext-grid
4172 this.$div.find(">ul.fancytree-container").remove();
4187 id: "ft-id-" + this._id,
4188 class: "ui-fancytree fancytree-container fancytree-plain",
4197 // // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant
4198 // // #577: Allow to set tabindex to "0", "-1" and ""
4202 // this.$container.attr("DIR", "RTL").addClass("fancytree-rtl");
4204 // // this.$container.attr("DIR", null).removeClass("fancytree-rtl");
4209 // this.$container.attr("aria-multiselectable", true);
4215 /* Return a context object that can be re-used for _callHook().
4382 * - 'moveUp', 'moveDown'
4383 * - 'indent', 'outdent'
4384 * - 'remove'
4385 * - 'edit', 'addChild', 'addSibling': (reqires ext-edit extension)
4386 * - 'cut', 'copy', 'paste': (use an internal singleton 'clipboard')
4387 * - 'down', 'first', 'last', 'left', 'parent', 'right', 'up': navigate
4444 // Add, edit (requires ext-edit):
4511 "patchList must be an array of length-2-arrays"
4576 /** Temporarily suppress rendering to improve performance on bulk-updates.
4654 * and wrap-around at the end.
4867 /** Return the first top level node if any (not the invisible root node).
4945 // ae && $(ae).closest(".fancytree-container").length
4954 // this.$container.toggleClass("fancytree-treefocus", hasFocus);
4997 * Make sure that a node with a given ID is loaded, by traversing - and
4998 * loading - its parents. This method is meant for lazy hierarchies.
5126 // Collect distinct top-most lazy nodes in a map.
5127 // Note that we can use node.key to de-dupe entries, even if a custom matcher would
5129 // map[node.key] => {node: node, pathList: [list of remaining rest-paths]}
5194 // remainMap contains parent nodes, each with a list of relative sub-paths.
5207 // // matcher is used, because we cannot assume that a single segment-key is unique
5221 /** Re-fire beforeActivate, activate, and (optional) focus events.
5234 this.activeNode = null; // Force re-activating
5249 /**Render tree (i.e. create DOM elements for all top-level nodes).
5289 window.console.time(this + " - " + label);
5299 window.console.timeEnd(this + " - " + label);
5345 /** Call fn(node) for all nodes in hierarchical order (depth-first).
5354 /** Call fn(node) for all nodes in vertical order, top down (or bottom up).<br>
5362 * {start: First top node, reverse: false, includeSelf: true, includeHidden: false}
5417 /*jshint -W083 */
5465 node = children[idx - 1];
5469 // eslint-disable-next-line no-unmodified-loop-condition
5476 node = children[children.length - 1];
5574 // Make sure that clicks stop, otherwise <a href='#'> jumps to the top
5575 // if(event.target.localName === "a" && event.target.className === "fancytree-title"){
5642 // only detect plain ascii alpha-numerics. But we still need
5643 // to ignore modifier-only, whitespace, cursor-keys, etc.
5678 if (stamp - tree.lastQuicksearchTime > 500) {
5699 case "-":
5786 Math.random() * (delay[1] - delay[0]);
5810 // 2020-01-03: refactored.
5814 // So we mock-up a thenable that resolves synchronously:
5887 // - modify `ctx.response` in-place (and leave `ctx.result` undefined)
5889 // - return a replacement in `ctx.result`
5935 // (otherwise use existing data, which may have been modified in-place)
6235 …* <span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fanc…
6236 * <span class="fancytree-expander"></span>
6237 * <span class="fancytree-checkbox"></span> // only present in checkbox mode
6238 * <span class="fancytree-icon"></span>
6239 * <a href="#" class="fancytree-title"> Node 1 </a>
6249 * @param {boolean} [force=false] re-render, even if html markup was already created
6257 * - node was not yet rendered:
6259 * - node was rendered: exit fast
6260 * - children have been added
6261 * - children have been removed
6293 // Discard markup on force-mode, or if it is not linked to parent <ul>
6302 // May happen, when a top-level node was dropped over another
6329 node.span.className = "fancytree-node";
6363 // hide top UL, so we can use an animation to show it later
6399 for (i = 0, l = children.length - 1; i < l; i++) {
6426 // #486: successorLi is set, if we re-rendered (i.e. discarded)
6479 " class='fancytree-expander fancytree-expander-fixed'></span>"
6485 "<span " + role + " class='fancytree-expander'></span>"
6493 className = "fancytree-checkbox";
6498 className += " fancytree-radio";
6506 // 2015-11-16
6552 "' class='fancytree-icon'" +
6560 " class='fancytree-custom-icon " +
6571 " class='fancytree-custom-icon " +
6583 " class='fancytree-custom-icon " +
6596 " class='fancytree-icon'" +
6628 "<span class='fancytree-title'" +
6644 ctx.$title = $(">span.fancytree-title", node.span);
6681 // $(">span.fancytree-title", statusElem).attr("tabindex", "0");
6684 // $(">span.fancytree-title", statusElem).removeAttr("tabindex");
6695 $ariaElem.removeAttr("aria-expanded");
6697 $ariaElem.attr("aria-expanded", Boolean(node.expanded));
6734 $ariaElem.attr("aria-selected", true);
6737 $ariaElem.attr("aria-selected", false);
6800 // #1042: don't scroll between mousedown/-up when clicking an embedded link
6933 // Auto-collapse mode: collapse all siblings
6995 // Create required markup, but make sure the top UL is hidden, so we
7011 // The UI toggle() effect works with the ext-wide extension,
7024 // node.debug("fancytree-animating end: " + node.li.className);
7031 // The UI toggle() effect works with the ext-wide extension,
7045 .find(".ui-effects-placeholder")
7053 // node.debug("fancytree-animating end: " + node.li.className);
7152 $(node.span).find(".fancytree-title").focus();
7158 "aria-activedescendant",
7165 // $(node.span).find(".fancytree-title").focus();
7219 // Remember the user's intent, in case down -> up propagation prevents
7255 // multi-hierarchical selection mode
7423 tree.$div.find(">ul.fancytree-container").empty();
7428 /** Widget was created (called only once, even it re-initialized).
7436 this.$div.find(">ul.fancytree-container").remove();
7438 this.$source.removeClass("fancytree-helper-hidden");
7441 /** Widget was (re-)initialized.
7450 // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant
7451 // #577: Allow to set tabindex to "0", "-1" and ""
7464 tree.$container.addClass("fancytree-checkbox-auto-hide");
7469 .addClass("fancytree-rtl");
7473 .removeClass("fancytree-rtl");
7478 tree.$container.attr("aria-multiselectable", true);
7507 // but another `<ul class='fancytree-container'>` is appended
7511 .not(".fancytree-container")
7516 "ui-fancytree-source fancytree-helper-hidden"
7519 // allow to init tree.data.foo from <ul data-foo=''>
7562 $.error("Invalid data-type: " + type);
7628 this.$container.toggleClass("fancytree-treefocus", flag);
7669 "fancytree-checkbox-auto-hide",
7681 .removeClass("fancytree-rtl");
7685 .addClass("fancytree-rtl");
7721 tree.render(true, false); // force, not-deep
7798 scrollOfs: { top: 0, bottom: 0 }, property
7813 active: "fancytree-active",
7814 animating: "fancytree-animating",
7815 combinedExpanderPrefix: "fancytree-exp-",
7816 combinedIconPrefix: "fancytree-ico-",
7817 error: "fancytree-error",
7818 expanded: "fancytree-expanded",
7819 focused: "fancytree-focused",
7820 folder: "fancytree-folder",
7821 hasChildren: "fancytree-has-children",
7822 lastsib: "fancytree-lastsib",
7823 lazy: "fancytree-lazy",
7824 loading: "fancytree-loading",
7825 node: "fancytree-node",
7826 partload: "fancytree-partload",
7827 partsel: "fancytree-partsel",
7828 radio: "fancytree-radio",
7829 selected: "fancytree-selected",
7830 statusNodePrefix: "fancytree-statusnode-",
7831 unselectable: "fancytree-unselectable",
7844 "') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html"
7878 // issue #876: we want to replace custom array-options, not merge them
7905 // 2015-11-16
7918 // 2015-11-16
7931 // 2016-04-04
7932 opts.tabindex = opts.tabbable ? "0" : "-1";
7974 // -------------------------------------------------------------------------
8039 "table.fancytree-container > thead"
8054 "span.fancytree-title",
8056 // prevent mouse-drags to select text ranges
8245 // http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at
8286 // eslint-disable-next-line no-unused-expressions
8290 // eslint-disable-next-line no-unused-expressions
8328 * See http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at
8342 myParts = /(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(
8345 atParts = /(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(
8379 // See http://jsperf.com/test-for-classname/2
8380 if (/\bfancytree-title\b/.test(tcn)) {
8382 } else if (/\bfancytree-expander\b/.test(tcn)) {
8387 // }else if( /\bfancytree-checkbox\b/.test(tcn) || /\bfancytree-radio\b/.test(tcn) ){
8388 } else if (/\bfancytree-checkbox\b/.test(tcn)) {
8390 } else if (/\bfancytree(-custom)?-icon\b/.test(tcn)) {
8392 } else if (/\bfancytree-node\b/.test(tcn)) {
8402 } else if ($target.closest(".fancytree-title").length) {
8405 } else if ($target.closest(".fancytree-checkbox").length) {
8408 } else if ($target.closest(".fancytree-expander").length) {
8450 * $.ui.fancytree.getTree(event); // Get tree for this mouse- or keyboard event
8467 el = $(".fancytree-container").eq(el); // el was an integer: return nth instance
8470 el = $("#ft-id-" + orgEl).eq(0);
8485 el = el.closest(":ui-fancytree");
8486 …widget = el.data("ui-fancytree") || el.data("fancytree"); // the latter is required by jQuery <= 1…
8575 * This is especially handy for switch-statements in event handlers.
8583 case "-":
8600 // Poor-man's hotkeys. See here for a complete implementation:
8750 // Translate hideCheckbox -> checkbox:false
8754 // Add <li data-NAME='...'> as node.data.NAME
8757 // #507: convert data-hidecheckbox (lower case) to hideCheckbox
8766 // #56: Allow to set special node.attributes from data-...
8775 // All other data-... goes to node.data...
8841 // See also the [live demo](https://wwWendt.de/tech/fancytree/demo/sample-ext-childcounter.html) of…
8854 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
8860 * @date 2023-02-01T20:52:50Z
8881 // Consider to use [strict mode](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/)
8884 // The [coding guidelines](http://contribute.jquery.org/style-guide/js/)
8888 /*eslint-disable no-unused-vars */
8891 // --------------
8914 * [ext-childcounter] Update counter badges for `node` and its parents.
8922 $badge = $("span.fancytree-childcounter", node.span),
8932 $badge = $("<span class='fancytree-childcounter'/>").appendTo(
8934 "span.fancytree-icon,span.fancytree-custom-icon",
8959 // ------------------------------
8961 …// enabled like so (see also the [live demo](https://wwWendt.de/tech/fancytree/demo/sample-ext-chi…
9008 …// with a `ctx` argument (see [EventData](https://wwWendt.de/tech/fancytree/doc/jsdoc/global.html#…
9014 …// See also the [complete list of available hook functions](https://wwWendt.de/tech/fancytree/doc/…
9028 this.$container.addClass("fancytree-ext-childcounter");
9056 "span.fancytree-icon,span.fancytree-custom-icon",
9059 $("<span class='fancytree-childcounter'/>").text(count)
9084 * Support faster lookup of nodes by key and shared ref-ids.
9087 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
9093 * @date 2023-02-01T20:52:50Z
9121 for (i = arr.length - 1; i >= 0; i--) {
9134 * @see http://github.com/garycourt/murmurhash-js
9141 * @return {number} 32-bit positive integer hash
9144 /*eslint-disable no-bitwise */
9148 bytes = key.length - remainder,
9221 return ("0000000" + (h1 >>> 0).toString(16)).substr(-8);
9224 /*eslint-enable no-bitwise */
9228 * Return a unique key for node by calculating the hash of the parents refKey-list.
9238 // 32-bit has a high probability of collisions, so we pump up to 64-bit
9248 * [ext-clones] Return a list of clone-nodes (i.e. same refKey) or null.
9283 * [ext-clones] Return true if this node has at least another clone with same refKey.
9296 * [ext-clones] Update key and/or refKey for an existing node.
9325 "[ext-clones] reRegister(" +
9369 * [ext-clones] Define a refKey for an existing node.
9382 * [ext-clones] Return all nodes with a given refKey (null if not found).
9416 * [ext-clones] Replace a refKey with a new one.
9449 highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers
9450 highlightClones: false, // set 'fancytree-clone' class on any node that has at least one clone
9459 this.$container.addClass("fancytree-ext-clones");
9568 $span.addClass("fancytree-clone");
9584 "fancytree-active-clone",
9600 * Drag-and-drop support (native HTML5).
9603 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
9609 * @date 2023-02-01T20:52:50Z
9645 classDragSource = "fancytree-drag-source",
9646 classDragRemove = "fancytree-drag-remove",
9647 classDropAccept = "fancytree-drop-accept",
9648 classDropAfter = "fancytree-drop-after",
9649 classDropBefore = "fancytree-drop-before",
9650 classDropOver = "fancytree-drop-over",
9651 classDropReject = "fancytree-drop-reject",
9652 classDropTarget = "fancytree-drop-target",
9653 nodeMimeType = "application/x-fancytree-node",
9684 // Take this badge off of me - I can't use it anymore:
9691 /* Convert number to string and prepend +/-; return empty string for 0.*/
9693 // eslint-disable-next-line no-nested-ternary
9755 /* Implement auto scrolling when drag cursor is in top/bottom area of scroll parent. */
9769 if (spOfs.top + sp.offsetHeight - event.pageY < sensitivity) {
9771 sp.scrollHeight -
9772 tree.$scrollParent.innerHeight() -
9775 // + ", spOfs.top: " + spOfs.top
9784 } else if (scrollTop > 0 && event.pageY - spOfs.top < sensitivity) {
9785 sp.scrollTop = scrolled = scrollTop - speed;
9789 if (scrollTop > 0 && event.pageY - scrollTop < sensitivity) {
9790 scrolled = scrollTop - speed;
9793 $(window).height() - (event.pageY - scrollTop) <
9845 " - evalEffectModifiers(): " +
9847 " -> " +
9892 // " -> " +
9921 " -> " +
9958 // " -> " +
9988 * - Auto-scroll when cursor is in border regions
9989 * - Apply restrictioan like 'preventVoidMoves'
9990 * - Calculate hit mode
9991 * - Calculate drop effect
9992 * - Trigger dragOver() callback to let user modify hit mode and drop effect
9993 * - Adjust the drop marker accordingly
9998 // Implement auto-scrolling
10004 data.tree.warn("Ignored dragover for non-node"); //, event, data);
10020 $targetTitle = $target.find("span.fancytree-title");
10030 relPosY = (event.pageY - nodeOfs.top) / $target.height();
10054 // Prevent no-ops like 'before source node'
10055 // TODO: these are no-ops when moving nodes, but not in copy mode
10099 markerAt = "top";
10114 pos.my = "right" + offsetString(-markerOffsetX) + " center";
10173 tree.info("Ignored dragstart on a non-node.");
10217 "Could not set data (IE only accepts 'text') - " + ex
10256 $dragImage = $(node.span).find(".fancytree-title");
10263 // See https://kryogenix.org/code/browser/custom-drag-image.html
10268 "<span class='fancytree-childcounter'/>"
10270 .text("+" + (SOURCE_NODE_LIST.length - 1))
10275 dataTransfer.setDragImage($dragImage[0], -10, -10);
10353 "Ignore non-node " +
10374 node.debug("Reject dropping a non-node.");
10425 "Ignore non-node " +
10459 Date.now() - DRAG_OVER_STAMP > dndOpts.autoExpandMS &&
10476 "Ignore non-node " +
10508 ": getData('application/x-fancytree-node'): '" +
10591 /** [ext-dnd5] Return a Fancytree instance, from element, index, event, or jQueryObject.
10605 /** [ext-dnd5] Return the FancytreeNode that is currently being dragged.
10631 … dropMarkerInsertOffsetX: -16, // Additional offset for drop-marker with hitMode = "before"/"after"
10632 …dropMarkerOffsetX: -24, // Absolute position offset for .fancytree-drop-marker relatively to ..fan…
10645 scroll: true, // Enable auto-scrolling while dragging
10646 scrollSensitivity: 20, // Active top/bottom margin in pixel
10674 "dragStop is not used by ext-dnd5. Use dragEnd instead."
10704 this.$container.addClass("fancytree-ext-dnd5");
10713 $dropMarker = $("#fancytree-drop-marker");
10715 $dropMarker = $("<div id='fancytree-drop-marker'></div>")
10718 "z-index": 1000,
10720 "pointer-events": "none",
10731 $dropMarker.toggleClass("fancytree-rtl", !!opts.rtl);
10762 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
10768 * @date 2023-02-01T20:52:50Z
10796 * [ext-edit] Start inline editing of current node title.
10807 $title = $(".fancytree-title", node.span),
10813 "fancytree-edit-new"
10834 // Disable standard Fancytree mouse- and key handling
10842 // #116: ext-dnd prevents the blur event, so we have to catch outer clicks
10843 $(document).on("mousedown.fancytree-edit", function (event) {
10844 if (!$(event.target).hasClass("fancytree-edit-input")) {
10851 class: "fancytree-edit-input",
10871 $input.addClass("fancytree-edit-dirty");
10892 * [ext-edit] Stop inline editing.
10907 $title = $(".fancytree-title", node.span),
10908 $input = $title.find("input.fancytree-edit-input");
10929 // Allow to break (keep editor open), modify input, or re-define data.save
10945 $input.removeClass("fancytree-edit-dirty").off();
10946 // Unbind outer-click handler
10947 $(document).off(".fancytree-edit");
10968 // Re-enable mouse and keyboard handling
10983 * [ext-edit] Create a new child or sibling node and start edit mode.
11023 .removeClass("fancytree-hide")
11024 .addClass("fancytree-match");
11027 $(newNode[tree.statusClassPropName]).addClass("fancytree-edit-new");
11034 * [ext-edit] Check if any node in this tree in edit mode.
11045 * [ext-edit] Check if this node is in edit mode.
11087 .addClass("fancytree-ext-edit")
11090 // When scrolling, the TR may be re-used by another node, so the
11119 $(ctx.originalEvent.target).hasClass("fancytree-title")
11167 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
11173 * @date 2023-02-01T20:52:50Z
11200 return (str + "").replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
11232 (matchingIndices[matchingIndices.length - 1] || 0);
11282 …https://codereview.stackexchange.com/questions/23899/faster-javascript-fuzzy-string-matching-funct…
11283 // and http://www.quora.com/How-is-the-fuzzy-search-algorithm-in-Sublime-Text-designed
11284 // and http://www.dustindiaz.com/autocomplete-fuzzy-matching
11363 this.$div.addClass("fancytree-ext-filter");
11365 this.$div.addClass("fancytree-ext-filter-hide");
11367 this.$div.addClass("fancytree-ext-filter-dimm");
11370 "fancytree-ext-filter-hide-expanders",
11455 * [ext-filter] Dimm or hide nodes.
11470 …"Fancytree.filterNodes() leavesOnly option is deprecated since 2.9.0 / 2015-04-19. Use opts.leaves…
11477 * [ext-filter] Dimm or hide whole branches.
11493 * [ext-filter] Re-apply current filter.
11513 * [ext-filter] Reset the filter.
11535 $title = $(node.span).find(">span.fancytree-title");
11567 "fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"
11575 * [ext-filter] Return true if a filter is currently applied.
11587 * [ext-filter] Return true if this node is matched by current filter (or no filter is active).
11606 autoApply: true, // Re-apply last filter if lazy data is loaded
11650 $title = $(node.span).find("span.fancytree-title"),
11661 .toggleClass("fancytree-match", !!node.match)
11662 .toggleClass("fancytree-submatch", !!node.subMatchCount)
11664 "fancytree-hide",
11675 "<span class='fancytree-childcounter'/>"
11678 "span.fancytree-icon, span.fancytree-custom-icon",
11715 * Use glyph-fonts, ligature-fonts, or SVG icons instead of icon sprites.
11718 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
11724 * @date 2023-02-01T20:52:50Z
11751 checkbox: "icon-check-empty",
11752 checkboxSelected: "icon-check",
11753 checkboxUnknown: "icon-check icon-muted",
11754 dragHelper: "icon-caret-right",
11755 dropMarker: "icon-caret-right",
11756 error: "icon-exclamation-sign",
11757 expanderClosed: "icon-caret-right",
11758 expanderLazy: "icon-angle-right",
11759 expanderOpen: "icon-caret-down",
11760 loading: "icon-refresh icon-spin",
11761 nodata: "icon-meh",
11763 radio: "icon-circle-blank",
11764 radioSelected: "icon-circle",
11765 // radioUnknown: "icon-circle icon-muted",
11768 doc: "icon-file-alt",
11769 docOpen: "icon-file-alt",
11770 folder: "icon-folder-close-alt",
11771 folderOpen: "icon-folder-open-alt",
11775 checkbox: "fa-square-o",
11776 checkboxSelected: "fa-check-square-o",
11777 checkboxUnknown: "fa-square fancytree-helper-indeterminate-cb",
11778 dragHelper: "fa-arrow-right",
11779 dropMarker: "fa-long-arrow-right",
11780 error: "fa-warning",
11781 expanderClosed: "fa-caret-right",
11782 expanderLazy: "fa-angle-right",
11783 expanderOpen: "fa-caret-down",
11785 loading: { html: "<span class='fa fa-spinner fa-pulse' />" },
11786 nodata: "fa-meh-o",
11788 radio: "fa-circle-thin", // "fa-circle-o"
11789 radioSelected: "fa-circle",
11790 // radioUnknown: "fa-dot-circle-o",
11793 doc: "fa-file-o",
11794 docOpen: "fa-file-o",
11795 folder: "fa-folder-o",
11796 folderOpen: "fa-folder-open-o",
11803 checkbox: "far fa-square",
11804 checkboxSelected: "far fa-check-square",
11805 // checkboxUnknown: "far fa-window-close",
11807 "fas fa-square fancytree-helper-indeterminate-cb",
11808 radio: "far fa-circle",
11809 radioSelected: "fas fa-circle",
11810 radioUnknown: "far fa-dot-circle",
11811 dragHelper: "fas fa-arrow-right",
11812 dropMarker: "fas fa-long-arrow-alt-right",
11813 error: "fas fa-exclamation-triangle",
11814 expanderClosed: "fas fa-caret-right",
11815 expanderLazy: "fas fa-angle-right",
11816 expanderOpen: "fas fa-caret-down",
11817 loading: "fas fa-spinner fa-pulse",
11818 nodata: "far fa-meh",
11822 doc: "far fa-file",
11823 docOpen: "far fa-file",
11824 folder: "far fa-folder",
11825 folderOpen: "far fa-folder-open",
11829 checkbox: "glyphicon-unchecked",
11830 checkboxSelected: "glyphicon-check",
11832 "glyphicon-expand fancytree-helper-indeterminate-cb", // "glyphicon-share",
11833 dragHelper: "glyphicon-play",
11834 dropMarker: "glyphicon-arrow-right",
11835 error: "glyphicon-warning-sign",
11836 expanderClosed: "glyphicon-menu-right", // glyphicon-plus-sign
11837 expanderLazy: "glyphicon-menu-right", // glyphicon-plus-sign
11838 expanderOpen: "glyphicon-menu-down", // glyphicon-minus-sign
11839 loading: "glyphicon-refresh fancytree-helper-spin",
11840 nodata: "glyphicon-info-sign",
11842 radio: "glyphicon-remove-circle", // "glyphicon-unchecked",
11843 radioSelected: "glyphicon-ok-circle", // "glyphicon-check",
11844 // radioUnknown: "glyphicon-ban-circle",
11847 doc: "glyphicon-file",
11848 docOpen: "glyphicon-file",
11849 folder: "glyphicon-folder-close",
11850 folderOpen: "glyphicon-folder-open",
11853 _addClass: "material-icons",
11858 dropMarker: { text: "arrow-forward" },
11865 addClass: "fancytree-helper-spin",
11884 $counter = $span.find(".fancytree-childcounter"),
11891 // node.debug( "setIcon(" + baseClass + ", " + type + "): " + "oldIcon" + " -> " + icon );
11896 // var oldIcon = "fa-" + $span.data("icon");
11897 // // node.debug( "setIcon(" + baseClass + ", " + type + "): " + oldIcon + " -> " + icon );
11944 tree.warn("ext-glyph: missing `preset` option.");
11947 tree.$container.addClass("fancytree-ext-glyph");
11963 span = $span.children(".fancytree-expander").get(0);
11976 // span.className = "fancytree-expander " + map[icon];
11977 setIcon(node, span, "fancytree-expander", opts, icon);
11981 span = $("td", node.tr).find(".fancytree-checkbox").get(0);
11983 span = $span.children(".fancytree-checkbox").get(0);
11995 "fancytree-checkbox fancytree-radio",
12000 // eslint-disable-next-line no-nested-ternary
12006 // span.className = "fancytree-checkbox " + map[icon];
12007 setIcon(node, span, "fancytree-checkbox", opts, icon);
12011 // Standard icon (note that this does not match .fancytree-custom-icon,
12013 span = $span.children(".fancytree-icon").get(0);
12025 setIcon(node, span, "fancytree-icon", opts, icon);
12043 span = $(".fancytree-expander", node.span).get(0);
12045 setIcon(node, span, "fancytree-expander", opts, status);
12050 ".fancytree-statusnode-" + status,
12053 .find(".fancytree-icon")
12056 setIcon(node, span, "fancytree-icon", opts, status);
12074 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
12080 * @date 2023-02-01T20:52:50Z
12116 "select-one": [KC.LEFT, KC.RIGHT],
12117 "select-multiple": [KC.LEFT, KC.RIGHT],
12209 this.$container.addClass("fancytree-ext-gridnav");
12237 $(node.span).find("span.fancytree-title").focus();
12241 ctx.tree.$container.attr("tabindex", "-1");
12264 // ctx.tree.debug("ext-gridnav nodeKeydown", event, inputType);
12279 // ctx.tree.debug("ext-gridnav NOT HANDLED", event, inputType);
12294 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
12300 * @date 2023-02-01T20:52:50Z
12340 this.$container.addClass("fancytree-ext-multi");
12343 "Fancytree ext-multi: selectMode: 1 (single) is not compatible."
12363 // Select clicked node (radio-button mode)
12424 * @depends: js-cookie or jquery-cookie
12426 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
12432 * @date 2023-02-01T20:52:50Z
12499 // Assume https://github.com/js-cookie/js-cookie
12508 // Fall back to https://github.com/carhartl/jquery-cookie
12559 // All lazy-expands have finished
12561 // If we read new nodes from server, try to resolve yet-missing keys
12581 * [ext-persist] Remove persistence data of the given type(s).
12617 * [ext-persist] Return persistence information from cookies
12647 cookiePrefix: undefined, // 'fancytree-<treeId>-' by default
12708 instOpts.cookiePrefix || "fancytree-" + tree._id + "-";
12735 // Bind init-handler to apply cookie state
12758 // Also remove expand-cookies for unmatched nodes
12799 // only stored the selected *top* nodes
12832 $(node.span).find(".fancytree-title").focus();
12900 // In selectMode 3 we only store the the selected *top* nodes.
12901 // De-selecting a node may also de-select some parents, so we
12911 // beforeSelect can prevent the change - flag doesn't reflect the node.selected state
12929 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
12935 * @date 2023-02-01T20:52:50Z
12973 // currentFlag = node.hide ? false : flag; // fix for ext-filter
12994 prev = siblings[i - 1];
12998 last = prev.children[prev.children.length - 1];
13054 $table.addClass("fancytree-container fancytree-ext-table");
13101 .html("<span class='fancytree-node' />");
13126 // #489: make sure $container is set to <table>, even if ext-dnd is listed before ext-table
13136 // #577: Allow to set tabindex to "0", "-1" and ""
13138 // this.$container.attr("tabindex", opts.tabbable ? "0" : "-1");
13142 .attr("aria-readonly", true);
13239 // $(node.tr).attr("aria-labelledby", "ftal_" + opts.idPrefix + node.key);
13241 node.span = $("span.fancytree-node", node.tr).get(0);
13316 $cb = $("span.fancytree-checkbox", node.span); //.detach();
13339 .addClass("fancytree-status-merged")
13355 $(node.tr).removeClass("fancytree-node");
13357 indent = (node.getLevel() - 1) * opts.table.indentation;
13370 // Expanded state isn't changed - just call base implementation
13426 // Call base-expand with disabled events and animation
13453 this.$source.removeClass("fancytree-helper-hidden");
13477 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
13483 * @date 2023-02-01T20:52:50Z
13509 activeClass: "ui-state-active", // Class added to active node
13510 // activeClass: "ui-state-highlight",
13511 addClass: "ui-corner-all", // Class added to all nodes
13512 focusClass: "ui-state-focus", // Class added to focused node
13513 hoverClass: "ui-state-hover", // Class added to hovered node
13514 selectedClass: "ui-state-highlight", // Class added to selected nodes
13515 // selectedClass: "ui-state-active"
13525 $el.addClass("ui-widget ui-corner-all");
13526 $el.find(">thead tr").addClass("ui-widget-header");
13527 $el.find(">tbody").addClass("ui-widget-conent");
13529 $el.addClass("ui-widget ui-widget-content ui-corner-all");
13534 ".fancytree-node",
13549 "ui-widget ui-widget-content ui-corner-all"
13560 ….ui-state-highlight: Class to be applied to highlighted or selected elements. Applies "highlight" …
13561 ….ui-state-error: Class to be applied to error messaging container elements. Applies "error" contai…
13562 ….ui-state-error-text: An additional class that applies just the error text color without backgroun…
13564 ….ui-state-default: Class to be applied to clickable button-like elements. Applies "clickable defau…
13565 ….ui-state-hover: Class to be applied on mouseover to clickable button-like elements. Applies "clic…
13566 ….ui-state-focus: Class to be applied on keyboard focus to clickable button-like elements. Applies …
13567 ….ui-state-active: Class to be applied on mousedown to clickable button-like elements. Applies "cli…
13569 // Set ui-state-* class (handle the case that the same class is assigned
13587 // Additional classes (e.g. 'ui-corner-all')
13601 * Copyright (c) 2008-2023, Martin Wendt (https://wwWendt.de)
13607 * @date 2023-02-01T20:52:50Z
13625 var reNumUnit = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; // split "1.5em" to ["1.5", "em"]
13634 // // http://blog.jquery.com/2012/08/16/jquery-1-8-box-sizing-width-csswidth-and-outerwidth/
13636 // // 'Client width without scrollbar' - 'padding'
13637 // return $el[0].clientWidth - ($el.innerWidth() - parseFloat($el.css("width"), 10));
13642 id = "fancytree-style-" + id;
13652 .addClass("fancytree-style")
13659 // fix for IE 6-8
13675 prefix = "#" + containerId + " span.fancytree-level-",
13682 " span.fancytree-title { padding-left: " +
13689 // This breaks the left:0 and padding-left:nn settings of the title
13693 " div.ui-effects-wrapper ul li span.fancytree-title, " +
13696 " li.fancytree-animating span.fancytree-title " + // #716
13697 "{ padding-left: " +
13706 // * [ext-wide] Recalculate the width of the selection bar after the tree container
13740 iconWidth: null, // Adjust this if @fancy-icon-width != "16px"
13741 iconSpacing: null, // Adjust this if @fancy-icon-spacing != "3px"
13748 this.$container.addClass("fancytree-ext-wide");
13759 …"<li id='fancytreeTemp'><span class='fancytree-node'><span class='fancytree-icon' /><span class='f…
13761 $dummyIcon = $dummyLI.find(".fancytree-icon"),
13763 // $dummyTitle = $dummyLI.find(".fancytree-title"),
13765 instOpts.iconSpacing || $dummyIcon.css("margin-left"),
13768 levelOfs = instOpts.levelOfs || $dummyUL.css("padding-left");
13825 // Generate some more level-n rules if required
13830 "Define global ext-wide css up to level " +
13843 // Add level-n class to apply indentation padding.
13846 $(node.span).addClass("fancytree-level-" + level);