diff --git a/.gitignore b/.gitignore
index 425af745..6f0bf15f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,4 @@
/jstree.sublime-project
/jstree.sublime-workspace
/node_modules
-/documentation.bat
\ No newline at end of file
+/favicon.ico
\ No newline at end of file
diff --git a/dist/jstree.js b/dist/jstree.js
index ba4215a0..4e4cad7f 100644
--- a/dist/jstree.js
+++ b/dist/jstree.js
@@ -633,7 +633,8 @@
if(obj === -1 || !obj || !obj.length) {
return false;
}
- var o = obj.parentNode.parentNode;
+ var o = obj[0].parentNode.parentNode;
+
return o.tagName === 'LI' ? $(o) : -1;
},
/**
@@ -2437,7 +2438,7 @@
var t = $(v),
d = t.data('jstree');
if(d && d.children && t.children('ul').length === 0) {
- this._progressive_data_clean(d.children);
+ this._progressive_data_clean(d.children, e.type === 'select_node');
}
}, this));
}, this));
@@ -2524,7 +2525,7 @@
}, this));
}
};
- this._progressive_data_clean = function (data) {
+ this._progressive_data_clean = function (data, is_select) {
if(!this.settings.checkbox.three_state) { return false; }
for(var i = 0, j = data.length; i < j; i++) {
if(data[i].data && data[i].data.jstree) {
@@ -2535,7 +2536,7 @@
delete data[i].data.jstree.undetermined;
}
if(data[i].children) {
- this._progressive_data_clean(data[i].children);
+ this._progressive_data_clean(data[i].children, is_select);
}
}
}
@@ -3609,7 +3610,7 @@
this.element
.bind("after_close.jstree", $.proxy(function (e, data) {
var t = $(data.node);
- if(this.settings.json.progressive_unload) {
+ if(this.settings.json.progressive_unload && t.find('.jstree-clicked:eq(0)').length === 0) {
t.data('jstree').children = this.get_json(t)[0].children;
t.children("ul").remove();
}
@@ -3618,24 +3619,22 @@
};
this.parse_json = function (node) {
var s = this.settings.json;
- if($.isArray(node.children) && (this._data.core.ready || !this.settings.core.expand_selected_onload || !this._has_selected(node.children))) {
- if(s.progressive_render) {
- if(!node.data) { node.data = {}; }
- if(!node.data.jstree) { node.data.jstree = {}; }
- node.data.jstree.children = node.children;
- node.children = true;
- }
+ if(s.progressive_render && $.isArray(node.children) && !this._json_has_selected(node.children)) {
+ if(!node.data) { node.data = {}; }
+ if(!node.data.jstree) { node.data.jstree = {}; }
+ node.data.jstree.children = node.children;
+ node.children = true;
}
return parent.parse_json.call(this, node);
};
- this._has_selected = function (data) {
+ this._json_has_selected = function (data) {
var r = false;
for(var i = 0, j = data.length; i < j; i++) {
if(data[i].data && data[i].data.jstree && data[i].data.jstree.selected) {
r = true;
}
else if(data[i].children) {
- r = r || this._has_selected(data[i].children);
+ r = r || this._json_has_selected(data[i].children);
}
else {
r = false;
diff --git a/dist/jstree.min.js b/dist/jstree.min.js
index 060c0ffa..2b4cfdb2 100644
--- a/dist/jstree.min.js
+++ b/dist/jstree.min.js
@@ -1,4 +1,4 @@
-/*! jsTree - v2.0.0-alpha - 2013-03-19 - (MIT) */
-(function(e){"use strict";if(!e.jstree){var t=0,n=!1,s=!1,a=[];e.jstree={version:"2.0.0-alpha",defaults:{plugins:[]},plugins:{}},e.jstree.create=function(n,s){var a=new e.jstree.core(++t),r=s;return s=e.extend(!0,{},e.jstree.defaults,s),r&&r.plugins&&(s.plugins=r.plugins),e.each(s.plugins,function(e,t){"core"!==e&&(a=a.plugin(t,s[t]))}),a.init(n,s),a},e.jstree.core=function(e){this._id=e,this._data={core:{themes:{}}}},e.jstree.reference=function(t){return e(t).closest(".jstree").data("jstree")},e.fn.jstree=function(t){var n="string"==typeof t,s=Array.prototype.slice.call(arguments,1),a=null;return this.each(function(){var r=e(this).data("jstree"),i=n&&r?r[t]:null;return a=n&&i?i.apply(r,s):null,r||e(this).data("jstree",new e.jstree.create(this,t)),null!==a&&a!==void 0?!1:void 0}),null!==a&&a!==void 0?a:this},e.expr[":"].jstree=e.expr.createPseudo(function(){return function(t){return e(t).hasClass("jstree")&&e(t).data("jstree")!==void 0}}),e.jstree.defaults.core={strings:!1,check_callback:!0,animation:100,aria_roles:!1,multiple:!0,themes:{name:!1,url:!0,dots:!0,icons:!0,dir:!1},base_height:!1,clean_loaded:!0,correct_loaded:!0,expand_selected_onload:!0},e.jstree.core.prototype={plugin:function(t,n){var s=e.jstree.plugins[t];return s?(this._data[t]={},s.prototype=this,new s(n,this)):this},init:function(t,n){this.element=e(t).addClass("jstree jstree-"+this._id),this.settings=n,this.element.bind("destroyed",e.proxy(this.teardown,this)),this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.settings.core.aria_roles&&this.element.attr("role","tree"),this._data.core.selected=e(),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html("
"),this._data.core.li_height=this.settings.base_height||this.get_container_ul().children("li:eq(0)").height()||18,this.load_node(-1)},destroy:function(){this.element.unbind("destroyed",this.teardown),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){e.support.touch&&this.element.addTouch(),this.element.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var e=window.getSelection();try{e.removeAllRanges(),e.collapse()}catch(t){}}}).on("click.jstree",".jstree-ocl",e.proxy(function(e){this.toggle_node(e.target)},this)).on("click.jstree",".jstree-anchor",e.proxy(function(e){e.preventDefault(),this.activate_node(e.currentTarget,e)},this)).on("keydown.jstree",".jstree-anchor",e.proxy(function(t){var n=null;switch(t.which){case 13:case 32:t.type="click",e(t.currentTarget).trigger(t);break;case 37:t.preventDefault(),this.is_open(t.currentTarget)?this.close_node(t.currentTarget):(n=this.get_prev(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus());break;case 38:t.preventDefault(),n=this.get_prev(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus();break;case 39:t.preventDefault(),this.is_closed(t.currentTarget)?this.open_node(t.currentTarget):(n=this.get_next(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus());break;case 40:t.preventDefault(),n=this.get_next(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus();break;default:}},this)).on("create_node.jstree",e.proxy(function(e,t){this.clean_node(t.node)},this)).on("load_node.jstree",e.proxy(function(t,n){if(n.status){if(this.settings.core.clean_loaded)if(-1===n.node){var s=this.get_container_ul().detach();s.children("li").length&&this.clean_node(s.children("li")),this.element.prepend(s)}else{var a=this._data.core.selected.length;n.node.children("ul").children("li").length&&this.clean_node(n.node.children("ul").children("li")),this._data.core.ready&&a!==this._data.core.selected.length&&this.trigger("changed",{action:"clean_node",selected:this._data.core.selected})}-1!==n.node||this._data.core.loaded||(this._data.core.loaded=!0,this.trigger("loaded")),this._data.core.ready||this.get_container_ul().find(".jstree-loading:eq(0)").length||(this._data.core.ready=!0,this._data.core.selected.length&&(this.settings.core.expand_selected_onload&&this._data.core.selected.parents(".jstree-closed").each(e.proxy(function(e,t){this.open_node(t,!1,0)},this)),this.trigger("changed",{action:"ready",selected:this._data.core.selected})),this.trigger("ready"))}},this)).on("loaded.jstree",e.proxy(function(e,t){this.settings.core.correct_loaded&&t.instance.get_container_ul().children("li").each(function(){t.instance.correct_node(this)})},this)).on("open_node.jstree",e.proxy(function(e,t){this.settings.core.correct_loaded&&t.node.children("li").each(function(){t.instance.correct_node(this)})},this)).on("init.jstree",e.proxy(function(){var e=this.settings.core.themes;this._data.core.themes.dots=e.dots,this._data.core.themes.icons=e.icons,e.name===!1&&(e.name="default"),this.set_theme(e.name,e.url)},this)).on("loaded.jstree",e.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"]()},this)).on("focus.jstree",".jstree-anchor",e.proxy(function(t){e(t.currentTarget).mouseenter()},this)).on("blur.jstree",".jstree-anchor",e.proxy(function(t){e(t.currentTarget).mouseleave()},this)).on("mouseenter.jstree",".jstree-anchor",e.proxy(function(e){var t=this.element.find(".jstree-anchor:focus").not(".jstree-clicked");t&&t.length&&t[0]!==e.currentTarget&&t.blur(),this.hover_node(e.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),e(document).off(".jstree-"+this._id)},trigger:function(t,n,s){n||(n={}),n.instance=this,"number"===(typeof s).toLowerCase()?setTimeout(e.proxy(function(){this.element.triggerHandler(t.replace(".jstree","")+".jstree",n)},this),s):this.element.triggerHandler(t.replace(".jstree","")+".jstree",n)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children("ul:eq(0)")},get_string:function(t){var n=this.settings.core.strings;return e.isFunction(n)?n.call(this,t):n&&n[t]?n[t]:t},_firstChild:function(e){for(e=e?e.firstChild:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_nextSibling:function(e){for(e=e?e.nextSibling:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_previousSibling:function(e){for(e=e?e.previousSibling:null;null!==e&&1!==e.nodeType;)e=e.previousSibling;return e},get_node:function(t){return-1===t?-1:(t=e(t,this.element),t.hasClass(".jstree")?-1:(t=t.closest("li",this.element),t.length?t:!1))},get_next:function(t,n){var s;return t=this.get_node(t),-1===t?(s=this._firstChild(this.get_container_ul()[0]),s?e(s):!1):t&&t.length?n?(s=this._nextSibling(t[0]),s?e(s):!1):t.hasClass("jstree-open")?(s=this._firstChild(t.children("ul")[0]),s?e(s):!1):(s=this._nextSibling(t[0]))?e(s):t.parentsUntil(".jstree","li").next("li").eq(0):!1},get_prev:function(t,n){var s;if(t=this.get_node(t),-1===t)return s=this.get_container_ul()[0].lastChild,s?e(s):!1;if(!t||!t.length)return!1;if(n)return s=this._previousSibling(t[0]),s?e(s):!1;if(s=this._previousSibling(t[0])){for(t=e(s);t.hasClass("jstree-open");)t=t.children("ul:eq(0)").children("li:last");return t}return s=t[0].parentNode.parentNode,s&&"LI"===s.tagName?e(s):!1},get_parent:function(t){if(t=this.get_node(t),-1===t||!t||!t.length)return!1;var n=t.parentNode.parentNode;return"LI"===n.tagName?e(n):-1},get_children:function(e){return e=this.get_node(e),-1===e?this.get_container_ul().children("li"):e&&e.length?e.children("ul").children("li"):!1},is_parent:function(e){return e=this.get_node(e),e&&-1!==e&&(this._firstChild(e.children("ul")[0])||e.hasClass("jstree-closed"))},is_loaded:function(e){return e=this.get_node(e),e&&(-1===e&&!this.element.children("ul").children("li.jstree-loading").length||-1!==e&&!e.hasClass("jstree-loading")&&(this._firstChild(e.children("ul")[0])||e.hasClass("jstree-leaf")))},is_loading:function(e){return e=this.get_node(e),e&&(-1===e&&this.element.children("ul").children("li.jstree-loading").length||-1!==e&&e.hasClass("jstree-loading"))},is_open:function(e){return e=this.get_node(e),e&&-1!==e&&e.hasClass("jstree-open")},is_closed:function(e){return e=this.get_node(e),e&&-1!==e&&e.hasClass("jstree-closed")},is_leaf:function(e){return e=this.get_node(e),e&&-1!==e&&e.hasClass("jstree-leaf")},load_node:function(t,n){return(t=this.get_node(t))?(-1!==t&&t.addClass("jstree-loading"),this._load_node(t,e.proxy(function(e){-1!==t&&t.removeClass("jstree-loading"),this.trigger("load_node",{node:t,status:e}),n&&n.call(this,t,e)},this)),!0):(n.call(this,t,!1),!1)},_load_node:function(e,t){-1===e?(this.get_container_ul().empty().append(this._data.core.original_container_html.clone(!0)),t.call(this,!0)):t.call(this,!1)},open_node:function(e,t,n){if(e=this.get_node(e),-1===e||!e||!e.length)return!1;if(n="undefined"===(typeof n).toLowerCase()?this.settings.core.animation:n,!this.is_closed(e))return t&&t.call(this,e,!1),!1;if(this.is_loaded(e)){var s=this;n?e.children("ul").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").children("ul").stop(!0,!0).slideDown(n,function(){this.style.display="",s.trigger("after_open",{node:e})}):e[0].className=e[0].className.replace("jstree-closed","jstree-open"),t&&t.call(this,e,!0),this.trigger("open_node",{node:e}),n||this.trigger("after_open",{node:e})}else this.load_node(e,function(e,s){return s?this.open_node(e,t,n):t?t.call(this,e,!1):!1})},close_node:function(e,t){if(e=this.get_node(e),!e||!e.length||!this.is_open(e))return!1;t="undefined"===(typeof t).toLowerCase()?this.settings.core.animation:t;var n=this;t?e.children("ul").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").children("ul").stop(!0,!0).slideUp(t,function(){this.style.display="",n.trigger("after_close",{node:e})}):e[0].className=e[0].className.replace("jstree-open","jstree-closed"),this.trigger("close_node",{node:e}),t||this.trigger("after_close",{node:e})},toggle_node:function(e){return this.is_closed(e)?this.open_node(e):this.is_open(e)?this.close_node(e):void 0},open_all:function(e,t,n){e=e?this.get_node(e):-1,e=e&&-1!==e?e:this.get_container_ul(),n=n||e;var s=this;e=this.is_closed(e)?e.find("li.jstree-closed").addBack():e.find("li.jstree-closed"),e.each(function(){s.open_node(this,s.is_loaded(this)?!1:function(e){this.open_all(e,t,n)},t||0)}),0===n.find("li.jstree-closed").length&&this.trigger("open_all",{node:n})},close_all:function(e,t){e=e?this.get_node(e):-1;var n=e&&-1!==e?e:this.get_container_ul(),s=this;n=this.is_open(n)?n.find("li.jstree-open").addBack():n.find("li.jstree-open"),n.each(function(){s.close_node(this,t||0)}),this.trigger("close_all",{node:e})},is_disabled:function(e){return e=this.get_node(e),e&&-1!==e&&e.children(".jstree-anchor").hasClass("jstree-disabled")},enable_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").removeClass("jstree-disabled"),this.trigger("enable_node",{node:e}),void 0):!1},disable_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").addClass("jstree-disabled"),this.trigger("disable_node",{node:e}),void 0):!1},activate_node:function(e,t){return this.is_disabled(e)?!1:(this.settings.core.multiple&&(t.metaKey||t.ctrlKey)?this.is_selected(e)?this.deselect_node(e):this.select_node(e):(this.deselect_all(!0),this.select_node(e)),this.trigger("activate_node",{node:e}),void 0)},hover_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:e}),void 0):!1},dehover_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").removeClass("jstree-hovered"),this.trigger("dehover_node",{node:e}),void 0):!1},select_node:function(e,t,n){if(e=this.get_node(e),!e||!e.length)return!1;if(this._data.core.selected=this._data.core.selected.add(e),this.element.find(".jstree-clicked").removeClass("jstree-clicked"),this._data.core.selected.children(".jstree-anchor").addClass("jstree-clicked"),!n){var s=this;e.parents(".jstree-closed").each(function(){s.open_node(this,!1,0)})}this.trigger("select_node",{node:e,selected:this._data.core.selected}),t||this.trigger("changed",{action:"select_node",node:e,selected:this._data.core.selected})},deselect_node:function(e,t){return e=this.get_node(e),e&&e.length?(this._data.core.selected=this._data.core.selected.not(e),this.element.find(".jstree-clicked").removeClass("jstree-clicked"),this._data.core.selected.children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("deselect_node",{node:e,selected:this._data.core.selected}),t||this.trigger("changed",{action:"deselect_node",node:e,selected:this._data.core.selected}),void 0):!1},deselect_all:function(t){this._data.core.selected=e();var n=this.element.find(".jstree-clicked").removeClass("jstree-clicked");this.trigger("deselect_all",{selected:this._data.core.selected,node:n}),t||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,node:n})},is_selected:function(e){return e=this.get_node(e),e&&e.length?this._data.core.selected.index(e)>=0:!1},get_selected:function(){return this._data.core.selected},clean_node:function(t){t=this.get_node(t),t=t&&-1!==t?t.find("li").addBack():this.element.find("li"),t.find("li.jstree-clicked").removeClass("jstree-clicked"),this.settings.core.aria_roles&&t.attr("role","treeitem").parent().attr("role","group");var n=this;return t.each(function(){var t=e(this),s=t.children("a"),a=t.data("jstree"),r=a&&a.opened||t.hasClass("jstree-open")?"open":a&&(a.closed||a.children)||t.children("ul").length?"closed":"leaf";switch(a&&a.opened&&delete a.opened,a&&a.closed&&delete a.closed,t.removeClass("jstree-open jstree-closed jstree-leaf jstree-last"),s.length?e.trim(s.attr("href"))||s.attr("href","#"):(t.contents().filter(function(){return 3===this.nodeType||"UL"!==this.tagName}).wrapAll(''),s=t.children("a"),s.html(t.children("a").html().replace(/[\s\t\n]+$/,""))),s.addClass("jstree-anchor"),t.children("i.jstree-ocl").length||t.prepend(" "),t.next().length||t.addClass("jstree-last"),r){case"leaf":t.addClass("jstree-leaf");break;case"closed":t.addClass("jstree-closed"),n.close_node(t,0);break;case"open":t.addClass("jstree-closed"),n.open_node(t,!1,0)}s.children("i.jstree-themeicon").length||s.prepend(" "),a&&a.icon!==void 0&&(n.set_icon(t,a.icon),delete a.icon),a&&a.selected&&(n.select_node(t,!0,!0),delete a.selected),a&&a.disabled&&(n.disable_node(t),delete a.disabled)})},correct_node:function(t,n){return t=this.get_node(t),!t||-1===t&&!n?!1:(t=-1===t?this.element.find("li"):n?t.find("li").addBack():t,t.each(function(){var t=e(this);switch(!0){case t.hasClass("jstree-open")&&!t.children("ul").children("li").length:t.removeClass("jstree-open").addClass("jstree-leaf").children("ul").remove();break;case t.hasClass("jstree-leaf")&&!!t.children("ul").children("li").length:t.removeClass("jstree-leaf").addClass("jstree-closed")}t[0===t.next().length?"addClass":"removeClass"]("jstree-last")}),t)},get_state:function(){var e={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},themes:{name:this.get_theme(),icons:this._data.core.themes.icons,dots:this._data.core.themes.dots},selected:[]}};return this.get_container_ul().find(".jstree-open").each(function(){this.id&&e.core.open.push(this.id)}),this._data.core.selected.each(function(){this.id&&e.core.selected.push(this.id)}),e},set_state:function(t,n){if(t){if(t.core){if(e.isArray(t.core.open)){var s=!0,a=this;return e.each(t.core.open.concat([]),function(n,r){r=document.getElementById(r),r&&(a.is_loaded(r)?(a.is_closed(r)&&a.open_node(r,!1,0),e.vakata.array_remove(t.core.open,n)):(a.is_loading(r)||a.open_node(r,e.proxy(function(){this.set_state(t)},a),0),s=!1))}),s&&(delete t.core.open,this.set_state(t,n)),!1}if(t.core.scroll)return t.core.scroll&&t.core.scroll.left!==void 0&&this.element.scrollLeft(t.core.scroll.left),t.core.scroll&&t.core.scroll.top!==void 0&&this.element.scrollTop(t.core.scroll.top),delete t.core.scroll,delete t.core.open,this.set_state(t,n),!1;if(t.core.themes)return t.core.themes.name&&this.set_theme(t.core.themes.name),t.core.themes.dots!==void 0&&this[t.core.themes.dots?"show_dots":"hide_dots"](),t.core.themes.icons!==void 0&&this[t.core.themes.icons?"show_icons":"hide_icons"](),delete t.core.themes,delete t.core.open,this.set_state(t,n),!1;if(t.core.selected){var r=this;return this.deselect_all(),e.each(t.core.selected,function(e,t){r.select_node(document.getElementById(t))}),delete t.core.selected,this.set_state(t,n),!1}return e.isEmptyObject(t)?(n&&n.call(this),this.trigger("set_state"),!1):!0}return!0}return!1},refresh:function(){this._data.core.state=this.get_state(),this.load_node(-1,function(t,n){n&&this.set_state(e.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")}),this._data.core.state=null})},get_text:function(t,n){return t=this.get_node(t),t&&-1!==t&&t.length?(t=t.children("a:eq(0)").clone(),t.children(".jstree-icon").remove(),t=t[n?"text":"html"](),t=e("")[n?"text":"html"](t),t.html()):!1},set_text:function(e,t){if(e=this.get_node(e),!e||-1===e||!e.length)return!1;e=e.children("a:eq(0)");var n=e.children("I").clone();return e.html(t).prepend(n),this.trigger("set_text",{obj:e,text:t}),!0},parse_json:function(t){var n,s,a,r;return null===t||e.isArray(t)&&0===t.length?!1:e.isArray(t)?(a=e(""),r=this,e.each(t,function(e,t){a.append(r.parse_json(t))}),a):(t===void 0&&(t={}),"string"==typeof t&&(t={title:t}),t.li_attr||(t.li_attr={}),t.a_attr||(t.a_attr={}),t.a_attr.href||(t.a_attr.href="#"),t.title||(t.title=this.get_string("New node")),n=e("").attr(t.li_attr),s=e("").attr(t.a_attr).html(t.title),a=e(""),t.data&&!e.isEmptyObject(t.data)&&n.data(t.data),(t.children===!0||e.isArray(t.children)||n.data("jstree")&&e.isArray(n.data("jstree").children))&&(n.data("jstree")||n.data("jstree",{}),n.data("jstree").closed=!0),n.append(s),e.isArray(t.children)&&(e.each(t.children,e.proxy(function(e,t){a.append(this.parse_json(t))},this)),n.append(a)),n)},get_json:function(t,n){t=t!==void 0?this.get_node(t):!1,n||t&&-1!==t||(t=this.get_container_ul().children("li"));var s,a,r,i={},o={},l={};return t&&t.length?t.length>1||!n?(s=[],a=this,t.each(function(){s.push(a.get_json(e(this),!0))}),s):(l=e.vakata.attributes(t,!0),e.each(l,function(t,n){return"id"===t?(i[t]=n,!0):(n=e.trim(n.replace(/\bjstree[^ ]*/gi,"").replace(/\s+$/gi," ")),n.length&&(i[t]=n),void 0)}),l=e.vakata.attributes(t.children(".jstree-anchor"),!0),e.each(l,function(t,n){return"id"===t?(o[t]=n,!0):(n=e.trim(n.replace(/\bjstree[^ ]*/gi,"").replace(/\s+$/gi," ")),n.length&&(o[t]=n),void 0)}),s={title:this.get_text(t),data:e.extend(!0,{},t.data()||{}),children:!1,li_attr:i,a_attr:o},s.data.jstree||(s.data.jstree={}),this.is_open(t)&&(s.data.jstree.opened=!0),this.is_closed(t)&&(s.data.jstree.closed=!0),r=this.get_icon(t),r!==void 0&&null!==r&&(s.data.jstree.icon=r),this.is_selected(t)&&(s.data.jstree.selected=!0),t=t.children("ul").children("li"),t.length&&(s.children=[],a=this,t.each(function(){s.children.push(a.get_json(e(this),!0))})),s):!1},create_node:function(e,t,n,s,a){if(e=this.get_node(e),n=n===void 0?"last":n,-1!==e&&!e.length)return!1;if(!n.match(/^(before|after)$/)&&!a&&!this.is_loaded(e))return this.load_node(e,function(){this.create_node(e,t,n,s,!0)});var r=this.parse_json(t),i=-1===e?this.element:e;switch(-1===e&&("before"===n&&(n="first"),"after"===n&&(n="last")),n){case"before":n=e.index(),e=this.get_parent(e);break;case"after":n=e.index()+1,e=this.get_parent(e);break;case"inside":case"first":n=0;break;case"last":n=i.children("ul").children("li").length;break;default:n||(n=0)}return this.check("create_node",r,e,n)?(i=-1===e?this.element:e,i.children("ul").length||i.append(""),i.children("ul").children("li").eq(n).length?i.children("ul").children("li").eq(n).before(r):i.children("ul").append(r),this.correct_node(e,!0),s&&s.call(this,r),this.trigger("create_node",{node:r,parent:e,position:r.index()}),r):!1},rename_node:function(e,t){e=this.get_node(e);var n=this.get_text(e);return this.check("rename_node",e,this.get_parent(e),t)?(e&&e.length&&(this.set_text(e,t),this.trigger("rename_node",{node:e,title:t,old:n})),void 0):!1},delete_node:function(e){if(e=this.get_node(e),!e||-1===e||!e.length)return!1;var t=this.get_parent(e),n=this.get_prev(e);if(!this.check("delete_node",e,t,e.index()))return!1;e=e.detach(),this.correct_node(t),this.correct_node(n),this.trigger("delete_node",{node:e,prev:n,parent:t});var s=e.find(".jstree-clicked"),a=this;return s.length&&(s.each(function(){a.deselect_node(this,!0)}),this.trigger("changed",{action:"delete_node",node:e,selected:this._data.core.selected,parent:t})),e},check:function(t,n,s,a){var r=t.match(/^move_node|copy_node|create_node$/i)?s:n,i=this.settings.core.check_callback;if(i===!1||e.isFunction(i)&&i.call(this,t,n,s,a)===!1)return!1;if(r=-1===r?this.element.data("jstree"):r.data("jstree"),r&&r.functions&&r.functions[t]&&(r=r.functions[t],e.isFunction(r)&&(r=r.call(this,t,n,s,a)),r===!1))return!1;switch(t){case"create_node":break;case"rename_node":break;case"move_node":if(r=-1===s?this.element:s,r=r.children("ul").children("li"),r.length&&-1!==r.index(n)&&(a===n.index()||a===n.index()+1))return!1;if(-1!==s&&-1!==s.parentsUntil(".jstree","li").addBack().index(n))return!1;break;case"copy_node":break;case"delete_node":}return!0},move_node:function(t,n,s,a,r){if(t=this.get_node(t),n=this.get_node(n),s=s===void 0?0:s,!t||-1===t||!t.length)return!1;if(-1!==n&&!n.length)return!1;if(!(""+s).match(/^(before|after)$/)&&!r&&!this.is_loaded(n))return this.load_node(n,function(){this.move_node(t,n,s,a,!0)});var i=this.get_parent(t),o=(""+s).match(/^(before|after)$/)&&-1!==n?this.get_parent(n):n,l=e.jstree.reference(t),c=-1===n?this:e.jstree.reference(n),d=l._id!==c._id;switch(-1===o&&(n=c.get_container(),"before"===s&&(s="first"),"after"===s&&(s="last")),s){case"before":s=n.index();break;case"after":s=n.index()+1;break;case"inside":case"first":s=0;break;case"last":s=n.children("ul").children("li").length;break;default:s||(s=0)}return this.check("move_node",t,o,s)?(n.children("ul").length||n.append(""),n.children("ul").children("li").eq(s).length?n.children("ul").children("li").eq(s).before(t):n.children("ul").append(t),d&&(t.find(".jstree-icon, .jstree-ocl").remove(),this.clean_node(t)),l.correct_node(i,!0),c.correct_node(o,!0),a&&a.call(this,t,o,t.index()),this.trigger("move_node",{node:t,parent:o,position:t.index(),old_parent:i,is_multi:d,old_instance:l,new_instance:c}),!0):!1},copy_node:function(t,n,s,a,r){if(t=this.get_node(t),n=this.get_node(n),s=s===void 0?"last":s,!t||-1===t||!t.length)return!1;if(-1!==n&&!n.length)return!1;if(!(""+s).match(/^(before|after)$/)&&!r&&!this.is_loaded(n))return this.load_node(n,function(){this.copy_node(t,n,s,a,!0)});var i=t,o=this.get_parent(t),l=(""+s).match(/^(before|after)$/)&&-1!==n?this.get_parent(n):n,c=e.jstree.reference(t),d=-1===n?this:e.jstree.reference(n),h=c._id!==d._id;switch(t=t.clone(!0),t.find("*[id]").addBack().each(function(){this.id&&(this.id="copy_"+this.id)}),-1===l&&(n=d.get_container(),"before"===s&&(s="first"),"after"===s&&(s="last")),s){case"before":s=n.index();break;case"after":s=n.index()+1;break;case"inside":case"first":s=0;break;case"last":s=n.children("ul").children("li").length;break;default:s||(s=0)}return this.check("copy_node",i,l,s)?(n.children("ul").length||n.append(""),n.children("ul").children("li").eq(s).length?n.children("ul").children("li").eq(s).before(t):n.children("ul").append(t),h&&t.find(".jstree-icon, .jstree-ocl").remove(),d.clean_node(t),d.correct_node(l,!0),a&&a.call(this,t,l,t.index(),i),this.trigger("copy_node",{node:t,parent:l,old_parent:o,position:t.index(),original:i,is_multi:h,old_instance:c,new_instance:d}),!0):!1},cut:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(n=e,s="move_node",this.trigger("cut",{node:e}),void 0):!1},copy:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(n=e,s="copy_node",this.trigger("copy",{node:e}),void 0):!1},get_buffer:function(){return{mode:s,node:n}},can_paste:function(){return s!==!1&&n!==!1},paste:function(e){return e=this.get_node(e),e&&s&&s.match(/^(copy_node|move_node)$/)&&n?(this[s](n,e),this.trigger("paste",{obj:e,nodes:n,mode:s}),n=!1,s=!1,void 0):!1},edit:function(t,n){if(t=this.get_node(t),!t||-1===t||!t.length)return!1;t.parentsUntil(".jstree",".jstree-closed").each(e.proxy(function(e,t){this.open_node(t,!1,0)},this));var s=this._data.core.rtl,a=this.element.width(),r=t.children("a:eq(0)"),i=t.children("i"),o=r.children("i"),l=i.width()*i.length,c=o.width()*o.length,d="string"==typeof n?n:this.get_text(t),h=e("",{css:{position:"absolute",top:"-200px",left:s?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),u=t.css("position","relative").append(e("",{value:d,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:s?"auto":l+c+4+"px",right:s?l+c+4+"px":"auto",top:"0px",height:this._data.core.li_height-2+"px",lineHeight:this._data.core.li_height-2+"px",width:"150px"},blur:e.proxy(function(){var e=t.children(".jstree-rename-input"),n=e.val();""===n&&(n=d),h.remove(),e.remove(),this.rename_node(t,n)===!1&&this.rename_node(t,d),t.css("position","")},this),keydown:function(e){var t=e.keyCode||e.which;27===t&&(this.value=d),(27===t||13===t||37===t||38===t||39===t||40===t)&&e.stopImmediatePropagation(),(27===t||13===t)&&(e.preventDefault(),this.blur())},keyup:function(e){e.keyCode||e.which,u.width(Math.min(h.text("pW"+this.value).width(),a))},keypress:function(e){var t=e.keyCode||e.which;return 13===t?!1:void 0}})).children(".jstree-rename-input"),_={fontFamily:r.css("fontFamily")||"",fontSize:r.css("fontSize")||"",fontWeight:r.css("fontWeight")||"",fontStyle:r.css("fontStyle")||"",fontStretch:r.css("fontStretch")||"",fontVariant:r.css("fontVariant")||"",letterSpacing:r.css("letterSpacing")||"",wordSpacing:r.css("wordSpacing")||""};this.set_text(t,""),h.css(_),u.css(_).width(Math.min(h.text("pW"+u[0].value).width(),a))[0].select()},set_theme:function(t,n){if(!t)return!1;if(n===!0){var s=this.settings.core.themes.dir;s||(s=e.jstree.path+"/themes"),n=s+"/"+t+"/style.css"}n&&-1===e.inArray(n,a)&&(e("head").append(''),a.push(n)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=t,this.element.addClass("jstree-"+t),this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},show_dots:function(){this._data.core.themes.dots=!0,this.element.children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.element.children("ul").addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.element.children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.element.children("ul").addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(e,t){return e=this.get_node(e),e&&-1!==e&&e.length?(e=e.children("a").children(".jstree-themeicon"),t===!1?this.hide_icon(e):-1===t.indexOf("/")?e.addClass(t).attr("rel",t):e.css("background","url('"+t+"') center center no-repeat").attr("rel",t),!0):!1},get_icon:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(e=e.children("a").children(".jstree-themeicon"),e.hasClass("jstree-themeicon-hidden")?!1:(e=e.attr("rel"),e&&e.length?e:null)):null},hide_icon:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(e.children("a").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(e.children("a").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}};var r=e("script:last").attr("src");e.jstree.path=r?r.replace(/\/[^\/]+$/,""):"",e.jstree.no_css=r&&-1!==r.indexOf("?no_css"),e.jstree.no_css&&(e.jstree.defaults.core.themes.url=!1),e(function(){var t=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; list-style-image:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree .jstree-icon { display:inline-block; text-decoration:none; margin:0; padding:0; vertical-align:top; } .jstree .jstree-ocl { width:18px; height:18px; text-align:center; line-height:18px; cursor:pointer; vertical-align:top; } .jstree li.jstree-open > ul { display:block; } .jstree li.jstree-closed > ul { display:none; } .jstree-anchor { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; padding:1px 4px 1px 2px; margin:0; text-decoration:none; outline:0; } .jstree-anchor > .jstree-themeicon { height:16px; width:16px; margin-right:3px; } .jstree-rtl .jstree-anchor { padding:1px 2px 1px 4px; } .jstree-rtl .jstree-anchor > .jstree-themeicon { margin-left:3px; margin-right:0; } .jstree-no-icons .jstree-themeicon, .jstree-anchor > .jstree-themeicon-hidden { display:none; } ";e.jstree.no_css||e("head").append('")}),e.jstree.defaults.plugins.push("checkbox")}(jQuery),function(e){e.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(){return{create:{separator_before:!1,separator_after:!0,label:"Create",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.create_node(s,{},"last",function(e){setTimeout(function(){n.edit(e)},0)})}},rename:{separator_before:!1,separator_after:!1,label:"Rename",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.edit(s)}},remove:{separator_before:!1,icon:!1,separator_after:!1,label:"Delete",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.delete_node(s)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.cut(s)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.copy(s)}},paste:{separator_before:!1,icon:!1,_disabled:!this.can_paste(),separator_after:!1,label:"Paste",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.paste(s)}}}}}}},e.jstree.plugins.contextmenu=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("contextmenu.jstree","a",e.proxy(function(e){e.preventDefault(),this.is_loading(e.currentTarget)||this.show_contextmenu(e.currentTarget,e.pageX,e.pageY)},this)).on("click.jstree","a",e.proxy(function(){this._data.contextmenu.visible&&e.vakata.context.hide()},this)),e(document).on("context_hide.vakata",e.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&e.vakata.context.hide(),n.teardown.call(this)},this.show_contextmenu=function(t,n,s){t=this.get_node(t);var a=this.settings.contextmenu,r=t.children("a:visible:eq(0)"),i=!1,o=!1;(a.show_at_node||n===void 0||s===void 0)&&(i=r.offset(),n=i.left,s=i.top+this._data.core.li_height),this.is_selected(t)||(this.deselect_all(),this.select_node(t)),o=t.data("jstree")&&t.data("jstree").contextmenu?t.data("jstree").contextmenu:a.items,e.isFunction(o)&&(o=o.call(this,t)),e(document).one("context_show.vakata",e.proxy(function(t,n){var s="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";e(n.element).addClass(s)},this)),this._data.contextmenu.visible=!0,e.vakata.context.show(r,{x:n,y:s},o),this.trigger("show_contextmenu",{node:t,x:n,y:s})}},function(e){var t=!1,n={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};e.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(t){e(document).triggerHandler("context_"+t+".vakata",{reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}})},_execute:function(e){return e=n.items[e],e&&!e._disabled&&e.action?e.action.call(null,{item:e,reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}}):!1},_parse:function(t,s){if(!t)return!1;s||(n.html="",n.items=[]);var a,r="",i=!1;return s&&(r+=""),e.each(t,function(t,s){return s?(n.items.push(s),!i&&s.separator_before&&(r+="- <"+"/a><"+"/li>"),i=!1,r+="",s.separator_after&&(r+="
- <"+"/a><"+"/li>",i=!0),void 0):!0}),r=r.replace(/
- <\/li\>$/,""),s&&(r+="
"),s||(n.html=r,e.vakata.context._trigger("parse")),r.length>10?r:!1},_show_submenu:function(n){if(n=e(n),n.length&&n.children("ul").length){var s=n.children("ul"),a=n.offset().left+n.outerWidth(),r=n.offset().top,i=s.width(),o=s.height(),l=e(window).width()+e(window).scrollLeft(),c=e(window).height()+e(window).scrollTop();t?n[0>a-(i+10+n.outerWidth())?"addClass":"removeClass"]("vakata-context-left"):n[a+i+10>l?"addClass":"removeClass"]("vakata-context-right"),r+o+10>c&&s.css("bottom","-1px"),s.show()}},show:function(s,a,r){switch(n.element&&n.element.length&&n.element.width(""),!0){case!a&&!s:return!1;case!!a&&!!s:n.reference=s,n.position_x=a.x,n.position_y=a.y;break;case!a&&!!s:n.reference=s;var i=s.offset();n.position_x=i.left+s.outerHeight(),n.position_y=i.top;break;case!!a&&!s:n.position_x=a.x,n.position_y=a.y}if(s&&!r&&e(s).data("vakata_contextmenu")&&(r=e(s).data("vakata_contextmenu")),e.vakata.context._parse(r)&&n.element.html(n.html),n.items.length){var o=n.element,l=n.position_x,c=n.position_y,d=o.width(),h=o.height(),u=e(window).width()+e(window).scrollLeft(),_=e(window).height()+e(window).scrollTop();t&&(l-=o.outerWidth(),e(window).scrollLeft()+20>l&&(l=e(window).scrollLeft()+20)),l+d+20>u&&(l=u-(d+20)),c+h+20>_&&(c=_-(h+20)),n.element.css({left:l,top:c}).show().find("a:eq(0)").focus().parent().addClass("vakata-context-hover"),n.is_visible=!0,e.vakata.context._trigger("show")}},hide:function(){n.is_visible&&(n.element.hide().find("ul").hide().end().find(":focus").blur(),n.is_visible=!1,e.vakata.context._trigger("hide"))}},e(function(){t="rtl"===e("body").css("direction");var s=!1,a='.vakata-context { display:none; _width:1px; } .vakata-context, .vakata-context ul { margin:0; padding:2px; position:absolute; background:#f5f5f5; border:1px solid #979797; -moz-box-shadow:5px 5px 4px -4px #666666; -webkit-box-shadow:2px 2px 2px #999999; box-shadow:2px 2px 2px #999999; }.vakata-context ul { list-style:none; left:100%; margin-top:-2.7em; margin-left:-4px; } .vakata-context li.vakata-context-right ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context li { list-style:none; display:inline; }.vakata-context li a { display:block; padding:0 2em 0 2em; text-decoration:none; width:auto; color:black; white-space:nowrap; line-height:2.4em; -moz-text-shadow:1px 1px 0px white; -webkit-text-shadow:1px 1px 0px white; text-shadow:1px 1px 0px white; -moz-border-radius:1px; -webkit-border-radius:1px; border-radius:1px; }.vakata-context li a:hover { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li.vakata-context-hover > a { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); background-position:right center; background-repeat:no-repeat; } .vakata-context li.vakata-context-separator a, .vakata-context li.vakata-context-separator a:hover { background:white; border:0; border-top:1px solid #e2e3e3; height:1px; min-height:1px; max-height:1px; padding:0; margin:0 0 0 2.4em; border-left:1px solid #e0e0e0; _overflow:hidden; -moz-text-shadow:0 0 0 transparent; -webkit-text-shadow:0 0 0 transparent; text-shadow:0 0 0 transparent; -moz-box-shadow:0 0 0 transparent; -webkit-box-shadow:0 0 0 transparent; box-shadow:0 0 0 transparent; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0; }.vakata-context li.vakata-contextmenu-disabled a, .vakata-context li.vakata-contextmenu-disabled a:hover { color:silver; background-color:transparent; border:0; box-shadow:0 0 0; }.vakata-context li a ins { text-decoration:none; display:inline-block; width:2.4em; height:2.4em; background:transparent; margin:0 0 0 -2em; } .vakata-context li a span { display:inline-block; width:1px; height:2.4em; background:white; margin:0 0.5em 0 0; border-left:1px solid #e2e3e3; _overflow:hidden; } .vakata-context-rtl ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context-rtl li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); background-position:left center; background-repeat:no-repeat; } .vakata-context-rtl li.vakata-context-separator a { margin:0 2.4em 0 0; border-left:0; border-right:1px solid #e2e3e3;} .vakata-context-rtl li.vakata-context-left ul { right:auto; left:100%; margin-left:-4px; margin-right:auto; } .vakata-context-rtl li a ins { margin:0 -2em 0 0; } .vakata-context-rtl li a span { margin:0 0 0 0.5em; border-left-color:white; background:#e2e3e3; } ';e.jstree.no_css||e("head").append('"),n.element=e(""),n.element.on("mouseenter","li",function(t){t.stopImmediatePropagation(),e.contains(this,t.relatedTarget)||(s&&clearTimeout(s),n.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),e(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),e.vakata.context._show_submenu(this))}).on("mouseleave","li",function(t){e.contains(this,t.relatedTarget)||e(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(){e(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),e.vakata.context.settings.hide_onmouseleave&&(s=setTimeout(function(){return function(){e.vakata.context.hide()}}(this),e.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault()}).on("mouseup","a",function(){e(this).blur().parent().hasClass("vakata-context-disabled")||e.vakata.context._execute(e(this).attr("rel"))===!1||e.vakata.context.hide()}).on("keydown","a",function(t){var s=null;switch(t.which){case 13:case 32:t.type="mouseup",t.preventDefault(),e(t.currentTarget).trigger(t);break;case 37:n.is_visible&&(n.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 38:n.is_visible&&(s=n.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),s.length||(s=n.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),s.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 39:n.is_visible&&(n.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 40:n.is_visible&&(s=n.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),s.length||(s=n.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),s.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 27:e.vakata.context.hide(),t.preventDefault();break;default:}}).appendTo("body"),e(document).on("mousedown",function(t){n.is_visible&&!e.contains(n.element[0],t.target)&&e.vakata.context.hide()}).on("context_show.vakata",function(){n.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),t&&n.element.addClass("vakata-context-rtl").css("direction","rtl"),n.element.find("ul").hide().end()})})}(e),e.jstree.defaults.plugins.push("contextmenu")}(jQuery),function(e){e.jstree.defaults.dnd={copy:!0,open_timeout:500},e.jstree.plugins.dnd=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("mousedown","a",e.proxy(function(t){var n=this.get_node(t.target);return n&&-1!==n&&n.length&&1===t.which?(this.element.trigger("mousedown.jstree"),e.vakata.dnd.start(t,{jstree:!0,origin:this,obj:n},''+this.get_text(t.currentTarget,!0)+'+
')):void 0},this))}},e(function(){var t=!1,n=!1,s=e('
').hide().appendTo("body");e(document).bind("dnd_start.vakata",function(){t=!1}).bind("dnd_move.vakata",function(a,r){if(n&&clearTimeout(n),r.data.jstree&&(!r.event.target.id||"jstree-marker"!==r.event.target.id)){var i,o,l,c,d,h,u=e.jstree.reference(r.event.target),_=!1,p=!1,g=!1;if(u&&u._data&&u._data.dnd)if(s.attr("class","jstree-"+u.get_theme()),r.helper.children().attr("class","jstree-"+u.get_theme()).find(".jstree-copy:eq(0)")[r.data.origin.settings.dnd.copy&&(r.event.metaKey||r.event.ctrlKey)?"show":"hide"](),r.event.target===u.element[0]||r.event.target===u.get_container_ul()[0]){if(u.check(r.data.origin.settings.dnd.copy&&(r.event.metaKey||r.event.ctrlKey)?"copy_node":"move_node",r.data.obj,-1,"last"))return t={ins:u,par:-1,pos:"last"},s.hide(),r.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),void 0}else if(_=e(r.event.target).closest("a"),_&&_.length&&_.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(p=_.offset(),g=r.event.pageY-p.top,l=_.height(),h=l/3>g?["b","i","a"]:g>l-l/3?["a","i","b"]:g>l/2?["i","a","b"]:["i","b","a"],e.each(h,function(e,a){switch(a){case"b":i=p.left-6,o=p.top-5,c=u.get_parent(_),d=_.parent().index();break;case"i":i=p.left-2,o=p.top-5+l/2+1,c=_.parent(),d=0;break;case"a":i=p.left-6,o=p.top-5+l+2,c=u.get_parent(_),d=_.parent().index()+1}return u.check(r.data.origin.settings.dnd.copy&&(r.event.metaKey||r.event.ctrlKey)?"copy_node":"move_node",r.data.obj,c,d)?("i"===a&&_.parent().is(".jstree-closed")&&u.settings.dnd.open_timeout&&(n=setTimeout(function(e,t){return function(){e.open_node(t)}}(u,_),u.settings.dnd.open_timeout)),t={ins:u,par:c,pos:d},s.css({left:i+"px",top:o+"px"}).show(),r.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),h=!0,!1):void 0}),h===!0))return;t=!1,r.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),s.hide()}}).bind("dnd_scroll.vakata",function(e,n){n.data.jstree&&(s.hide(),t=!1,n.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er"))}).bind("dnd_stop.vakata",function(e,a){n&&clearTimeout(n),a.data.jstree&&(s.hide(),t&&t.ins[a.data.origin.settings.dnd.copy&&(a.event.metaKey||a.event.ctrlKey)?"copy_node":"move_node"](a.data.obj,t.par,t.pos))}).bind("keyup keydown",function(t,n){n=e.vakata.dnd._get(),n.data&&n.data.jstree&&n.helper.find(".jstree-copy:eq(0)")[n.data.origin.settings.dnd.copy&&(t.metaKey||t.ctrlKey)?"show":"hide"]()});var a="#jstree-marker { position: absolute; top:0; left:0; margin:0; padding:0; border-right:0; border-top:5px solid transparent; border-bottom:5px solid transparent; border-left:5px solid; width:0; height:0; font-size:0; line-height:0; _border-top-color:pink; _border-botton-color:pink; _filter:chroma(color=pink); } #jstree-dnd { line-height:16px; margin:0; padding:4px; } #jstree-dnd .jstree-icon, #jstree-dnd .jstree-copy { display:inline-block; text-decoration:none; margin:0 2px 0 0; padding:0; width:16px; height:16px; } #jstree-dnd .jstree-ok { background:green; } #jstree-dnd .jstree-er { background:red; } #jstree-dnd .jstree-copy { margin:0 2px 0 2px; }";e.jstree.no_css||e("head").append('")}),e.jstree.defaults.plugins.push("dnd")}(jQuery),function(e){e.fn.vakata_reverse=[].reverse;var t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1};e.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5},_trigger:function(t,n){var s=e.vakata.dnd._get();s.event=n,e(document).triggerHandler("dnd_"+t+".vakata",s)},_get:function(){return{data:t.data,element:t.element,helper:t.helper}},_clean:function(){t.helper&&t.helper.remove(),t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1},e(document).unbind("mousemove",e.vakata.dnd.drag),e(document).unbind("mouseup",e.vakata.dnd.stop)},_scroll:function(n){if(!t.scroll_e||!t.scroll_l&&!t.scroll_t)return t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),!1;if(!t.scroll_i)return t.scroll_i=setInterval(e.vakata.dnd._scroll,100),!1;if(n===!0)return!1;var s=t.scroll_e.scrollTop(),a=t.scroll_e.scrollLeft();t.scroll_e.scrollTop(s+t.scroll_t*e.vakata.dnd.settings.scroll_speed),t.scroll_e.scrollLeft(a+t.scroll_l*e.vakata.dnd.settings.scroll_speed),(s!==t.scroll_e.scrollTop()||a!==t.scroll_e.scrollLeft())&&e.vakata.dnd._trigger("scroll",t.scroll_e)},start:function(n,s,a){t.is_drag&&e.vakata.dnd.stop({});try{n.currentTarget.unselectable="on",n.currentTarget.onselectstart=function(){return!1},n.currentTarget.style&&(n.currentTarget.style.MozUserSelect="none")}catch(r){}return t.init_x=n.pageX,t.init_y=n.pageY,t.data=s,t.is_down=!0,t.element=n.currentTarget,a!==!1&&(t.helper=e("").html(a).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove",e.vakata.dnd.drag),e(document).bind("mouseup",e.vakata.dnd.stop),!1},drag:function(n){if(t.is_down){if(!t.is_drag){if(!(Math.abs(n.pageX-t.init_x)>e.vakata.dnd.settings.threshold||Math.abs(n.pageY-t.init_y)>e.vakata.dnd.settings.threshold))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth()),t.is_drag=!0,e.vakata.dnd._trigger("start",n)}var s=!1,a=!1,r=!1,i=!1,o=!1,l=!1,c=!1,d=!1,h=!1,u=!1;t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1,e(n.target).parentsUntil("body").addBack().vakata_reverse().filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var s=e(this),a=s.offset();return this.scrollHeight>this.offsetHeight&&(a.top+s.height()-n.pageYthis.offsetWidth&&(a.left+s.width()-n.pageXi&&n.pageY-ci&&i-(n.pageY-c)l&&n.pageX-dl&&l-(n.pageX-d)r&&(h=r-50),o&&u+t.helper_w>o&&(u=o-(t.helper_w+2)),t.helper.css({left:u+"px",top:h+"px"})),e.vakata.dnd._trigger("move",n)}},stop:function(n){t.is_drag&&e.vakata.dnd._trigger("stop",n),e.vakata.dnd._clean()}}}(jQuery),function(e){e.jstree.defaults.html={data:!1,ajax:!1},e.jstree.plugins.html=function(t,n){this.append_html_data=function(t,n){return n=e(n),t=this.get_node(t),n&&n.length&&n.is("ul, li")?(-1===t&&(t=this.element),t.length?(t.children("ul").length||t.append(""),t.children("ul").empty().append(n.is("ul")?n.children("li"):n),!0):!1):(t&&-1!==t&&t.is("li")&&t.removeClass("jstree-closed").addClass("jstree-leaf").children("ul").remove(),!0)},this._load_node=function(t,s){var a=e.extend(!0,{},this.settings.html);if(t=this.get_node(t),!t)return!1;switch(!0){case!a.data&&!a.ajax:return n._load_node.call(this,t,s);case e.isFunction(a.data):return a.data.call(this,t,e.proxy(function(e){return s.call(this,this._append_html_data(t,e))},this));case!!a.data&&!a.ajax||!!a.data&&!!a.ajax&&-1===t:return s.call(this,this._append_html_data(t,a.data));case!a.data&&!!a.ajax||!!a.data&&!!a.ajax&&-1!==t:return a.ajax.success=e.proxy(function(n,a,r){var i=this.settings.html.ajax;e.isFunction(i.success)&&(n=i.success.call(this,n,a,r)||n),s.call(this,this._append_html_data(t,n))},this),a.ajax.error=e.proxy(function(t,n,a){var r=this.settings.html.ajax;e.isFunction(r.error)&&r.error.call(this,t,n,a),s.call(this,!1)},this),a.ajax.dataType||(a.ajax.dataType="html"),e.isFunction(a.ajax.url)&&(a.ajax.url=a.ajax.url.call(this,t)),e.isFunction(a.ajax.data)&&(a.ajax.data=a.ajax.data.call(this,t)),e.ajax(a.ajax)}}},e.jstree.defaults.plugins.push("html")}(jQuery),function(e){e.jstree.defaults.json={data:!1,ajax:!1,progressive_render:!1,progressive_unload:!1},e.jstree.plugins.json=function(t,n){this.bind=function(){n.bind.call(this),this.element.bind("ready.jstree",e.proxy(function(){this.element.bind("after_close.jstree",e.proxy(function(t,n){var s=e(n.node);this.settings.json.progressive_unload&&(s.data("jstree").children=this.get_json(s)[0].children,s.children("ul").remove())},this))},this))},this.parse_json=function(t){var s=this.settings.json;return!e.isArray(t.children)||!this._data.core.ready&&this.settings.core.expand_selected_onload&&this._has_selected(t.children)||s.progressive_render&&(t.data||(t.data={}),t.data.jstree||(t.data.jstree={}),t.data.jstree.children=t.children,t.children=!0),n.parse_json.call(this,t)},this._has_selected=function(e){for(var t=!1,n=0,s=e.length;s>n&&(t=e[n].data&&e[n].data.jstree&&e[n].data.jstree.selected?!0:e[n].children?t||this._has_selected(e[n].children):!1,t!==!0);n++);return t},this._append_json_data=function(e,t){return e=this.get_node(e),-1===e&&(e=this.element),t=this.parse_json(t),e.length?t?(e.children("ul").length||e.append(""),e.children("ul").empty().append(t.is("li")?t:t.children("li")),!0):(e&&e.is("li")&&e.removeClass("jstree-closed").addClass("jstree-leaf").children("ul").remove(),!0):!1},this._load_node=function(t,s){var a=!1,r=e.extend(!0,{},this.settings.json);if(t=this.get_node(t),!t)return!1;switch(!0){case-1===t&&this.get_container().data("jstree")&&e.isArray(this.get_container().data("jstree").children):return a=this.element.data("jstree").children,this.get_container().data("jstree").children=null,s.call(this,this._append_json_data(t,a));case-1!==t&&t.length&&t.data("jstree")&&e.isArray(t.data("jstree").children):return a=t.data("jstree").children,t.data("jstree").children=null,s.call(this,this._append_json_data(t,a));case!r.data&&!r.ajax:return n._load_node.call(this,t,s);case e.isFunction(r.data):return r.data.call(this,t,e.proxy(function(e){return s.call(this,this._append_json_data(t,e))},this));case!!r.data&&!r.ajax||!!r.data&&!!r.ajax&&-1===t:return s.call(this,this._append_json_data(t,r.data));case!r.data&&!!r.ajax||!!r.data&&!!r.ajax&&-1!==t:return r.ajax.success=e.proxy(function(n,a,r){var i=this.settings.json.ajax;e.isFunction(i.success)&&(n=i.success.call(this,n,a,r)||n),s.call(this,this._append_json_data(t,n))},this),r.ajax.error=e.proxy(function(t,n,a){var r=this.settings.json.ajax;e.isFunction(r.error)&&r.error.call(this,t,n,a),s.call(this,!1)},this),r.ajax.dataType||(r.ajax.dataType="json"),e.isFunction(r.ajax.url)&&(r.ajax.url=r.ajax.url.call(this,t)),e.isFunction(r.ajax.data)&&(r.ajax.data=r.ajax.data.call(this,t)),e.ajax(r.ajax)}}},e.jstree.defaults.plugins.push("json")}(jQuery),function(e){e.jstree.defaults.rules={check_max_depth:!0,check_max_children:!0,check_valid_children:!0,types:{}},e.jstree.plugins.rules=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("load_node.jstree",e.proxy(function(e,t){if(this.settings.rules.check_max_depth){var n=-1===t.node?this.element:t.node,s=this,a=function(){s.apply_max_depth(this)&&(n=n.not(this))};if(!this.apply_max_depth(n))for(;n.length;)n=n.children("ul").children("li"),n.each(a)}},this))},this.apply_max_depth=function(t){if(t=this.get_node(t),!t||!t.length)return!1;t=-1===t?this.element:t;var n=t.data("jstree"),s={},a=function(){s=e(this).data("jstree")||{},s.max_depth=0,e(this).data("jstree",s)},r=function(){s=e(this).data("jstree")||{},s.max_depth=s.max_depth&&-1!==s.max_depth?Math.min(s.max_depth,n):n,e(this).data("jstree",s)};if(n&&n.max_depth!==void 0&&-1!==n.max_depth){for(n=n.max_depth;t.length>0;){if(t=t.children("ul").children("li"),n=Math.max(n-1,0),0===n){t.find("li").addBack().each(a);break}t.each(r)}return!0}return!1},this.get_rules=function(e){if(e=this.get_node(e),-1===e)return e=this.element,e=e.data("jstree"),{type:!1,max_depth:e&&e.max_depth?e.max_depth:-1,max_children:e&&e.max_children?e.max_children:-1,valid_children:e&&e.valid_children?e.valid_children:-1};if(!e||!e.length)return!1;
+/*! jsTree - v2.0.0-alpha - 2013-03-22 - (MIT) */
+(function(e){"use strict";if(!e.jstree){var t=0,n=!1,s=!1,a=[];e.jstree={version:"2.0.0-alpha",defaults:{plugins:[]},plugins:{}},e.jstree.create=function(n,s){var a=new e.jstree.core(++t),r=s;return s=e.extend(!0,{},e.jstree.defaults,s),r&&r.plugins&&(s.plugins=r.plugins),e.each(s.plugins,function(e,t){"core"!==e&&(a=a.plugin(t,s[t]))}),a.init(n,s),a},e.jstree.core=function(e){this._id=e,this._data={core:{themes:{}}}},e.jstree.reference=function(t){return e(t).closest(".jstree").data("jstree")},e.fn.jstree=function(t){var n="string"==typeof t,s=Array.prototype.slice.call(arguments,1),a=null;return this.each(function(){var r=e(this).data("jstree"),i=n&&r?r[t]:null;return a=n&&i?i.apply(r,s):null,r||e(this).data("jstree",new e.jstree.create(this,t)),null!==a&&a!==void 0?!1:void 0}),null!==a&&a!==void 0?a:this},e.expr[":"].jstree=e.expr.createPseudo(function(){return function(t){return e(t).hasClass("jstree")&&e(t).data("jstree")!==void 0}}),e.jstree.defaults.core={strings:!1,check_callback:!0,animation:100,aria_roles:!1,multiple:!0,themes:{name:!1,url:!0,dots:!0,icons:!0,dir:!1},base_height:!1,clean_loaded:!0,correct_loaded:!0,expand_selected_onload:!0},e.jstree.core.prototype={plugin:function(t,n){var s=e.jstree.plugins[t];return s?(this._data[t]={},s.prototype=this,new s(n,this)):this},init:function(t,n){this.element=e(t).addClass("jstree jstree-"+this._id),this.settings=n,this.element.bind("destroyed",e.proxy(this.teardown,this)),this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.settings.core.aria_roles&&this.element.attr("role","tree"),this._data.core.selected=e(),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html(""),this._data.core.li_height=this.settings.base_height||this.get_container_ul().children("li:eq(0)").height()||18,this.load_node(-1)},destroy:function(){this.element.unbind("destroyed",this.teardown),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){e.support.touch&&this.element.addTouch(),this.element.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var e=window.getSelection();try{e.removeAllRanges(),e.collapse()}catch(t){}}}).on("click.jstree",".jstree-ocl",e.proxy(function(e){this.toggle_node(e.target)},this)).on("click.jstree",".jstree-anchor",e.proxy(function(e){e.preventDefault(),this.activate_node(e.currentTarget,e)},this)).on("keydown.jstree",".jstree-anchor",e.proxy(function(t){var n=null;switch(t.which){case 13:case 32:t.type="click",e(t.currentTarget).trigger(t);break;case 37:t.preventDefault(),this.is_open(t.currentTarget)?this.close_node(t.currentTarget):(n=this.get_prev(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus());break;case 38:t.preventDefault(),n=this.get_prev(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus();break;case 39:t.preventDefault(),this.is_closed(t.currentTarget)?this.open_node(t.currentTarget):(n=this.get_next(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus());break;case 40:t.preventDefault(),n=this.get_next(t.currentTarget),n&&n.length&&n.children(".jstree-anchor").focus();break;default:}},this)).on("create_node.jstree",e.proxy(function(e,t){this.clean_node(t.node)},this)).on("load_node.jstree",e.proxy(function(t,n){if(n.status){if(this.settings.core.clean_loaded)if(-1===n.node){var s=this.get_container_ul().detach();s.children("li").length&&this.clean_node(s.children("li")),this.element.prepend(s)}else{var a=this._data.core.selected.length;n.node.children("ul").children("li").length&&this.clean_node(n.node.children("ul").children("li")),this._data.core.ready&&a!==this._data.core.selected.length&&this.trigger("changed",{action:"clean_node",selected:this._data.core.selected})}-1!==n.node||this._data.core.loaded||(this._data.core.loaded=!0,this.trigger("loaded")),this._data.core.ready||this.get_container_ul().find(".jstree-loading:eq(0)").length||(this._data.core.ready=!0,this._data.core.selected.length&&(this.settings.core.expand_selected_onload&&this._data.core.selected.parents(".jstree-closed").each(e.proxy(function(e,t){this.open_node(t,!1,0)},this)),this.trigger("changed",{action:"ready",selected:this._data.core.selected})),this.trigger("ready"))}},this)).on("loaded.jstree",e.proxy(function(e,t){this.settings.core.correct_loaded&&t.instance.get_container_ul().children("li").each(function(){t.instance.correct_node(this)})},this)).on("open_node.jstree",e.proxy(function(e,t){this.settings.core.correct_loaded&&t.node.children("li").each(function(){t.instance.correct_node(this)})},this)).on("init.jstree",e.proxy(function(){var e=this.settings.core.themes;this._data.core.themes.dots=e.dots,this._data.core.themes.icons=e.icons,e.name===!1&&(e.name="default"),this.set_theme(e.name,e.url)},this)).on("loaded.jstree",e.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"]()},this)).on("focus.jstree",".jstree-anchor",e.proxy(function(t){e(t.currentTarget).mouseenter()},this)).on("blur.jstree",".jstree-anchor",e.proxy(function(t){e(t.currentTarget).mouseleave()},this)).on("mouseenter.jstree",".jstree-anchor",e.proxy(function(e){var t=this.element.find(".jstree-anchor:focus").not(".jstree-clicked");t&&t.length&&t[0]!==e.currentTarget&&t.blur(),this.hover_node(e.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),e(document).off(".jstree-"+this._id)},trigger:function(t,n,s){n||(n={}),n.instance=this,"number"===(typeof s).toLowerCase()?setTimeout(e.proxy(function(){this.element.triggerHandler(t.replace(".jstree","")+".jstree",n)},this),s):this.element.triggerHandler(t.replace(".jstree","")+".jstree",n)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children("ul:eq(0)")},get_string:function(t){var n=this.settings.core.strings;return e.isFunction(n)?n.call(this,t):n&&n[t]?n[t]:t},_firstChild:function(e){for(e=e?e.firstChild:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_nextSibling:function(e){for(e=e?e.nextSibling:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_previousSibling:function(e){for(e=e?e.previousSibling:null;null!==e&&1!==e.nodeType;)e=e.previousSibling;return e},get_node:function(t){return-1===t?-1:(t=e(t,this.element),t.hasClass(".jstree")?-1:(t=t.closest("li",this.element),t.length?t:!1))},get_next:function(t,n){var s;return t=this.get_node(t),-1===t?(s=this._firstChild(this.get_container_ul()[0]),s?e(s):!1):t&&t.length?n?(s=this._nextSibling(t[0]),s?e(s):!1):t.hasClass("jstree-open")?(s=this._firstChild(t.children("ul")[0]),s?e(s):!1):(s=this._nextSibling(t[0]))?e(s):t.parentsUntil(".jstree","li").next("li").eq(0):!1},get_prev:function(t,n){var s;if(t=this.get_node(t),-1===t)return s=this.get_container_ul()[0].lastChild,s?e(s):!1;if(!t||!t.length)return!1;if(n)return s=this._previousSibling(t[0]),s?e(s):!1;if(s=this._previousSibling(t[0])){for(t=e(s);t.hasClass("jstree-open");)t=t.children("ul:eq(0)").children("li:last");return t}return s=t[0].parentNode.parentNode,s&&"LI"===s.tagName?e(s):!1},get_parent:function(t){if(t=this.get_node(t),-1===t||!t||!t.length)return!1;var n=t[0].parentNode.parentNode;return"LI"===n.tagName?e(n):-1},get_children:function(e){return e=this.get_node(e),-1===e?this.get_container_ul().children("li"):e&&e.length?e.children("ul").children("li"):!1},is_parent:function(e){return e=this.get_node(e),e&&-1!==e&&(this._firstChild(e.children("ul")[0])||e.hasClass("jstree-closed"))},is_loaded:function(e){return e=this.get_node(e),e&&(-1===e&&!this.element.children("ul").children("li.jstree-loading").length||-1!==e&&!e.hasClass("jstree-loading")&&(this._firstChild(e.children("ul")[0])||e.hasClass("jstree-leaf")))},is_loading:function(e){return e=this.get_node(e),e&&(-1===e&&this.element.children("ul").children("li.jstree-loading").length||-1!==e&&e.hasClass("jstree-loading"))},is_open:function(e){return e=this.get_node(e),e&&-1!==e&&e.hasClass("jstree-open")},is_closed:function(e){return e=this.get_node(e),e&&-1!==e&&e.hasClass("jstree-closed")},is_leaf:function(e){return e=this.get_node(e),e&&-1!==e&&e.hasClass("jstree-leaf")},load_node:function(t,n){return(t=this.get_node(t))?(-1!==t&&t.addClass("jstree-loading"),this._load_node(t,e.proxy(function(e){-1!==t&&t.removeClass("jstree-loading"),this.trigger("load_node",{node:t,status:e}),n&&n.call(this,t,e)},this)),!0):(n.call(this,t,!1),!1)},_load_node:function(e,t){-1===e?(this.get_container_ul().empty().append(this._data.core.original_container_html.clone(!0)),t.call(this,!0)):t.call(this,!1)},open_node:function(e,t,n){if(e=this.get_node(e),-1===e||!e||!e.length)return!1;if(n="undefined"===(typeof n).toLowerCase()?this.settings.core.animation:n,!this.is_closed(e))return t&&t.call(this,e,!1),!1;if(this.is_loaded(e)){var s=this;n?e.children("ul").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").children("ul").stop(!0,!0).slideDown(n,function(){this.style.display="",s.trigger("after_open",{node:e})}):e[0].className=e[0].className.replace("jstree-closed","jstree-open"),t&&t.call(this,e,!0),this.trigger("open_node",{node:e}),n||this.trigger("after_open",{node:e})}else this.load_node(e,function(e,s){return s?this.open_node(e,t,n):t?t.call(this,e,!1):!1})},close_node:function(e,t){if(e=this.get_node(e),!e||!e.length||!this.is_open(e))return!1;t="undefined"===(typeof t).toLowerCase()?this.settings.core.animation:t;var n=this;t?e.children("ul").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").children("ul").stop(!0,!0).slideUp(t,function(){this.style.display="",n.trigger("after_close",{node:e})}):e[0].className=e[0].className.replace("jstree-open","jstree-closed"),this.trigger("close_node",{node:e}),t||this.trigger("after_close",{node:e})},toggle_node:function(e){return this.is_closed(e)?this.open_node(e):this.is_open(e)?this.close_node(e):void 0},open_all:function(e,t,n){e=e?this.get_node(e):-1,e=e&&-1!==e?e:this.get_container_ul(),n=n||e;var s=this;e=this.is_closed(e)?e.find("li.jstree-closed").addBack():e.find("li.jstree-closed"),e.each(function(){s.open_node(this,s.is_loaded(this)?!1:function(e){this.open_all(e,t,n)},t||0)}),0===n.find("li.jstree-closed").length&&this.trigger("open_all",{node:n})},close_all:function(e,t){e=e?this.get_node(e):-1;var n=e&&-1!==e?e:this.get_container_ul(),s=this;n=this.is_open(n)?n.find("li.jstree-open").addBack():n.find("li.jstree-open"),n.each(function(){s.close_node(this,t||0)}),this.trigger("close_all",{node:e})},is_disabled:function(e){return e=this.get_node(e),e&&-1!==e&&e.children(".jstree-anchor").hasClass("jstree-disabled")},enable_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").removeClass("jstree-disabled"),this.trigger("enable_node",{node:e}),void 0):!1},disable_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").addClass("jstree-disabled"),this.trigger("disable_node",{node:e}),void 0):!1},activate_node:function(e,t){return this.is_disabled(e)?!1:(this.settings.core.multiple&&(t.metaKey||t.ctrlKey)?this.is_selected(e)?this.deselect_node(e):this.select_node(e):(this.deselect_all(!0),this.select_node(e)),this.trigger("activate_node",{node:e}),void 0)},hover_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:e}),void 0):!1},dehover_node:function(e){return e=this.get_node(e),e&&e.length?(e.children(".jstree-anchor").removeClass("jstree-hovered"),this.trigger("dehover_node",{node:e}),void 0):!1},select_node:function(e,t,n){if(e=this.get_node(e),!e||!e.length)return!1;if(this._data.core.selected=this._data.core.selected.add(e),this.element.find(".jstree-clicked").removeClass("jstree-clicked"),this._data.core.selected.children(".jstree-anchor").addClass("jstree-clicked"),!n){var s=this;e.parents(".jstree-closed").each(function(){s.open_node(this,!1,0)})}this.trigger("select_node",{node:e,selected:this._data.core.selected}),t||this.trigger("changed",{action:"select_node",node:e,selected:this._data.core.selected})},deselect_node:function(e,t){return e=this.get_node(e),e&&e.length?(this._data.core.selected=this._data.core.selected.not(e),this.element.find(".jstree-clicked").removeClass("jstree-clicked"),this._data.core.selected.children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("deselect_node",{node:e,selected:this._data.core.selected}),t||this.trigger("changed",{action:"deselect_node",node:e,selected:this._data.core.selected}),void 0):!1},deselect_all:function(t){this._data.core.selected=e();var n=this.element.find(".jstree-clicked").removeClass("jstree-clicked");this.trigger("deselect_all",{selected:this._data.core.selected,node:n}),t||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,node:n})},is_selected:function(e){return e=this.get_node(e),e&&e.length?this._data.core.selected.index(e)>=0:!1},get_selected:function(){return this._data.core.selected},clean_node:function(t){t=this.get_node(t),t=t&&-1!==t?t.find("li").addBack():this.element.find("li"),t.find("li.jstree-clicked").removeClass("jstree-clicked"),this.settings.core.aria_roles&&t.attr("role","treeitem").parent().attr("role","group");var n=this;return t.each(function(){var t=e(this),s=t.children("a"),a=t.data("jstree"),r=a&&a.opened||t.hasClass("jstree-open")?"open":a&&(a.closed||a.children)||t.children("ul").length?"closed":"leaf";switch(a&&a.opened&&delete a.opened,a&&a.closed&&delete a.closed,t.removeClass("jstree-open jstree-closed jstree-leaf jstree-last"),s.length?e.trim(s.attr("href"))||s.attr("href","#"):(t.contents().filter(function(){return 3===this.nodeType||"UL"!==this.tagName}).wrapAll(''),s=t.children("a"),s.html(t.children("a").html().replace(/[\s\t\n]+$/,""))),s.addClass("jstree-anchor"),t.children("i.jstree-ocl").length||t.prepend(" "),t.next().length||t.addClass("jstree-last"),r){case"leaf":t.addClass("jstree-leaf");break;case"closed":t.addClass("jstree-closed"),n.close_node(t,0);break;case"open":t.addClass("jstree-closed"),n.open_node(t,!1,0)}s.children("i.jstree-themeicon").length||s.prepend(" "),a&&a.icon!==void 0&&(n.set_icon(t,a.icon),delete a.icon),a&&a.selected&&(n.select_node(t,!0,!0),delete a.selected),a&&a.disabled&&(n.disable_node(t),delete a.disabled)})},correct_node:function(t,n){return t=this.get_node(t),!t||-1===t&&!n?!1:(t=-1===t?this.element.find("li"):n?t.find("li").addBack():t,t.each(function(){var t=e(this);switch(!0){case t.hasClass("jstree-open")&&!t.children("ul").children("li").length:t.removeClass("jstree-open").addClass("jstree-leaf").children("ul").remove();break;case t.hasClass("jstree-leaf")&&!!t.children("ul").children("li").length:t.removeClass("jstree-leaf").addClass("jstree-closed")}t[0===t.next().length?"addClass":"removeClass"]("jstree-last")}),t)},get_state:function(){var e={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},themes:{name:this.get_theme(),icons:this._data.core.themes.icons,dots:this._data.core.themes.dots},selected:[]}};return this.get_container_ul().find(".jstree-open").each(function(){this.id&&e.core.open.push(this.id)}),this._data.core.selected.each(function(){this.id&&e.core.selected.push(this.id)}),e},set_state:function(t,n){if(t){if(t.core){if(e.isArray(t.core.open)){var s=!0,a=this;return e.each(t.core.open.concat([]),function(n,r){r=document.getElementById(r),r&&(a.is_loaded(r)?(a.is_closed(r)&&a.open_node(r,!1,0),e.vakata.array_remove(t.core.open,n)):(a.is_loading(r)||a.open_node(r,e.proxy(function(){this.set_state(t)},a),0),s=!1))}),s&&(delete t.core.open,this.set_state(t,n)),!1}if(t.core.scroll)return t.core.scroll&&t.core.scroll.left!==void 0&&this.element.scrollLeft(t.core.scroll.left),t.core.scroll&&t.core.scroll.top!==void 0&&this.element.scrollTop(t.core.scroll.top),delete t.core.scroll,delete t.core.open,this.set_state(t,n),!1;if(t.core.themes)return t.core.themes.name&&this.set_theme(t.core.themes.name),t.core.themes.dots!==void 0&&this[t.core.themes.dots?"show_dots":"hide_dots"](),t.core.themes.icons!==void 0&&this[t.core.themes.icons?"show_icons":"hide_icons"](),delete t.core.themes,delete t.core.open,this.set_state(t,n),!1;if(t.core.selected){var r=this;return this.deselect_all(),e.each(t.core.selected,function(e,t){r.select_node(document.getElementById(t))}),delete t.core.selected,this.set_state(t,n),!1}return e.isEmptyObject(t)?(n&&n.call(this),this.trigger("set_state"),!1):!0}return!0}return!1},refresh:function(){this._data.core.state=this.get_state(),this.load_node(-1,function(t,n){n&&this.set_state(e.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")}),this._data.core.state=null})},get_text:function(t,n){return t=this.get_node(t),t&&-1!==t&&t.length?(t=t.children("a:eq(0)").clone(),t.children(".jstree-icon").remove(),t=t[n?"text":"html"](),t=e("")[n?"text":"html"](t),t.html()):!1},set_text:function(e,t){if(e=this.get_node(e),!e||-1===e||!e.length)return!1;e=e.children("a:eq(0)");var n=e.children("I").clone();return e.html(t).prepend(n),this.trigger("set_text",{obj:e,text:t}),!0},parse_json:function(t){var n,s,a,r;return null===t||e.isArray(t)&&0===t.length?!1:e.isArray(t)?(a=e(""),r=this,e.each(t,function(e,t){a.append(r.parse_json(t))}),a):(t===void 0&&(t={}),"string"==typeof t&&(t={title:t}),t.li_attr||(t.li_attr={}),t.a_attr||(t.a_attr={}),t.a_attr.href||(t.a_attr.href="#"),t.title||(t.title=this.get_string("New node")),n=e("").attr(t.li_attr),s=e("").attr(t.a_attr).html(t.title),a=e(""),t.data&&!e.isEmptyObject(t.data)&&n.data(t.data),(t.children===!0||e.isArray(t.children)||n.data("jstree")&&e.isArray(n.data("jstree").children))&&(n.data("jstree")||n.data("jstree",{}),n.data("jstree").closed=!0),n.append(s),e.isArray(t.children)&&(e.each(t.children,e.proxy(function(e,t){a.append(this.parse_json(t))},this)),n.append(a)),n)},get_json:function(t,n){t=t!==void 0?this.get_node(t):!1,n||t&&-1!==t||(t=this.get_container_ul().children("li"));var s,a,r,i={},o={},l={};return t&&t.length?t.length>1||!n?(s=[],a=this,t.each(function(){s.push(a.get_json(e(this),!0))}),s):(l=e.vakata.attributes(t,!0),e.each(l,function(t,n){return"id"===t?(i[t]=n,!0):(n=e.trim(n.replace(/\bjstree[^ ]*/gi,"").replace(/\s+$/gi," ")),n.length&&(i[t]=n),void 0)}),l=e.vakata.attributes(t.children(".jstree-anchor"),!0),e.each(l,function(t,n){return"id"===t?(o[t]=n,!0):(n=e.trim(n.replace(/\bjstree[^ ]*/gi,"").replace(/\s+$/gi," ")),n.length&&(o[t]=n),void 0)}),s={title:this.get_text(t),data:e.extend(!0,{},t.data()||{}),children:!1,li_attr:i,a_attr:o},s.data.jstree||(s.data.jstree={}),this.is_open(t)&&(s.data.jstree.opened=!0),this.is_closed(t)&&(s.data.jstree.closed=!0),r=this.get_icon(t),r!==void 0&&null!==r&&(s.data.jstree.icon=r),this.is_selected(t)&&(s.data.jstree.selected=!0),t=t.children("ul").children("li"),t.length&&(s.children=[],a=this,t.each(function(){s.children.push(a.get_json(e(this),!0))})),s):!1},create_node:function(e,t,n,s,a){if(e=this.get_node(e),n=n===void 0?"last":n,-1!==e&&!e.length)return!1;if(!n.match(/^(before|after)$/)&&!a&&!this.is_loaded(e))return this.load_node(e,function(){this.create_node(e,t,n,s,!0)});var r=this.parse_json(t),i=-1===e?this.element:e;switch(-1===e&&("before"===n&&(n="first"),"after"===n&&(n="last")),n){case"before":n=e.index(),e=this.get_parent(e);break;case"after":n=e.index()+1,e=this.get_parent(e);break;case"inside":case"first":n=0;break;case"last":n=i.children("ul").children("li").length;break;default:n||(n=0)}return this.check("create_node",r,e,n)?(i=-1===e?this.element:e,i.children("ul").length||i.append(""),i.children("ul").children("li").eq(n).length?i.children("ul").children("li").eq(n).before(r):i.children("ul").append(r),this.correct_node(e,!0),s&&s.call(this,r),this.trigger("create_node",{node:r,parent:e,position:r.index()}),r):!1},rename_node:function(e,t){e=this.get_node(e);var n=this.get_text(e);return this.check("rename_node",e,this.get_parent(e),t)?(e&&e.length&&(this.set_text(e,t),this.trigger("rename_node",{node:e,title:t,old:n})),void 0):!1},delete_node:function(e){if(e=this.get_node(e),!e||-1===e||!e.length)return!1;var t=this.get_parent(e),n=this.get_prev(e);if(!this.check("delete_node",e,t,e.index()))return!1;e=e.detach(),this.correct_node(t),this.correct_node(n),this.trigger("delete_node",{node:e,prev:n,parent:t});var s=e.find(".jstree-clicked"),a=this;return s.length&&(s.each(function(){a.deselect_node(this,!0)}),this.trigger("changed",{action:"delete_node",node:e,selected:this._data.core.selected,parent:t})),e},check:function(t,n,s,a){var r=t.match(/^move_node|copy_node|create_node$/i)?s:n,i=this.settings.core.check_callback;if(i===!1||e.isFunction(i)&&i.call(this,t,n,s,a)===!1)return!1;if(r=-1===r?this.element.data("jstree"):r.data("jstree"),r&&r.functions&&r.functions[t]&&(r=r.functions[t],e.isFunction(r)&&(r=r.call(this,t,n,s,a)),r===!1))return!1;switch(t){case"create_node":break;case"rename_node":break;case"move_node":if(r=-1===s?this.element:s,r=r.children("ul").children("li"),r.length&&-1!==r.index(n)&&(a===n.index()||a===n.index()+1))return!1;if(-1!==s&&-1!==s.parentsUntil(".jstree","li").addBack().index(n))return!1;break;case"copy_node":break;case"delete_node":}return!0},move_node:function(t,n,s,a,r){if(t=this.get_node(t),n=this.get_node(n),s=s===void 0?0:s,!t||-1===t||!t.length)return!1;if(-1!==n&&!n.length)return!1;if(!(""+s).match(/^(before|after)$/)&&!r&&!this.is_loaded(n))return this.load_node(n,function(){this.move_node(t,n,s,a,!0)});var i=this.get_parent(t),o=(""+s).match(/^(before|after)$/)&&-1!==n?this.get_parent(n):n,l=e.jstree.reference(t),c=-1===n?this:e.jstree.reference(n),d=l._id!==c._id;switch(-1===o&&(n=c.get_container(),"before"===s&&(s="first"),"after"===s&&(s="last")),s){case"before":s=n.index();break;case"after":s=n.index()+1;break;case"inside":case"first":s=0;break;case"last":s=n.children("ul").children("li").length;break;default:s||(s=0)}return this.check("move_node",t,o,s)?(n.children("ul").length||n.append(""),n.children("ul").children("li").eq(s).length?n.children("ul").children("li").eq(s).before(t):n.children("ul").append(t),d&&(t.find(".jstree-icon, .jstree-ocl").remove(),this.clean_node(t)),l.correct_node(i,!0),c.correct_node(o,!0),a&&a.call(this,t,o,t.index()),this.trigger("move_node",{node:t,parent:o,position:t.index(),old_parent:i,is_multi:d,old_instance:l,new_instance:c}),!0):!1},copy_node:function(t,n,s,a,r){if(t=this.get_node(t),n=this.get_node(n),s=s===void 0?"last":s,!t||-1===t||!t.length)return!1;if(-1!==n&&!n.length)return!1;if(!(""+s).match(/^(before|after)$/)&&!r&&!this.is_loaded(n))return this.load_node(n,function(){this.copy_node(t,n,s,a,!0)});var i=t,o=this.get_parent(t),l=(""+s).match(/^(before|after)$/)&&-1!==n?this.get_parent(n):n,c=e.jstree.reference(t),d=-1===n?this:e.jstree.reference(n),h=c._id!==d._id;switch(t=t.clone(!0),t.find("*[id]").addBack().each(function(){this.id&&(this.id="copy_"+this.id)}),-1===l&&(n=d.get_container(),"before"===s&&(s="first"),"after"===s&&(s="last")),s){case"before":s=n.index();break;case"after":s=n.index()+1;break;case"inside":case"first":s=0;break;case"last":s=n.children("ul").children("li").length;break;default:s||(s=0)}return this.check("copy_node",i,l,s)?(n.children("ul").length||n.append(""),n.children("ul").children("li").eq(s).length?n.children("ul").children("li").eq(s).before(t):n.children("ul").append(t),h&&t.find(".jstree-icon, .jstree-ocl").remove(),d.clean_node(t),d.correct_node(l,!0),a&&a.call(this,t,l,t.index(),i),this.trigger("copy_node",{node:t,parent:l,old_parent:o,position:t.index(),original:i,is_multi:h,old_instance:c,new_instance:d}),!0):!1},cut:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(n=e,s="move_node",this.trigger("cut",{node:e}),void 0):!1},copy:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(n=e,s="copy_node",this.trigger("copy",{node:e}),void 0):!1},get_buffer:function(){return{mode:s,node:n}},can_paste:function(){return s!==!1&&n!==!1},paste:function(e){return e=this.get_node(e),e&&s&&s.match(/^(copy_node|move_node)$/)&&n?(this[s](n,e),this.trigger("paste",{obj:e,nodes:n,mode:s}),n=!1,s=!1,void 0):!1},edit:function(t,n){if(t=this.get_node(t),!t||-1===t||!t.length)return!1;t.parentsUntil(".jstree",".jstree-closed").each(e.proxy(function(e,t){this.open_node(t,!1,0)},this));var s=this._data.core.rtl,a=this.element.width(),r=t.children("a:eq(0)"),i=t.children("i"),o=r.children("i"),l=i.width()*i.length,c=o.width()*o.length,d="string"==typeof n?n:this.get_text(t),h=e("",{css:{position:"absolute",top:"-200px",left:s?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),u=t.css("position","relative").append(e("",{value:d,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:s?"auto":l+c+4+"px",right:s?l+c+4+"px":"auto",top:"0px",height:this._data.core.li_height-2+"px",lineHeight:this._data.core.li_height-2+"px",width:"150px"},blur:e.proxy(function(){var e=t.children(".jstree-rename-input"),n=e.val();""===n&&(n=d),h.remove(),e.remove(),this.rename_node(t,n)===!1&&this.rename_node(t,d),t.css("position","")},this),keydown:function(e){var t=e.keyCode||e.which;27===t&&(this.value=d),(27===t||13===t||37===t||38===t||39===t||40===t)&&e.stopImmediatePropagation(),(27===t||13===t)&&(e.preventDefault(),this.blur())},keyup:function(e){e.keyCode||e.which,u.width(Math.min(h.text("pW"+this.value).width(),a))},keypress:function(e){var t=e.keyCode||e.which;return 13===t?!1:void 0}})).children(".jstree-rename-input"),_={fontFamily:r.css("fontFamily")||"",fontSize:r.css("fontSize")||"",fontWeight:r.css("fontWeight")||"",fontStyle:r.css("fontStyle")||"",fontStretch:r.css("fontStretch")||"",fontVariant:r.css("fontVariant")||"",letterSpacing:r.css("letterSpacing")||"",wordSpacing:r.css("wordSpacing")||""};this.set_text(t,""),h.css(_),u.css(_).width(Math.min(h.text("pW"+u[0].value).width(),a))[0].select()},set_theme:function(t,n){if(!t)return!1;if(n===!0){var s=this.settings.core.themes.dir;s||(s=e.jstree.path+"/themes"),n=s+"/"+t+"/style.css"}n&&-1===e.inArray(n,a)&&(e("head").append(''),a.push(n)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=t,this.element.addClass("jstree-"+t),this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},show_dots:function(){this._data.core.themes.dots=!0,this.element.children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.element.children("ul").addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.element.children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.element.children("ul").addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(e,t){return e=this.get_node(e),e&&-1!==e&&e.length?(e=e.children("a").children(".jstree-themeicon"),t===!1?this.hide_icon(e):-1===t.indexOf("/")?e.addClass(t).attr("rel",t):e.css("background","url('"+t+"') center center no-repeat").attr("rel",t),!0):!1},get_icon:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(e=e.children("a").children(".jstree-themeicon"),e.hasClass("jstree-themeicon-hidden")?!1:(e=e.attr("rel"),e&&e.length?e:null)):null},hide_icon:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(e.children("a").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(e){return e=this.get_node(e),e&&-1!==e&&e.length?(e.children("a").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}};var r=e("script:last").attr("src");e.jstree.path=r?r.replace(/\/[^\/]+$/,""):"",e.jstree.no_css=r&&-1!==r.indexOf("?no_css"),e.jstree.no_css&&(e.jstree.defaults.core.themes.url=!1),e(function(){var t=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; list-style-image:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree .jstree-icon { display:inline-block; text-decoration:none; margin:0; padding:0; vertical-align:top; } .jstree .jstree-ocl { width:18px; height:18px; text-align:center; line-height:18px; cursor:pointer; vertical-align:top; } .jstree li.jstree-open > ul { display:block; } .jstree li.jstree-closed > ul { display:none; } .jstree-anchor { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; padding:1px 4px 1px 2px; margin:0; text-decoration:none; outline:0; } .jstree-anchor > .jstree-themeicon { height:16px; width:16px; margin-right:3px; } .jstree-rtl .jstree-anchor { padding:1px 2px 1px 4px; } .jstree-rtl .jstree-anchor > .jstree-themeicon { margin-left:3px; margin-right:0; } .jstree-no-icons .jstree-themeicon, .jstree-anchor > .jstree-themeicon-hidden { display:none; } ";e.jstree.no_css||e("head").append('")}),e.jstree.defaults.plugins.push("checkbox")}(jQuery),function(e){e.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(){return{create:{separator_before:!1,separator_after:!0,label:"Create",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.create_node(s,{},"last",function(e){setTimeout(function(){n.edit(e)},0)})}},rename:{separator_before:!1,separator_after:!1,label:"Rename",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.edit(s)}},remove:{separator_before:!1,icon:!1,separator_after:!1,label:"Delete",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.delete_node(s)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.cut(s)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.copy(s)}},paste:{separator_before:!1,icon:!1,_disabled:!this.can_paste(),separator_after:!1,label:"Paste",action:function(t){var n=e.jstree.reference(t.reference),s=n.get_node(t.reference);n.paste(s)}}}}}}},e.jstree.plugins.contextmenu=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("contextmenu.jstree","a",e.proxy(function(e){e.preventDefault(),this.is_loading(e.currentTarget)||this.show_contextmenu(e.currentTarget,e.pageX,e.pageY)},this)).on("click.jstree","a",e.proxy(function(){this._data.contextmenu.visible&&e.vakata.context.hide()},this)),e(document).on("context_hide.vakata",e.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&e.vakata.context.hide(),n.teardown.call(this)},this.show_contextmenu=function(t,n,s){t=this.get_node(t);var a=this.settings.contextmenu,r=t.children("a:visible:eq(0)"),i=!1,o=!1;(a.show_at_node||n===void 0||s===void 0)&&(i=r.offset(),n=i.left,s=i.top+this._data.core.li_height),this.is_selected(t)||(this.deselect_all(),this.select_node(t)),o=t.data("jstree")&&t.data("jstree").contextmenu?t.data("jstree").contextmenu:a.items,e.isFunction(o)&&(o=o.call(this,t)),e(document).one("context_show.vakata",e.proxy(function(t,n){var s="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";e(n.element).addClass(s)},this)),this._data.contextmenu.visible=!0,e.vakata.context.show(r,{x:n,y:s},o),this.trigger("show_contextmenu",{node:t,x:n,y:s})}},function(e){var t=!1,n={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};e.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(t){e(document).triggerHandler("context_"+t+".vakata",{reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}})},_execute:function(e){return e=n.items[e],e&&!e._disabled&&e.action?e.action.call(null,{item:e,reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}}):!1},_parse:function(t,s){if(!t)return!1;s||(n.html="",n.items=[]);var a,r="",i=!1;return s&&(r+=""),e.each(t,function(t,s){return s?(n.items.push(s),!i&&s.separator_before&&(r+="- <"+"/a><"+"/li>"),i=!1,r+="",s.separator_after&&(r+="
- <"+"/a><"+"/li>",i=!0),void 0):!0}),r=r.replace(/
- <\/li\>$/,""),s&&(r+="
"),s||(n.html=r,e.vakata.context._trigger("parse")),r.length>10?r:!1},_show_submenu:function(n){if(n=e(n),n.length&&n.children("ul").length){var s=n.children("ul"),a=n.offset().left+n.outerWidth(),r=n.offset().top,i=s.width(),o=s.height(),l=e(window).width()+e(window).scrollLeft(),c=e(window).height()+e(window).scrollTop();t?n[0>a-(i+10+n.outerWidth())?"addClass":"removeClass"]("vakata-context-left"):n[a+i+10>l?"addClass":"removeClass"]("vakata-context-right"),r+o+10>c&&s.css("bottom","-1px"),s.show()}},show:function(s,a,r){switch(n.element&&n.element.length&&n.element.width(""),!0){case!a&&!s:return!1;case!!a&&!!s:n.reference=s,n.position_x=a.x,n.position_y=a.y;break;case!a&&!!s:n.reference=s;var i=s.offset();n.position_x=i.left+s.outerHeight(),n.position_y=i.top;break;case!!a&&!s:n.position_x=a.x,n.position_y=a.y}if(s&&!r&&e(s).data("vakata_contextmenu")&&(r=e(s).data("vakata_contextmenu")),e.vakata.context._parse(r)&&n.element.html(n.html),n.items.length){var o=n.element,l=n.position_x,c=n.position_y,d=o.width(),h=o.height(),u=e(window).width()+e(window).scrollLeft(),_=e(window).height()+e(window).scrollTop();t&&(l-=o.outerWidth(),e(window).scrollLeft()+20>l&&(l=e(window).scrollLeft()+20)),l+d+20>u&&(l=u-(d+20)),c+h+20>_&&(c=_-(h+20)),n.element.css({left:l,top:c}).show().find("a:eq(0)").focus().parent().addClass("vakata-context-hover"),n.is_visible=!0,e.vakata.context._trigger("show")}},hide:function(){n.is_visible&&(n.element.hide().find("ul").hide().end().find(":focus").blur(),n.is_visible=!1,e.vakata.context._trigger("hide"))}},e(function(){t="rtl"===e("body").css("direction");var s=!1,a='.vakata-context { display:none; _width:1px; } .vakata-context, .vakata-context ul { margin:0; padding:2px; position:absolute; background:#f5f5f5; border:1px solid #979797; -moz-box-shadow:5px 5px 4px -4px #666666; -webkit-box-shadow:2px 2px 2px #999999; box-shadow:2px 2px 2px #999999; }.vakata-context ul { list-style:none; left:100%; margin-top:-2.7em; margin-left:-4px; } .vakata-context li.vakata-context-right ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context li { list-style:none; display:inline; }.vakata-context li a { display:block; padding:0 2em 0 2em; text-decoration:none; width:auto; color:black; white-space:nowrap; line-height:2.4em; -moz-text-shadow:1px 1px 0px white; -webkit-text-shadow:1px 1px 0px white; text-shadow:1px 1px 0px white; -moz-border-radius:1px; -webkit-border-radius:1px; border-radius:1px; }.vakata-context li a:hover { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li.vakata-context-hover > a { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); background-position:right center; background-repeat:no-repeat; } .vakata-context li.vakata-context-separator a, .vakata-context li.vakata-context-separator a:hover { background:white; border:0; border-top:1px solid #e2e3e3; height:1px; min-height:1px; max-height:1px; padding:0; margin:0 0 0 2.4em; border-left:1px solid #e0e0e0; _overflow:hidden; -moz-text-shadow:0 0 0 transparent; -webkit-text-shadow:0 0 0 transparent; text-shadow:0 0 0 transparent; -moz-box-shadow:0 0 0 transparent; -webkit-box-shadow:0 0 0 transparent; box-shadow:0 0 0 transparent; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0; }.vakata-context li.vakata-contextmenu-disabled a, .vakata-context li.vakata-contextmenu-disabled a:hover { color:silver; background-color:transparent; border:0; box-shadow:0 0 0; }.vakata-context li a ins { text-decoration:none; display:inline-block; width:2.4em; height:2.4em; background:transparent; margin:0 0 0 -2em; } .vakata-context li a span { display:inline-block; width:1px; height:2.4em; background:white; margin:0 0.5em 0 0; border-left:1px solid #e2e3e3; _overflow:hidden; } .vakata-context-rtl ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context-rtl li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); background-position:left center; background-repeat:no-repeat; } .vakata-context-rtl li.vakata-context-separator a { margin:0 2.4em 0 0; border-left:0; border-right:1px solid #e2e3e3;} .vakata-context-rtl li.vakata-context-left ul { right:auto; left:100%; margin-left:-4px; margin-right:auto; } .vakata-context-rtl li a ins { margin:0 -2em 0 0; } .vakata-context-rtl li a span { margin:0 0 0 0.5em; border-left-color:white; background:#e2e3e3; } ';e.jstree.no_css||e("head").append('"),n.element=e(""),n.element.on("mouseenter","li",function(t){t.stopImmediatePropagation(),e.contains(this,t.relatedTarget)||(s&&clearTimeout(s),n.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),e(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),e.vakata.context._show_submenu(this))}).on("mouseleave","li",function(t){e.contains(this,t.relatedTarget)||e(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(){e(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),e.vakata.context.settings.hide_onmouseleave&&(s=setTimeout(function(){return function(){e.vakata.context.hide()}}(this),e.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault()}).on("mouseup","a",function(){e(this).blur().parent().hasClass("vakata-context-disabled")||e.vakata.context._execute(e(this).attr("rel"))===!1||e.vakata.context.hide()}).on("keydown","a",function(t){var s=null;switch(t.which){case 13:case 32:t.type="mouseup",t.preventDefault(),e(t.currentTarget).trigger(t);break;case 37:n.is_visible&&(n.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 38:n.is_visible&&(s=n.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),s.length||(s=n.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),s.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 39:n.is_visible&&(n.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 40:n.is_visible&&(s=n.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),s.length||(s=n.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),s.addClass("vakata-context-hover").children("a").focus(),t.stopImmediatePropagation(),t.preventDefault());break;case 27:e.vakata.context.hide(),t.preventDefault();break;default:}}).appendTo("body"),e(document).on("mousedown",function(t){n.is_visible&&!e.contains(n.element[0],t.target)&&e.vakata.context.hide()}).on("context_show.vakata",function(){n.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),t&&n.element.addClass("vakata-context-rtl").css("direction","rtl"),n.element.find("ul").hide().end()})})}(e),e.jstree.defaults.plugins.push("contextmenu")}(jQuery),function(e){e.jstree.defaults.dnd={copy:!0,open_timeout:500},e.jstree.plugins.dnd=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("mousedown","a",e.proxy(function(t){var n=this.get_node(t.target);return n&&-1!==n&&n.length&&1===t.which?(this.element.trigger("mousedown.jstree"),e.vakata.dnd.start(t,{jstree:!0,origin:this,obj:n},''+this.get_text(t.currentTarget,!0)+'+
')):void 0},this))}},e(function(){var t=!1,n=!1,s=e('
').hide().appendTo("body");e(document).bind("dnd_start.vakata",function(){t=!1}).bind("dnd_move.vakata",function(a,r){if(n&&clearTimeout(n),r.data.jstree&&(!r.event.target.id||"jstree-marker"!==r.event.target.id)){var i,o,l,c,d,h,u=e.jstree.reference(r.event.target),_=!1,p=!1,g=!1;if(u&&u._data&&u._data.dnd)if(s.attr("class","jstree-"+u.get_theme()),r.helper.children().attr("class","jstree-"+u.get_theme()).find(".jstree-copy:eq(0)")[r.data.origin.settings.dnd.copy&&(r.event.metaKey||r.event.ctrlKey)?"show":"hide"](),r.event.target===u.element[0]||r.event.target===u.get_container_ul()[0]){if(u.check(r.data.origin.settings.dnd.copy&&(r.event.metaKey||r.event.ctrlKey)?"copy_node":"move_node",r.data.obj,-1,"last"))return t={ins:u,par:-1,pos:"last"},s.hide(),r.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),void 0}else if(_=e(r.event.target).closest("a"),_&&_.length&&_.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(p=_.offset(),g=r.event.pageY-p.top,l=_.height(),h=l/3>g?["b","i","a"]:g>l-l/3?["a","i","b"]:g>l/2?["i","a","b"]:["i","b","a"],e.each(h,function(e,a){switch(a){case"b":i=p.left-6,o=p.top-5,c=u.get_parent(_),d=_.parent().index();break;case"i":i=p.left-2,o=p.top-5+l/2+1,c=_.parent(),d=0;break;case"a":i=p.left-6,o=p.top-5+l+2,c=u.get_parent(_),d=_.parent().index()+1}return u.check(r.data.origin.settings.dnd.copy&&(r.event.metaKey||r.event.ctrlKey)?"copy_node":"move_node",r.data.obj,c,d)?("i"===a&&_.parent().is(".jstree-closed")&&u.settings.dnd.open_timeout&&(n=setTimeout(function(e,t){return function(){e.open_node(t)}}(u,_),u.settings.dnd.open_timeout)),t={ins:u,par:c,pos:d},s.css({left:i+"px",top:o+"px"}).show(),r.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),h=!0,!1):void 0}),h===!0))return;t=!1,r.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),s.hide()}}).bind("dnd_scroll.vakata",function(e,n){n.data.jstree&&(s.hide(),t=!1,n.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er"))}).bind("dnd_stop.vakata",function(e,a){n&&clearTimeout(n),a.data.jstree&&(s.hide(),t&&t.ins[a.data.origin.settings.dnd.copy&&(a.event.metaKey||a.event.ctrlKey)?"copy_node":"move_node"](a.data.obj,t.par,t.pos))}).bind("keyup keydown",function(t,n){n=e.vakata.dnd._get(),n.data&&n.data.jstree&&n.helper.find(".jstree-copy:eq(0)")[n.data.origin.settings.dnd.copy&&(t.metaKey||t.ctrlKey)?"show":"hide"]()});var a="#jstree-marker { position: absolute; top:0; left:0; margin:0; padding:0; border-right:0; border-top:5px solid transparent; border-bottom:5px solid transparent; border-left:5px solid; width:0; height:0; font-size:0; line-height:0; _border-top-color:pink; _border-botton-color:pink; _filter:chroma(color=pink); } #jstree-dnd { line-height:16px; margin:0; padding:4px; } #jstree-dnd .jstree-icon, #jstree-dnd .jstree-copy { display:inline-block; text-decoration:none; margin:0 2px 0 0; padding:0; width:16px; height:16px; } #jstree-dnd .jstree-ok { background:green; } #jstree-dnd .jstree-er { background:red; } #jstree-dnd .jstree-copy { margin:0 2px 0 2px; }";e.jstree.no_css||e("head").append('")}),e.jstree.defaults.plugins.push("dnd")}(jQuery),function(e){e.fn.vakata_reverse=[].reverse;var t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1};e.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5},_trigger:function(t,n){var s=e.vakata.dnd._get();s.event=n,e(document).triggerHandler("dnd_"+t+".vakata",s)},_get:function(){return{data:t.data,element:t.element,helper:t.helper}},_clean:function(){t.helper&&t.helper.remove(),t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1},e(document).unbind("mousemove",e.vakata.dnd.drag),e(document).unbind("mouseup",e.vakata.dnd.stop)},_scroll:function(n){if(!t.scroll_e||!t.scroll_l&&!t.scroll_t)return t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),!1;if(!t.scroll_i)return t.scroll_i=setInterval(e.vakata.dnd._scroll,100),!1;if(n===!0)return!1;var s=t.scroll_e.scrollTop(),a=t.scroll_e.scrollLeft();t.scroll_e.scrollTop(s+t.scroll_t*e.vakata.dnd.settings.scroll_speed),t.scroll_e.scrollLeft(a+t.scroll_l*e.vakata.dnd.settings.scroll_speed),(s!==t.scroll_e.scrollTop()||a!==t.scroll_e.scrollLeft())&&e.vakata.dnd._trigger("scroll",t.scroll_e)},start:function(n,s,a){t.is_drag&&e.vakata.dnd.stop({});try{n.currentTarget.unselectable="on",n.currentTarget.onselectstart=function(){return!1},n.currentTarget.style&&(n.currentTarget.style.MozUserSelect="none")}catch(r){}return t.init_x=n.pageX,t.init_y=n.pageY,t.data=s,t.is_down=!0,t.element=n.currentTarget,a!==!1&&(t.helper=e("").html(a).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove",e.vakata.dnd.drag),e(document).bind("mouseup",e.vakata.dnd.stop),!1},drag:function(n){if(t.is_down){if(!t.is_drag){if(!(Math.abs(n.pageX-t.init_x)>e.vakata.dnd.settings.threshold||Math.abs(n.pageY-t.init_y)>e.vakata.dnd.settings.threshold))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth()),t.is_drag=!0,e.vakata.dnd._trigger("start",n)}var s=!1,a=!1,r=!1,i=!1,o=!1,l=!1,c=!1,d=!1,h=!1,u=!1;t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1,e(n.target).parentsUntil("body").addBack().vakata_reverse().filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var s=e(this),a=s.offset();return this.scrollHeight>this.offsetHeight&&(a.top+s.height()-n.pageYthis.offsetWidth&&(a.left+s.width()-n.pageXi&&n.pageY-ci&&i-(n.pageY-c)l&&n.pageX-dl&&l-(n.pageX-d)r&&(h=r-50),o&&u+t.helper_w>o&&(u=o-(t.helper_w+2)),t.helper.css({left:u+"px",top:h+"px"})),e.vakata.dnd._trigger("move",n)}},stop:function(n){t.is_drag&&e.vakata.dnd._trigger("stop",n),e.vakata.dnd._clean()}}}(jQuery),function(e){e.jstree.defaults.html={data:!1,ajax:!1},e.jstree.plugins.html=function(t,n){this.append_html_data=function(t,n){return n=e(n),t=this.get_node(t),n&&n.length&&n.is("ul, li")?(-1===t&&(t=this.element),t.length?(t.children("ul").length||t.append(""),t.children("ul").empty().append(n.is("ul")?n.children("li"):n),!0):!1):(t&&-1!==t&&t.is("li")&&t.removeClass("jstree-closed").addClass("jstree-leaf").children("ul").remove(),!0)},this._load_node=function(t,s){var a=e.extend(!0,{},this.settings.html);if(t=this.get_node(t),!t)return!1;switch(!0){case!a.data&&!a.ajax:return n._load_node.call(this,t,s);case e.isFunction(a.data):return a.data.call(this,t,e.proxy(function(e){return s.call(this,this._append_html_data(t,e))},this));case!!a.data&&!a.ajax||!!a.data&&!!a.ajax&&-1===t:return s.call(this,this._append_html_data(t,a.data));case!a.data&&!!a.ajax||!!a.data&&!!a.ajax&&-1!==t:return a.ajax.success=e.proxy(function(n,a,r){var i=this.settings.html.ajax;e.isFunction(i.success)&&(n=i.success.call(this,n,a,r)||n),s.call(this,this._append_html_data(t,n))},this),a.ajax.error=e.proxy(function(t,n,a){var r=this.settings.html.ajax;e.isFunction(r.error)&&r.error.call(this,t,n,a),s.call(this,!1)},this),a.ajax.dataType||(a.ajax.dataType="html"),e.isFunction(a.ajax.url)&&(a.ajax.url=a.ajax.url.call(this,t)),e.isFunction(a.ajax.data)&&(a.ajax.data=a.ajax.data.call(this,t)),e.ajax(a.ajax)}}},e.jstree.defaults.plugins.push("html")}(jQuery),function(e){e.jstree.defaults.json={data:!1,ajax:!1,progressive_render:!1,progressive_unload:!1},e.jstree.plugins.json=function(t,n){this.bind=function(){n.bind.call(this),this.element.bind("ready.jstree",e.proxy(function(){this.element.bind("after_close.jstree",e.proxy(function(t,n){var s=e(n.node);this.settings.json.progressive_unload&&0===s.find(".jstree-clicked:eq(0)").length&&(s.data("jstree").children=this.get_json(s)[0].children,s.children("ul").remove())},this))},this))},this.parse_json=function(t){var s=this.settings.json;return s.progressive_render&&e.isArray(t.children)&&!this._json_has_selected(t.children)&&(t.data||(t.data={}),t.data.jstree||(t.data.jstree={}),t.data.jstree.children=t.children,t.children=!0),n.parse_json.call(this,t)},this._json_has_selected=function(e){for(var t=!1,n=0,s=e.length;s>n&&(t=e[n].data&&e[n].data.jstree&&e[n].data.jstree.selected?!0:e[n].children?t||this._json_has_selected(e[n].children):!1,t!==!0);n++);return t},this._append_json_data=function(e,t){return e=this.get_node(e),-1===e&&(e=this.element),t=this.parse_json(t),e.length?t?(e.children("ul").length||e.append(""),e.children("ul").empty().append(t.is("li")?t:t.children("li")),!0):(e&&e.is("li")&&e.removeClass("jstree-closed").addClass("jstree-leaf").children("ul").remove(),!0):!1},this._load_node=function(t,s){var a=!1,r=e.extend(!0,{},this.settings.json);if(t=this.get_node(t),!t)return!1;switch(!0){case-1===t&&this.get_container().data("jstree")&&e.isArray(this.get_container().data("jstree").children):return a=this.element.data("jstree").children,this.get_container().data("jstree").children=null,s.call(this,this._append_json_data(t,a));case-1!==t&&t.length&&t.data("jstree")&&e.isArray(t.data("jstree").children):return a=t.data("jstree").children,t.data("jstree").children=null,s.call(this,this._append_json_data(t,a));case!r.data&&!r.ajax:return n._load_node.call(this,t,s);case e.isFunction(r.data):return r.data.call(this,t,e.proxy(function(e){return s.call(this,this._append_json_data(t,e))},this));case!!r.data&&!r.ajax||!!r.data&&!!r.ajax&&-1===t:return s.call(this,this._append_json_data(t,r.data));case!r.data&&!!r.ajax||!!r.data&&!!r.ajax&&-1!==t:return r.ajax.success=e.proxy(function(n,a,r){var i=this.settings.json.ajax;e.isFunction(i.success)&&(n=i.success.call(this,n,a,r)||n),s.call(this,this._append_json_data(t,n))},this),r.ajax.error=e.proxy(function(t,n,a){var r=this.settings.json.ajax;e.isFunction(r.error)&&r.error.call(this,t,n,a),s.call(this,!1)},this),r.ajax.dataType||(r.ajax.dataType="json"),e.isFunction(r.ajax.url)&&(r.ajax.url=r.ajax.url.call(this,t)),e.isFunction(r.ajax.data)&&(r.ajax.data=r.ajax.data.call(this,t)),e.ajax(r.ajax)}}},e.jstree.defaults.plugins.push("json")}(jQuery),function(e){e.jstree.defaults.rules={check_max_depth:!0,check_max_children:!0,check_valid_children:!0,types:{}},e.jstree.plugins.rules=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("load_node.jstree",e.proxy(function(e,t){if(this.settings.rules.check_max_depth){var n=-1===t.node?this.element:t.node,s=this,a=function(){s.apply_max_depth(this)&&(n=n.not(this))};if(!this.apply_max_depth(n))for(;n.length;)n=n.children("ul").children("li"),n.each(a)}},this))},this.apply_max_depth=function(t){if(t=this.get_node(t),!t||!t.length)return!1;t=-1===t?this.element:t;var n=t.data("jstree"),s={},a=function(){s=e(this).data("jstree")||{},s.max_depth=0,e(this).data("jstree",s)},r=function(){s=e(this).data("jstree")||{},s.max_depth=s.max_depth&&-1!==s.max_depth?Math.min(s.max_depth,n):n,e(this).data("jstree",s)};if(n&&n.max_depth!==void 0&&-1!==n.max_depth){for(n=n.max_depth;t.length>0;){if(t=t.children("ul").children("li"),n=Math.max(n-1,0),0===n){t.find("li").addBack().each(a);break}t.each(r)}return!0}return!1},this.get_rules=function(e){if(e=this.get_node(e),-1===e)return e=this.element,e=e.data("jstree"),{type:!1,max_depth:e&&e.max_depth?e.max_depth:-1,max_children:e&&e.max_children?e.max_children:-1,valid_children:e&&e.valid_children?e.valid_children:-1};if(!e||!e.length)return!1;
var t=this.settings.rules,n=this.get_type(e),s={type:n,max_depth:-1,max_children:-1,valid_children:-1};return e=e.data("jstree"),n&&t[n]&&(t[n].max_depth&&(s.max_depth=t[n].max_depth),t[n].max_children&&(s.max_children=t[n].max_children),t[n].valid_children&&(s.valid_children=t[n].valid_children)),e&&e.max_children!==void 0&&(s.max_children=e.max_children),e&&e.valid_children!==void 0&&(s.valid_children=e.valid_children),e&&e.max_depth!==void 0&&(-1===s.max_depth||-1!==e.max_depth&&e.max_depthi.max_children)return!1;if(o.check_valid_children&&i.valid_children!==void 0&&-1!==i.valid_children){if(!e.isArray(i.valid_children))return!1;if(s.each(function(){return-1===e.inArray(l.get_type(this),i.valid_children)?(l=!1,!1):void 0}),l===!1)return!1}if(o.check_max_depth&&-1!==i.max_depth){c=0;do c++,s=s.children("ul").children("li");while(s.length&&"create_node"!==t);if(0>i.max_depth-c)return!1}}return!0}},e.jstree.defaults.plugins.push("rules")}(jQuery),function(e){e.jstree.defaults.search={ajax:!1,case_sensitive:!1,show_only_matches:!0},e.jstree.plugins.search=function(t,n){this.bind=function(){n.bind.call(this),this._data.search.str="",this._data.search.res=e(),this.settings.search.show_only_matches&&this.element.on("search.jstree",function(t,n){n.nodes.length&&(e(this).children("ul").find("li").hide().removeClass("jstree-last"),n.nodes.parentsUntil(".jstree").addBack().show().filter("ul").each(function(){e(this).children("li:visible").eq(-1).addClass("jstree-last")}))}).on("clear_search.jstree",function(t,n){n.nodes.length&&e(this).children("ul").find("li").css("display","").end().end().jstree("correct_node",-1,!0)})},this.search=function(t,n){if(t===!1||""===e.trim(t))return this.clear_search();var s=this.settings.search,a=this;return!n&&s.ajax!==!1&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0?(s.ajax.success=e.proxy(function(n,s,a){var r=this.settings.search.ajax;e.isFunction(r.success)&&(n=r.success.call(this,n,s,a)||n),this._search_open(n,t)},this),s.ajax.error=e.proxy(function(t,n,s){var a=this.settings.search.ajax;e.isFunction(a.error)&&a.error.call(this,t,n,s)},this),s.ajax.dataType||(s.ajax.dataType="json"),e.isFunction(s.ajax.url)&&(s.ajax.url=s.ajax.url.call(this,t)),e.isFunction(s.ajax.data)?s.ajax.data=s.ajax.data.call(this,t):(s.ajax.data||(s.ajax.data={}),s.ajax.data.str=t),e.ajax(s.ajax),void 0):(this._data.search.res.length&&this.clear_search(),this._data.search.str=t,this._data.search.res=this._search(t),this._data.search.res.addClass("jstree-search").parent().parentsUntil(".jstree",".jstree-closed").each(function(){a.open_node(this,!1,0)}),this.trigger("search",{nodes:this._data.search.res,str:t}),void 0)},this.clear_search=function(){this._data.search.res.removeClass("jstree-search"),this.trigger("clear_search",{nodes:this._data.search.res,str:this._data.search.str}),this._data.search.str="",this._data.search.res=e()},this._search=function(t){return t=this.settings.search.case_sensitive?t:t.toLowerCase(),this.settings.json&&this.settings.json.progressive_render&&this.get_container_ul().find("li.jstree-closed:not(:has(ul))").each(e.proxy(function(n,s){this._search_data(t,e(s).data("jstree"))&&this.open_node(s,!1,0)},this)),this.element.find(".jstree-anchor:"+(this.settings.search.case_sensitive?"contains":"vakata_icontains")+"("+t+")")},this._search_data=function(t,n){if(!n||!n.children||!e.isArray(n.children))return!1;var s=!1;return e.each(n.children,e.proxy(function(e,a){var r,i="string"==typeof a?a:a.title;i=this.settings.search.case_sensitive?i:i.toLowerCase(),r=-1!==i.indexOf(t)||this._search_data(t,a),r&&(n.data||(n.data={}),n.data.jstree||(n.data.jstree={}),n.data.jstree.opened=!0),s=s||r},this)),s},this._search_open=function(t,n){var s=!0,a=this;e.each(t.concat([]),function(r,i){i=document.getElementById(i),i&&(a.is_loaded(i)?(a.is_closed(i)&&a.open_node(i,!1,0),e.vakata.array_remove(t,r)):(a.is_loading(i)||a.open_node(i,e.proxy(function(){this._search_open(t,n)},a),0),s=!1))}),s&&this.search(n,!0)}},e.expr[":"].vakata_icontains=e.expr.createPseudo(function(e){return function(t){return(t.textContent||t.innerText||"").toLowerCase().indexOf(e.toLowerCase())>=0}}),e.jstree.defaults.plugins.push("search")}(jQuery),function(e){e.jstree.defaults.sort=function(e,t){return this.get_text(e,!0)>this.get_text(t,!0)?1:-1},e.jstree.plugins.sort=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("load_node.jstree",e.proxy(function(e,t){var n=this.get_node(t.node);n=-1===n?this.get_container_ul():n.children("ul"),this.sort(n,!0)},this)).on("rename_node.jstree create_node.jstree",e.proxy(function(e,t){this.sort(t.node.parent(),!1)},this)).on("move_node.jstree copy_node.jstree",e.proxy(function(e,t){var n=-1===t.parent?this.get_container_ul():t.parent.children("ul");this.sort(n,!1)},this))},this.sort=function(t,n){var s=this.settings.sort,a=this;t.append(e.makeArray(t.children("li")).sort(e.proxy(s,a))),t.children("li").each(function(){a.correct_node(this,!1)}),n&&(t.children("li").children("ul").each(function(){a.sort(e(this))}),a.correct_node(t.children("li"),!0))}},e.jstree.defaults.plugins.push("sort")}(jQuery),function(e){var t=!1;e.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree",ttl:!1},e.jstree.plugins.state=function(n,s){this.bind=function(){s.bind.call(this),this.element.on("ready.jstree",e.proxy(function(){this.element.one("restore_state.jstree set_state.jstree",e.proxy(function(){this.element.on(this.settings.state.events,e.proxy(function(){t&&clearTimeout(t),t=setTimeout(e.proxy(function(){this.save_state()},this),100)},this))},this)),this.restore_state()},this))},this.save_state=function(){e.vakata.storage.set(this.settings.state.key,this.get_state(),this.settings.state.ttl)},this.restore_state=function(){var t=e.vakata.storage.get(this.settings.state.key);t&&this.set_state(t),this.trigger("restore_state",{state:t})},this.clear_state=function(){return e.vakata.storage.del(this.settings.state.key)}}}(jQuery),function(e,t,n){var s=function(e){return e},a=function(e){return decodeURIComponent(e.replace(/\+/g," "))},r=e.vakata.cookie=function(i,o,l){if(o!==n){if(l=e.extend({},r.defaults,l),null===o&&(l.expires=-1),"number"==typeof l.expires){var c=l.expires,d=l.expires=new Date;d.setDate(d.getDate()+c)}return o=r.json?e.vakata.json.encode(o):o+"",t.cookie=[encodeURIComponent(i),"=",r.raw?o:encodeURIComponent(o),l.expires?"; expires="+l.expires.toUTCString():"",l.path?"; path="+l.path:"",l.domain?"; domain="+l.domain:"",l.secure?"; secure":""].join("")}for(var h=r.raw?s:a,u=t.cookie.split("; "),_=0,p=u.length;p>_;_++){var g=u[_].split("=");if(h(g.shift())===i){var f=h(g.join("="));return r.json?e.vakata.json.decode(f):f}}return null};r.defaults={},e.vakata.removeCookie=function(t,n){return null!==e.cookie(t)?(e.cookie(t,null,n),!0):!1}}(jQuery,document),function(e){function t(){var t=!1;if("localStorage"in window)try{window.localStorage.setItem("_tmptest","tmpval"),t=!0,window.localStorage.removeItem("_tmptest")}catch(s){}if(t)try{window.localStorage&&(o=window.localStorage,u="localStorage")}catch(a){}else if("globalStorage"in window)try{window.globalStorage&&(o=window.globalStorage[window.location.hostname],u="globalStorage")}catch(i){}else{if(l=document.createElement("link"),l.addBehavior){l.style.behavior="url(#default#userData)",document.getElementsByTagName("head")[0].appendChild(l);try{l.load("jStorage");var c="{}";c=l.getAttribute("jStorage"),o.jStorage=c,u="userDataBehavior"}catch(d){}}if(!u&&(e.vakata.cookie("__vjstorage")||e.vakata.cookie("__vjstorage","{}",{expires:365})&&"{}"===e.vakata.cookie("__vjstorage"))&&(l=null,o.jStorage=e.vakata.cookie("__vjstorage"),u="cookie"),!u)return l=null,void 0}n(),r()}function n(){if(o.jStorage)try{i=h(o.jStorage+"")}catch(e){o.jStorage="{}"}else o.jStorage="{}";c=o.jStorage?(o.jStorage+"").length:0}function s(){try{o.jStorage=d(i),"userDataBehavior"===u&&(l.setAttribute("jStorage",o.jStorage),l.save("jStorage")),"cookie"===u&&e.vakata.cookie("__vjstorage",o.jStorage,{expires:365}),c=o.jStorage?(o.jStorage+"").length:0}catch(t){}}function a(e){if(!e||"string"!=typeof e&&"number"!=typeof e)throw new TypeError("Key name must be string or numeric");if("__jstorage_meta"===e)throw new TypeError("Reserved key name");return!0}function r(){var e,t,n=+new Date,a=1/0,o=!1;if(_!==!1&&clearTimeout(_),i.__jstorage_meta&&"object"==typeof i.__jstorage_meta.TTL){t=i.__jstorage_meta.TTL;for(e in t)t.hasOwnProperty(e)&&(n>=t[e]?(delete t[e],delete i[e],o=!0):a>t[e]&&(a=t[e]));1/0!==a&&(_=setTimeout(r,a-n)),o&&s()}}var i={},o={jStorage:"{}"},l=null,c=0,d=e.vakata.json.encode,h=e.vakata.json.decode,u=!1,_=!1;e.vakata.storage={version:"0.3.0",set:function(t,n,r){return a(t),"object"==typeof n&&(n=h(d(n))),i[t]=n,s(),r&&parseInt(r,10)&&e.vakata.storage.setTTL(t,parseInt(r,10)),n},get:function(e,t){return a(e),e in i?i[e]:t===void 0?null:t},del:function(e){return a(e),e in i?(delete i[e],i.__jstorage_meta&&"object"==typeof i.__jstorage_meta.TTL&&e in i.__jstorage_meta.TTL&&delete i.__jstorage_meta.TTL[e],s(),!0):!1},setTTL:function(e,t){var n=+new Date;return a(e),t=Number(t)||0,e in i?(i.__jstorage_meta||(i.__jstorage_meta={}),i.__jstorage_meta.TTL||(i.__jstorage_meta.TTL={}),t>0?i.__jstorage_meta.TTL[e]=n+t:delete i.__jstorage_meta.TTL[e],s(),r(),!0):!1},getTTL:function(e){var t,n=+new Date;return a(e),e in i&&i.__jstorage_meta.TTL&&i.__jstorage_meta.TTL[e]?(t=i.__jstorage_meta.TTL[e]-n,t||0):0},flush:function(){return i={},s(),!0},storageObj:function(){return e.extend(!0,{},i)},index:function(){var t=[];return e.each(i,function(e){"__jstorage_meta"!==e&&t.push(e)}),t},storageSize:function(){return c},currentBackend:function(){return u},storageAvailable:function(){return!!u}},t()}(jQuery),function(e){e.jstree.plugins.unique=function(t,n){this.check=function(t,s,a,r){if(n.check.call(this,t,s,a,r)===!1)return!1;a=-1===a?this.element:a;var i="rename_node"===t?e("").html(r).text():this.get_text(s,!0),o=[],l=this;switch(a.children("ul").children("li").each(function(){o.push(l.get_text(this,!0))}),t){case"delete_node":return!0;case"rename_node":case"copy_node":return-1===e.inArray(i,o);case"move_node":return-1!==a.children("ul").children("li").index(s)||-1===e.inArray(i,o)}return!0}},e.jstree.defaults.plugins.push("unique")}(jQuery),function(e){e.jstree.plugins.wholerow=function(t,n){this.bind=function(){n.bind.call(this),this.element.on("ready.jstree set_state.jstree",e.proxy(function(){this.hide_dots()},this)).on("ready.jstree",e.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",e.proxy(function(){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree ",e.proxy(function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked"),t.selected.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",e.proxy(function(t,n){this.element.find(".jstree-wholerow-hovered").removeClass("jstree-wholerow-hovered"),"hover_node"===t.type&&n.node.each(function(){e(this).children(".jstree-wholerow").addClass("jstree-wholerow-hovered")})},this)).on("contextmenu.jstree",".jstree-wholerow",e.proxy(function(t){this._data.contextmenu!==void 0&&(t.preventDefault(),e(t.currentTarget).closest("li").children("a:eq(0)").trigger("contextmenu",t))},this)).on("click.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation(),e(t.currentTarget).closest("li").children("a:eq(0)").trigger("click",t)}).on("click.jstree",".jstree-leaf > .jstree-ocl",e.proxy(function(t){t.stopImmediatePropagation(),e(t.currentTarget).closest("li").children("a:eq(0)").trigger("click",t)},this)).on("mouseover.jstree","li",e.proxy(function(t){return t.stopImmediatePropagation(),e(t.currentTarget).closest("li").children(".jstree-hovered, .jstree-clicked").length?!1:(this.hover_node(t.currentTarget),!1)},this)).on("mouseleave.jstree","li",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.element.find(".jstree-wholerow").remove(),n.teardown.call(this)},this.clean_node=function(t){t=n.clean_node.call(this,t);var s=this;return t.each(function(){var t=e(this);t.children(".jstree-wholerow").length||t.prepend("
")})}},e(function(){var t=".jstree .jstree-wholerow-ul { position:relative; display:inline-block; min-width:100%; }.jstree-wholerow-ul li > a, .jstree-wholerow-ul li > i { position:relative; }.jstree-wholerow-ul .jstree-wholerow { width:100%; cursor:pointer; position:absolute; left:0; user-select:none;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; }";e.jstree.no_css||e("head").append('")})}(jQuery),function(e){var t={nest:' ',flat:' '},n=function(e){return(""+e).replace(/&/g,"&").replace(/<'+'/g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")};e.jstree.defaults.xml={xsl:"flat",data:!1,ajax:!1},e.jstree.plugins.xml=function(s,a){this._append_xml_data=function(n,s){return s=e.vakata.xslt(s,t[this.settings.xml.xsl]),s===!1?!1:(s=e(s),n=this.get_node(n),s&&s.length&&s.is("ul, li")?(-1===n&&(n=this.element),n.length?(n.children("ul").length||n.append(""),n.children("ul").empty().append(s.is("ul")?s.children("li"):s),!0):!1):(n&&-1!==n&&n.is("li")&&n.removeClass("jstree-closed").addClass("jstree-leaf").children("ul").remove(),!0))},this._load_node=function(t,n){var s=e.extend(!0,{},this.settings.xml);if(t=this.get_node(t),!t)return!1;switch(!0){case!s.data&&!s.ajax:return a._load_node.call(this,t,n);case e.isFunction(s.data):return s.data.call(this,t,e.proxy(function(e){return n.call(this,this._append_xml_data(t,e))},this));case!!s.data&&!s.ajax||!!s.data&&!!s.ajax&&-1===t:return n.call(this,this._append_xml_data(t,s.data));case!s.data&&!!s.ajax||!!s.data&&!!s.ajax&&-1!==t:return s.ajax.success=e.proxy(function(s,a,r){var i=this.settings.xml.ajax;e.isFunction(i.success)&&(s=i.success.call(this,s,a,r)||s),n.call(this,this._append_xml_data(t,s))},this),s.ajax.error=e.proxy(function(t,s,a){var r=this.settings.xml.ajax;e.isFunction(r.error)&&r.error.call(this,t,s,a),n.call(this,!1)},this),s.ajax.dataType||(s.ajax.dataType="xml"),e.isFunction(s.ajax.url)&&(s.ajax.url=s.ajax.url.call(this,t)),e.isFunction(s.ajax.data)&&(s.ajax.data=s.ajax.data.call(this,t)),e.ajax(s.ajax)}},this.get_xml=function(t,s,a){var r="";return t||(t="flat"),a===void 0?(s=this.get_json(s),e.each(s,e.proxy(function(e,n){r+=this.get_xml(t,n,!0)},this)),''+r+"<"+"/root>"):(r+="- ",r+="<"+"/content>","flat"===t&&(r+="
"),s.children&&e.each(s.children,e.proxy(function(e,n){r+=this.get_xml(t,n,s.li_attr&&s.li_attr.id?s.li_attr.id:!0)},this)),"nest"===t&&(r+=""),r)}},e.jstree.defaults.plugins.push("xml"),e.vakata.xslt=function(t,n){var s,a,r,i=!1,o=e.parseXML(t),l=e.parseXML(n);if("undefined"!=typeof XSLTProcessor)return s=new XSLTProcessor,s.importStylesheet(l),i=s.transformToFragment(o,document),e("").append(i).html();if(o.transformNode!==void 0)return o.transformNode(l);if(window.ActiveXObject)try{i=new ActiveXObject("Msxml2.XSLTemplate"),a=new ActiveXObject("Msxml2.DOMDocument"),a.loadXML(t),r=new ActiveXObject("Msxml2.FreeThreadedDOMDocument"),r.loadXML(n),i.stylesheet=r,s=i.createProcessor(),s.input=a,s.transform(),i=s.output}catch(c){}return i}}(jQuery);
\ No newline at end of file
diff --git a/docs/jstree.json b/docs/jstree.json
index 8ae643d2..1b7a59b9 100644
--- a/docs/jstree.json
+++ b/docs/jstree.json
@@ -227,7 +227,7 @@
"body": ""
},
"ignore": false,
- "code": "get_parent : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(obj === -1 || !obj || !obj.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar o = obj.parentNode.parentNode;\n\t\t\treturn o.tagName === 'LI' ? $(o) : -1;\n\t\t},"
+ "code": "get_parent : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(obj === -1 || !obj || !obj.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar o = obj[0].parentNode.parentNode;\n\n\t\t\treturn o.tagName === 'LI' ? $(o) : -1;\n\t\t},"
},
{
"tags": [],
@@ -826,7 +826,7 @@
"body": ""
},
"ignore": false,
- "code": "(function ($) {\n\t$.jstree.defaults.checkbox = {\n\t\tthree_state : true,\n\t\twhole_node : false,\n\t\tkeep_selected_style : true,\n\t\ticons : true,\n\t\tparse_data : true\n\t};\n\n\t$.jstree.plugins.checkbox = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\n\t\t\tthis.element\n\t\t\t\t.on(\"init.jstree\", $.proxy(function () {\n\t\t\t\t\t\tthis._data.checkbox.icons = this.settings.checkbox.icons;\n\t\t\t\t\t}, this))\n\t\t\t\t.on('loaded.jstree', $.proxy(function () {\n\t\t\t\t\t\tthis[this._data.checkbox.icons ? 'show_checkboxes' : 'hide_checkboxes' ]();\n\t\t\t\t\t}, this));\n\t\t\tif(!this.settings.checkbox.keep_selected_style) {\n\t\t\t\tthis.element.addClass('jstree-checkbox-no-clicked');\n\t\t\t}\n\t\t\tif(this.settings.checkbox.three_state) {\n\t\t\t\tthis.element\n\t\t\t\t\t.on('ready.jstree', $.proxy(function () {\n\t\t\t\t\t\t\tvar change = false,\n\t\t\t\t\t\t\t\tnodes = this.get_selected(),\n\t\t\t\t\t\t\t\ttmp = nodes\n\t\t\t\t\t\t\t\t\t\t.find('.jstree-undetermined').removeClass('jstree-undetermined').end()\n\t\t\t\t\t\t\t\t\t\t.find('.jstree-anchor:not(.jstree-clicked)');\n\n\t\t\t\t\t\t\tif(tmp.length) {\n\t\t\t\t\t\t\t\tchange = true;\n\t\t\t\t\t\t\t\tthis.select_node(tmp, true, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnodes.each($.proxy(function (i,v) {\n\t\t\t\t\t\t\t\tchange = change || this.check_up($(v).parent());\n\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\tif(change) {\n\t\t\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : this._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(this.settings.json && this.settings.json.progressive_render && this.settings.checkbox.three_state) {\n\t\t\t\t\t\t\t\tthis.element\n\t\t\t\t\t\t\t\t\t.on('deselect_all.jstree select_node.jstree deselect_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\t\t\t\tdata.node.filter('.jstree-closed').each($.proxy(function (i, v) {\n\t\t\t\t\t\t\t\t\t\t\tvar t = $(v),\n\t\t\t\t\t\t\t\t\t\t\t\td = t.data('jstree');\n\t\t\t\t\t\t\t\t\t\t\tif(d && d.children && t.children('ul').length === 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tthis._progressive_data_clean(d.children);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('deselect_all.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tthis.element.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('open_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tif(data.node && data.node !== -1) {\n\t\t\t\t\t\t\t\tvar tmp;\n\t\t\t\t\t\t\t\tif(this.is_selected(data.node)) {\n\t\t\t\t\t\t\t\t\ttmp = data.node.find('.jstree-anchor').not('.jstree-clicked');\n\t\t\t\t\t\t\t\t\tif(tmp.length) {\n\t\t\t\t\t\t\t\t\t\tthis.select_node(tmp, true, true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif(this.check_up(data.node)) {\n\t\t\t\t\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : this._data.core.selected });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('changed.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar action = data.action || '',\n\t\t\t\t\t\t\t\tnode = false,\n\t\t\t\t\t\t\t\tchange = false,\n\t\t\t\t\t\t\t\ttmp;\n\t\t\t\t\t\t\tswitch(action) {\n\t\t\t\t\t\t\t\tcase 'select_node':\n\t\t\t\t\t\t\t\t\tnode = data.node.parent();\n\t\t\t\t\t\t\t\t\ttmp = data.node.find('.jstree-anchor:not(.jstree-clicked)');\n\t\t\t\t\t\t\t\t\tif(tmp.length) {\n\t\t\t\t\t\t\t\t\t\tchange = true;\n\t\t\t\t\t\t\t\t\t\tthis.select_node(tmp, true, true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdata.node.find('.jstree-undetermined').removeClass('jstree-undetermined');"
+ "code": "(function ($) {\n\t$.jstree.defaults.checkbox = {\n\t\tthree_state : true,\n\t\twhole_node : false,\n\t\tkeep_selected_style : true,\n\t\ticons : true,\n\t\tparse_data : true\n\t};\n\n\t$.jstree.plugins.checkbox = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\n\t\t\tthis.element\n\t\t\t\t.on(\"init.jstree\", $.proxy(function () {\n\t\t\t\t\t\tthis._data.checkbox.icons = this.settings.checkbox.icons;\n\t\t\t\t\t}, this))\n\t\t\t\t.on('loaded.jstree', $.proxy(function () {\n\t\t\t\t\t\tthis[this._data.checkbox.icons ? 'show_checkboxes' : 'hide_checkboxes' ]();\n\t\t\t\t\t}, this));\n\t\t\tif(!this.settings.checkbox.keep_selected_style) {\n\t\t\t\tthis.element.addClass('jstree-checkbox-no-clicked');\n\t\t\t}\n\t\t\tif(this.settings.checkbox.three_state) {\n\t\t\t\tthis.element\n\t\t\t\t\t.on('ready.jstree', $.proxy(function () {\n\t\t\t\t\t\t\tvar change = false,\n\t\t\t\t\t\t\t\tnodes = this.get_selected(),\n\t\t\t\t\t\t\t\ttmp = nodes\n\t\t\t\t\t\t\t\t\t\t.find('.jstree-undetermined').removeClass('jstree-undetermined').end()\n\t\t\t\t\t\t\t\t\t\t.find('.jstree-anchor:not(.jstree-clicked)');\n\n\t\t\t\t\t\t\tif(tmp.length) {\n\t\t\t\t\t\t\t\tchange = true;\n\t\t\t\t\t\t\t\tthis.select_node(tmp, true, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnodes.each($.proxy(function (i,v) {\n\t\t\t\t\t\t\t\tchange = change || this.check_up($(v).parent());\n\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\tif(change) {\n\t\t\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : this._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(this.settings.json && this.settings.json.progressive_render && this.settings.checkbox.three_state) {\n\t\t\t\t\t\t\t\tthis.element\n\t\t\t\t\t\t\t\t\t.on('deselect_all.jstree select_node.jstree deselect_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\t\t\t\tdata.node.filter('.jstree-closed').each($.proxy(function (i, v) {\n\t\t\t\t\t\t\t\t\t\t\tvar t = $(v),\n\t\t\t\t\t\t\t\t\t\t\t\td = t.data('jstree');\n\t\t\t\t\t\t\t\t\t\t\tif(d && d.children && t.children('ul').length === 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tthis._progressive_data_clean(d.children, e.type === 'select_node');\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('deselect_all.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tthis.element.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('open_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tif(data.node && data.node !== -1) {\n\t\t\t\t\t\t\t\tvar tmp;\n\t\t\t\t\t\t\t\tif(this.is_selected(data.node)) {\n\t\t\t\t\t\t\t\t\ttmp = data.node.find('.jstree-anchor').not('.jstree-clicked');\n\t\t\t\t\t\t\t\t\tif(tmp.length) {\n\t\t\t\t\t\t\t\t\t\tthis.select_node(tmp, true, true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif(this.check_up(data.node)) {\n\t\t\t\t\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : this._data.core.selected });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('changed.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar action = data.action || '',\n\t\t\t\t\t\t\t\tnode = false,\n\t\t\t\t\t\t\t\tchange = false,\n\t\t\t\t\t\t\t\ttmp;\n\t\t\t\t\t\t\tswitch(action) {\n\t\t\t\t\t\t\t\tcase 'select_node':\n\t\t\t\t\t\t\t\t\tnode = data.node.parent();\n\t\t\t\t\t\t\t\t\ttmp = data.node.find('.jstree-anchor:not(.jstree-clicked)');\n\t\t\t\t\t\t\t\t\tif(tmp.length) {\n\t\t\t\t\t\t\t\t\t\tchange = true;\n\t\t\t\t\t\t\t\t\t\tthis.select_node(tmp, true, true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdata.node.find('.jstree-undetermined').removeClass('jstree-undetermined');"
},
{
"tags": [],
@@ -846,7 +846,7 @@
"body": ""
},
"ignore": false,
- "code": "break;\n\t\t\t\t\t\t\t\tcase 'deselect_all':\n\t\t\t\t\t\t\t\t\tthis.element.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'delete_node':\n\t\t\t\t\t\t\t\t\tnode = data.parent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(node && this.check_up(node)) {\n\t\t\t\t\t\t\t\tchange = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(change) {\n\t\t\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : this._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('move_node.jstree copy_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tif(data.old_instance && data.old_instance.check_up && data.old_instance.check_up(data.old_parent)) {\n\t\t\t\t\t\t\t\tdata.old_instance.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : data.old_instance._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(data.new_instance && data.new_instance.check_up && data.new_instance.check_up(data.parent)) {\n\t\t\t\t\t\t\t\tdata.new_instance.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : data.new_instance._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\t\t\t}\n\t\t};\n\t\tthis._progressive_data_clean = function (data) {\n\t\t\tif(!this.settings.checkbox.three_state) { return false; }\n\t\t\tfor(var i = 0, j = data.length; i < j; i++) {\n\t\t\t\tif(data[i].data && data[i].data.jstree) {\n\t\t\t\t\tif(data[i].data.jstree.selected) {\n\t\t\t\t\t\tdelete data[i].data.jstree.selected;\n\t\t\t\t\t}\n\t\t\t\t\tif(data[i].data.jstree.undetermined) {\n\t\t\t\t\t\tdelete data[i].data.jstree.undetermined;\n\t\t\t\t\t}\n\t\t\t\t\tif(data[i].children) {\n\t\t\t\t\t\tthis._progressive_data_clean(data[i].children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis._set_state = function (node) {\n\t\t\tvar i = 0, j = 0, c = 0, r = false;\n\t\t\tif($.isArray(node)) {\n\t\t\t\tfor(i = 0, j = node.length; i < j; i++) {\n\t\t\t\t\tnode[i] = this._set_state(node[i]);\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(typeof node === \"undefined\") { node = {}; }\n\t\t\t\tif(typeof node === \"string\") { node = { \"title\" : node }; }\n\t\t\t\tif(!node.data) { node.data = {}; }\n\t\t\t\tif(!node.data.jstree) { node.data.jstree = {}; }\n\t\t\t\tr = node.data.jstree;\n\t\t\t\tif(r.selected || r.undetermined || r._checkboxed) { return node; }\n\t\t\t\tr._checkboxed = true;\n\n\t\t\t\tif(node.children && node.children.length) {\n\t\t\t\t\tfor(i = 0, j = node.children.length; i < j; i++) {\n\t\t\t\t\t\tnode.children[i] = this._set_state(node.children[i]);\n\t\t\t\t\t\tr = node.children[i].data.jstree;\n\t\t\t\t\t\tif(r.selected) { c += 2; }\n\t\t\t\t\t\telse if(r.undetermined) { c += 1; }\n\t\t\t\t\t}\n\t\t\t\t\tif(c > 0) {\n\t\t\t\t\t\tif(c === j * 2) {\n\t\t\t\t\t\t\tnode.data.jstree.selected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnode.data.jstree.undetermined = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t};\n\t\tthis.parse_json = function(data) {\n\t\t\tvar s = this.settings.checkbox;\n\t\t\tif(s.parse_data && s.three_state && $.isArray(data)) {\n\t\t\t\tdata = this._set_state(data);\n\t\t\t}\n\t\t\treturn parent.parse_json.call(this, data);\n\t\t};\n\t\tthis.clean_node = function(obj) {\n\t\t\tobj = parent.clean_node.call(this, obj);\n\t\t\tvar _this = this;\n\t\t\treturn obj.each(function () {\n\t\t\t\tvar t = $(this),\n\t\t\t\t\td = t.data('jstree'),\n\t\t\t\t\to = t.children('a');\n\t\t\t\tif(!o.children(\"i.jstree-checkbox\").length) {\n\t\t\t\t\to.prepend(\"<\"+\"i class='jstree-icon jstree-checkbox'><\"+\"/i>\");\n\t\t\t\t}\n\t\t\t\tif(d && d.undetermined) {\n\t\t\t\t\to.parentsUntil('.jstree', 'li').children(\"a.jstree-anchor\").children(\"i.jstree-checkbox\").addClass('jstree-undetermined');\n\t\t\t\t\tdelete d.undetermined;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tthis.get_json = function (obj, is_callback) {\n\t\t\tvar r = parent.get_json.call(this, obj, is_callback);\n\t\t\tif(is_callback) {\n\t\t\t\tif(obj.children(\".jstree-anchor\").children(\".jstree-undetermined\").length) {\n\t\t\t\t\tr.data.jstree.undetermined = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn r;\n\t\t};\n\t\tthis.activate_node = function (obj, e) {\n\t\t\tif(this.settings.checkbox.whole_node || $(e.target).hasClass('jstree-checkbox')) {\n\t\t\t\te.ctrlKey = true;\n\t\t\t}\n\t\t\tparent.activate_node.call(this, obj, e);\n\t\t};\n\t\tthis.check_up = function (obj) {\n\t\t\tif(!this.settings.checkbox.three_state) { return false; }\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(obj === -1 || !obj || !obj.length) { return false; }\n\n\t\t\tvar state = 0,\n\t\t\t\thas_children = obj.children(\"ul\").children(\"li\").length > 0,\n\t\t\t\tall_checked = has_children && obj.children(\"ul\").children(\"li\").not(this._data.core.selected).length === 0,\n\t\t\t\tnone_checked = has_children && obj.find('li > .jstree-clicked, li > .jstree-anchor > .jstree-undetermined').length === 0;\n\n\t\t\tif(!state && this.is_selected(obj)) { state = 1; }\n\t\t\tif(!state && obj.children(\".jstree-anchor\").children(\".jstree-undetermined\").length) { state = 2; }\r\n\t\t\tif(!has_children) {\n\t\t\t\tif(state === 2) {\n\t\t\t\t\tobj.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\r\n\t\t\tif(all_checked) {\n\t\t\t\tif(state !== 1) {\n\t\t\t\t\tobj.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\tthis.select_node(obj, true);\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\r\n\t\t\tif(none_checked) {\n\t\t\t\tif(state === 2) {\n\t\t\t\t\tobj.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif(state === 1) {\n\t\t\t\t\tthis.deselect_node(obj, true);\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\r\n\t\t\tif(state === 1) {\n\t\t\t\tobj.children(\".jstree-anchor\").children(\".jstree-checkbox\").addClass('jstree-undetermined');\n\t\t\t\tthis.deselect_node(obj, true);\n\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\treturn true;\n\t\t\t}\r\n\t\t\tif(state === 0) {\n\t\t\t\tvar tmp = obj.children('.jstree-anchor').children('.jstree-checkbox');\n\t\t\t\tif(!tmp.hasClass('jstree-undetermined')) {\n\t\t\t\t\tobj.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-undetermined');\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};"
+ "code": "break;\n\t\t\t\t\t\t\t\tcase 'deselect_all':\n\t\t\t\t\t\t\t\t\tthis.element.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'delete_node':\n\t\t\t\t\t\t\t\t\tnode = data.parent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(node && this.check_up(node)) {\n\t\t\t\t\t\t\t\tchange = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(change) {\n\t\t\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : this._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('move_node.jstree copy_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tif(data.old_instance && data.old_instance.check_up && data.old_instance.check_up(data.old_parent)) {\n\t\t\t\t\t\t\t\tdata.old_instance.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : data.old_instance._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(data.new_instance && data.new_instance.check_up && data.new_instance.check_up(data.parent)) {\n\t\t\t\t\t\t\t\tdata.new_instance.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : data.new_instance._data.core.selected });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\t\t\t}\n\t\t};\n\t\tthis._progressive_data_clean = function (data, is_select) {\n\t\t\tif(!this.settings.checkbox.three_state) { return false; }\n\t\t\tfor(var i = 0, j = data.length; i < j; i++) {\n\t\t\t\tif(data[i].data && data[i].data.jstree) {\n\t\t\t\t\tif(data[i].data.jstree.selected) {\n\t\t\t\t\t\tdelete data[i].data.jstree.selected;\n\t\t\t\t\t}\n\t\t\t\t\tif(data[i].data.jstree.undetermined) {\n\t\t\t\t\t\tdelete data[i].data.jstree.undetermined;\n\t\t\t\t\t}\n\t\t\t\t\tif(data[i].children) {\n\t\t\t\t\t\tthis._progressive_data_clean(data[i].children, is_select);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis._set_state = function (node) {\n\t\t\tvar i = 0, j = 0, c = 0, r = false;\n\t\t\tif($.isArray(node)) {\n\t\t\t\tfor(i = 0, j = node.length; i < j; i++) {\n\t\t\t\t\tnode[i] = this._set_state(node[i]);\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(typeof node === \"undefined\") { node = {}; }\n\t\t\t\tif(typeof node === \"string\") { node = { \"title\" : node }; }\n\t\t\t\tif(!node.data) { node.data = {}; }\n\t\t\t\tif(!node.data.jstree) { node.data.jstree = {}; }\n\t\t\t\tr = node.data.jstree;\n\t\t\t\tif(r.selected || r.undetermined || r._checkboxed) { return node; }\n\t\t\t\tr._checkboxed = true;\n\n\t\t\t\tif(node.children && node.children.length) {\n\t\t\t\t\tfor(i = 0, j = node.children.length; i < j; i++) {\n\t\t\t\t\t\tnode.children[i] = this._set_state(node.children[i]);\n\t\t\t\t\t\tr = node.children[i].data.jstree;\n\t\t\t\t\t\tif(r.selected) { c += 2; }\n\t\t\t\t\t\telse if(r.undetermined) { c += 1; }\n\t\t\t\t\t}\n\t\t\t\t\tif(c > 0) {\n\t\t\t\t\t\tif(c === j * 2) {\n\t\t\t\t\t\t\tnode.data.jstree.selected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnode.data.jstree.undetermined = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t};\n\t\tthis.parse_json = function(data) {\n\t\t\tvar s = this.settings.checkbox;\n\t\t\tif(s.parse_data && s.three_state && $.isArray(data)) {\n\t\t\t\tdata = this._set_state(data);\n\t\t\t}\n\t\t\treturn parent.parse_json.call(this, data);\n\t\t};\n\t\tthis.clean_node = function(obj) {\n\t\t\tobj = parent.clean_node.call(this, obj);\n\t\t\tvar _this = this;\n\t\t\treturn obj.each(function () {\n\t\t\t\tvar t = $(this),\n\t\t\t\t\td = t.data('jstree'),\n\t\t\t\t\to = t.children('a');\n\t\t\t\tif(!o.children(\"i.jstree-checkbox\").length) {\n\t\t\t\t\to.prepend(\"<\"+\"i class='jstree-icon jstree-checkbox'><\"+\"/i>\");\n\t\t\t\t}\n\t\t\t\tif(d && d.undetermined) {\n\t\t\t\t\to.parentsUntil('.jstree', 'li').children(\"a.jstree-anchor\").children(\"i.jstree-checkbox\").addClass('jstree-undetermined');\n\t\t\t\t\tdelete d.undetermined;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tthis.get_json = function (obj, is_callback) {\n\t\t\tvar r = parent.get_json.call(this, obj, is_callback);\n\t\t\tif(is_callback) {\n\t\t\t\tif(obj.children(\".jstree-anchor\").children(\".jstree-undetermined\").length) {\n\t\t\t\t\tr.data.jstree.undetermined = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn r;\n\t\t};\n\t\tthis.activate_node = function (obj, e) {\n\t\t\tif(this.settings.checkbox.whole_node || $(e.target).hasClass('jstree-checkbox')) {\n\t\t\t\te.ctrlKey = true;\n\t\t\t}\n\t\t\tparent.activate_node.call(this, obj, e);\n\t\t};\n\t\tthis.check_up = function (obj) {\n\t\t\tif(!this.settings.checkbox.three_state) { return false; }\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(obj === -1 || !obj || !obj.length) { return false; }\n\n\t\t\tvar state = 0,\n\t\t\t\thas_children = obj.children(\"ul\").children(\"li\").length > 0,\n\t\t\t\tall_checked = has_children && obj.children(\"ul\").children(\"li\").not(this._data.core.selected).length === 0,\n\t\t\t\tnone_checked = has_children && obj.find('li > .jstree-clicked, li > .jstree-anchor > .jstree-undetermined').length === 0;\n\n\t\t\tif(!state && this.is_selected(obj)) { state = 1; }\n\t\t\tif(!state && obj.children(\".jstree-anchor\").children(\".jstree-undetermined\").length) { state = 2; }\r\n\t\t\tif(!has_children) {\n\t\t\t\tif(state === 2) {\n\t\t\t\t\tobj.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\r\n\t\t\tif(all_checked) {\n\t\t\t\tif(state !== 1) {\n\t\t\t\t\tobj.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\tthis.select_node(obj, true);\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\r\n\t\t\tif(none_checked) {\n\t\t\t\tif(state === 2) {\n\t\t\t\t\tobj.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif(state === 1) {\n\t\t\t\t\tthis.deselect_node(obj, true);\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\r\n\t\t\tif(state === 1) {\n\t\t\t\tobj.children(\".jstree-anchor\").children(\".jstree-checkbox\").addClass('jstree-undetermined');\n\t\t\t\tthis.deselect_node(obj, true);\n\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\treturn true;\n\t\t\t}\r\n\t\t\tif(state === 0) {\n\t\t\t\tvar tmp = obj.children('.jstree-anchor').children('.jstree-checkbox');\n\t\t\t\tif(!tmp.hasClass('jstree-undetermined')) {\n\t\t\t\t\tobj.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-undetermined');\n\t\t\t\t\tthis.check_up(obj.parent());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};"
},
{
"tags": [],
@@ -944,7 +944,7 @@
"body": ""
},
"ignore": false,
- "code": "(function ($) {\n\t$.jstree.defaults.json = {\n\t\tdata\t: false,\n\t\tajax\t: false,\n\t\tprogressive_render : false, // get_json, data on each node\n\t\tprogressive_unload : false\n\t};\n\n\t$.jstree.plugins.json = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\t\t\tthis.element\n\t\t\t\t.bind(\"ready.jstree\", $.proxy(function () {\n\t\t\t\t\tthis.element\n\t\t\t\t\t\t.bind(\"after_close.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar t = $(data.node);\n\t\t\t\t\t\t\tif(this.settings.json.progressive_unload) {\n\t\t\t\t\t\t\t\tt.data('jstree').children = this.get_json(t)[0].children;\n\t\t\t\t\t\t\t\tt.children(\"ul\").remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\t\t\t}, this));\n\t\t};\n\t\tthis.parse_json = function (node) {\n\t\t\tvar s = this.settings.json;\n\t\t\tif($.isArray(node.children) && (this._data.core.ready || !this.settings.core.expand_selected_onload || !this._has_selected(node.children))) {\n\t\t\t\tif(s.progressive_render) {\n\t\t\t\t\tif(!node.data) { node.data = {}; }\n\t\t\t\t\tif(!node.data.jstree) { node.data.jstree = {}; }\n\t\t\t\t\tnode.data.jstree.children = node.children;\n\t\t\t\t\tnode.children = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn parent.parse_json.call(this, node);\n\t\t};\n\t\tthis._has_selected = function (data) {\n\t\t\tvar r = false;\n\t\t\tfor(var i = 0, j = data.length; i < j; i++) {\n\t\t\t\tif(data[i].data && data[i].data.jstree && data[i].data.jstree.selected) {\n\t\t\t\t\tr = true;\n\t\t\t\t}\n\t\t\t\telse if(data[i].children) {\n\t\t\t\t\tr = r || this._has_selected(data[i].children);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr = false;\n\t\t\t\t}\n\t\t\t\tif(r === true) { break; }\n\t\t\t}\n\t\t\treturn r;\n\t\t};\n\t\tthis._append_json_data = function (dom, data) {\n\t\t\tdom = this.get_node(dom);\n\t\t\tif(dom === -1) { dom = this.element; }\n\t\t\tdata = this.parse_json(data);\n\t\t\tif(!dom.length) { return false; }\n\t\t\tif(!data) {\n\t\t\t\tif(dom && dom.is('li')) {\n\t\t\t\t\tdom.removeClass('jstree-closed').addClass('jstree-leaf').children('ul').remove();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(!dom.children('ul').length) { dom.append(''); }\n\t\t\tdom.children('ul').empty().append(data.is('li') ? data : data.children('li'));\n\t\t\treturn true;\n\t\t};\n\t\tthis._load_node = function (obj, callback) {\n\t\t\tvar d = false,\n\t\t\t\ts = $.extend(true, {}, this.settings.json);\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) { return false; }\n\n\t\t\tswitch(!0) {\r\n\t\t\t\tcase (obj === -1 && this.get_container().data('jstree') && $.isArray(this.get_container().data('jstree').children)):\n\t\t\t\t\td = this.element.data('jstree').children;\n\t\t\t\t\tthis.get_container().data('jstree').children = null;\n\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, d));\r\n\t\t\t\tcase (obj !== -1 && obj.length && obj.data('jstree') && $.isArray(obj.data('jstree').children)):\n\t\t\t\t\td = obj.data('jstree').children;\n\t\t\t\t\tobj.data('jstree').children = null;\n\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, d));\r\n\t\t\t\tcase (!s.data && !s.ajax):\n\t\t\t\t\treturn parent._load_node.call(this, obj, callback);\r\n\t\t\t\tcase ($.isFunction(s.data)):\n\t\t\t\t\treturn s.data.call(this, obj, $.proxy(function (d) {\n\t\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, d));\n\t\t\t\t\t}, this));\r\n\t\t\t\tcase ((!!s.data && !s.ajax) || (!!s.data && !!s.ajax && obj === -1)):\n\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, s.data));\r\n\t\t\t\tcase ((!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj !== -1)):\n\t\t\t\t\ts.ajax.success = $.proxy(function (d, t, x) {\n\t\t\t\t\t\tvar s = this.settings.json.ajax;\n\t\t\t\t\t\tif($.isFunction(s.success)) {\n\t\t\t\t\t\t\td = s.success.call(this, d, t, x) || d;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback.call(this, this._append_json_data(obj, d));\n\t\t\t\t\t}, this);\n\t\t\t\t\ts.ajax.error = $.proxy(function (x, t, e) {\n\t\t\t\t\t\tvar s = this.settings.json.ajax;\n\t\t\t\t\t\tif($.isFunction(s.error)) {\n\t\t\t\t\t\t\ts.error.call(this, x, t, e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback.call(this, false);\n\t\t\t\t\t}, this);\n\t\t\t\t\tif(!s.ajax.dataType) { s.ajax.dataType = \"json\"; }\n\t\t\t\t\tif($.isFunction(s.ajax.url))\t{ s.ajax.url\t= s.ajax.url.call(this, obj); }\n\t\t\t\t\tif($.isFunction(s.ajax.data))\t{ s.ajax.data\t= s.ajax.data.call(this, obj); }\n\t\t\t\t\treturn $.ajax(s.ajax);\n\t\t\t}\n\t\t};\n\t};\r\n\t$.jstree.defaults.plugins.push(\"json\");\n})(jQuery);"
+ "code": "(function ($) {\n\t$.jstree.defaults.json = {\n\t\tdata\t: false,\n\t\tajax\t: false,\n\t\tprogressive_render : false, // get_json, data on each node\n\t\tprogressive_unload : false\n\t};\n\n\t$.jstree.plugins.json = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\t\t\tthis.element\n\t\t\t\t.bind(\"ready.jstree\", $.proxy(function () {\n\t\t\t\t\tthis.element\n\t\t\t\t\t\t.bind(\"after_close.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar t = $(data.node);\n\t\t\t\t\t\t\tif(this.settings.json.progressive_unload && t.find('.jstree-clicked:eq(0)').length === 0) {\n\t\t\t\t\t\t\t\tt.data('jstree').children = this.get_json(t)[0].children;\n\t\t\t\t\t\t\t\tt.children(\"ul\").remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\t\t\t}, this));\n\t\t};\n\t\tthis.parse_json = function (node) {\n\t\t\tvar s = this.settings.json;\n\t\t\tif(s.progressive_render && $.isArray(node.children) && !this._json_has_selected(node.children)) {\n\t\t\t\tif(!node.data) { node.data = {}; }\n\t\t\t\tif(!node.data.jstree) { node.data.jstree = {}; }\n\t\t\t\tnode.data.jstree.children = node.children;\n\t\t\t\tnode.children = true;\n\t\t\t}\n\t\t\treturn parent.parse_json.call(this, node);\n\t\t};\n\t\tthis._json_has_selected = function (data) {\n\t\t\tvar r = false;\n\t\t\tfor(var i = 0, j = data.length; i < j; i++) {\n\t\t\t\tif(data[i].data && data[i].data.jstree && data[i].data.jstree.selected) {\n\t\t\t\t\tr = true;\n\t\t\t\t}\n\t\t\t\telse if(data[i].children) {\n\t\t\t\t\tr = r || this._json_has_selected(data[i].children);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr = false;\n\t\t\t\t}\n\t\t\t\tif(r === true) { break; }\n\t\t\t}\n\t\t\treturn r;\n\t\t};\n\t\tthis._append_json_data = function (dom, data) {\n\t\t\tdom = this.get_node(dom);\n\t\t\tif(dom === -1) { dom = this.element; }\n\t\t\tdata = this.parse_json(data);\n\t\t\tif(!dom.length) { return false; }\n\t\t\tif(!data) {\n\t\t\t\tif(dom && dom.is('li')) {\n\t\t\t\t\tdom.removeClass('jstree-closed').addClass('jstree-leaf').children('ul').remove();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(!dom.children('ul').length) { dom.append(''); }\n\t\t\tdom.children('ul').empty().append(data.is('li') ? data : data.children('li'));\n\t\t\treturn true;\n\t\t};\n\t\tthis._load_node = function (obj, callback) {\n\t\t\tvar d = false,\n\t\t\t\ts = $.extend(true, {}, this.settings.json);\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) { return false; }\n\n\t\t\tswitch(!0) {\r\n\t\t\t\tcase (obj === -1 && this.get_container().data('jstree') && $.isArray(this.get_container().data('jstree').children)):\n\t\t\t\t\td = this.element.data('jstree').children;\n\t\t\t\t\tthis.get_container().data('jstree').children = null;\n\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, d));\r\n\t\t\t\tcase (obj !== -1 && obj.length && obj.data('jstree') && $.isArray(obj.data('jstree').children)):\n\t\t\t\t\td = obj.data('jstree').children;\n\t\t\t\t\tobj.data('jstree').children = null;\n\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, d));\r\n\t\t\t\tcase (!s.data && !s.ajax):\n\t\t\t\t\treturn parent._load_node.call(this, obj, callback);\r\n\t\t\t\tcase ($.isFunction(s.data)):\n\t\t\t\t\treturn s.data.call(this, obj, $.proxy(function (d) {\n\t\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, d));\n\t\t\t\t\t}, this));\r\n\t\t\t\tcase ((!!s.data && !s.ajax) || (!!s.data && !!s.ajax && obj === -1)):\n\t\t\t\t\treturn callback.call(this, this._append_json_data(obj, s.data));\r\n\t\t\t\tcase ((!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj !== -1)):\n\t\t\t\t\ts.ajax.success = $.proxy(function (d, t, x) {\n\t\t\t\t\t\tvar s = this.settings.json.ajax;\n\t\t\t\t\t\tif($.isFunction(s.success)) {\n\t\t\t\t\t\t\td = s.success.call(this, d, t, x) || d;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback.call(this, this._append_json_data(obj, d));\n\t\t\t\t\t}, this);\n\t\t\t\t\ts.ajax.error = $.proxy(function (x, t, e) {\n\t\t\t\t\t\tvar s = this.settings.json.ajax;\n\t\t\t\t\t\tif($.isFunction(s.error)) {\n\t\t\t\t\t\t\ts.error.call(this, x, t, e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback.call(this, false);\n\t\t\t\t\t}, this);\n\t\t\t\t\tif(!s.ajax.dataType) { s.ajax.dataType = \"json\"; }\n\t\t\t\t\tif($.isFunction(s.ajax.url))\t{ s.ajax.url\t= s.ajax.url.call(this, obj); }\n\t\t\t\t\tif($.isFunction(s.ajax.data))\t{ s.ajax.data\t= s.ajax.data.call(this, obj); }\n\t\t\t\t\treturn $.ajax(s.ajax);\n\t\t\t}\n\t\t};\n\t};\r\n\t$.jstree.defaults.plugins.push(\"json\");\n})(jQuery);"
},
{
"tags": [],
diff --git a/src/jstree.checkbox.js b/src/jstree.checkbox.js
index b81ca976..8aebfceb 100644
--- a/src/jstree.checkbox.js
+++ b/src/jstree.checkbox.js
@@ -50,7 +50,7 @@
var t = $(v),
d = t.data('jstree');
if(d && d.children && t.children('ul').length === 0) {
- this._progressive_data_clean(d.children);
+ this._progressive_data_clean(d.children, e.type === 'select_node');
}
}, this));
}, this));
@@ -137,7 +137,7 @@
}, this));
}
};
- this._progressive_data_clean = function (data) {
+ this._progressive_data_clean = function (data, is_select) {
if(!this.settings.checkbox.three_state) { return false; }
for(var i = 0, j = data.length; i < j; i++) {
if(data[i].data && data[i].data.jstree) {
@@ -148,7 +148,7 @@
delete data[i].data.jstree.undetermined;
}
if(data[i].children) {
- this._progressive_data_clean(data[i].children);
+ this._progressive_data_clean(data[i].children, is_select);
}
}
}
diff --git a/src/jstree.js b/src/jstree.js
index eb2a82ae..048bd6c5 100644
--- a/src/jstree.js
+++ b/src/jstree.js
@@ -633,7 +633,8 @@
if(obj === -1 || !obj || !obj.length) {
return false;
}
- var o = obj.parentNode.parentNode;
+ var o = obj[0].parentNode.parentNode;
+
return o.tagName === 'LI' ? $(o) : -1;
},
/**
diff --git a/src/jstree.json.js b/src/jstree.json.js
index 2110565e..ef4e826a 100644
--- a/src/jstree.json.js
+++ b/src/jstree.json.js
@@ -17,7 +17,7 @@
this.element
.bind("after_close.jstree", $.proxy(function (e, data) {
var t = $(data.node);
- if(this.settings.json.progressive_unload) {
+ if(this.settings.json.progressive_unload && t.find('.jstree-clicked:eq(0)').length === 0) {
t.data('jstree').children = this.get_json(t)[0].children;
t.children("ul").remove();
}
@@ -26,24 +26,22 @@
};
this.parse_json = function (node) {
var s = this.settings.json;
- if($.isArray(node.children) && (this._data.core.ready || !this.settings.core.expand_selected_onload || !this._has_selected(node.children))) {
- if(s.progressive_render) {
- if(!node.data) { node.data = {}; }
- if(!node.data.jstree) { node.data.jstree = {}; }
- node.data.jstree.children = node.children;
- node.children = true;
- }
+ if(s.progressive_render && $.isArray(node.children) && !this._json_has_selected(node.children)) {
+ if(!node.data) { node.data = {}; }
+ if(!node.data.jstree) { node.data.jstree = {}; }
+ node.data.jstree.children = node.children;
+ node.children = true;
}
return parent.parse_json.call(this, node);
};
- this._has_selected = function (data) {
+ this._json_has_selected = function (data) {
var r = false;
for(var i = 0, j = data.length; i < j; i++) {
if(data[i].data && data[i].data.jstree && data[i].data.jstree.selected) {
r = true;
}
else if(data[i].children) {
- r = r || this._has_selected(data[i].children);
+ r = r || this._json_has_selected(data[i].children);
}
else {
r = false;