![JAR search and dependency download from the Maven repository](/logo.png)
template.js.jstree.jquery.jstree.min.js Maven / Gradle / Ivy
/*
* jsTree 1.0-rc3
* http://jstree.com/
*
* Copyright (c) 2010 Ivan Bozhanov (vakata.com)
*
* Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Date: 2011-02-09 01:17:14 +0200 $
* $Revision: 236 $
*/
"use strict";(function(){if(jQuery&&jQuery.jstree){return}var c=false,b=false,a=false;(function(g){g.vakata={};g.vakata.css={get_css:function(n,k,l){n=n.toLowerCase();var m=l.cssRules||l.rules,i=0;do{if(m.length&&i>m.length+5){return false}if(m[i].selectorText&&m[i].selectorText.toLowerCase()==n){if(k===true){if(l.removeRule){l.removeRule(i)}if(l.deleteRule){l.deleteRule(i)}return true}else{return m[i]}}}while(m[++i]);return false},add_css:function(j,i){if(g.jstree.css.get_css(j,false,i)){return false}if(i.insertRule){i.insertRule(j+" { }",0)}else{i.addRule(j,null,0)}return g.vakata.css.get_css(j)},remove_css:function(j,i){return g.vakata.css.get_css(j,true,i)},add_sheet:function(j){var i=false,l=true;if(j.str){if(j.title){i=g("style[id='"+j.title+"-stylesheet']")[0]}if(i){l=false}else{i=document.createElement("style");i.setAttribute("type","text/css");if(j.title){i.setAttribute("id",j.title+"-stylesheet")}}if(i.styleSheet){if(l){document.getElementsByTagName("head")[0].appendChild(i);i.styleSheet.cssText=j.str}else{i.styleSheet.cssText=i.styleSheet.cssText+" "+j.str}}else{i.appendChild(document.createTextNode(j.str));document.getElementsByTagName("head")[0].appendChild(i)}return i.sheet||i.styleSheet}if(j.url){if(document.createStyleSheet){try{i=document.createStyleSheet(j.url)}catch(k){}}else{i=document.createElement("link");i.rel="stylesheet";i.type="text/css";i.media="all";i.href=j.url;document.getElementsByTagName("head")[0].appendChild(i);return i.styleSheet}}}};var h=[],f=-1,e={},d={};g.fn.jstree=function(l){var i=(typeof l=="string"),j=Array.prototype.slice.call(arguments,1),k=this;if(i){if(l.substring(0,1)=="_"){return k}this.each(function(){var m=h[g.data(this,"jstree_instance_id")],n=(m&&g.isFunction(m[l]))?m[l].apply(m,j):m;if(typeof n!=="undefined"&&(l.indexOf("is_")===0||(n!==true&&n!==false))){k=n;return false}})}else{this.each(function(){var q=g.data(this,"jstree_instance_id"),n=[],m=l?g.extend({},true,l):{},r=g(this),p=false,o=[];n=n.concat(j);if(r.data("jstree")){n.push(r.data("jstree"))}m=n.length?g.extend.apply(null,[true,m].concat(n)):m;if(typeof q!=="undefined"&&h[q]){h[q].destroy()}q=parseInt(h.push({}),10)-1;g.data(this,"jstree_instance_id",q);m.plugins=g.isArray(m.plugins)?m.plugins:g.jstree.defaults.plugins.slice();m.plugins.unshift("core");m.plugins=m.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");p=g.extend(true,{},g.jstree.defaults,m);p.plugins=m.plugins;g.each(e,function(s,t){if(g.inArray(s,p.plugins)===-1){p[s]=null;delete p[s]}else{o.push(s)}});p.plugins=o;h[q]=new g.jstree._instance(q,g(this).addClass("jstree jstree-"+q),p);g.each(h[q]._get_settings().plugins,function(s,t){h[q].data[t]={}});g.each(h[q]._get_settings().plugins,function(s,t){if(e[t]){e[t].__init.apply(h[q])}});setTimeout(function(){if(h[q]){h[q].init()}},0)})}return k};g.jstree={defaults:{plugins:[]},_focused:function(){return h[f]||null},_reference:function(i){if(h[i]){return h[i]}var j=g(i);if(!j.length&&typeof i==="string"){j=g("#"+i)}if(!j.length){return null}return h[j.closest(".jstree").data("jstree_instance_id")]||null},_instance:function(j,i,k){this.data={core:{}};this.get_settings=function(){return g.extend(true,{},k)};this._get_settings=function(){return k};this.get_index=function(){return j};this.get_container=function(){return i};this.get_container_ul=function(){return i.children("ul:eq(0)")};this._set_settings=function(l){k=g.extend(true,{},k,l)}},_fn:{},plugin:function(i,j){j=g.extend({},{__init:g.noop,__destroy:g.noop,_fn:{},defaults:false},j);e[i]=j;g.jstree.defaults[i]=j.defaults;g.each(j._fn,function(k,l){l.plugin=i;l.old=g.jstree._fn[k];g.jstree._fn[k]=function(){var m,o=l,n=Array.prototype.slice.call(arguments),q=new g.Event("before.jstree"),p=false;if(this.data.core.locked===true&&k!=="unlock"&&k!=="is_locked"){return}do{if(o&&o.plugin&&g.inArray(o.plugin,this._get_settings().plugins)!==-1){break}o=o.old}while(o);if(!o){return}if(k.indexOf("_")===0){m=o.apply(this,n)}else{m=this.get_container().triggerHandler(q,{func:k,inst:this,args:n,plugin:o.plugin});if(m===false){return}if(typeof m!=="undefined"){n=m}m=o.apply(g.extend({},this,{__callback:function(r){this.get_container().triggerHandler(k+".jstree",{inst:this,args:n,rslt:r,rlbk:p})},__rollback:function(){p=this.get_rollback();return p},__call_old:function(r){return o.old.apply(this,(r?Array.prototype.slice.call(arguments,1):n))}}),n)}return m};g.jstree._fn[k].old=l.old;g.jstree._fn[k].plugin=i})},rollback:function(i){if(i){if(!g.isArray(i)){i=[i]}g.each(i,function(j,k){h[k.i].set_rollback(k.h,k.d)})}}};g.jstree._fn=g.jstree._instance.prototype={};g(function(){var k=navigator.userAgent.toLowerCase(),j=(k.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],i=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type: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 ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";if(/msie/.test(k)&&parseInt(j,10)==6){c=true;try{document.execCommand("BackgroundImageCache",false,true)}catch(l){}i+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}if(/msie/.test(k)&&parseInt(j,10)==7){b=true;i+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "}if(!/compatible/.test(k)&&/mozilla/.test(k)&&parseFloat(j,10)<1.9){a=true;i+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "}g.vakata.css.add_sheet({str:i,title:"jstree"})});g.jstree.plugin("core",{__init:function(){this.data.core.locked=false;this.data.core.to_open=this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:false,animation:500,initially_open:[],initially_load:[],open_parents:true,notify_plugins:true,rtl:false,load_open:false,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus();if(this._get_settings().core.rtl){this.get_container().addClass("jstree-rtl").css("direction","rtl")}this.get_container().html("");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",g.proxy(function(j){var i=g(j.target);this.toggle_node(i)},this)).bind("mousedown.jstree",g.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(j){var k;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){k=window.getSelection();try{k.removeAllRanges();k.collapse()}catch(i){}}}});if(this._get_settings().core.notify_plugins){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li").each(function(){var m=g(this);if(m.data("jstree")){g.each(m.data("jstree"),function(o,n){if(i.data[o]&&g.isFunction(i["_"+o+"_notify"])){i["_"+o+"_notify"].call(i,m,n)}})}})},this))}if(this._get_settings().core.load_open){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li.jstree-open:not(:has(ul))").each(function(){i.load_node(this,g.noop,g.noop)})},this))}this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var j,m=this.get_index(),k=this._get_settings(),l=this;g.each(k.plugins,function(n,p){try{e[p].__destroy.apply(l)}catch(o){}});this.__callback();if(this.is_focused()){for(j in h){if(h.hasOwnProperty(j)&&j!=m){h[j].set_focus();break}}}if(m===f){f=-1}this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});g(document).unbind(".jstree-"+m).undelegate(".jstree-"+m);h[m]=null;delete h[m]},_core_notify:function(j,i){if(i.opened){this.open_node(j,false,true)}},lock:function(){this.data.core.locked=true;this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");this.__callback({})},unlock:function(){this.data.core.locked=false;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var i=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){i.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(i.data.core.to_open)},save_loaded:function(){},reload_nodes:function(j){var m=this,i=true,l=[],k=[];if(!j){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=g.map(g.makeArray(this.data.core.to_open),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.data.core.to_load=g.map(g.makeArray(this.data.core.to_load),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});if(this.data.core.to_open.length){this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open)}}if(this.data.core.to_load.length){g.each(this.data.core.to_load,function(n,o){if(o=="#"){return true}if(g(o).length){l.push(o)}else{k.push(o)}});if(l.length){this.data.core.to_load=k;g.each(l,function(n,o){if(!m._is_loaded(o)){m.load_node(o,function(){m.reload_nodes(true)},function(){m.reload_nodes(true)});i=false}})}}if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(n,o){m.open_node(o,false,true)})}if(i){if(this.data.core.reopen){clearTimeout(this.data.core.reopen)}this.data.core.reopen=setTimeout(function(){m.__callback({},m)},50);this.data.core.refreshing=false;this.reopen()}},reopen:function(){var i=this;if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(j,k){i.open_node(k,false,true)})}this.__callback({})},refresh:function(i){var j=this;this.save_opened();if(!i){i=-1}i=this._get_node(i);if(!i){i=-1}if(i!==-1){i.children("UL").remove()}else{this.get_container_ul().empty()}this.load_node(i,function(){j.__callback({obj:i});j.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(this.is_focused()){return}var i=g.jstree._focused();if(i){i.unset_focus()}this.get_container().addClass("jstree-focused");f=this.get_index();this.__callback()},is_focused:function(){return f==this.get_index()},unset_focus:function(){if(this.is_focused()){this.get_container().removeClass("jstree-focused");f=-1}this.__callback()},_get_node:function(i){var j=g(i,this.get_container());if(j.is(".jstree")||i==-1){return -1}j=j.closest("li",this.get_container());return j.length?j:false},_get_next:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:first-child")}if(!j.length){return false}if(i){return(j.nextAll("li").size()>0)?j.nextAll("li:eq(0)"):false}if(j.hasClass("jstree-open")){return j.find("li:eq(0)")}else{if(j.nextAll("li").size()>0){return j.nextAll("li:eq(0)")}else{return j.parentsUntil(".jstree","li").next("li").eq(0)}}},_get_prev:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:last-child")}if(!j.length){return false}if(i){return(j.prevAll("li").length>0)?j.prevAll("li:eq(0)"):false}if(j.prev("li").length){j=j.prev("li").eq(0);while(j.hasClass("jstree-open")){j=j.children("ul:eq(0)").children("li:last")}return j}else{var k=j.parentsUntil(".jstree","li:eq(0)");return k.length?k:false}},_get_parent:function(i){i=this._get_node(i);if(i==-1||!i.length){return false}var j=i.parentsUntil(".jstree","li:eq(0)");return j.length?j:-1},_get_children:function(i){i=this._get_node(i);if(i===-1){return this.get_container().children("ul:eq(0)").children("li")}if(!i.length){return false}return i.children("ul:eq(0)").children("li")},get_path:function(k,i){var j=[],l=this;k=this._get_node(k);if(k===-1||!k||!k.length){return false}k.parentsUntil(".jstree","li").each(function(){j.push(i?this.id:l.get_text(this))});j.reverse();j.push(i?k.attr("id"):this.get_text(k));return j},_get_string:function(i){return this._get_settings().core.strings[i]||i},is_open:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-open")},is_closed:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-closed")},is_leaf:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-leaf")},correct_state:function(i){i=this._get_node(i);if(!i||i===-1){return false}i.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},open_node:function(l,m,j){l=this._get_node(l);if(!l.length){return false}if(!l.hasClass("jstree-closed")){if(m){m.call()}return false}var k=j||c?0:this._get_settings().core.animation,i=this;if(!this._is_loaded(l)){l.children("a").addClass("jstree-loading");this.load_node(l,function(){i.open_node(l,m,j)},m)}else{if(this._get_settings().core.open_parents){l.parentsUntil(".jstree",".jstree-closed").each(function(){i.open_node(this,false,true)})}if(k){l.children("ul").css("display","none")}l.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");if(k){l.children("ul").stop(true,true).slideDown(k,function(){this.style.display="";i.after_open(l)})}else{i.after_open(l)}this.__callback({obj:l});if(m){m.call()}}},after_open:function(i){this.__callback({obj:i})},close_node:function(l,j){l=this._get_node(l);var k=j||c?0:this._get_settings().core.animation,i=this;if(!l.length||!l.hasClass("jstree-open")){return false}if(k){l.children("ul").attr("style","display:block !important")}l.removeClass("jstree-open").addClass("jstree-closed");if(k){l.children("ul").stop(true,true).slideUp(k,function(){this.style.display="";i.after_close(l)})}else{i.after_close(l)}this.__callback({obj:l})},after_close:function(i){this.__callback({obj:i})},toggle_node:function(i){i=this._get_node(i);if(i.hasClass("jstree-closed")){return this.open_node(i)}if(i.hasClass("jstree-open")){return this.close_node(i)}},open_all:function(k,j,i){k=k?this._get_node(k):-1;if(!k||k===-1){k=this.get_container_ul()}if(i){k=k.find("li.jstree-closed")}else{i=k;if(k.is(".jstree-closed")){k=k.find("li.jstree-closed").andSelf()}else{k=k.find("li.jstree-closed")}}var l=this;k.each(function(){var m=this;if(!l._is_loaded(this)){l.open_node(this,function(){l.open_all(m,j,i)},!j)}else{l.open_node(this,false,!j)}});if(i.find("li.jstree-closed").length===0){this.__callback({obj:i})}},close_all:function(j,i){var k=this;j=j?this._get_node(j):this.get_container();if(!j||j===-1){j=this.get_container_ul()}j.find("li.jstree-open").andSelf().each(function(){k.close_node(this,!i)});this.__callback({obj:j})},clean_node:function(i){i=i&&i!=-1?g(i):this.get_container_ul();i=i.is("li")?i.find("li").andSelf():i.find("li");i.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");i.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(true),d:this.data}},set_rollback:function(i,j){this.get_container().empty().append(i);this.data=j;this.__callback()},load_node:function(k,i,j){this.__callback({obj:k})},_is_loaded:function(i){return true},create_node:function(n,i,m,p,j){n=this._get_node(n);i=typeof i==="undefined"?"last":i;var o=g(""),l=this._get_settings().core,k;if(n!==-1&&!n.length){return false}if(!j&&!this._is_loaded(n)){this.load_node(n,function(){this.create_node(n,i,m,p,true)});return false}this.__rollback();if(typeof m==="string"){m={data:m}}if(!m){m={}}if(m.attr){o.attr(m.attr)}if(m.metadata){o.data(m.metadata)}if(m.state){o.addClass("jstree-"+m.state)}if(!m.data){m.data=this._get_string("new_node")}if(!g.isArray(m.data)){k=m.data;m.data=[];m.data.push(k)}g.each(m.data,function(r,q){k=g("");if(g.isFunction(q)){q=q.call(this,m)}if(typeof q=="string"){k.attr("href","#")[l.html_titles?"html":"text"](q)}else{if(!q.attr){q.attr={}}if(!q.attr.href){q.attr.href="#"}k.attr(q.attr)[l.html_titles?"html":"text"](q.title);if(q.language){k.addClass(q.language)}}k.prepend(" ");if(!q.icon&&m.icon){q.icon=m.icon}if(q.icon){if(q.icon.indexOf("/")===-1){k.children("ins").addClass(q.icon)}else{k.children("ins").css("background","url('"+q.icon+"') center center no-repeat")}}o.append(k)});o.prepend(" ");if(n===-1){n=this.get_container();if(i==="before"){i="first"}if(i==="after"){i="last"}}switch(i){case"before":n.before(o);k=this._get_parent(n);break;case"after":n.after(o);k=this._get_parent(n);break;case"inside":case"first":if(!n.children("ul").length){n.append("
")}n.children("ul").prepend(o);k=n;break;case"last":if(!n.children("ul").length){n.append("
")}n.children("ul").append(o);k=n;break;default:if(!n.children("ul").length){n.append("
")}if(!i){i=0}k=n.children("ul").children("li").eq(i);if(k.length){k.before(o)}else{n.children("ul").append(o)}k=n;break}if(k===-1||k.get(0)===this.get_container().get(0)){k=-1}this.clean_node(k);this.__callback({obj:o,parent:k});if(p){p.call(this,o)}return o},get_text:function(j){j=this._get_node(j);if(!j.length){return false}var i=this._get_settings().core.html_titles;j=j.children("a:eq(0)");if(i){j=j.clone();j.children("INS").remove();return j.html()}else{j=j.contents().filter(function(){return this.nodeType==3})[0];return j.nodeValue}},set_text:function(j,k){j=this._get_node(j);if(!j.length){return false}j=j.children("a:eq(0)");if(this._get_settings().core.html_titles){var i=j.children("INS").clone();j.html(k).prepend(i);this.__callback({obj:j,name:k});return true}else{j=j.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:j,name:k});return(j.nodeValue=k)}},rename_node:function(i,j){i=this._get_node(i);this.__rollback();if(i&&i.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))){this.__callback({obj:i,name:j})}},delete_node:function(l){l=this._get_node(l);if(!l.length){return false}this.__rollback();var k=this._get_parent(l),j=g([]),i=this;l.each(function(){j=j.add(i._get_prev(this))});l=l.detach();if(k!==-1&&k.find("> ul > li").length===0){k.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}this.clean_node(k);this.__callback({obj:l,prev:j,parent:k});return l},prepare_move:function(m,k,n,i,j){var l={};l.ot=g.jstree._reference(m)||this;l.o=l.ot._get_node(m);l.r=k===-1?-1:this._get_node(k);l.p=(typeof n==="undefined"||n===false)?"last":n;if(!j&&d.o&&d.o[0]===l.o[0]&&d.r[0]===l.r[0]&&d.p===l.p){this.__callback(d);if(i){i.call(this,d)}return}l.ot=g.jstree._reference(l.o)||this;l.rt=g.jstree._reference(l.r)||this;if(l.r===-1||!l.r){l.cr=-1;switch(l.p){case"first":case"before":case"inside":l.cp=0;break;case"after":case"last":l.cp=l.rt.get_container().find(" > ul > li").length;break;default:l.cp=l.p;break}}else{if(!/^(before|after)$/.test(l.p)&&!this._is_loaded(l.r)){return this.load_node(l.r,function(){this.prepare_move(m,k,n,i,true)})}switch(l.p){case"before":l.cp=l.r.index();l.cr=l.rt._get_parent(l.r);break;case"after":l.cp=l.r.index()+1;l.cr=l.rt._get_parent(l.r);break;case"inside":case"first":l.cp=0;l.cr=l.r;break;case"last":l.cp=l.r.find(" > ul > li").length;l.cr=l.r;break;default:l.cp=l.p;l.cr=l.r;break}}l.np=l.cr==-1?l.rt.get_container():l.cr;l.op=l.ot._get_parent(l.o);l.cop=l.o.index();if(l.op===-1){l.op=l.ot?l.ot.get_container():this.get_container()}if(!/^(before|after)$/.test(l.p)&&l.op&&l.np&&l.op[0]===l.np[0]&&l.o.index() ul > li:nth-child("+(l.cp+1)+")");d=l;this.__callback(d);if(i){i.call(this,d)}},check_move:function(){var k=d,i=true,j=k.r===-1?this.get_container():k.r;if(!k||!k.o||k.or[0]===k.o[0]){return false}if(k.op&&k.np&&k.op[0]===k.np[0]&&k.cp-1===k.o.index()){return false}k.o.each(function(){if(j.parentsUntil(".jstree","li").andSelf().index(this)!==-1){i=false;return false}});return i},move_node:function(p,l,i,k,j,n){if(!j){return this.prepare_move(p,l,i,function(o){this.move_node(o,false,false,k,true,n)})}if(k){d.cy=true}if(!n&&!this.check_move()){return false}this.__rollback();var q=false;if(k){q=p.o.clone(true);q.find("*[id]").andSelf().each(function(){if(this.id){this.id="copy_"+this.id}})}else{q=p.o}if(p.or.length){p.or.before(q)}else{if(!p.np.children("ul").length){g("
").appendTo(p.np)}p.np.children("ul:eq(0)").append(q)}try{p.ot.clean_node(p.op);p.rt.clean_node(p.np);if(!p.op.find("> ul > li").length){p.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}}catch(m){}if(k){d.cy=true;d.oc=q}this.__callback(d);return d},_get_move:function(){return d}}})})(jQuery);(function(d){var g,f,e;d(function(){if(/msie/.test(navigator.userAgent.toLowerCase())){f=d('').css({position:"absolute",top:-1000,left:0}).appendTo("body");e=d('').css({position:"absolute",top:-1000,left:0}).appendTo("body");g=f.width()-e.width();f.add(e).remove()}else{f=d("").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:0}).prependTo("body").append("").find("div").css({width:"100%",height:200});g=100-f.width();f.parent().remove()}});d.jstree.plugin("ui",{__init:function(){this.data.ui.selected=d();this.data.ui.last_selected=false;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",d.proxy(function(h){h.preventDefault();h.currentTarget.blur();if(!d(h.currentTarget).hasClass("jstree-loading")){this.select_node(h.currentTarget,true,h)}},this)).delegate("a","mouseenter.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.hover_node(h.target)}},this)).delegate("a","mouseleave.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.dehover_node(h.target)}},this)).bind("reopen.jstree",d.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",d.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",d.proxy(function(){this.reselect()},this)).bind("close_node.jstree",d.proxy(function(i,j){var h=this._get_settings().ui,k=this._get_node(j.rslt.obj),l=(k&&k.length)?k.children("ul").find("a.jstree-clicked"):d(),m=this;if(h.selected_parent_close===false||!l.length){return}l.each(function(){m.deselect_node(this);if(h.selected_parent_close==="select_parent"){m.select_node(k)}})},this)).bind("delete_node.jstree",d.proxy(function(i,j){var h=this._get_settings().ui.select_prev_on_delete,k=this._get_node(j.rslt.obj),l=(k&&k.length)?k.find("a.jstree-clicked"):[],m=this;l.each(function(){m.deselect_node(this)});if(h&&l.length){j.rslt.prev.each(function(){if(this.parentNode){m.select_node(this);return false}})}},this)).bind("move_node.jstree",d.proxy(function(h,i){if(i.rslt.cy){i.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")}},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:true,select_prev_on_delete:true,disable_selecting_children:false,initially_select:[]},_fn:{_get_node:function(h,i){if(typeof h==="undefined"||h===null){return i?this.data.ui.selected:this.data.ui.last_selected}var j=d(h,this.get_container());if(j.is(".jstree")||h==-1){return -1}j=j.closest("li",this.get_container());return j.length?j:false},_ui_notify:function(i,h){if(h.selected){this.select_node(i,false)}},save_selected:function(){var h=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){if(this.id){h.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(this.data.ui.to_select)},reselect:function(){var i=this,h=this.data.ui.to_select;h=d.map(d.makeArray(h),function(j){return"#"+j.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});d.each(h,function(j,k){if(k&&k!=="#"){i.select_node(k)}});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(h){this.save_selected();return this.__call_old()},hover_node:function(h){h=this._get_node(h);if(!h.length){return false}if(!h.hasClass("jstree-hovered")){this.dehover_node()}this.data.ui.hovered=h.children("a").addClass("jstree-hovered").parent();this._fix_scroll(h);this.__callback({obj:h})},dehover_node:function(){var i=this.data.ui.hovered,h;if(!i||!i.length){return false}h=i.children("a").removeClass("jstree-hovered").parent();if(this.data.ui.hovered[0]===h[0]){this.data.ui.hovered=null}this.__callback({obj:i})},select_node:function(k,h,l){k=this._get_node(k);if(k==-1||!k||!k.length){return false}var p=this._get_settings().ui,n=(p.select_multiple_modifier=="on"||(p.select_multiple_modifier!==false&&l&&l[p.select_multiple_modifier+"Key"])),i=(p.select_range_modifier!==false&&l&&l[p.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==k[0]&&this.data.ui.last_selected.parent()[0]===k.parent()[0]),j=this.is_selected(k),m=true,o=this;if(h){if(p.disable_selecting_children&&n&&((k.parentsUntil(".jstree","li").children("a.jstree-clicked").length)||(k.children("ul").find("a.jstree-clicked:eq(0)").length))){return false}m=false;switch(!0){case (i):this.data.ui.last_selected.addClass("jstree-last-selected");k=k[k.index()0){this.deselect_all();m=true}break;case (j&&n):this.deselect_node(k);break;case (!j&&n):if(p.select_limit==-1||this.data.ui.selected.length+1<=p.select_limit){m=true}break}}if(m&&!j){if(!i){this.data.ui.last_selected=k}k.children("a").addClass("jstree-clicked");if(p.selected_parent_open){k.parents(".jstree-closed").each(function(){o.open_node(this,false,true)})}this.data.ui.selected=this.data.ui.selected.add(k);this._fix_scroll(k.eq(0));this.__callback({obj:k,e:l})}},_fix_scroll:function(i){var j=this.get_container()[0],h;if(j.scrollHeight>j.offsetHeight){i=this._get_node(i);if(!i||i===-1||!i.length||!i.is(":visible")){return}h=i.offset().top-this.get_container().offset().top;if(h<0){j.scrollTop=j.scrollTop+h-1}if(h+this.data.core.li_height+(j.scrollWidth>j.offsetWidth?g:0)>j.offsetHeight){j.scrollTop=j.scrollTop+(h-j.offsetHeight+this.data.core.li_height+1+(j.scrollWidth>j.offsetWidth?g:0))}}},deselect_node:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){h.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(h);if(this.data.ui.last_selected.get(0)===h.get(0)){this.data.ui.last_selected=this.data.ui.selected.eq(0)}this.__callback({obj:h})}},toggle_select:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){this.deselect_node(h)}else{this.select_node(h)}},is_selected:function(h){return this.data.ui.selected.index(this._get_node(h))>=0},get_selected:function(h){return h?d(h).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(i){var h=i?d(i).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();h.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=d([]);this.data.ui.last_selected=false;this.__callback({obj:h})}}});d.jstree.defaults.plugins.push("ui")})(jQuery);(function(d){d.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",d.proxy(function(h,g){if(this._get_settings().crrm.move.open_onmove){var f=this;g.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){f.open_node(this,false,true)})}},this))},defaults:{input_width_limit:200,move:{always_copy:false,open_onmove:true,default_position:"last",check_move:function(e){return true}}},_fn:{_show_input:function(e,l){e=this._get_node(e);var j=this._get_settings().core.rtl,k=this._get_settings().crrm.input_width_limit,g=e.children("ins").width(),f=e.find("> a:visible > ins").width()*e.find("> a:visible > ins").length,m=this.get_text(e),i=d("",{css:{position:"absolute",top:"-200px",left:(j?"0px":"-1000px"),visibility:"hidden"}}).appendTo("body"),h=e.css("position","relative").append(d("",{value:m,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:(j?"auto":(g+f+4)+"px"),right:(j?(g+f+4)+"px":"auto"),top:"0px",height:(this.data.core.li_height-2)+"px",lineHeight:(this.data.core.li_height-2)+"px",width:"150px"},blur:d.proxy(function(){var o=e.children(".jstree-rename-input"),n=o.val();if(n===""){n=m}i.remove();o.remove();this.set_text(e,m);this.rename_node(e,n);l.call(this,e,n,m);e.css("position","")},this),keyup:function(o){var n=o.keyCode||o.which;if(n==27){this.value=m;this.blur();return}else{if(n==13){this.blur();return}else{h.width(Math.min(i.text("pW"+this.value).width(),k))}}},keypress:function(o){var n=o.keyCode||o.which;if(n==13){return false}}})).children(".jstree-rename-input");this.set_text(e,"");i.css({fontFamily:h.css("fontFamily")||"",fontSize:h.css("fontSize")||"",fontWeight:h.css("fontWeight")||"",fontStyle:h.css("fontStyle")||"",fontStretch:h.css("fontStretch")||"",fontVariant:h.css("fontVariant")||"",letterSpacing:h.css("letterSpacing")||"",wordSpacing:h.css("wordSpacing")||""});h.width(Math.min(i.text("pW"+h[0].value).width(),k))[0].select()},rename:function(g){g=this._get_node(g);this.__rollback();var e=this.__callback;this._show_input(g,function(i,h,f){e.call(this,{obj:i,new_name:h,old_name:f})})},create:function(i,f,h,k,e){var g,j=this;i=this._get_node(i);if(!i){i=-1}this.__rollback();g=this.create_node(i,f,h,function(l){var m=this._get_parent(l),n=d(l).index();if(k){k.call(this,l)}if(m.length&&m.hasClass("jstree-closed")){this.open_node(m,false,true)}if(!e){this._show_input(l,function(q,p,o){j.__callback({obj:q,name:p,parent:m,position:n})})}else{j.__callback({obj:l,name:this.get_text(l),parent:m,position:n})}});return g},remove:function(g){g=this._get_node(g,true);var f=this._get_parent(g),e=this._get_prev(g);this.__rollback();g=this.delete_node(g);if(g!==false){this.__callback({obj:g,prev:e,parent:f})}},check_move:function(){if(!this.__call_old()){return false}var e=this._get_settings().crrm.move;if(!e.check_move.call(this,this._get_move())){return false}return true},move_node:function(k,i,e,g,f,j){var h=this._get_settings().crrm.move;if(!f){if(typeof e==="undefined"){e=h.default_position}if(e==="inside"&&!h.default_position.match(/^(before|after)$/)){e=h.default_position}return this.__call_old(true,k,i,e,g,false,j)}if(h.always_copy===true||(h.always_copy==="multitree"&&k.rt.get_index()!==k.ot.get_index())){g=true}this.__call_old(true,k,i,e,g,true,j)},cut:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.cp_nodes=false;this.data.crrm.ct_nodes=e;this.__callback({obj:e})},copy:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.ct_nodes=false;this.data.crrm.cp_nodes=e;this.__callback({obj:e})},paste:function(f){f=this._get_node(f);if(!f||!f.length){return false}var e=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes){return false}if(this.data.crrm.ct_nodes){this.move_node(this.data.crrm.ct_nodes,f);this.data.crrm.ct_nodes=false}if(this.data.crrm.cp_nodes){this.move_node(this.data.crrm.cp_nodes,f,false,true)}this.__callback({obj:f,nodes:e})}}})})(jQuery);(function(d){var e=[];d.jstree._themes=false;d.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",d.proxy(function(){var f=this._get_settings().themes;this.data.themes.dots=f.dots;this.data.themes.icons=f.icons;this.set_theme(f.theme,f.url)},this)).bind("loaded.jstree",d.proxy(function(){if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}},this))},defaults:{theme:"default",url:false,dots:true,icons:true},_fn:{set_theme:function(g,f){if(!g){return false}if(!f){f=d.jstree._themes+g+"/style.css"}if(d.inArray(f,e)==-1){d.vakata.css.add_sheet({url:f});e.push(f)}if(this.data.themes.theme!=g){this.get_container().removeClass("jstree-"+this.data.themes.theme);this.data.themes.theme=g}this.get_container().addClass("jstree-"+g);if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=true;this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=false;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){if(this.data.themes.dots){this.hide_dots()}else{this.show_dots()}},show_icons:function(){this.data.themes.icons=true;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=false;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){if(this.data.themes.icons){this.hide_icons()}else{this.show_icons()}}}});d(function(){if(d.jstree._themes===false){d("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)){d.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/";return false}})}if(d.jstree._themes===false){d.jstree._themes="themes/"}});d.jstree.defaults.plugins.push("themes")})(jQuery);(function(f){var e=[];function d(h,j){var k=f.jstree._focused(),g;if(k&&k.data&&k.data.hotkeys&&k.data.hotkeys.enabled){g=k._get_settings().hotkeys[h];if(g){return g.call(k,j)}}}f.jstree.plugin("hotkeys",{__init:function(){if(typeof f.hotkeys==="undefined"){throw"jsTree hotkeys: jQuery hotkeys plugin not included."}if(!this.data.ui){throw"jsTree hotkeys: jsTree UI plugin not included."}f.each(this._get_settings().hotkeys,function(h,g){if(g!==false&&f.inArray(h,e)==-1){f(document).bind("keydown",h,function(i){return d(h,i)});e.push(h)}});this.get_container().bind("lock.jstree",f.proxy(function(){if(this.data.hotkeys.enabled){this.data.hotkeys.enabled=false;this.data.hotkeys.revert=true}},this)).bind("unlock.jstree",f.proxy(function(){if(this.data.hotkeys.revert){this.data.hotkeys.enabled=true}},this));this.enable_hotkeys()},defaults:{up:function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},"ctrl+up":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},"shift+up":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},down:function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},"ctrl+down":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},"shift+down":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},left:function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},"ctrl+left":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},"shift+left":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},right:function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},"ctrl+right":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},"shift+right":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},space:function(){if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").click()}return false},"ctrl+space":function(g){g.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(g)}return false},"shift+space":function(g){g.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(g)}return false},f2:function(){this.rename(this.data.ui.hovered||this.data.ui.last_selected)},del:function(){this.remove(this.data.ui.hovered||this._get_node(null))}},_fn:{enable_hotkeys:function(){this.data.hotkeys.enabled=true},disable_hotkeys:function(){this.data.hotkeys.enabled=false}}})})(jQuery);(function(d){d.jstree.plugin("json_data",{__init:function(){var e=this._get_settings().json_data;if(e.progressive_unload){this.get_container().bind("after_close.jstree",function(g,f){f.rslt.obj.children("ul").remove()})}},defaults:{data:false,ajax:false,correct_state:true,progressive_render:false,progressive_unload:false},_fn:{load_node:function(g,e,f){var h=this;this.load_node_json(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(f){var e=this._get_settings().json_data;f=this._get_node(f);return f==-1||!f||(!e.ajax&&!e.progressive_render&&!d.isFunction(e.data))||f.is(".jstree-open, .jstree-leaf")||f.children("ul").children("li").length>0},refresh:function(f){f=this._get_node(f);var e=this._get_settings().json_data;if(f&&f!==-1&&e.progressive_unload&&(d.isFunction(e.data)||!!e.ajax)){f.removeData("jstree_children")}return this.__call_old()},load_node_json:function(i,e,g){var h=this.get_settings().json_data,k,f=function(){},j=function(){};i=this._get_node(i);if(i&&i!==-1&&(h.progressive_render||h.progressive_unload)&&!i.is(".jstree-open, .jstree-leaf")&&i.children("ul").children("li").length===0&&i.data("jstree_children")){k=this._parse_json(i.data("jstree_children"),i);if(k){i.append(k);if(!h.progressive_unload){i.removeData("jstree_children")}}this.clean_node(i);if(e){e.call(this)}return}if(i&&i!==-1){if(i.data("jstree_is_loading")){return}else{i.data("jstree_is_loading",true)}}switch(!0){case (!h.data&&!h.ajax):throw"Neither data nor ajax settings supplied.";case (d.isFunction(h.data)):h.data.call(this,i,d.proxy(function(l){l=this._parse_json(l,i);if(!l){if(i===-1||!i){if(h.correct_state){this.get_container().children("ul").empty()}}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(i)}}if(g){g.call(this)}}else{if(i===-1||!i){this.get_container().children("ul").empty().append(l.children())}else{i.append(l).children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading")}this.clean_node(i);if(e){e.call(this)}}},this));break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!i||i===-1)):if(!i||i==-1){k=this._parse_json(h.data,i);if(k){this.get_container().children("ul").empty().append(k.children());this.clean_node()}else{if(h.correct_state){this.get_container().children("ul").empty()}}}if(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&i&&i!==-1):f=function(m,n,o){var l=this.get_settings().json_data.ajax.error;if(l){l.call(this,m,n,o)}if(i!=-1&&i.length){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(n==="success"&&h.correct_state){this.correct_state(i)}}else{if(n==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};j=function(o,m,l){var n=this.get_settings().json_data.ajax.success;if(n){o=n.call(this,o,m,l)||o}if(o===""||(o&&o.toString&&o.toString().replace(/^[\s\n]+$/,"")==="")||(!d.isArray(o)&&!d.isPlainObject(o))){return f.call(this,l,m,"")}o=this._parse_json(o,i);if(o){if(i===-1||!i){this.get_container().children("ul").empty().append(o.children())}else{i.append(o).children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i===-1||!i){if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=j;if(!h.ajax.dataType){h.ajax.dataType="json"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,i)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,i)}d.ajax(h.ajax);break}},_parse_json:function(e,k,q){var m=false,f=this._get_settings(),u=f.json_data,r=f.core.html_titles,l,h,g,o,n;if(!e){return m}if(u.progressive_unload&&k&&k!==-1){k.data("jstree_children",m)}if(d.isArray(e)){m=d();if(!e.length){return false}for(h=0,g=e.length;h ");if(e.attr){m.attr(e.attr)}if(e.metadata){m.data(e.metadata)}if(e.state){m.addClass("jstree-"+e.state)}if(!d.isArray(e.data)){l=e.data;e.data=[];e.data.push(l)}d.each(e.data,function(p,j){l=d("");if(d.isFunction(j)){j=j.call(this,e)}if(typeof j=="string"){l.attr("href","#")[r?"html":"text"](j)}else{if(!j.attr){j.attr={}}if(!j.attr.href){j.attr.href="#"}l.attr(j.attr)[r?"html":"text"](j.title);if(j.language){l.addClass(j.language)}}l.prepend(" ");if(!j.icon&&e.icon){j.icon=e.icon}if(j.icon){if(j.icon.indexOf("/")===-1){l.children("ins").addClass(j.icon)}else{l.children("ins").css("background","url('"+j.icon+"') center center no-repeat")}}m.append(l)});m.prepend(" ");if(e.children){if(u.progressive_render&&e.state!=="open"){m.addClass("jstree-closed").data("jstree_children",e.children)}else{if(u.progressive_unload){m.data("jstree_children",e.children)}if(d.isArray(e.children)&&e.children.length){l=this._parse_json(e.children,k,true);if(l.length){n=d("
");n.append(l);m.append(n)}}}}}if(!q){o=d("
");o.append(m);m=o}return m},get_json:function(j,g,e,n){var q=[],p=this._get_settings(),k=this,i,h,m,l,o,f;j=this._get_node(j);if(!j||j===-1){j=this.get_container().find("> ul > li")}g=d.isArray(g)?g:["id","class"];if(!n&&this.data.types){g.push(p.types.type_attr)}e=d.isArray(e)?e:[];j.each(function(){m=d(this);i={data:[]};if(g.length){i.attr={}}d.each(g,function(s,r){h=m.attr(r);if(h&&h.length&&h.replace(/jstree[^ ]*/ig,"").length){i.attr[r]=(" "+h).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}});if(m.hasClass("jstree-open")){i.state="open"}if(m.hasClass("jstree-closed")){i.state="closed"}if(m.data()){i.metadata=m.data()}l=m.children("a");l.each(function(){o=d(this);if(e.length||d.inArray("languages",p.plugins)!==-1||o.children("ins").get(0).style.backgroundImage.length||(o.children("ins").get(0).className&&o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length)){f=false;if(d.inArray("languages",p.plugins)!==-1&&d.isArray(p.languages)&&p.languages.length){d.each(p.languages,function(r,s){if(o.hasClass(s)){f=s;return false}})}h={attr:{},title:k.get_text(o,f)};d.each(e,function(r,s){h.attr[s]=(" "+(o.attr(s)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")});if(d.inArray("languages",p.plugins)!==-1&&d.isArray(p.languages)&&p.languages.length){d.each(p.languages,function(r,s){if(o.hasClass(s)){h.language=s;return true}})}if(o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){h.icon=o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}if(o.children("ins").get(0).style.backgroundImage.length){h.icon=o.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}}else{h=k.get_text(o)}if(l.length>1){i.data.push(h)}else{i.data=h}});m=m.find("> ul > li");if(m.length){i.children=k.get_json(m,g,e,true)}q.push(i)});return q}}})})(jQuery);(function(d){d.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(g){var h=this._get_settings().languages,f=false,e=".jstree-"+this.get_index()+" a";if(!d.isArray(h)||h.length===0){return false}if(d.inArray(g,h)==-1){if(!!h[g]){g=h[g]}else{return false}}if(g==this.data.languages.current_language){return true}f=d.vakata.css.get_css(e+"."+this.data.languages.current_language,false,this.data.languages.language_css);if(f!==false){f.style.display="none"}f=d.vakata.css.get_css(e+"."+g,false,this.data.languages.language_css);if(f!==false){f.style.display=""}this.data.languages.current_language=g;this.__callback(g);return true},get_lang:function(){return this.data.languages.current_language},_get_string:function(e,h){var g=this._get_settings().languages,f=this._get_settings().core.strings;if(d.isArray(g)&&g.length){h=(h&&d.inArray(h,g)!=-1)?h:this.data.languages.current_language}if(f[h]&&f[h][e]){return f[h][e]}if(f[e]){return f[e]}return e},get_text:function(g,h){g=this._get_node(g)||this.data.ui.last_selected;if(!g.size()){return false}var f=this._get_settings().languages,e=this._get_settings().core.html_titles;if(d.isArray(f)&&f.length){h=(h&&d.inArray(h,f)!=-1)?h:this.data.languages.current_language;g=g.children("a."+h)}else{g=g.children("a:eq(0)")}if(e){g=g.clone();g.children("INS").remove();return g.html()}else{g=g.contents().filter(function(){return this.nodeType==3})[0];return g.nodeValue}},set_text:function(h,j,i){h=this._get_node(h)||this.data.ui.last_selected;if(!h.size()){return false}var g=this._get_settings().languages,f=this._get_settings().core.html_titles,e;if(d.isArray(g)&&g.length){i=(i&&d.inArray(i,g)!=-1)?i:this.data.languages.current_language;h=h.children("a."+i)}else{h=h.children("a:eq(0)")}if(f){e=h.children("INS").clone();h.html(j).prepend(e);this.__callback({obj:h,name:j,lang:i});return true}else{h=h.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:h,name:j,lang:i});return(h.nodeValue=j)}},_load_css:function(){var g=this._get_settings().languages,h="/* languages css */",e=".jstree-"+this.get_index()+" a",f;if(d.isArray(g)&&g.length){this.data.languages.current_language=g[0];for(f=0;fthis.get_text(e)?1:-1},_fn:{sort:function(g){var f=this._get_settings().sort,e=this;g.append(d.makeArray(g.children("li")).sort(d.proxy(f,e)));g.find("> li > ul").each(function(){e.sort(d(this))});this.clean_node(g)}}})})(jQuery);(function(j){var f=false,d=false,g=false,h=false,k=false,e=false,n=false,l=false,i=false;j.vakata.dnd={is_down:false,is_drag:false,helper:false,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,helper_top:10,user_data:{},drag_start:function(q,p,m){if(j.vakata.dnd.is_drag){j.vakata.drag_stop({})}try{q.currentTarget.unselectable="on";q.currentTarget.onselectstart=function(){return false};if(q.currentTarget.style){q.currentTarget.style.MozUserSelect="none"}}catch(o){}j.vakata.dnd.init_x=q.pageX;j.vakata.dnd.init_y=q.pageY;j.vakata.dnd.user_data=p;j.vakata.dnd.is_down=true;j.vakata.dnd.helper=j("").html(m);j(document).bind("mousemove",j.vakata.dnd.drag);j(document).bind("mouseup",j.vakata.dnd.drag_stop);return false},drag:function(p){if(!j.vakata.dnd.is_down){return}if(!j.vakata.dnd.is_drag){if(Math.abs(p.pageX-j.vakata.dnd.init_x)>5||Math.abs(p.pageY-j.vakata.dnd.init_y)>5){j.vakata.dnd.helper.appendTo("body");j.vakata.dnd.is_drag=true;j(document).triggerHandler("drag_start.vakata",{event:p,data:j.vakata.dnd.user_data})}else{return}}if(p.type==="mousemove"){var q=j(document),o=q.scrollTop(),m=q.scrollLeft();if(p.pageY-o<20){if(e&&n==="down"){clearInterval(e);e=false}if(!e){n="up";e=setInterval(function(){j(document).scrollTop(j(document).scrollTop()-j.vakata.dnd.scroll_spd)},150)}}else{if(e&&n==="up"){clearInterval(e);e=false}}if(j(window).height()-(p.pageY-o)<20){if(e&&n==="up"){clearInterval(e);e=false}if(!e){n="down";e=setInterval(function(){j(document).scrollTop(j(document).scrollTop()+j.vakata.dnd.scroll_spd)},150)}}else{if(e&&n==="down"){clearInterval(e);e=false}}if(p.pageX-m<20){if(k&&l==="right"){clearInterval(k);k=false}if(!k){l="left";k=setInterval(function(){j(document).scrollLeft(j(document).scrollLeft()-j.vakata.dnd.scroll_spd)},150)}}else{if(k&&l==="left"){clearInterval(k);k=false}}if(j(window).width()-(p.pageX-m)<20){if(k&&l==="left"){clearInterval(k);k=false}if(!k){l="right";k=setInterval(function(){j(document).scrollLeft(j(document).scrollLeft()+j.vakata.dnd.scroll_spd)},150)}}else{if(k&&l==="right"){clearInterval(k);k=false}}}j.vakata.dnd.helper.css({left:(p.pageX+j.vakata.dnd.helper_left)+"px",top:(p.pageY+j.vakata.dnd.helper_top)+"px"});j(document).triggerHandler("drag.vakata",{event:p,data:j.vakata.dnd.user_data})},drag_stop:function(m){if(k){clearInterval(k)}if(e){clearInterval(e)}j(document).unbind("mousemove",j.vakata.dnd.drag);j(document).unbind("mouseup",j.vakata.dnd.drag_stop);j(document).triggerHandler("drag_stop.vakata",{event:m,data:j.vakata.dnd.user_data});j.vakata.dnd.helper.remove();j.vakata.dnd.init_x=0;j.vakata.dnd.init_y=0;j.vakata.dnd.user_data={};j.vakata.dnd.is_down=false;j.vakata.dnd.is_drag=false}};j(function(){var m="#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ";j.vakata.css.add_sheet({str:m,title:"vakata"})});j.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:false,after:false,inside:false,before:false,off:false,prepared:false,w:0,to1:false,to2:false,cof:false,cw:false,ch:false,i1:false,i2:false,mto:false};this.get_container().bind("mouseenter.jstree",j.proxy(function(q){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(this.data.themes){g.attr("class","jstree-"+this.data.themes.theme);if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}if(q.currentTarget===q.target&&j.vakata.dnd.user_data.obj&&j(j.vakata.dnd.user_data.obj).length&&j(j.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==q.target){var p=j.jstree._reference(q.target),o;if(p.data.dnd.foreign){o=p._get_settings().dnd.drag_check.call(this,{o:f,r:p.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}else{p.prepare_move(f,p.get_container(),"last");if(p.check_move()){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}}}},this)).bind("mouseup.jstree",j.proxy(function(q){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree&&q.currentTarget===q.target&&j.vakata.dnd.user_data.obj&&j(j.vakata.dnd.user_data.obj).length&&j(j.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==q.target){var p=j.jstree._reference(q.currentTarget),o;if(p.data.dnd.foreign){o=p._get_settings().dnd.drag_check.call(this,{o:f,r:p.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){p._get_settings().dnd.drag_finish.call(this,{o:f,r:p.get_container(),is_root:true})}}else{p.move_node(f,p.get_container(),"last",q[p._get_settings().dnd.copy_modifier+"Key"])}}},this)).bind("mouseleave.jstree",j.proxy(function(o){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(j.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}}},this)).bind("mousemove.jstree",j.proxy(function(p){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){var o=this.get_container()[0];if(p.pageX+24>this.data.dnd.cof.left+this.data.dnd.cw){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(j.proxy(function(){this.scrollLeft+=j.vakata.dnd.scroll_spd},o),100)}else{if(p.pageX-24this.data.dnd.cof.top+this.data.dnd.ch){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(j.proxy(function(){this.scrollTop+=j.vakata.dnd.scroll_spd},o),100)}else{if(p.pageY-24"+j(p.target).text());if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");var o=this.get_container();this.data.dnd.cof=o.offset();this.data.dnd.cw=parseInt(o.width(),10);this.data.dnd.ch=parseInt(o.height(),10);this.data.dnd.foreign=true;p.preventDefault()},this))}if(m.drop_target){j(document).delegate(m.drop_target,"mouseenter.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:f,r:j(o.target),e:o})){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}},this)).delegate(m.drop_target,"mouseleave.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}},this)).delegate(m.drop_target,"mouseup.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active&&j.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){this._get_settings().dnd.drop_finish.call(this,{o:f,r:j(o.target),e:o})}},this))}},defaults:{copy_modifier:"ctrl",check_timeout:100,open_timeout:500,drop_target:".jstree-drop",drop_check:function(m){return true},drop_finish:j.noop,drag_target:".jstree-draggable",drag_finish:j.noop,drag_check:function(m){return{after:false,before:false,inside:true}}},_fn:{dnd_prepare:function(){if(!d||!d.length){return}this.data.dnd.off=d.offset();if(this._get_settings().core.rtl){this.data.dnd.off.right=this.data.dnd.off.left+d.width()}if(this.data.dnd.foreign){var m=this._get_settings().dnd.drag_check.call(this,{o:f,r:d});this.data.dnd.after=m.after;this.data.dnd.before=m.before;this.data.dnd.inside=m.inside;this.data.dnd.prepared=true;return this.dnd_show()}this.prepare_move(f,d,"before");this.data.dnd.before=this.check_move();this.prepare_move(f,d,"after");this.data.dnd.after=this.check_move();if(this._is_loaded(d)){this.prepare_move(f,d,"inside");this.data.dnd.inside=this.check_move()}else{this.data.dnd.inside=false}this.data.dnd.prepared=true;return this.dnd_show()},dnd_show:function(){if(!this.data.dnd.prepared){return}var q=["before","inside","after"],m=false,p=this._get_settings().core.rtl,s;if(this.data.dnd.w1?this._get_string("multiple_selection"):this.get_text(f),m=this.get_container();if(!this._get_settings().core.html_titles){o=o.replace(//ig,">")}j.vakata.dnd.drag_start(p,{jstree:true,obj:f},""+o);if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}this.data.dnd.cof=m.offset();this.data.dnd.cw=parseInt(m.width(),10);this.data.dnd.ch=parseInt(m.height(),10);this.data.dnd.active=true}}});j(function(){var m="#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }";j.vakata.css.add_sheet({str:m,title:"jstree"});g=j("").attr({id:"jstree-marker"}).hide().html("»").bind("mouseleave mouseenter",function(o){g.hide();h.hide();o.preventDefault();o.stopImmediatePropagation();return false}).appendTo("body");h=j("").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(o){if(d&&d.length){d.children("a").trigger(o);o.preventDefault();o.stopImmediatePropagation();return false}}).bind("mouseleave",function(p){var o=j(p.relatedTarget);if(o.is(".jstree")||o.closest(".jstree").length===0){if(d&&d.length){d.children("a").trigger(p);g.hide();h.hide();p.preventDefault();p.stopImmediatePropagation();return false}}}).appendTo("body");j(document).bind("drag_start.vakata",function(p,o){if(o.data.jstree){g.show();if(h){h.show()}}});j(document).bind("drag_stop.vakata",function(p,o){if(o.data.jstree){g.hide();if(h){h.hide()}}})})})(jQuery);(function(d){d.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui;if(this.data.ui&&this.data.checkbox.noui){this.select_node=this.deselect_node=this.deselect_all=d.noop;this.get_selected=this.get_checked}this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",d.proxy(function(g,f){this._prepare_checkboxes(f.rslt.obj)},this)).bind("loaded.jstree",d.proxy(function(f){this._prepare_checkboxes()},this)).delegate((this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox"),"click.jstree",d.proxy(function(f){f.preventDefault();if(this._get_node(f.target).hasClass("jstree-checked")){this.uncheck_node(f.target)}else{this.check_node(f.target)}if(this.data.ui&&this.data.checkbox.noui){this.save_selected();if(this.data.cookies){this.save_cookie("select_node")}}else{f.stopImmediatePropagation();return false}},this))},defaults:{override_ui:false,two_state:false,real_checkboxes:false,checked_parent_open:true,real_checkboxes_names:function(e){return[("check_"+(e[0].id||Math.ceil(Math.random()*10000))),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},_fn:{_checkbox_notify:function(f,e){if(e.checked){this.check_node(f,false)}},_prepare_checkboxes:function(i){i=!i||i==-1?this.get_container().find("> ul > li"):this._get_node(i);if(i===false){return}var k,j=this,e,g=this._get_settings().checkbox.two_state,h=this._get_settings().checkbox.real_checkboxes,f=this._get_settings().checkbox.real_checkboxes_names;i.each(function(){e=d(this);k=e.is("li")&&(e.hasClass("jstree-checked")||(h&&e.children(":checked").length))?"jstree-checked":"jstree-unchecked";e.find("li").andSelf().each(function(){var m=d(this),l;m.children("a"+(j.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend(" ").parent().not(".jstree-checked, .jstree-unchecked").addClass(g?"jstree-unchecked":k);if(h){if(!m.children(":checkbox").length){l=f.call(j,m);m.prepend("")}else{m.children(":checkbox").addClass("jstree-real-checkbox")}}if(!g){if(k==="jstree-checked"||m.hasClass("jstree-checked")||m.children(":checked").length){m.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked",true)}}else{if(m.hasClass("jstree-checked")||m.children(":checked").length){m.addClass("jstree-checked").children(":checkbox").prop("checked",true)}}})});if(!g){i.find(".jstree-checked").parent().parent().each(function(){j._repair_state(this)})}},change_state:function(h,g){h=this._get_node(h);var e=false,f=this._get_settings().checkbox.real_checkboxes;if(!h||h===-1){return false}g=(g===false||g===true)?g:h.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state){if(g){h.removeClass("jstree-checked").addClass("jstree-unchecked");if(f){h.children(":checkbox").prop("checked",false)}}else{h.removeClass("jstree-unchecked").addClass("jstree-checked");if(f){h.children(":checkbox").prop("checked",true)}}}else{if(g){e=h.find("li").andSelf();if(!e.filter(".jstree-checked, .jstree-undetermined").length){return false}e.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){e.children(":checkbox").prop("checked",false)}}else{e=h.find("li").andSelf();if(!e.filter(".jstree-unchecked, .jstree-undetermined").length){return false}e.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){e.children(":checkbox").prop("checked",true)}if(this.data.ui){this.data.ui.last_selected=h}this.data.checkbox.last_selected=h}h.parentsUntil(".jstree","li").each(function(){var i=d(this);if(g){if(i.children("ul").children("li.jstree-checked, li.jstree-undetermined").length){i.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){i.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{i.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){i.children(":checkbox").prop("checked",false)}}}else{if(i.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length){i.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){i.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{i.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){i.children(":checkbox").prop("checked",true)}}}})}if(this.data.ui&&this.data.checkbox.noui){this.data.ui.selected=this.get_checked()}this.__callback(h);return true},check_node:function(f){if(this.change_state(f,false)){f=this._get_node(f);if(this._get_settings().checkbox.checked_parent_open){var e=this;f.parents(".jstree-closed").each(function(){e.open_node(this,false,true)})}this.__callback({obj:f})}},uncheck_node:function(e){if(this.change_state(e,true)){this.__callback({obj:this._get_node(e)})}},check_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,false)});this.__callback()},uncheck_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,true)});this.__callback()},is_checked:function(e){e=this._get_node(e);return e.length?e.is(".jstree-checked"):false},get_checked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-checked"):f.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-unchecked"):f.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(h){h=this._get_node(h);if(!h.length){return}if(this._get_settings().checkbox.two_state){h.find("li").andSelf().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",true);return}var g=this._get_settings().checkbox.real_checkboxes,f=h.find("> ul > .jstree-checked").length,e=h.find("> ul > .jstree-undetermined").length,i=h.find("> ul > li").length;if(i===0){if(h.hasClass("jstree-undetermined")){this.change_state(h,false)}}else{if(f===0&&e===0){this.change_state(h,true)}else{if(f===i){this.change_state(h,false)}else{h.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(g){h.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}}}}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var f=this,e=this.data.ui.to_select;e=d.map(d.makeArray(e),function(g){return"#"+g.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();d.each(e,function(g,h){f.check_node(h)});this.__callback()}else{this.__call_old()}},save_loaded:function(){var e=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){if(this.id){e.data.core.to_load.push("#"+this.id)}})}}});d(function(){var e=".jstree .jstree-real-checkbox { display:none; } ";d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(f){f.vakata.xslt=function(i,j,n){var g="",m,h,l,k;if(document.recalc){m=document.createElement("xml");h=document.createElement("xml");m.innerHTML=i;h.innerHTML=j;f("body").append(m).append(h);setTimeout((function(p,o,q){return function(){q.call(null,p.transformNode(o.XMLDocument));setTimeout((function(s,r){return function(){f(s).remove();f(r).remove()}})(p,o),200)}})(m,h,n),100);return true}if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor==="undefined"){i=new DOMParser().parseFromString(i,"text/xml");j=new DOMParser().parseFromString(j,"text/xml")}if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor!=="undefined"){l=new XSLTProcessor();k=f.isFunction(l.transformDocument)?(typeof window.XMLSerializer!=="undefined"):true;if(!k){return false}i=new DOMParser().parseFromString(i,"text/xml");j=new DOMParser().parseFromString(j,"text/xml");if(f.isFunction(l.transformDocument)){g=document.implementation.createDocument("","",null);l.transformDocument(i,j,g,null);n.call(null,new XMLSerializer().serializeToString(g));return true}else{l.importStylesheet(j);g=l.transformToFragment(i,document);n.call(null,f("").append(g).html());return true}}return false};var e={nest:' -
jstree-last jstree-open jstree-closed jstree-leaf # jstree-icon background:url( ) center center no-repeat;
',flat:'
jstree-last jstree-open jstree-closed jstree-leaf # jstree-icon background:url( ) center center no-repeat;
'},d=function(g){return g.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};f.jstree.plugin("xml_data",{defaults:{data:false,ajax:false,xsl:"flat",clean_node:false,correct_state:true,get_skip_empty:false,get_include_preamble:true},_fn:{load_node:function(i,g,h){var j=this;this.load_node_xml(i,function(){j.__callback({obj:j._get_node(i)});g.call(this)},h)},_is_loaded:function(h){var g=this._get_settings().xml_data;h=this._get_node(h);return h==-1||!h||(!g.ajax&&!f.isFunction(g.data))||h.is(".jstree-open, .jstree-leaf")||h.children("ul").children("li").size()>0},load_node_xml:function(k,g,i){var j=this.get_settings().xml_data,h=function(){},l=function(){};k=this._get_node(k);if(k&&k!==-1){if(k.data("jstree_is_loading")){return}else{k.data("jstree_is_loading",true)}}switch(!0){case (!j.data&&!j.ajax):throw"Neither data nor ajax settings supplied.";case (f.isFunction(j.data)):j.data.call(this,k,f.proxy(function(m){this.parse_xml(m,f.proxy(function(n){if(n){n=n.replace(/ ?xmlns="[^"]*"/ig,"");if(n.length>10){n=f(n);if(k===-1||!k){this.get_container().children("ul").empty().append(n.children())}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.append(n);k.removeData("jstree_is_loading")}if(j.clean_node){this.clean_node(k)}if(g){g.call(this)}}else{if(k&&k!==-1){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(j.correct_state){this.correct_state(k);if(g){g.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}}}},this))},this));break;case (!!j.data&&!j.ajax)||(!!j.data&&!!j.ajax&&(!k||k===-1)):if(!k||k==-1){this.parse_xml(j.data,f.proxy(function(m){if(m){m=m.replace(/ ?xmlns="[^"]*"/ig,"");if(m.length>10){m=f(m);this.get_container().children("ul").empty().append(m.children());if(j.clean_node){this.clean_node(k)}if(g){g.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}},this))}break;case (!j.data&&!!j.ajax)||(!!j.data&&!!j.ajax&&k&&k!==-1):h=function(n,o,p){var m=this.get_settings().xml_data.ajax.error;if(m){m.call(this,n,o,p)}if(k!==-1&&k.length){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(o==="success"&&j.correct_state){this.correct_state(k)}}else{if(o==="success"&&j.correct_state){this.get_container().children("ul").empty()}}if(i){i.call(this)}};l=function(p,n,m){p=m.responseText;var o=this.get_settings().xml_data.ajax.success;if(o){p=o.call(this,p,n,m)||p}if(p===""||(p&&p.toString&&p.toString().replace(/^[\s\n]+$/,"")==="")){return h.call(this,m,n,"")}this.parse_xml(p,f.proxy(function(q){if(q){q=q.replace(/ ?xmlns="[^"]*"/ig,"");if(q.length>10){q=f(q);if(k===-1||!k){this.get_container().children("ul").empty().append(q.children())}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.append(q);k.removeData("jstree_is_loading")}if(j.clean_node){this.clean_node(k)}if(g){g.call(this)}}else{if(k&&k!==-1){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(j.correct_state){this.correct_state(k);if(g){g.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}}}},this))};j.ajax.context=this;j.ajax.error=h;j.ajax.success=l;if(!j.ajax.dataType){j.ajax.dataType="xml"}if(f.isFunction(j.ajax.url)){j.ajax.url=j.ajax.url.call(this,k)}if(f.isFunction(j.ajax.data)){j.ajax.data=j.ajax.data.call(this,k)}f.ajax(j.ajax);break}},parse_xml:function(g,i){var h=this._get_settings().xml_data;f.vakata.xslt(g,e[h.xsl],i)},get_xml:function(o,l,i,g,q){var t="",r=this._get_settings(),m=this,k,j,p,n,h;if(!o){o="flat"}if(!q){q=0}l=this._get_node(l);if(!l||l===-1){l=this.get_container().find("> ul > li")}i=f.isArray(i)?i:["id","class"];if(!q&&this.data.types&&f.inArray(r.types.type_attr,i)===-1){i.push(r.types.type_attr)}g=f.isArray(g)?g:[];if(!q){if(r.xml_data.get_include_preamble){t+=''}t+=""}l.each(function(){t+="- ";t+="
";n=p.children("a");n.each(function(){k=f(this);h=false;t+="";t+="";t+=" "});t+=" ";j=p[0].id||true;p=p.find("> ul > li");if(p.length){j=m.get_xml(o,p,i,g,j)}else{j=""}if(o=="nest"){t+=j}t+=" ";if(o=="flat"){t+=j}});if(!q){t+=" "}return t}}})})(jQuery);(function(d){d.expr[":"].jstree_contains=function(f,g,e){return(f.textContent||f.innerText||"").toLowerCase().indexOf(e[3].toLowerCase())>=0};d.expr[":"].jstree_title_contains=function(f,g,e){return(f.getAttribute("title")||"").toLowerCase().indexOf(e[3].toLowerCase())>=0};d.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=d();if(this._get_settings().search.show_only_matches){this.get_container().bind("search.jstree",function(g,f){d(this).children("ul").find("li").hide().removeClass("jstree-last");f.rslt.nodes.parentsUntil(".jstree").andSelf().show().filter("ul").each(function(){d(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",function(){d(this).children("ul").find("li").css("display","").end().end().jstree("clean_node",-1)})}},defaults:{ajax:false,search_method:"jstree_contains",show_only_matches:false},_fn:{search:function(j,e){if(d.trim(j)===""){this.clear_search();return}var h=this.get_settings().search,g=this,f=function(){},i=function(){};this.data.search.str=j;if(!e&&h.ajax!==false&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0){this.search.supress_callback=true;f=function(){};i=function(n,l,k){var m=this.get_settings().search.ajax.success;if(m){n=m.call(this,n,l,k)||n}this.data.search.to_open=n;this._search_open()};h.ajax.context=this;h.ajax.error=f;h.ajax.success=i;if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,j)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,j)}if(!h.ajax.data){h.ajax.data={search_string:j}}if(!h.ajax.dataType||/^json/.exec(h.ajax.dataType)){h.ajax.dataType="json"}d.ajax(h.ajax);return}if(this.data.search.result.length){this.clear_search()}this.data.search.result=this.get_container().find("a"+(this.data.languages?"."+this.get_lang():"")+":"+(h.search_method)+"("+this.data.search.str+")");this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){g.open_node(this,false,true)});this.__callback({nodes:this.data.search.result,str:j})},clear_search:function(e){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=d()},_search_open:function(f){var i=this,e=true,h=[],g=[];if(this.data.search.to_open.length){d.each(this.data.search.to_open,function(j,k){if(k=="#"){return true}if(d(k).length&&d(k).is(".jstree-closed")){h.push(k)}else{g.push(k)}});if(h.length){this.data.search.to_open=g;d.each(h,function(j,k){i.open_node(k,function(){i._search_open(true)})});e=false}}if(e){this.search(this.data.search.str,true)}}}})})(jQuery);(function(d){d.vakata.context={hide_on_mouseleave:false,cnt:d(""),vis:false,tgt:false,par:false,func:false,data:false,rtl:false,show:function(o,n,l,j,i,e,k){d.vakata.context.rtl=!!k;var g=d.vakata.context.parse(o),f,m;if(!g){return}d.vakata.context.vis=true;d.vakata.context.tgt=n;d.vakata.context.par=e||n||null;d.vakata.context.data=i||null;d.vakata.context.cnt.html(g).css({visibility:"hidden",display:"block",left:0,top:0});if(d.vakata.context.hide_on_mouseleave){d.vakata.context.cnt.one("mouseleave",function(h){d.vakata.context.hide()})}f=d.vakata.context.cnt.height();m=d.vakata.context.cnt.width();if(l+m>d(document).width()){l=d(document).width()-(m+5);d.vakata.context.cnt.find("li > ul").addClass("right")}if(j+f>d(document).height()){j=j-(f+n[0].offsetHeight);d.vakata.context.cnt.find("li > ul").addClass("bottom")}d.vakata.context.cnt.css({left:l,top:j}).find("li:has(ul)").bind("mouseenter",function(s){var p=d(document).width(),r=d(document).height(),q=d(this).children("ul").show();if(p!==d(document).width()){q.toggleClass("right")}if(r!==d(document).height()){q.toggleClass("bottom")}}).bind("mouseleave",function(h){d(this).children("ul").hide()}).end().css({visibility:"visible"}).show();d(document).triggerHandler("context_show.vakata")},hide:function(){d.vakata.context.vis=false;d.vakata.context.cnt.attr("class","").css({visibility:"hidden"});d(document).triggerHandler("context_hide.vakata")},parse:function(h,g){if(!h){return false}var i="",f=false,e=true;if(!g){d.vakata.context.func={}}i+="";d.each(h,function(j,k){if(!k){return true}d.vakata.context.func[j]=k.action;if(!e&&k.separator_before){i+=""}e=false;i+="- <\/li\>$/,"");i+="
";d(document).triggerHandler("context_parse.vakata");return i.length>10?i:false},exec:function(e){if(d.isFunction(d.vakata.context.func[e])){d.vakata.context.func[e].call(d.vakata.context.data,d.vakata.context.par);return true}else{return false}}};d(function(){var e="#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ";d.vakata.css.add_sheet({str:e,title:"vakata"});d.vakata.context.cnt.delegate("a","click",function(f){f.preventDefault()}).delegate("a","mouseup",function(f){if(!d(this).parent().hasClass("jstree-contextmenu-disabled")&&d.vakata.context.exec(d(this).attr("rel"))){d.vakata.context.hide()}else{d(this).blur()}}).delegate("a","mouseover",function(){d.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");d(document).bind("mousedown",function(f){if(d.vakata.context.vis&&!d.contains(d.vakata.context.cnt[0],f.target)){d.vakata.context.hide()}});if(typeof d.hotkeys!=="undefined"){d(document).bind("keydown","up",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","down",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","right",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","left",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","esc",function(f){d.vakata.context.hide();f.preventDefault()}).bind("keydown","space",function(f){d.vakata.context.cnt.find(".vakata-hover").last().children("a").click();f.preventDefault()})}});d.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",d.proxy(function(f){f.preventDefault();if(!d(f.currentTarget).hasClass("jstree-loading")){this.show_contextmenu(f.currentTarget,f.pageX,f.pageY)}},this)).delegate("a","click.jstree",d.proxy(function(f){if(this.data.contextmenu){d.vakata.context.hide()}},this)).bind("destroy.jstree",d.proxy(function(){if(this.data.contextmenu){d.vakata.context.hide()}},this));d(document).bind("context_hide.vakata",d.proxy(function(){this.data.contextmenu=false},this))},defaults:{select_node:false,show_at_node:true,items:{create:{separator_before:false,separator_after:true,label:"Create",action:function(e){this.create(e)}},rename:{separator_before:false,separator_after:false,label:"Rename",action:function(e){this.rename(e)}},remove:{separator_before:false,icon:false,separator_after:false,label:"Delete",action:function(e){if(this.is_selected(e)){this.remove()}else{this.remove(e)}}},ccp:{separator_before:true,icon:false,separator_after:false,label:"Edit",action:false,submenu:{cut:{separator_before:false,separator_after:false,label:"Cut",action:function(e){this.cut(e)}},copy:{separator_before:false,icon:false,separator_after:false,label:"Copy",action:function(e){this.copy(e)}},paste:{separator_before:false,icon:false,separator_after:false,label:"Paste",action:function(e){this.paste(e)}}}}}},_fn:{show_contextmenu:function(j,e,l){j=this._get_node(j);var h=this.get_settings().contextmenu,f=j.children("a:visible:eq(0)"),k=false,g=false;if(h.select_node&&this.data.ui&&!this.is_selected(j)){this.deselect_all();this.select_node(j,true)}if(h.show_at_node||typeof e==="undefined"||typeof l==="undefined"){k=f.offset();e=k.left;l=k.top+this.data.core.li_height}g=j.data("jstree")&&j.data("jstree").contextmenu?j.data("jstree").contextmenu:h.items;if(d.isFunction(g)){g=g.call(this,j)}this.data.contextmenu=true;d.vakata.context.show(g,f,e,l,this,j,this._get_settings().core.rtl);if(this.data.themes){d.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}}})})(jQuery);(function(d){d.jstree.plugin("types",{__init:function(){var e=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",d.proxy(function(){var h=e.types,g=e.type_attr,f="",i=this;d.each(h,function(j,k){d.each(k,function(m,l){if(!/^(max_depth|max_children|icon|valid_children)$/.test(m)){i.data.types.attach_to.push(m)}});if(!k.icon){return true}if(k.icon.image||k.icon.position){if(j=="default"){f+=".jstree-"+i.get_index()+" a > .jstree-icon { "}else{f+=".jstree-"+i.get_index()+" li["+g+'="'+j+'"] > a > .jstree-icon { '}if(k.icon.image){f+=" background-image:url("+k.icon.image+"); "}if(k.icon.position){f+=" background-position:"+k.icon.position+"; "}else{f+=" background-position:0 0; "}f+="} "}});if(f!==""){d.vakata.css.add_sheet({str:f,title:"jstree-types"})}},this)).bind("before.jstree",d.proxy(function(i,h){var g,f,k=this._get_settings().types.use_data?this._get_node(h.args[0]):false,j=k&&k!==-1&&k.length?k.data("jstree"):false;if(j&&j.types&&j.types[h.func]===false){i.stopImmediatePropagation();return false}if(d.inArray(h.func,this.data.types.attach_to)!==-1){if(!h.args[0]||(!h.args[0].tagName&&!h.args[0].jquery)){return}g=this._get_settings().types.types;f=this._get_type(h.args[0]);if(((g[f]&&typeof g[f][h.func]!=="undefined")||(g["default"]&&typeof g["default"][h.func]!=="undefined"))&&this._check(h.func,h.args[0])===false){i.stopImmediatePropagation();return false}}},this));if(c){this.get_container().bind("load_node.jstree set_type.jstree",d.proxy(function(i,h){var g=h&&h.rslt&&h.rslt.obj&&h.rslt.obj!==-1?this._get_node(h.rslt.obj).parent():this.get_container_ul(),j=false,f=this._get_settings().types;d.each(f.types,function(k,l){if(l.icon&&(l.icon.image||l.icon.position)){j=k==="default"?g.find("li > a > .jstree-icon"):g.find("li["+f.type_attr+"='"+k+"'] > a > .jstree-icon");if(l.icon.image){j.css("backgroundImage","url("+l.icon.image+")")}j.css("backgroundPosition",l.icon.position||"0 0")}})},this))}},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:false,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(f,e){if(e.type&&this._get_settings().types.use_data){this.set_type(e.type,f)}},_get_type:function(e){e=this._get_node(e);return(!e||!e.length)?false:e.attr(this._get_settings().types.type_attr)||"default"},set_type:function(g,f){f=this._get_node(f);var e=(!f.length||!g)?false:f.attr(this._get_settings().types.type_attr,g);if(e){this.__callback({obj:f,type:g})}return e},_check:function(j,g,e){g=this._get_node(g);var k=false,l=this._get_type(g),i=0,h=this,m=this._get_settings().types,f=false;if(g===-1){if(!!m[j]){k=m[j]}else{return}}else{if(l===false){return}f=m.use_data?g.data("jstree"):false;if(f&&f.types&&typeof f.types[j]!=="undefined"){k=f.types[j]}else{if(!!m.types[l]&&typeof m.types[l][j]!=="undefined"){k=m.types[l][j]}else{if(!!m.types["default"]&&typeof m.types["default"][j]!=="undefined"){k=m.types["default"][j]}}}}if(d.isFunction(k)){k=k.call(this,g)}if(j==="max_depth"&&g!==-1&&e!==false&&m.max_depth!==-2&&k!==0){g.children("a:eq(0)").parentsUntil(".jstree","li").each(function(n){if(m.max_depth!==-1&&m.max_depth-(n+1)<=0){k=0;return false}i=(n===0)?k:h._check(j,this,false);if(i!==-1&&i-(n+1)<=0){k=0;return false}if(i>=0&&(i-(n+1) ";if(k.separator_after){i+="";e=true}});i=i.replace(/=0&&(m.max_depth-(n+1) ul > li").not(e.o).length:e.cr.find("> ul > li").not(e.o).length;if(h+e.o.length>k){return false}}if(i.max_depth!==-2&&j!==-1){l=0;if(j===0){return false}if(typeof e.o.d==="undefined"){f=e.o;while(f.length>0){f=f.find("> ul > li");l++}e.o.d=l}if(j-e.o.d<0){return false}}return true},create_node:function(h,i,f,o,k,n){if(!n&&(k||this._is_loaded(h))){var g=(typeof i=="string"&&i.match(/^before|after$/i)&&h!==-1)?this._get_parent(h):this._get_node(h),q=this._get_settings().types,m=this._check("max_children",g),l=this._check("max_depth",g),j=this._check("valid_children",g),e;if(typeof f==="string"){f={data:f}}if(!f){f={}}if(j==="none"){return false}if(d.isArray(j)){if(!f.attr||!f.attr[q.type_attr]){if(!f.attr){f.attr={}}f.attr[q.type_attr]=j[0]}else{if(d.inArray(f.attr[q.type_attr],j)===-1){return false}}}if(q.max_children!==-2&&m!==-1){e=g===-1?this.get_container().find("> ul > li").length:g.find("> ul > li").length;if(e+1>m){return false}}if(q.max_depth!==-2&&l!==-1&&(l-1)<0){return false}}return this.__call_old(true,h,i,f,o,k,n)}}})})(jQuery);(function(d){d.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(true);this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType==3}).remove()},defaults:{data:false,ajax:false,correct_state:true},_fn:{load_node:function(g,e,f){var h=this;this.load_node_html(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(e){e=this._get_node(e);return e==-1||!e||(!this._get_settings().html_data.ajax&&!d.isFunction(this._get_settings().html_data.data))||e.is(".jstree-open, .jstree-leaf")||e.children("ul").children("li").size()>0},load_node_html:function(i,e,g){var k,h=this.get_settings().html_data,f=function(){},j=function(){};i=this._get_node(i);if(i&&i!==-1){if(i.data("jstree_is_loading")){return}else{i.data("jstree_is_loading",true)}}switch(!0){case (d.isFunction(h.data)):h.data.call(this,i,d.proxy(function(l){if(l&&l!==""&&l.toString&&l.toString().replace(/^[\s\n]+$/,"")!==""){l=d(l);if(!l.is("ul")){l=d("
").append(l)}if(i==-1||!i){this.get_container().children("ul").empty().append(l.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.append(l).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");i.removeData("jstree_is_loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i&&i!==-1){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}},this));break;case (!h.data&&!h.ajax):if(!i||i==-1){this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(e){e.call(this)}break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!i||i===-1)):if(!i||i==-1){k=d(h.data);if(!k.is("ul")){k=d("
").append(k)}this.get_container().children("ul").empty().append(k.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&i&&i!==-1):i=this._get_node(i);f=function(m,n,o){var l=this.get_settings().html_data.ajax.error;if(l){l.call(this,m,n,o)}if(i!=-1&&i.length){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(n==="success"&&h.correct_state){this.correct_state(i)}}else{if(n==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};j=function(o,m,l){var n=this.get_settings().html_data.ajax.success;if(n){o=n.call(this,o,m,l)||o}if(o===""||(o&&o.toString&&o.toString().replace(/^[\s\n]+$/,"")==="")){return f.call(this,l,m,"")}if(o){o=d(o);if(!o.is("ul")){o=d("
").append(o)}if(i==-1||!i){this.get_container().children("ul").empty().append(o.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.append(o).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");i.removeData("jstree_is_loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i&&i!==-1){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=j;if(!h.ajax.dataType){h.ajax.dataType="html"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,i)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,i)}d.ajax(h.ajax);break}}}});d.jstree.defaults.plugins.push("html_data")})(jQuery);(function(d){d.jstree.plugin("themeroller",{__init:function(){var e=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a","mouseenter.jstree",function(f){if(!d(f.currentTarget).hasClass("jstree-loading")){d(this).addClass(e.item_h)}}).delegate("a","mouseleave.jstree",function(){d(this).removeClass(e.item_h)}).bind("init.jstree",d.proxy(function(g,f){f.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");this._themeroller(f.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",d.proxy(function(f){this._themeroller()},this)).bind("close_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.obj)},this)).bind("delete_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.parent)},this)).bind("correct_state.jstree",d.proxy(function(g,f){f.rslt.obj.children("ins.jstree-icon").removeClass(e.opened+" "+e.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_open+" "+e.item_clsd).addClass(e.item_leaf||"jstree-no-icon")},this)).bind("select_node.jstree",d.proxy(function(g,f){f.rslt.obj.children("a").addClass(e.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",d.proxy(function(g,f){this.get_container().find("a."+e.item_a).removeClass(e.item_a).end().find("a.jstree-clicked").addClass(e.item_a)},this)).bind("dehover_node.jstree",d.proxy(function(g,f){f.rslt.obj.children("a").removeClass(e.item_h)},this)).bind("hover_node.jstree",d.proxy(function(g,f){this.get_container().find("a."+e.item_h).not(f.rslt.obj).removeClass(e.item_h);f.rslt.obj.children("a").addClass(e.item_h)},this)).bind("move_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.o);this._themeroller(f.rslt.op)},this))},__destroy:function(){var e=this._get_settings().themeroller,f=["ui-icon"];d.each(e,function(h,g){g=g.split(" ");if(g.length){f=f.concat(g)}});this.get_container().removeClass("ui-widget-content").find("."+f.join(", .")).removeClass(f.join(" "))},_fn:{_themeroller:function(f){var e=this._get_settings().themeroller;f=!f||f==-1?this.get_container_ul():this._get_node(f).parent();f.find("li.jstree-closed").children("ins.jstree-icon").removeClass(e.opened).addClass("ui-icon "+e.closed).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_leaf+" "+e.item_open).addClass(e.item_clsd||"jstree-no-icon").end().end().end().end().find("li.jstree-open").children("ins.jstree-icon").removeClass(e.closed).addClass("ui-icon "+e.opened).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_leaf+" "+e.item_clsd).addClass(e.item_open||"jstree-no-icon").end().end().end().end().find("li.jstree-leaf").children("ins.jstree-icon").removeClass(e.closed+" ui-icon "+e.opened).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_clsd+" "+e.item_open).addClass(e.item_leaf||"jstree-no-icon")}},defaults:{opened:"ui-icon-triangle-1-se",closed:"ui-icon-triangle-1-e",item:"ui-state-default",item_h:"ui-state-hover",item_a:"ui-state-active",item_open:"ui-icon-folder-open",item_clsd:"ui-icon-folder-collapsed",item_leaf:"ui-icon-document"}});d(function(){var e=".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }";d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(d){d.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",d.proxy(function(k,i){var f=[],h=true,j,g;if(i.func=="move_node"){if(i.args[4]===true){if(i.args[0].o&&i.args[0].o.length){i.args[0].o.children("a").each(function(){f.push(d(this).text().replace(/^\s+/g,""))});h=this._check_unique(f,i.args[0].np.find("> ul > li").not(i.args[0].o),"move_node")}}}if(i.func=="create_node"){if(i.args[4]||this._is_loaded(i.args[0])){j=this._get_node(i.args[0]);if(i.args[1]&&(i.args[1]==="before"||i.args[1]==="after")){j=this._get_parent(i.args[0]);if(!j||j===-1){j=this.get_container()}}if(typeof i.args[2]==="string"){f.push(i.args[2])}else{if(!i.args[2]||!i.args[2].data){f.push(this._get_string("new_node"))}else{f.push(i.args[2].data)}}h=this._check_unique(f,j.find("> ul > li"),"create_node")}}if(i.func=="rename_node"){f.push(i.args[1]);g=this._get_node(i.args[0]);j=this._get_parent(g);if(!j||j===-1){j=this.get_container()}h=this._check_unique(f,j.find("> ul > li").not(g),"rename_node")}if(!h){k.stopPropagation();return false}},this))},defaults:{error_callback:d.noop},_fn:{_check_unique:function(f,h,g){var e=[];h.children("a").each(function(){e.push(d(this).text().replace(/^\s+/g,""))});if(!e.length||!f.length){return true}e=e.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");if((e.length+f.length)!=e.concat(f).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length){this._get_settings().unique.error_callback.call(null,f,h,g);return false}return true},check_move:function(){if(!this.__call_old()){return false}var f=this._get_move(),e=[];if(f.o&&f.o.length){f.o.children("a").each(function(){e.push(d(this).text().replace(/^\s+/g,""))});return this._check_unique(e,f.np.find("> ul > li").not(f.o),"check_move")}return true}}})})(jQuery);(function(d){d.jstree.plugin("wholerow",{__init:function(){if(!this.data.ui){throw"jsTree wholerow: jsTree UI plugin not included."}this.data.wholerow.html=false;this.data.wholerow.to=false;this.get_container().bind("init.jstree",d.proxy(function(g,f){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",d.proxy(function(g,f){this._prepare_wholerow_span(f&&f.rslt&&f.rslt.obj?f.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",d.proxy(function(g,f){if(this.data.to){clearTimeout(this.data.to)}this.data.to=setTimeout((function(e,h){return function(){e._prepare_wholerow_ul(h)}})(this,f&&f.rslt&&f.rslt.obj?f.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",d.proxy(function(g,f){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",d.proxy(function(g,f){f.rslt.obj.each(function(){var e=f.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+(parseInt(((d(this).offset().top-f.inst.get_container().offset().top+f.inst.get_container()[0].scrollTop)/f.inst.data.core.li_height),10))+")");e.children("a").attr("class",f.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",d.proxy(function(h,g){this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered "+(this.data.themeroller?this._get_settings().themeroller.item_h:""));if(h.type==="hover_node"){var f=this.get_container().find(" > .jstree-wholerow li:visible:eq("+(parseInt(((g.rslt.obj.offset().top-this.get_container().offset().top+this.get_container()[0].scrollTop)/this.data.core.li_height),10))+")");f.children("a").attr("class",g.rslt.obj.children(".jstree-hovered").attr("class"))}},this)).delegate(".jstree-wholerow-span, ins.jstree-icon, li","click.jstree",function(f){var g=d(f.currentTarget);if(f.target.tagName==="A"||(f.target.tagName==="INS"&&g.closest("li").is(".jstree-open, .jstree-closed"))){return}g.closest("li").children("a:visible:eq(0)").click();f.stopImmediatePropagation()}).delegate("li","mouseover.jstree",d.proxy(function(f){f.stopImmediatePropagation();if(d(f.currentTarget).children(".jstree-hovered, .jstree-clicked").length){return false}this.hover_node(f.currentTarget);return false},this)).delegate("li","mouseleave.jstree",d.proxy(function(f){if(d(f.currentTarget).children("a").hasClass("jstree-hovered").length){return}this.dehover_node(f.currentTarget)},this));if(b||c){d.vakata.css.add_sheet({str:".jstree-"+this.get_index()+" { position:relative; } ",title:"jstree"})}},defaults:{},__destroy:function(){this.get_container().children(".jstree-wholerow").remove();this.get_container().find(".jstree-wholerow-span").remove()},_fn:{_prepare_wholerow_span:function(e){e=!e||e==-1?this.get_container().find("> ul > li"):this._get_node(e);if(e===false){return}e.each(function(){d(this).find("li").andSelf().each(function(){var f=d(this);if(f.children(".jstree-wholerow-span").length){return true}f.prepend(" ")})})},_prepare_wholerow_ul:function(){var f=this.get_container().children("ul").eq(0),e=f.html();f.addClass("jstree-wholerow-real");if(this.data.wholerow.last_html!==e){this.data.wholerow.last_html=e;this.get_container().children(".jstree-wholerow").remove();this.get_container().append(f.clone().removeClass("jstree-wholerow-real").wrapAll("").parent().width(f.parent()[0].scrollWidth).css("top",(f.height()+(b?5:0))*-1).find("li[id]").each(function(){this.removeAttribute("id")}).end())}}}});d(function(){var e=".jstree .jstree-wholerow-real { position:relative; z-index:1; } .jstree .jstree-wholerow-real li { cursor:pointer; } .jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } .jstree .jstree-wholerow { position:relative; z-index:0; height:0; } .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } .jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }";if(a){e+=".jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } .jstree .jstree-wholerow-real a { border-color:transparent !important; } "}if(b||c){e+=".jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } .jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } "}d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(d){var e=["getChildren","getChildrenCount","getAttr","getName","getProps"],f=function(i,g){var h=true;i=i||{};g=[].concat(g);d.each(g,function(k,j){if(!d.isFunction(i[j])){h=false;return false}});return h};d.jstree.plugin("model",{__init:function(){if(!this.data.json_data){throw"jsTree model: jsTree json_data plugin not included."}this._get_settings().json_data.data=function(i,g){var h=(i==-1)?this._get_settings().model.object:i.data("jstree_model");if(!f(h,e)){return g.call(null,false)}if(this._get_settings().model.async){h.getChildren(d.proxy(function(j){this.model_done(j,g)},this))}else{this.model_done(h.getChildren(),g)}}},defaults:{object:false,id_prefix:false,async:false},_fn:{model_done:function(i,k){var g=[],h=this._get_settings(),j=this;if(!d.isArray(i)){i=[i]}d.each(i,function(l,n){var m=n.getProps()||{};m.attr=n.getAttr()||{};if(n.getChildrenCount()){m.state="closed"}m.data=n.getName();if(!d.isArray(m.data)){m.data=[m.data]}if(j.data.types&&d.isFunction(n.getType)){m.attr[h.types.type_attr]=n.getType()}if(m.attr.id&&h.model.id_prefix){m.attr.id=h.model.id_prefix+m.attr.id}if(!m.metadata){m.metadata={}}m.metadata.jstree_model=n;g.push(m)});k.call(null,g)}}})})(jQuery)})();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy