Lines Matching +full:k +full:- +full:touch

21  * Licensed same as jquery - under the terms of the MIT License
22 * http://www.opensource.org/licenses/mit-license.php
50 _temp1.className = 'jstree-icon jstree-ocl';
54 _temp1.className = 'jstree-anchor';
56 _temp1.setAttribute('tabindex','-1');
58 _temp2.className = 'jstree-icon jstree-themeicon';
91 path : src && src.indexOf('/') !== -1 ? src.replace(/\/[^\/]+$/,'') : '',
92 idregex : /[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g
108 $.each(options.plugins, function (i, k) { argument
110 tmp = tmp.plugin(k, options[k]);
204 * In any other case - nothing is returned and chaining is not broken.
229 // if calling a method, and method is available - execute on the instance
233 // if there is no instance and no method is being called - create one
237 // if there is an instance and no method is called - return the instance
241 // if there was a method call which returned a result - break and return the value
246 …// if there was a method call with a valid return value - return that, otherwise continue the chain
281 …* It is possible to pass in a standard jQuery-like AJAX config and jstree will automatically deter…
370 …* the open / close animation duration in milliseconds - set this to `false` to disable the animati…
395 * the location of all jstree themes - only used if `url` is set to `true`
495 this.element = $(el).addClass('jstree jstree-' + this._id);
501 this.element[this._data.core.rtl ? 'addClass' : 'removeClass']("jstree-rtl");
504 this.element.attr('aria-multiselectable', true);
525-container-ul jstree-children' role='group'><"+"li id='j"+this._id+"_loading' class='jstree-initia…
526 this.element.attr('aria-activedescendant','j' + this._id + '_loading');
597 .on("mousedown.jstree", ".jstree-ocl", function (e) {
600 .on("click.jstree", ".jstree-ocl", $.proxy(function (e) {
603 .on("dblclick.jstree", ".jstree-anchor", $.proxy(function (e) {
608 .on("click.jstree", ".jstree-anchor", $.proxy(function (e) {
613 .on('keydown.jstree', '.jstree-anchor', $.proxy(function (e) {
639 if(o && o.id !== '#') { this.get_node(o, true).children('.jstree-anchor').focus(); }
645 if(o && o.length) { o.children('.jstree-anchor').focus(); }
650 …this.open_node(e.currentTarget, function (o) { this.get_node(o, true).children('.jstree-anchor').f…
653 o = this.get_node(e.currentTarget, true).children('.jstree-children')[0];
654 if(o) { $(this._firstChild(o)).children('.jstree-anchor').focus(); }
660 if(o && o.length) { o.children('.jstree-anchor').focus(); }
662 case 106: // aria defines * on numpad as open_all - not very common
668 if(o) { $(o).children('.jstree-anchor').filter(':visible').focus(); }
672 this.element.find('.jstree-anchor').filter(':visible').last().focus();
703 this.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id);
714 if(!this.get_container_ul().find('.jstree-loading').length) {
749 col = this.element.find('.jstree-anchor').filter(':visible'),
812 .on('blur.jstree', '.jstree-anchor', $.proxy(function (e) {
814 $(e.currentTarget).filter('.jstree-hovered').mouseleave();
817 .on('focus.jstree', '.jstree-anchor', $.proxy(function (e) {
822 this.element.find('.jstree-hovered').not(e.currentTarget).mouseleave();
824 this.element.attr('tabindex', '-1');
827 if(+(new Date()) - was_click > 500 && !this._data.core.focused) {
829 … this.get_node(this.element.attr('aria-activedescendant'), true).find('> .jstree-anchor').focus();
832 .on('mouseenter.jstree', '.jstree-anchor', $.proxy(function (e) {
835 .on('mouseleave.jstree', '.jstree-anchor', $.proxy(function (e) {
846 $(document).off('.jstree-' + this._id);
877 return this.element.children(".jstree-children").first();
953 …regex,'\\$&'), this.element)).length && this._model.data[dom.closest('.jstree-node').attr('id')]) {
954 obj = this._model.data[dom.closest('.jstree-node').attr('id')];
956 …else if((dom = $(obj, this.element)).length && this._model.data[dom.closest('.jstree-node').attr('…
957 obj = this._model.data[dom.closest('.jstree-node').attr('id')];
976 …* @param {String} glue if you want the path as a string - pass the glue here (for example '/'), i…
1020 if(obj.hasClass("jstree-open")) {
1021 tmp = this._firstChild(obj.children('.jstree-children')[0]);
1036 return obj.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first();
1071 while(obj.hasClass("jstree-open")) {
1072 obj = obj.children(".jstree-children").first().children(".jstree-node:visible:last");
1077 return tmp && tmp.className && tmp.className.indexOf('jstree-node') !== -1 ? $(tmp) : false;
1101 return this.get_container_ul().children(".jstree-node");
1106 return obj.children(".jstree-children").children(".jstree-node");
1171 …the function is executed in the instance's scope and receives two arguments - the node and a boole…
1176 var k, l, i, j, c;
1186 …// if(obj.state.loading) { } // the node is already loading - just wait for it to load and invoke …
1189 for(k = 0, l = obj.children_d.length; k < l; k++) {
1191 …ren_d = $.vakata.array_remove_item(this._model.data[obj.parents[i]].children_d, obj.children_d[k]);
1193 if(this._model.data[obj.children_d[k]].state.selected) {
1195 …this._data.core.selected = $.vakata.array_remove_item(this._data.core.selected, obj.children_d[k]);
1197 delete this._model.data[obj.children_d[k]];
1207 this.get_node(obj, true).addClass("jstree-loading").attr('aria-busy',true);
1214 …if(obj.state.loaded && !obj.children.length && dom && dom.length && !dom.hasClass('jstree-leaf')) {
1215 dom.removeClass('jstree-closed jstree-open').addClass('jstree-leaf');
1217 dom.removeClass("jstree-loading").attr('aria-busy',false);
1237 … the function is executed in the instance's scope and receives one argument - the array passed to …
1307 …lete, the function is executed in the instance's scope and receives one argument - a boolean status
1346 var type = x.getResponseHeader('Content-Type');
1347 if((type && type.indexOf('json') !== -1) || typeof d === "object") {
1351 if((type && type.indexOf('html') !== -1) || typeof d === "string") {
1453 this.get_container_ul().children('.jstree-initial-node').remove();
1467 * @param {Boolean} force_processing internal param - do not set
1721 …// ?) three_state selection - p.state.selected && t - (if three_state foreach(dat => ch) -> foreac…
1765 this._model.data = rslt.mod; // breaks the reference in load_node - careful
1773 if($.inArray(r[i], a) === -1 && $.inArray(r[i], s) === -1) {
1779 if($.inArray(s[i], r) === -1) {
1796 // this.get_container_ul().children('.jstree-initial-node').remove();
1916 data.state.opened = d.hasClass('jstree-open');
1917 data.state.selected = d.children('a').hasClass('jstree-clicked');
1918 data.state.disabled = d.children('a').hasClass('jstree-disabled');
1926 tmp = d.children("a").children(".jstree-themeicon");
1928 data.icon = tmp.hasClass('jstree-themeicon-hidden') ? false : tmp.attr('rel');
1953 if(d.hasClass('jstree-closed')) {
1958 …data.li_attr['class'] = data.li_attr['class'].replace('jstree-closed','').replace('jstree-open',''…
1961 …data.a_attr['class'] = data.a_attr['class'].replace('jstree-clicked','').replace('jstree-disabled'…
2200 if(tmp && tmp.length && tmp.children('.jstree-anchor')[0] !== document.activeElement) {
2201 tmp.children('.jstree-anchor').focus();
2218 * redraws all nodes that need to be redrawn or optionally - the whole tree
2242 k = false,
2249 node.children('.jstree-children').remove();
2252 k = d.createElement('UL');
2253 k.setAttribute('role', 'group');
2254 k.className = 'jstree-children';
2256 k.appendChild(this.redraw_node(obj.children[i], true, true));
2258 node.appendChild(k);
2277 k = false,
2289 … : this.element[0].querySelector('#' + ("0123456789".indexOf(obj.id[0]) !== -1 ? '\\3' + obj.id[0]…
2310 // m[obj.id].data = node.data(); // use only node's data, no need to touch jquery storage
2311 if(!deep && obj.children.length && !node.children('.jstree-children').length) {
2315 old = node.children('.jstree-children')[0];
2317 f = node.children('.jstree-anchor')[0] === document.activeElement;
2325 c = 'jstree-node ';
2340 node.setAttribute('aria-selected', !!obj.state.selected);
2341 node.setAttribute('aria-level', obj.parents.length);
2342 node.setAttribute('aria-labelledby', obj.a_attr.id);
2344 node.setAttribute('aria-disabled', true);
2348 c += ' jstree-leaf';
2351 c += obj.state.opened && obj.state.loaded ? ' jstree-open' : ' jstree-closed';
2352 node.setAttribute('aria-expanded', (obj.state.opened && obj.state.loaded) );
2354 if(obj.parent !== null && m[obj.parent].children[m[obj.parent].children.length - 1] === obj.id) {
2355 c += ' jstree-last';
2359 …c = ( obj.state.selected ? ' jstree-clicked' : '') + ( obj.state.disabled ? ' jstree-disabled' : '…
2372 node.childNodes[1].className = 'jstree-anchor ' + c;
2376 node.childNodes[1].childNodes[0].className += ' jstree-themeicon-hidden';
2378 else if(obj.icon.indexOf('/') === -1 && obj.icon.indexOf('.') === -1) {
2379 node.childNodes[1].childNodes[0].className += ' ' + obj.icon + ' jstree-themeicon-custom';
2385 node.childNodes[1].childNodes[0].className += ' jstree-themeicon-custom';
2398 k = d.createElement('UL');
2399 k.setAttribute('role', 'group');
2400 k.className = 'jstree-children';
2402 k.appendChild(this.redraw_node(obj.children[i], deep, true));
2404 node.appendChild(k);
2415 … && par.childNodes[i].className && par.childNodes[i].className.indexOf('jstree-children') !== -1) {
2423 tmp.className = 'jstree-children';
2492 if(animation && d.children(".jstree-children").length) {
2493 d.children(".jstree-children").stop(true, true);
2495 if(obj.children.length && !this._firstChild(d.children('.jstree-children')[0])) {
2501 d[0].className = d[0].className.replace('jstree-closed', 'jstree-open');
2502 d[0].setAttribute("aria-expanded", true);
2507 .children(".jstree-children").css("display","none").end()
2508 .removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded", true)
2509 .children(".jstree-children").stop(true, true)
2594 d[0].className = d[0].className.replace('jstree-open', 'jstree-closed');
2595 d.attr("aria-expanded", false).children('.jstree-children').remove();
2599 .children(".jstree-children").attr("style","display:block !important").end()
2600 .removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded", false)
2601 .children(".jstree-children").stop(true, true).slideUp(animation, function () {
2603 d.children('.jstree-children').remove();
2627 * toggles a node - closing it if it is open, opening it if it is closed
2670 dom = this.is_closed(obj) ? dom.find('.jstree-closed').addBack() : dom.find('.jstree-closed');
2678 if(original_obj.find('.jstree-closed').length === 0) {
2707 dom = this.is_open(obj) ? dom.find('.jstree-open').addBack() : dom.find('.jstree-open');
2728 * enables a node - so that it can be selected
2747 …this.get_node(obj,true).children('.jstree-anchor').removeClass('jstree-disabled').attr('aria-disab…
2757 * disables a node - so that it can not be selected
2776 …this.get_node(obj,true).children('.jstree-anchor').addClass('jstree-disabled').attr('aria-disabled…
2798 …e it fresh (maybe it was moved?) and make sure it is still selected, if not - make last_clicked th…
2801 …core.last_clicked = this.get_node(this._data.core.selected[this._data.core.selected.length - 1]); }
2863 if(!obj || !obj.length || obj.children('.jstree-hovered').length) {
2866 var o = this.element.find('.jstree-hovered'), t = this.element;
2869 obj.children('.jstree-anchor').addClass('jstree-hovered');
2877 setTimeout(function () { t.attr('aria-activedescendant', obj[0].id); }, 0);
2888 if(!obj || !obj.length || !obj.children('.jstree-hovered').length) {
2891 obj.children('.jstree-anchor').removeClass('jstree-hovered');
2929 dom.attr('aria-selected', true).children('.jstree-anchor').addClass('jstree-clicked');
2979 dom.attr('aria-selected', false).children('.jstree-anchor').removeClass('jstree-clicked');
3035 …this.element.find('.jstree-clicked').removeClass('jstree-clicked').parent().attr('aria-selected', …
3064 … `true` the returned array will consist of the full node objects, otherwise - only IDs will be ret…
3073 … `true` the returned array will consist of the full node objects, otherwise - only IDs will be ret…
3078 obj = {}, i, j, k, l;
3083 for(k = 0, l = tmp[i].children_d.length; k < l; k++) {
3084 if(obj[tmp[i].children_d[k]]) {
3085 delete obj[tmp[i].children_d[k]];
3100 … `true` the returned array will consist of the full node objects, otherwise - only IDs will be ret…
3199 if(state.hasOwnProperty(i) && i !== "core" && $.inArray(i, this.settings.plugins) === -1) {
3225 * refreshes the tree - all nodes are reloaded with calls to `load_node`.
3247-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><…
3248 this.element.attr('aria-activedescendant','j'+this._id+'_loading');
3254 this.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id);
3280 this.get_node(obj, true).find('.jstree-open').each(function() { opened.push(this.id); });
3288 * @param {Object} node - the refreshed node
3289 * @param {Array} nodes - an array of the IDs of the nodes that were reloaded
3319 if(i !== -1) { this._data.core.selected[i] = id; }
3323 …i.attr('id', id).children('.jstree-anchor').attr('id', id + '_anchor').end().attr('aria-labelledby…
3324 if(this.element.attr('aria-activedescendant') === obj.id) {
3325 this.element.attr('aria-activedescendant', id);
3575 var t1, t2, par, pos, tmp, i, j, k, l, c;
3592 if(pos !== -1) {
3597 for(k = 0, l = tmp.length; k < l; k++) {
3599 pos = $.inArray(tmp[k], this._model.data[obj.parents[i]].children_d);
3600 if(pos !== -1) {
3604 if(this._model.data[tmp[k]].state.selected) {
3606 pos = $.inArray(tmp[k], this._data.core.selected);
3607 if(pos !== -1) {
3623 for(k = 0, l = tmp.length; k < l; k++) {
3624 delete this._model.data[tmp[k]];
3636 * @param {mixed} pos the position to insert at, or if "rename_node" - the new name
3646 …= par.id || $.inArray(obj.id, par.children) === pos || $.inArray(par.id, obj.children_d) !== -1)) {
3678 …allback a function to call once the move is completed, receives 3 arguments - the node, the new pa…
3685 var t1, t2, old_par, old_pos, new_par, old_ins, is_multi, dpc, tmp, i, j, k, l, p;
3718 …_ins._model.data[old_par].children ? $.inArray(obj.id, old_ins._model.data[old_par].children) : -1;
3761 if(tmp !== -1) {
3763 if(pos > tmp) { pos--; }
3781 for(k = 0, l = p.length; k < l; k++) {
3782 if($.inArray(p[k], tmp) === -1) {
3783 dpc.push(p[k]);
3813 …_model.data[obj.children_d[i]].parents = this._model.data[obj.children_d[i]].parents.slice(0,p*-1);
3851 …allback a function to call once the move is completed, receives 3 arguments - the node, the new pa…
3971 …_par].children ? $.inArray(obj.id, old_ins._model.data[old_par].children) : -1,'is_multi' : (old_i…
4061 * @param {String} mode the performed operation - "copy_node" or "move_node"
4108 a = obj.children('.jstree-anchor');
4117 …("<"+"div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000…
4120 "class" : "jstree-rename-input",
4125 "box-sizing" : "border-box",
4126 "display" : "inline-block",
4132 var i = s.children(".jstree-rename-input"),
4196 if(theme_url && $.inArray(theme_url, themes_loaded) === -1) {
4201 this.element.removeClass('jstree-' + this._data.core.themes.name);
4204 this.element.addClass('jstree-' + theme_name);
4205 …ings.core.themes.responsive ? 'addClass' : 'removeClass' ]('jstree-' + theme_name + '-responsive');
4227 …this.element.removeClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.va…
4231 …this.element.addClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.varia…
4244 … () { this._data.core.themes.stripes = true; this.get_container_ul().addClass("jstree-striped"); },
4249 …{ this._data.core.themes.stripes = false; this.get_container_ul().removeClass("jstree-striped"); },
4259 … () { this._data.core.themes.dots = true; this.get_container_ul().removeClass("jstree-no-dots"); },
4264 …on () { this._data.core.themes.dots = false; this.get_container_ul().addClass("jstree-no-dots"); },
4274 …) { this._data.core.themes.icons = true; this.get_container_ul().removeClass("jstree-no-icons"); },
4279 … () { this._data.core.themes.icons = false; this.get_container_ul().addClass("jstree-no-icons"); },
4289 …* @param {String} icon the new icon - can be a path to an icon or a className, if using an image t…
4304 dom = this.get_node(obj, true).children(".jstree-anchor").children(".jstree-themeicon");
4309 dom.removeClass('jstree-themeicon-custom ' + old).css("background","").removeAttr("rel");
4312 else if(icon.indexOf("/") === -1 && icon.indexOf(".") === -1) {
4314 dom.addClass(icon + ' jstree-themeicon-custom').attr("rel",icon);
4319 …dom.addClass('jstree-themeicon-custom').css("background", "url('" + icon + "') center center no-re…
4351 …this.get_node(obj, true).children(".jstree-anchor").children(".jstree-themeicon").addClass('jstree
4371 …obj.icon = dom.length ? dom.children(".jstree-anchor").children(".jstree-themeicon").attr('rel') :…
4373 …dom.children(".jstree-anchor").children(".jstree-themeicon").removeClass('jstree-themeicon-hidden'…
4386 …if($.inArray(v.name.toLowerCase(),['style','contenteditable','hasfocus','tabindex']) !== -1) { ret…
4415 return tmp !== -1 ? $.vakata.array_remove(array, tmp) : array;
4423 …* It also supports tri-state behavior, meaning that if a node has a few of its children checked it…
4427 _i.className = 'jstree-icon jstree-checkbox';
4461 …is in the string - cascading up is enabled, if 'down' is in the string - cascading down is enabled…
4486 this.element.addClass('jstree-checkbox-no-clicked');
4489 this.element.addClass('jstree-checkbox-selection');
4495 if(this.settings.checkbox.cascade.indexOf('undetermined') !== -1) {
4518 …is.settings.checkbox.cascade.indexOf('up') !== -1 || this.settings.checkbox.cascade.indexOf('down'…
4525 … c, i, j, k, l, tmp, s = this.settings.checkbox.cascade, t = this.settings.checkbox.tie_selection;
4527 if(s.indexOf('down') !== -1) {
4538 for(k = 0, l = m[dpc[i]].children_d.length; k < l; k++) {
4539 m[m[dpc[i]].children_d[k]].state[ t ? 'selected' : 'checked' ] = true;
4547 if(s.indexOf('up') !== -1) {
4555 for(k = 0, l = chd.length; k < l; k++) {
4556 p = m[chd[k]];
4567 …tmp.attr('aria-selected', true).children('.jstree-anchor').addClass( t ? 'jstree-clicked' : 'jstre…
4588 if(s.indexOf('down') !== -1) {
4600 if(s.indexOf('up') !== -1) {
4611 …tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree
4622 if(s.indexOf('down') !== -1 && dom.length) {
4623 …dom.find('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked').parent().attr('aria-s…
4646 if(s.indexOf('down') !== -1) {
4657 if(s.indexOf('up') !== -1) {
4666 …tmp.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'js…
4674 …(s.indexOf('down') === -1 || $.inArray(this._data[ t ? 'core' : 'checkbox' ].selected[i], obj.chil…
4675 …(s.indexOf('up') === -1 || $.inArray(this._data[ t ? 'core' : 'checkbox' ].selected[i], obj.parent…
4683 if(s.indexOf('down') !== -1 && dom.length) {
4684 …dom.find('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked').parent().attr('ari…
4688 if(this.settings.checkbox.cascade.indexOf('up') !== -1) {
4705 …tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree
4733 …tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree
4754 …tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree
4764 …tmp.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'js…
4783 …var i, j, k, l, o = {}, m = this._model.data, t = this.settings.checkbox.tie_selection, s = this._…
4786 for(k = 0, l = m[s[i]].parents.length; k < l; k++) {
4787 if(o[m[s[i]].parents[k]] === undefined && m[s[i]].parents[k] !== '#') {
4788 o[m[s[i]].parents[k]] = true;
4789 p.push(m[s[i]].parents[k]);
4795 this.element.find('.jstree-closed').not(':has(.jstree-children)')
4804 for(k = 0, l = tmp.parents.length; k < l; k++) {
4805 if(o[tmp.parents[k]] === undefined && tmp.parents[k] !== '#') {
4806 o[tmp.parents[k]] = true;
4807 p.push(tmp.parents[k]);
4820 for(k = 0, l = tmp2.parents.length; k < l; k++) {
4821 if(o[tmp2.parents[k]] === undefined && tmp2.parents[k] !== '#') {
4822 o[tmp2.parents[k]] = true;
4823 p.push(tmp2.parents[k]);
4831 this.element.find('.jstree-undetermined').removeClass('jstree-undetermined');
4836 s.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-undetermined');
4846 …i] && obj.childNodes[i].className && obj.childNodes[i].className.indexOf("jstree-anchor") !== -1) {
4852 …ox.tie_selection && this._model.data[obj.id].state.checked) { tmp.className += ' jstree-checked'; }
4856 if(!is_callback && this.settings.checkbox.cascade.indexOf('undetermined') !== -1) {
4867 …data.core.themes.checkboxes = true; this.get_container_ul().removeClass("jstree-no-checkboxes"); };
4873 …._data.core.themes.checkboxes = false; this.get_container_ul().addClass("jstree-no-checkboxes"); };
4889 …ed' ] === true || s.indexOf('undetermined') === -1 || (s.indexOf('down') === -1 && s.indexOf('up')…
4896 …if($.inArray(obj.children_d[i], d) !== -1 || (!m[obj.children_d[i]].state.loaded && m[obj.children…
4904 ….tie_selection && (this.settings.checkbox.whole_node || $(e.target).hasClass('jstree-checkbox'))) {
4907 …ie_selection || (!this.settings.checkbox.whole_node && !$(e.target).hasClass('jstree-checkbox'))) {
4948 dom.children('.jstree-anchor').addClass('jstree-checked');
4988 dom.children('.jstree-anchor').removeClass('jstree-checked');
5042 this.element.find('.jstree-checked').removeClass('jstree-checked');
5069 … `true` the returned array will consist of the full node objects, otherwise - only IDs will be ret…
5080 … `true` the returned array will consist of the full node objects, otherwise - only IDs will be ret…
5087 obj = {}, i, j, k, l;
5092 for(k = 0, l = tmp[i].children_d.length; k < l; k++) {
5093 if(obj[tmp[i].children_d[k]]) {
5094 delete obj[tmp[i].children_d[k]];
5109 … `true` the returned array will consist of the full node objects, otherwise - only IDs will be ret…
5125 var k, l, i, j, c, tmp;
5129 for(k = 0, l = tmp.children_d.length; k < l; k++) {
5130 if(this._model.data[tmp.children_d[k]].state.checked) {
5132 …ta.checkbox.selected = $.vakata.array_remove_item(this._data.checkbox.selected, tmp.children_d[k]);
5169 * Shows a context menu when a node is right-clicked.
5195 * * `separator_before` - a boolean indicating if there should be a separator before this item
5196 * * `separator_after` - a boolean indicating if there should be a separator after this item
5197 * * `_disabled` - a boolean indicating if this action should be disabled
5198 * * `label` - a string - the name of the action (could be a function returning a string)
5199 * * `action` - a function to be executed if this item is chosen
5200 …* * `icon` - a string, can be a path to an icon or a className, if using an image that is in the c…
5201 …* * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for …
5202 * * `shortcut_label` - shortcut label (like for example `F2` for rename)
5230 "icon" : "glyphicon glyphicon-leaf",
5319 .on("contextmenu.jstree", ".jstree-anchor", $.proxy(function (e, data) {
5332 .on("click.jstree", ".jstree-anchor", $.proxy(function (e) {
5333 …if(this._data.contextmenu.visible && (!last_ts || (+new Date()) - last_ts > 250)) { // work around…
5338 .on("touchstart.jstree", ".jstree-anchor", function (e) {
5349 …ouches && e.originalEvent.changedTouches[0] && (Math.abs(ex - e.pageX) > 50 || Math.abs(ey - e.pag…
5363 .on("touchstart", ".jstree-anchor", function (e) {
5367 …Point(e.originalEvent.targetTouches[0].pageX - window.pageXOffset, e.originalEvent.targetTouches[0…
5369 tm = ((+(new Date())) - tm);
5393 * @param {Number} x the x-coordinate relative to the document to show the menu at
5394 * @param {Number} y the y-coordinate relative to the document to show the menu at
5404 a = d.children(".jstree-anchor"),
5430 * @param {Number} x the x-coordinate relative to the document to show the menu at
5431 * @param {Number} y the y-coordinate relative to the document to show the menu at
5439 a = d.children(".jstree-anchor");
5441 var cls = 'jstree-contextmenu jstree-' + this.get_theme() + '-contextmenu';
5451 * @param {Number} x the x-coordinate of the menu relative to the document
5452 * @param {Number} y the y-coordinate of the menu relative to the document
5514 …str += "<"+"li class='vakata-context-separator'><"+"a href='#' " + ($.vakata.context.settings.icon…
5517 …lement" : vakata_context.element })) ? " vakata-contextmenu-disabled " : "") + "' "+(val.shortcut?…
5518 str += "<"+"a href='#' rel='" + (vakata_context.items.length - 1) + "'>";
5522 …icon.indexOf("/") !== -1 || val.icon.indexOf(".") !== -1) { str += " style='background:url(\"" + v…
5525 str += "><"+"/i><"+"span class='vakata-contextmenu-sep'>&#160;<"+"/span>";
5527 … : val.label) + (val.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortc…
5534 …str += "<"+"li class='vakata-context-separator'><"+"a href='#' " + ($.vakata.context.settings.icon…
5538 str = str.replace(/<li class\='vakata-context-separator'\><\/li\>$/,"");
5562 // може да се спести е една проверка - дали няма някой от класовете вече нагоре
5564 o[x - (w + 10 + o.outerWidth()) < 0 ? "addClass" : "removeClass"]("vakata-context-left");
5567 o[x + w + 10 > dw ? "addClass" : "removeClass"]("vakata-context-right");
5570 e.css("bottom","-1px");
5614 x -= (e.outerWidth() - $(reference).outerWidth());
5620 x = dw - (w + 20);
5623 y = dh - (h + 20);
5629 .find('a').first().focus().parent().addClass("vakata-context-hover");
5664 vakata_context.element = $("<ul class='vakata-context'></ul>");
5670 // премахнато заради delegate mouseleave по-долу
5671 // $(this).find(".vakata-context-hover").removeClass("vakata-context-hover");
5676 vakata_context.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end();
5680 .parentsUntil(".vakata-context", "li").addBack().addClass("vakata-context-hover");
5683 // тестово - дали не натоварва?
5686 $(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover");
5689 $(this).find(".vakata-context-hover").removeClass("vakata-context-hover");
5701 …if(!$(this).blur().parent().hasClass("vakata-context-disabled") && $.vakata.context._execute($(thi…
5716 …t.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-conte…
5723 …addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li…
5724 …ext.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last…
5725 o.addClass("vakata-context-hover").children('a').focus();
5732-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").remove…
5739 …addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li…
5740 …ext.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").firs…
5741 o.addClass("vakata-context-hover").children('a').focus();
5757 var a = vakata_context.element.find('.vakata-contextmenu-shortcut-' + e.which).parent();
5758 if(a.parent().not('.vakata-context-disabled')) {
5770 vakata_context.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");
5772 vakata_context.element.addClass("vakata-context-rtl").css("direction", "rtl");
5806 …e's scope and receives the nodes about to be dragged as an argument (array) - return `false` to pr…
5824 …* when dropping a node "inside", this setting indicates the position the node should go to - it ca…
5836touch devices. If left as boolean true dnd will work the same as in desktop browsers, which in som…
5837 * @name $.jstree.defaults.dnd.touch
5840 touch : true, property
5848 …lems with tree scrolling on mobile depending on the interface - in that case set the touch option …
5860 … touchstart.jstree', this.settings.dnd.large_drag_target ? '.jstree-node' : '.jstree-anchor', $.pr…
5861 …if(this.settings.dnd.large_drag_target && $(e.target).closest('.jstree-node')[0] !== e.currentTarg…
5864 …s.dnd.touch || (this.settings.dnd.touch === 'selected' && !$(e.currentTarget).closest('.jstree-nod…
5877-dnd" class="jstree-' + this.get_theme() + ' jstree-' + this.get_theme() + '-' + this.get_theme_va…
5888 marker = $('<div id="jstree-marker">&#160;</div>').hide(); //.appendTo('body');
5901 if(data.event.target.id && data.event.target.id === 'jstree-marker') {
5912 …marker.attr('class', 'jstree-' + ins.get_theme() + ( ins.settings.core.themes.responsive ? ' jstre…
5914 …tree-' + ins.get_theme() + ' jstree-' + ins.get_theme() + '-' + ins.get_theme_variant() + ' ' + ( …
5915 ….find('.jstree-copy').first()[ data.data.origin && (data.data.origin.settings.dnd.always_copy || (…
5928 data.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok');
5934 …? $(data.event.target).closest('.jstree-node').children('.jstree-anchor') : $(data.event.target).c…
5935 if(ref && ref.length && ref.parent().is('.jstree-closed, .jstree-open, .jstree-leaf')) {
5937 rel = data.event.pageY - off.top;
5942 else if(rel > h - h / 3) {
5951 l = off.left - 6;
5959 l = off.left - 2;
5965 l = off.left - 6;
5978 ps -= 1;
5987 if(v === 'i' && ref.parent().is('.jstree-closed') && ins.settings.dnd.open_timeout) {
5993 data.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok');
6004 data.helper.find('.jstree-icon').removeClass('jstree-ok').addClass('jstree-er');
6011 data.helper.find('.jstree-icon').first().removeClass('jstree-ok').addClass('jstree-er');
6037 …data.helper.find('.jstree-copy').first()[ data.data.origin && (data.data.origin.settings.dnd.alway…
6146 …oint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[…
6162 vakata_dnd.helper = $("<div id='vakata-dnd'></div>").html(html).css({
6167 "top" : "-2000px",
6180 …oint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[…
6185 …Math.abs(e.pageX - vakata_dnd.init_x) > (vakata_dnd.is_touch ? $.vakata.dnd.settings.threshold_tou…
6186 …Math.abs(e.pageY - vakata_dnd.init_y) > (vakata_dnd.is_touch ? $.vakata.dnd.settings.threshold_tou…
6225 …if(o.top + t.height() - e.pageY < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = …
6226 if(e.pageY - o.top < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; }
6229 …if(o.left + t.width() - e.pageX < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = …
6230 … if(e.pageX - o.left < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; }
6243 …if(dh > wh && e.pageY - dt < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; …
6244 …if(dh > wh && wh - (e.pageY - dt) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t …
6245 …if(dw > ww && e.pageX - dl < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; }
6246 …if(dw > ww && ww - (e.pageX - dl) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l …
6256 if(dh && ht + 25 > dh) { ht = dh - 50; }
6257 if(dw && hl + vakata_dnd.helper_w > dw) { hl = dw - (vakata_dnd.helper_w + 2); }
6280 …oint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[…
6320 * It is possible to set this to a standard jQuery-like AJAX config.
6325 …* Both the AJAX and the function approach rely on the same return value - an object where the keys…
6408 * a jQuery-like AJAX config, which jstree uses if a server should be queried for results.
6411 …ion, which will be invoked in the instance's scope and receive 3 parameters - the search string, t…
6448 …* If set to a function it wil be called in the instance's scope with two arguments - search string…
6470 …ctorAll('#' + $.map(r, function (v) { return "0123456789".indexOf(v[0]) !== -1 ? '\\3' + v[0] + ' …
6471 this._data.search.dom.children(".jstree-anchor").addClass('jstree-search');
6477 …ctorAll('#' + $.map(s, function (v) { return "0123456789".indexOf(v[0]) !== -1 ? '\\3' + v[0] + ' …
6479 …s.element.find(".jstree-node").hide().filter('.jstree-last').filter(function() { return this.nextS…
6482 ….filter(".jstree-children").each(function () { $(this).children(".jstree-node:visible").eq(-1).add…
6489 …s.element.find(".jstree-node").hide().filter('.jstree-last').filter(function() { return this.nextS…
6491 ….filter(".jstree-children").each(function () { $(this).children(".jstree-node:visible").eq(-1).add…
6497 …ment.find(".jstree-node").css("display","").filter('.jstree-last').filter(function() { return this…
6580 …ctorAll('#' + $.map(r, function (v) { return "0123456789".indexOf(v[0]) !== -1 ? '\\3' + v[0] + ' …
6584 …ctorAll('#' + $.map(r, function (v) { return "0123456789".indexOf(v[0]) !== -1 ? '\\3' + v[0] + ' …
6587 this._data.search.dom.children(".jstree-anchor").addClass('jstree-search');
6607 this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search");
6667 matchmask = 1 << (patternLen - 1);
6675 mask[pattern.charAt(i)] |= 1 << (patternLen - i - 1);
6681 proximity = Math.abs(MATCH_LOCATION - x);
6690 if(pattern === text || text.indexOf(pattern) !== -1) {
6711 if (bestLoc !== -1) {
6714 if (bestLoc !== -1) {
6718 bestLoc = -1;
6728 binMid = Math.floor((binMax - binMin) / 2 + binMin);
6731 start = Math.max(1, MATCH_LOCATION - binMid + 1);
6734 rd[finish + 1] = (1 << i) - 1;
6735 for (j = finish; j >= start; j--) {
6736 charMatch = pattern_alphabet[text.charAt(j - 1)];
6743 score = match_bitapScore(i, j - 1);
6746 bestLoc = j - 1;
6749 start = Math.max(1, 2 * MATCH_LOCATION - bestLoc);
6788 …It is executed in the tree's context, accepts two nodes as arguments and should return `1` or `-1`.
6793 …//return this.get_type(a) === this.get_type(b) ? (this.get_text(a) > this.get_text(b) ? 1 : -1) : …
6794 return this.get_text(a) > this.get_text(b) ? 1 : -1;
6864 … * Time in milliseconds after which the state will expire. Defaults to 'false' meaning - no expire.
6870 …* A function that will be executed prior to restoring state with one argument - the state object. …
6913 var k = $.vakata.storage.get(this.settings.state.key);
6914 if(!!k) { try { k = JSON.parse(k); } catch(ex) { return false; } }
6915 if(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; }
6916 if(!!k && k.state) { k = k.state; }
6917 …if(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k)…
6918 if(!!k) {
6919 …nction (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); });
6920 this.set_state(k);
6956 … number of immediate children this node type can have. Do not specify or set to `-1` for unlimited.
6957 …that the node can have children, but no grandchildren. Do not specify or set to `-1` for unlimited.
6958 …strings, that nodes of this type can have as children. Do not specify or set to `-1` for no limits.
6959 …* * `icon` a string - can be a path to an icon or a className, if using an image that is in the cu…
6964 …* * `default` represents the default node - any settings here will be applied to all nodes that do…
7076 if(chk !== 'move_node' || $.inArray(obj.id, par.children) === -1) {
7078 …if(tmp.max_children !== undefined && tmp.max_children !== -1 && tmp.max_children === par.children.…
7082 …en !== undefined && tmp.valid_children !== -1 && $.inArray((obj.type || 'default'), tmp.valid_chil…
7091 d = d - obj.parents.length + 1;
7095 if(tmp.max_depth !== undefined && tmp.max_depth !== -1 && tmp.max_depth < d) {
7119 if(tmp.max_depth === undefined) { tmp.max_depth = -1; }
7120 if(tmp.max_children === undefined) { tmp.max_children = -1; }
7121 if(tmp.valid_children === undefined) { tmp.valid_children = -1; }
7213 … i = ($.inArray(n, c) === -1 || (obj.text && obj.text[ s ? 'toString' : 'toLowerCase']() === n));
7219 i = ($.inArray(n, c) === -1);
7225 i = ($.inArray(n, c) === -1);
7231 i = ( (obj.parent === par.id && (!more || !more.is_multi)) || $.inArray(n, c) === -1);
7260 while($.inArray(s ? n : n.toLowerCase(), dpc) !== -1) {
7282 div.className = 'jstree-wholerow';
7294 this.get_container_ul().addClass('jstree-wholerow-ul');
7297 this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');
7300 this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');
7305 tmp.children('.jstree-wholerow').addClass('jstree-wholerow-clicked');
7310 …get_node(data.node, true).find('.jstree-clicked').parent().children('.jstree-wholerow').addClass('…
7314 …de(data.node, true).children('.jstree-wholerow')[e.type === "hover_node"?"addClass":"removeClass"]…
7316 .on("contextmenu.jstree", ".jstree-wholerow", $.proxy(function (e) {
7319 $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp);
7322 .on("mousedown.jstree touchstart.jstree", ".jstree-wholerow", function (e) {
7324 var a = $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor");
7330 .on("click.jstree", ".jstree-wholerow", function (e) {
7333 …$(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus();
7335 .on("click.jstree", ".jstree-leaf > .jstree-ocl", $.proxy(function (e) {
7338 …$(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus();
7340 .on("mouseover.jstree", ".jstree-wholerow, .jstree-icon", $.proxy(function (e) {
7347 .on("mouseleave.jstree", ".jstree-node", $.proxy(function (e) {
7353 this.element.find(".jstree-wholerow").remove();
7362 …if($.inArray(obj.id, this._data.core.selected) !== -1) { tmp.className += ' jstree-wholerow-clicke…
7363 …ore.focused && this._data.core.focused === obj.id) { tmp.className += ' jstree-wholerow-hovered'; }
7392 document.registerElement("vakata-jstree", { prototype: proto });