").attr({id:"jstree-marker"}).hide().appendTo("body");$(document).bind("drag_start.vakata",function(e,data){if(data.data.jstree){m.show()}});$(document).bind("drag_stop.vakata",function(e,data){if(data.data.jstree){m.hide()}})})})(jQuery);(function($){$.jstree.plugin("checkbox",{__init:function(){this.select_node=this.deselect_node=this.deselect_all=$.noop;this.get_selected=this.get_checked;this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree",$.proxy(function(e,data){this._prepare_checkboxes(data.rslt.obj)},this)).bind("loaded.jstree",$.proxy(function(e){this._prepare_checkboxes()},this)).delegate("a","click.jstree",$.proxy(function(e){if(this._get_node(e.target).hasClass("jstree-checked")){this.uncheck_node(e.target)}else{this.check_node(e.target)}if(this.data.ui){this.save_selected()}if(this.data.cookies){this.save_cookie("select_node")}e.preventDefault()},this))},__destroy:function(){this.get_container().find(".jstree-checkbox").remove()},_fn:{_prepare_checkboxes:function(obj){obj=!obj||obj==-1?this.get_container():this._get_node(obj);var c,_this=this,t;obj.each(function(){t=$(this);c=t.is("li")&&t.hasClass("jstree-checked")?"jstree-checked":"jstree-unchecked";t.find("a").not(":has(.jstree-checkbox)").prepend("
").parent().not(".jstree-checked, .jstree-unchecked").addClass(c)});if(obj.is("li")){this._repair_state(obj)}else{obj.find("> ul > li").each(function(){_this._repair_state(this)})}},change_state:function(obj,state){obj=this._get_node(obj);state=(state===false||state===true)?state:obj.hasClass("jstree-checked");if(state){obj.find("li").andSelf().removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}else{obj.find("li").andSelf().removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(this.data.ui){this.data.ui.last_selected=obj}this.data.checkbox.last_selected=obj}obj.parentsUntil(".jstree","li").each(function(){var $this=$(this);if(state){if($this.children("ul").children(".jstree-checked, .jstree-undetermined").length){$this.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");return false}else{$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked")}}else{if($this.children("ul").children(".jstree-unchecked, .jstree-undetermined").length){$this.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");return false}else{$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked")}}});if(this.data.ui){this.data.ui.selected=this.get_checked()}this.__callback(obj)},check_node:function(obj){this.change_state(obj,false)},uncheck_node:function(obj){this.change_state(obj,true)},check_all:function(){var _this=this;this.get_container().children("ul").children("li").each(function(){_this.check_node(this,false)})},uncheck_all:function(){var _this=this;this.get_container().children("ul").children("li").each(function(){_this.change_state(this,true)})},is_checked:function(obj){obj=this._get_node(obj);return obj.length?obj.is(".jstree-checked"):false},get_checked:function(obj){obj=!obj||obj===-1?this.get_container():this._get_node(obj);return obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(obj){obj=!obj||obj===-1?this.get_container():this._get_node(obj);return obj.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(obj){obj=this._get_node(obj);if(!obj.length){return}var a=obj.find("> ul > .jstree-checked").length,b=obj.find("> ul > .jstree-undetermined").length,c=obj.find("> ul > li").length;if(c===0){if(obj.hasClass("jstree-undetermined")){this.check_node(obj)}}else{if(a===0&&b===0){this.uncheck_node(obj)}else{if(a===c){this.check_node(obj)}else{obj.parentsUntil(".jstree","li").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined")}}}},reselect:function(){if(this.data.ui){var _this=this,s=this.data.ui.to_select;s=$.map($.makeArray(s),function(n){return"#"+n.toString().replace(/^#/,"").replace("\\/","/").replace("/","\\/")});this.deselect_all();$.each(s,function(i,val){_this.check_node(val)});this.__callback()}}}})})(jQuery);(function($){$.vakata.xslt=function(xml,xsl,callback){var rs="",xm,xs,processor,support;if(document.recalc){xm=document.createElement("xml");xs=document.createElement("xml");xm.innerHTML=xml;xs.innerHTML=xsl;$("body").append(xm).append(xs);setTimeout((function(xm,xs,callback){return function(){callback.call(null,xm.transformNode(xs.XMLDocument));setTimeout((function(xm,xs){return function(){jQuery("body").remove(xm).remove(xs)}})(xm,xs),200)}})(xm,xs,callback),100);return true}if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor!=="undefined"){processor=new XSLTProcessor();support=$.isFunction(processor.transformDocument)?(typeof window.XMLSerializer!=="undefined"):true;if(!support){return false}xml=new DOMParser().parseFromString(xml,"text/xml");xsl=new DOMParser().parseFromString(xsl,"text/xml");if($.isFunction(processor.transformDocument)){rs=document.implementation.createDocument("","",null);processor.transformDocument(xml,xsl,rs,null);callback.call(null,XMLSerializer().serializeToString(rs));return true}else{processor.importStylesheet(xsl);rs=processor.transformToFragment(xml,document);callback.call(null,$("
").append(rs).html());return true}}return false};var xsl={nest:'
',flat:'
jstree-last jstree-open jstree-closed jstree-leaf # jstree-icon background:url() center center no-repeat; '};$.jstree.plugin("xml_data",{defaults:{data:false,ajax:false,xsl:"flat",clean_node:false,correct_state:true},_fn:{load_node:function(obj,s_call,e_call){var _this=this;this.load_node_xml(obj,function(){_this.__callback({obj:obj});s_call.call(this)},e_call)},_is_loaded:function(obj){var s=this._get_settings().xml_data;obj=this._get_node(obj);return obj==-1||!obj||!s.ajax||obj.is(".jstree-open, .jstree-leaf")||obj.children("ul").children("li").size()>0},load_node_xml:function(obj,s_call,e_call){var s=this.get_settings().xml_data,error_func=function(){},success_func=function(){};obj=this._get_node(obj);if(obj&&obj!==-1){if(obj.data("jstree-is-loading")){return}else{obj.data("jstree-is-loading",true)}}switch(!0){case (!s.data&&!s.ajax):throw"Neither data nor ajax settings supplied.";case (!!s.data&&!s.ajax)||(!!s.data&&!!s.ajax&&(!obj||obj===-1)):if(!obj||obj==-1){this.parse_xml(s.data,$.proxy(function(d){if(d){d=d.replace(/ ?xmlns="[^"]*"/ig,"");if(d.length>10){d=$(d);this.get_container().children("ul").empty().append(d.children());if(s.clean_node){this.clean_node(obj)}if(s_call){s_call.call(this)}}}else{if(s.correct_state){this.get_container().children("ul").empty();if(s_call){s_call.call(this)}}}},this))}break;case (!s.data&&!!s.ajax)||(!!s.data&&!!s.ajax&&obj&&obj!==-1):error_func=function(x,t,e){var ef=this.get_settings().xml_data.ajax.error;if(ef){ef.call(this,x,t,e)}if(obj!==-1&&obj.length){obj.children(".jstree-loading").removeClass("jstree-loading");obj.data("jstree-is-loading",false);if(t==="success"&&s.correct_state){obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}}else{if(t==="success"&&s.correct_state){this.get_container().children("ul").empty()}}if(e_call){e_call.call(this)}};success_func=function(d,t,x){d=x.responseText;var sf=this.get_settings().xml_data.ajax.success;if(sf){d=sf.call(this,d,t,x)||d}if(d==""){return error_func.call(this,x,t,"")}this.parse_xml(d,$.proxy(function(d){if(d){d=d.replace(/ ?xmlns="[^"]*"/ig,"");if(d.length>10){d=$(d);if(obj===-1||!obj){this.get_container().children("ul").empty().append(d.children())}else{obj.children(".jstree-loading").removeClass("jstree-loading");obj.append(d);obj.data("jstree-is-loading",false)}if(s.clean_node){this.clean_node(obj)}if(s_call){s_call.call(this)}}else{if(obj&&obj!==-1){obj.children(".jstree-loading").removeClass("jstree-loading");obj.data("jstree-is-loading",false);if(s.correct_state){obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");if(s_call){s_call.call(this)}}}else{if(s.correct_state){this.get_container().children("ul").empty();if(s_call){s_call.call(this)}}}}}},this))};s.ajax.context=this;s.ajax.error=error_func;s.ajax.success=success_func;if(!s.ajax.dataType){s.ajax.dataType="xml"}if($.isFunction(s.ajax.url)){s.ajax.url=s.ajax.url.call(this,obj)}if($.isFunction(s.ajax.data)){s.ajax.data=s.ajax.data.call(this,obj)}$.ajax(s.ajax);break}},parse_xml:function(xml,callback){var s=this._get_settings().xml_data;$.vakata.xslt(xml,xsl[s.xsl],callback)},get_xml:function(tp,obj,li_attr,a_attr,is_callback){var result="",s=this._get_settings(),_this=this,tmp1,tmp2,li,a,lang;if(!tp){tp="flat"}if(!is_callback){is_callback=0}obj=this._get_node(obj);if(!obj||obj===-1){obj=this.get_container().find("> ul > li")}li_attr=$.isArray(li_attr)?li_attr:["id","class"];if(!is_callback&&this.data.types&&$.inArray(s.types.type_attr,li_attr)===-1){li_attr.push(s.types.type_attr)}a_attr=$.isArray(a_attr)?a_attr:[];if(!is_callback){result+="
"}obj.each(function(){result+="- ";result+="";a=li.children("a");a.each(function(){tmp1=$(this);lang=false;result+="";result+="";result+=""});result+="";tmp2=li[0].id;li=li.find("> ul > li");if(li.length){tmp2=_this.get_xml(tp,li,li_attr,a_attr,tmp2)}else{tmp2=""}if(tp=="nest"){result+=tmp2}result+="
";if(tp=="flat"){result+=tmp2}});if(!is_callback){result+=""}return result}}})})(jQuery);(function($){$.expr[":"].jstree_contains=function(a,i,m){return(a.textContent||a.innerText||"").toLowerCase().indexOf(m[3].toLowerCase())>=0};$.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=$()},defaults:{ajax:false,case_insensitive:false},_fn:{search:function(str,skip_async){if(str===""){return}var s=this.get_settings().search,t=this,error_func=function(){},success_func=function(){};this.data.search.str=str;if(!skip_async&&s.ajax!==false&&this.get_container().find(".jstree-closed:eq(0)").length>0){this.search.supress_callback=true;error_func=function(){};success_func=function(d,t,x){var sf=this.get_settings().search.ajax.success;if(sf){d=sf.call(this,d,t,x)||d}this.data.search.to_open=d;this._search_open()};s.ajax.context=this;s.ajax.error=error_func;s.ajax.success=success_func;if($.isFunction(s.ajax.url)){s.ajax.url=s.ajax.url.call(this,str)}if($.isFunction(s.ajax.data)){s.ajax.data=s.ajax.data.call(this,str)}if(!s.ajax.data){s.ajax.data={search_string:str}}if(!s.ajax.dataType||/^json/.exec(s.ajax.dataType)){s.ajax.dataType="json"}$.ajax(s.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():"")+":"+(s.case_insensitive?"jstree_contains":"contains")+"("+this.data.search.str+")");this.data.search.result.addClass("jstree-search").parents(".jstree-closed").each(function(){t.open_node(this,false,true)});this.__callback({nodes:this.data.search.result,str:str})},clear_search:function(str){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=$()},_search_open:function(is_callback){var _this=this,done=true,current=[],remaining=[];if(this.data.search.to_open.length){$.each(this.data.search.to_open,function(i,val){if(val=="#"){return true}if($(val).length&&$(val).is(".jstree-closed")){current.push(val)}else{remaining.push(val)}});if(current.length){this.data.search.to_open=remaining;$.each(current,function(i,val){_this.open_node(val,function(){_this._search_open(true)})});done=false}}if(done){this.search(this.data.search.str,true)}}}})})(jQuery);(function($){$.vakata.context={cnt:$(""),vis:false,tgt:false,par:false,func:false,data:false,show:function(s,t,x,y,d,p){var html=$.vakata.context.parse(s),h,w;if(!html){return}$.vakata.context.vis=true;$.vakata.context.tgt=t;$.vakata.context.par=p||t||null;$.vakata.context.data=d||null;$.vakata.context.cnt.html(html).css({visibility:"hidden",display:"block",left:0,top:0});h=$.vakata.context.cnt.height();w=$.vakata.context.cnt.width();if(x+w>$(document).width()){x=$(document).width()-(w+5);$.vakata.context.cnt.find("li > ul").addClass("right")}if(y+h>$(document).height()){y=y-(h+t[0].offsetHeight);$.vakata.context.cnt.find("li > ul").addClass("bottom")}$.vakata.context.cnt.css({left:x,top:y}).find("li:has(ul)").bind("mouseenter",function(e){var w=$(document).width(),h=$(document).height(),ul=$(this).children("ul").show();if(w!==$(document).width()){ul.toggleClass("right")}if(h!==$(document).height()){ul.toggleClass("bottom")}}).bind("mouseleave",function(e){$(this).children("ul").hide()}).end().css({visibility:"visible"}).show();$(document).triggerHandler("context_show.vakata")},hide:function(){$.vakata.context.vis=false;$.vakata.context.cnt.attr("class","").hide();$(document).triggerHandler("context_hide.vakata")},parse:function(s,is_callback){if(!s){return false}var str="",tmp=false,was_sep=true;if(!is_callback){$.vakata.context.func={}}str+="
";$.each(s,function(i,val){if(!val){return true}$.vakata.context.func[i]=val.action;if(!was_sep&&val.separator_before){str+=""}was_sep=false;str+="";if(val.separator_after){str+="";was_sep=true}});str=str.replace(/- <\/li\>$/,"");str+="
";return str.length>10?str:false},exec:function(i){if($.isFunction($.vakata.context.func[i])){$.vakata.context.func[i].call($.vakata.context.data,$.vakata.context.par);return true}else{return false}}};$(function(){var css_string="#vakata-contextmenu { display:none; 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; } ";$.vakata.css.add_sheet({str:css_string});$.vakata.context.cnt.delegate("a","click",function(e){e.preventDefault()}).delegate("a","mouseup",function(e){if(!$(this).parent().hasClass("jstree-contextmenu-disabled")&&$.vakata.context.exec($(this).attr("rel"))){$.vakata.context.hide()}else{$(this).blur()}}).delegate("a","mouseover",function(){$.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");$(document).bind("mousedown",function(e){if($.vakata.context.vis&&!$.contains($.vakata.context.cnt[0],e.target)){$.vakata.context.hide()}});if(typeof $.hotkeys!=="undefined"){$(document).bind("keydown","up",function(e){if($.vakata.context.vis){var o=$.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();if(!o.length){o=$.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last()}o.addClass("vakata-hover");e.stopImmediatePropagation();e.preventDefault()}}).bind("keydown","down",function(e){if($.vakata.context.vis){var o=$.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();if(!o.length){o=$.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first()}o.addClass("vakata-hover");e.stopImmediatePropagation();e.preventDefault()}}).bind("keydown","right",function(e){if($.vakata.context.vis){$.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");e.stopImmediatePropagation();e.preventDefault()}}).bind("keydown","left",function(e){if($.vakata.context.vis){$.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");e.stopImmediatePropagation();e.preventDefault()}}).bind("keydown","esc",function(e){$.vakata.context.hide();e.preventDefault()}).bind("keydown","space",function(e){$.vakata.context.cnt.find(".vakata-hover").last().children("a").click();e.preventDefault()})}});$.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",$.proxy(function(e){e.preventDefault();this.show_contextmenu(e.currentTarget,e.pageX,e.pageY)},this)).bind("destroy.jstree",$.proxy(function(){if(this.data.contextmenu){$.vakata.context.hide()}},this));$(document).bind("context_hide.vakata",$.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(obj){this.create(obj)}},rename:{separator_before:false,separator_after:false,label:"Rename",action:function(obj){this.rename(obj)}},remove:{separator_before:false,icon:false,separator_after:false,label:"Delete",action:function(obj){this.remove(obj)}},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(obj){this.cut(obj)}},copy:{separator_before:false,icon:false,separator_after:false,label:"Copy",action:function(obj){this.copy(obj)}},paste:{separator_before:false,icon:false,separator_after:false,label:"Paste",action:function(obj){this.paste(obj)}}}}}},_fn:{show_contextmenu:function(obj,x,y){obj=this._get_node(obj);var s=this.get_settings().contextmenu,a=obj.children("a:visible:eq(0)"),o=false;if(s.select_node&&this.data.ui&&!this.is_selected(obj)){this.deselect_all();this.select_node(obj,true)}if(s.show_at_node||typeof x==="undefined"||typeof y==="undefined"){o=a.offset();x=o.left;y=o.top+this.data.core.li_height}if($.isFunction(s.items)){s.items=s.items.call(this,obj)}this.data.contextmenu=true;$.vakata.context.show(s.items,a,x,y,this,obj);if(this.data.themes){$.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}}})})(jQuery);(function($){$.jstree.plugin("types",{__init:function(){var s=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",$.proxy(function(){var types=s.types,attr=s.type_attr,icons_css="",_this=this;$.each(types,function(i,tp){$.each(tp,function(k,v){if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)){_this.data.types.attach_to.push(k)}});if(!tp.icon){return true}if(tp.icon.image||tp.icon.position){if(i=="default"){icons_css+=".jstree-"+_this.get_index()+" a > .jstree-icon { "}else{icons_css+=".jstree-"+_this.get_index()+" li["+attr+"="+i+"] > a > .jstree-icon { "}if(tp.icon.image){icons_css+=" background-image:url("+tp.icon.image+"); "}if(tp.icon.position){icons_css+=" background-position:"+tp.icon.position+"; "}else{icons_css+=" background-position:0 0; "}icons_css+="} "}});if(icons_css!=""){$.vakata.css.add_sheet({str:icons_css})}},this)).bind("before.jstree",$.proxy(function(e,data){if($.inArray(data.func,this.data.types.attach_to)!==-1){var s=this._get_settings().types.types,t=this._get_type(data.args[0]);if(((s[t]&&typeof s[t][data.func]!=="undefined")||(s["default"]&&typeof s["default"][data.func]!=="undefined"))&&!this._check(data.func,data.args[0])){e.stopImmediatePropagation();return false}}},this))},defaults:{max_children:-1,max_depth:-1,valid_children:"all",type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_get_type:function(obj){obj=this._get_node(obj);return(!obj||!obj.length)?false:obj.attr(this._get_settings().types.type_attr)||"default"},set_type:function(str,obj){obj=this._get_node(obj);return(!obj.length||!str)?false:obj.attr(this._get_settings().types.type_attr,str)},_check:function(rule,obj,opts){var v=false,t=this._get_type(obj),d=0,_this=this,s=this._get_settings().types;if(obj===-1){if(!!s[rule]){v=s[rule]}else{return}}else{if(t===false){return}if(!!s.types[t]&&!!s.types[t][rule]){v=s.types[t][rule]}else{if(!!s.types["default"]&&!!s.types["default"][rule]){v=s.types["default"][rule]}}}if($.isFunction(v)){v=v.call(this,obj)}if(rule==="max_depth"&&obj!==-1&&opts!==false&&s.max_depth!==-2&&v!==0){this._get_node(obj).children("a:eq(0)").parentsUntil(".jstree","li").each(function(i){if(s.max_depth!==-1&&s.max_depth-(i+1)<=0){v=0;return false}d=(i===0)?v:_this._check(rule,this,false);if(d!==-1&&d-(i+1)<=0){v=0;return false}if(d>=0&&(d-(i+1)
=0&&(s.max_depth-(i+1) ul > li").not(m.o).length:m.cr.children("> ul > li").not(m.o).length;if(ch+m.o.length>mc){return false}}if(s.max_depth!==-2&&md!==-1){d=0;if(md===0){return false}if(typeof m.o.d==="undefined"){t=m.o;while(t.length>0){t=t.find("> ul > li");d++}m.o.d=d}if(md-m.o.d<0){return false}}return true},create_node:function(obj,position,js,callback,is_loaded,skip_check){if(!skip_check&&(is_loaded||this._is_loaded(obj))){var p=(position&&position.match(/^before|after$/i)&&obj!==-1)?this._get_parent(obj):this._get_node(obj),s=this._get_settings().types,mc=this._check("max_children",p),md=this._check("max_depth",p),vc=this._check("valid_children",p),ch;if(!js){js={}}if(vc==="none"){return false}if($.isArray(vc)){if(!js.attr||!js.attr[s.type_attr]){if(!js.attr){js.attr={}}js.attr[s.type_attr]=vc[0]}else{if($.inArray(js.attr[s.type_attr],vc)===-1){return false}}}if(s.max_children!==-2&&mc!==-1){ch=p===-1?this.get_container().children("> ul > li").length:p.children("> ul > li").length;if(ch+1>mc){return false}}if(s.max_depth!==-2&&md!==-1&&(md-1)<0){return false}}return this.__call_old(true,obj,position,js,callback,is_loaded,skip_check)}}})})(jQuery);(function($){$.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(obj,s_call,e_call){var _this=this;this.load_node_html(obj,function(){_this.__callback({obj:obj});s_call.call(this)},e_call)},_is_loaded:function(obj){obj=this._get_node(obj);return obj==-1||!obj||!this._get_settings().html_data.ajax||obj.is(".jstree-open, .jstree-leaf")||obj.children("ul").children("li").size()>0},load_node_html:function(obj,s_call,e_call){var d,s=this.get_settings().html_data,error_func=function(){},success_func=function(){};obj=this._get_node(obj);if(obj&&obj!==-1){if(obj.data("jstree-is-loading")){return}else{obj.data("jstree-is-loading",true)}}switch(!0){case (!s.data&&!s.ajax):if(!obj||obj==-1){this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(s_call){s_call.call(this)}break;case (!!s.data&&!s.ajax)||(!!s.data&&!!s.ajax&&(!obj||obj===-1)):if(!obj||obj==-1){d=$(s.data);if(!d.is("ul")){d=$("").append(d)}this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function(){return this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(s_call){s_call.call(this)}break;case (!s.data&&!!s.ajax)||(!!s.data&&!!s.ajax&&obj&&obj!==-1):obj=this._get_node(obj);error_func=function(x,t,e){var ef=this.get_settings().html_data.ajax.error;if(ef){ef.call(this,x,t,e)}if(obj!=-1&&obj.length){obj.children(".jstree-loading").removeClass("jstree-loading");obj.data("jstree-is-loading",false);if(t==="success"&&s.correct_state){obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}}else{if(t==="success"&&s.correct_state){this.get_container().children("ul").empty()}}if(e_call){e_call.call(this)}};success_func=function(d,t,x){var sf=this.get_settings().html_data.ajax.success;if(sf){d=sf.call(this,d,t,x)||d}if(d==""){return error_func.call(this,x,t,"")}if(d){d=$(d);if(!d.is("ul")){d=$("").append(d)}if(obj==-1||!obj){this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function(){return this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{obj.children(".jstree-loading").removeClass("jstree-loading");obj.append(d).find("li, a").filter(function(){return this.firstChild.tagName!=="INS"}).prepend(" ").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");obj.data("jstree-is-loading",false)}this.clean_node(obj);if(s_call){s_call.call(this)}}else{if(obj&&obj!==-1){obj.children(".jstree-loading").removeClass("jstree-loading");obj.data("jstree-is-loading",false);if(s.correct_state){obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");if(s_call){s_call.call(this)}}}else{if(s.correct_state){this.get_container().children("ul").empty();if(s_call){s_call.call(this)}}}}};s.ajax.context=this;s.ajax.error=error_func;s.ajax.success=success_func;if(!s.ajax.dataType){s.ajax.dataType="html"}if($.isFunction(s.ajax.url)){s.ajax.url=s.ajax.url.call(this,obj)}if($.isFunction(s.ajax.data)){s.ajax.data=s.ajax.data.call(this,obj)}$.ajax(s.ajax);break}}}});$.jstree.defaults.plugins.push("html_data")})(jQuery);(function($){$.jstree.plugin("themeroller",{__init:function(){var s=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").delegate("a","mouseenter.jstree",function(){$(this).addClass(s.item_h)}).delegate("a","mouseleave.jstree",function(){$(this).removeClass(s.item_h)}).bind("open_node.jstree create_node.jstree",$.proxy(function(e,data){this._themeroller(data.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",$.proxy(function(e){this._themeroller()},this)).bind("close_node.jstree",$.proxy(function(e,data){data.rslt.obj.children("ins").removeClass(s.opened).addClass(s.closed)},this)).bind("select_node.jstree",$.proxy(function(e,data){data.rslt.obj.children("a").addClass(s.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",$.proxy(function(e,data){this.get_container().find("."+s.item_a).removeClass(s.item_a).end().find(".jstree-clicked").addClass(s.item_a)},this)).bind("move_node.jstree",$.proxy(function(e,data){this._themeroller(data.rslt.o)},this))},__destroy:function(){var s=this._get_settings().themeroller,c=["ui-icon"];$.each(s,function(i,v){v=v.split(" ");if(v.length){c=c.concat(v)}});this.get_container().removeClass("ui-widget-content").find("."+c.join(", .")).removeClass(c.join(" "))},_fn:{_themeroller:function(obj){var s=this._get_settings().themeroller;obj=!obj||obj==-1?this.get_container():this._get_node(obj).parent();obj.find("li.jstree-closed > ins.jstree-icon").removeClass(s.opened).addClass("ui-icon "+s.closed).end().find("li.jstree-open > ins.jstree-icon").removeClass(s.closed).addClass("ui-icon "+s.opened).end().find("a").addClass(s.item).children("ins.jstree-icon").addClass("ui-icon "+s.item_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_icon:"ui-icon-folder-collapsed"}});$(function(){var css_string=".jstree .ui-icon { overflow:visible; } .jstree a { padding:0 2px; }";$.vakata.css.add_sheet({str:css_string})})})(jQuery);(function($){$.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",$.proxy(function(e,data){var nms=[],res=true,p,t;if(data.func=="move_node"){if(data.args[4]===true){if(data.args[0].o&&data.args[0].o.length){data.args[0].o.children("a").each(function(){nms.push($(this).text().replace(/^\s+/g,""))});res=this._check_unique(nms,data.args[0].np.find("> ul > li").not(data.args[0].o))}}}if(data.func=="create_node"){if(data.args[4]||this._is_loaded(data.args[0])){p=this._get_node(data.args[0]);if(data.args[1]&&(data.args[1]==="before"||data.args[1]==="after")){p=this._get_parent(data.args[0]);if(!p||p===-1){p=this.get_container()}}if(typeof data.args[2]==="string"){nms.push(data.args[2])}else{if(!data.args[2]||!data.args[2].data){nms.push(this._get_settings().core.strings.new_node)}else{nms.push(data.args[2].data)}}res=this._check_unique(nms,p.find("> ul > li"))}}if(data.func=="rename_node"){nms.push(data.args[1]);t=this._get_node(data.args[0]);p=this._get_parent(t);if(!p||p===-1){p=this.get_container()}res=this._check_unique(nms,p.find("> ul > li").not(t))}if(!res){e.stopPropagation();return false}},this))},_fn:{_check_unique:function(nms,p){var cnms=[];p.children("a").each(function(){cnms.push($(this).text().replace(/^\s+/g,""))});if(!cnms.length||!nms.length){return true}cnms=cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");if((cnms.length+nms.length)!=cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length){return false}return true},check_move:function(){if(!this.__call_old()){return false}var p=this._get_move(),nms=[];if(p.o&&p.o.length){p.o.children("a").each(function(){nms.push($(this).text().replace(/^\s+/g,""))});return this._check_unique(nms,p.np.find("> ul > li").not(p.o))}return true}}})})(jQuery);