diff --git a/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.jgz b/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.jgz index 2fbed408bc1914303e4d0641e045172a82fad4fd..8ba61f32afcbc31f54a7ab8b5a9df2ec6a2c2a26 100644 Binary files a/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.jgz and b/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.jgz differ diff --git a/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.js b/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.js index 84fc5d24d0479093bc2496aba7fbc037df8e4eaf..321ce99e9901990e7b0b52a8ca2d6e9c2dcfacb2 100644 --- a/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.js +++ b/htdocs/includes/jquery/plugins/jstree/jquery.jstree.min.js @@ -15,15 +15,15 @@ else{tmp.appendChild(document.createTextNode(opts.str));document.getElementsByTa return tmp.sheet||tmp.styleSheet;} if(opts.url){if(document.createStyleSheet){try{tmp=document.createStyleSheet(opts.url);}catch(e){}} else{tmp=document.createElement('link');tmp.rel='stylesheet';tmp.type='text/css';tmp.media="all";tmp.href=opts.url;document.getElementsByTagName("head")[0].appendChild(tmp);return tmp.styleSheet;}}}};var instances=[],focused_instance=-1,plugins={},prepared_move={};$.fn.jstree=function(settings){var isMethodCall=(typeof settings=='string'),args=Array.prototype.slice.call(arguments,1),returnValue=this;if(isMethodCall){if(settings.substring(0,1)=='_'){return returnValue;} -this.each(function(){var instance=instances[$.data(this,"jstree-instance-id")],methodValue=(instance&&$.isFunction(instance[settings]))?instance[settings].apply(instance,args):instance;if(typeof methodValue!=="undefined"&&(settings.indexOf("is_")===0||(methodValue!==true&&methodValue!==false))){returnValue=methodValue;return false;}});} -else{this.each(function(){var instance_id=$.data(this,"jstree-instance-id"),a=[],b=settings?$.extend({},true,settings):{},c=$(this),s=false,t=[];a=a.concat(args);if(c.data("jstree")){a.push(c.data("jstree"));} +this.each(function(){var instance=instances[$.data(this,"jstree_instance_id")],methodValue=(instance&&$.isFunction(instance[settings]))?instance[settings].apply(instance,args):instance;if(typeof methodValue!=="undefined"&&(settings.indexOf("is_")===0||(methodValue!==true&&methodValue!==false))){returnValue=methodValue;return false;}});} +else{this.each(function(){var instance_id=$.data(this,"jstree_instance_id"),a=[],b=settings?$.extend({},true,settings):{},c=$(this),s=false,t=[];a=a.concat(args);if(c.data("jstree")){a.push(c.data("jstree"));} b=a.length?$.extend.apply(null,[true,b].concat(a)):b;if(typeof instance_id!=="undefined"&&instances[instance_id]){instances[instance_id].destroy();} -instance_id=parseInt(instances.push({}),10)-1;$.data(this,"jstree-instance-id",instance_id);b.plugins=$.isArray(b.plugins)?b.plugins:$.jstree.defaults.plugins.slice();b.plugins.unshift("core");b.plugins=b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");s=$.extend(true,{},$.jstree.defaults,b);s.plugins=b.plugins;$.each(plugins,function(i,val){if($.inArray(i,s.plugins)===-1){s[i]=null;delete s[i];} -else{t.push(i);}});s.plugins=t;instances[instance_id]=new $.jstree._instance(instance_id,$(this).addClass("jstree jstree-"+instance_id),s);$.each(instances[instance_id]._get_settings().plugins,function(i,val){instances[instance_id].data[val]={};});$.each(instances[instance_id]._get_settings().plugins,function(i,val){if(plugins[val]){plugins[val].__init.apply(instances[instance_id]);}});setTimeout(function(){instances[instance_id].init();},0);});} +instance_id=parseInt(instances.push({}),10)-1;$.data(this,"jstree_instance_id",instance_id);b.plugins=$.isArray(b.plugins)?b.plugins:$.jstree.defaults.plugins.slice();b.plugins.unshift("core");b.plugins=b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");s=$.extend(true,{},$.jstree.defaults,b);s.plugins=b.plugins;$.each(plugins,function(i,val){if($.inArray(i,s.plugins)===-1){s[i]=null;delete s[i];} +else{t.push(i);}});s.plugins=t;instances[instance_id]=new $.jstree._instance(instance_id,$(this).addClass("jstree jstree-"+instance_id),s);$.each(instances[instance_id]._get_settings().plugins,function(i,val){instances[instance_id].data[val]={};});$.each(instances[instance_id]._get_settings().plugins,function(i,val){if(plugins[val]){plugins[val].__init.apply(instances[instance_id]);}});setTimeout(function(){if(instances[instance_id]){instances[instance_id].init();}},0);});} return returnValue;};$.jstree={defaults:{plugins:[]},_focused:function(){return instances[focused_instance]||null;},_reference:function(needle){if(instances[needle]){return instances[needle];} var o=$(needle);if(!o.length&&typeof needle==="string"){o=$("#"+needle);} if(!o.length){return null;} -return instances[o.closest(".jstree").data("jstree-instance-id")]||null;},_instance:function(index,container,settings){this.data={core:{}};this.get_settings=function(){return $.extend(true,{},settings);};this._get_settings=function(){return settings;};this.get_index=function(){return index;};this.get_container=function(){return container;};this.get_container_ul=function(){return container.children("ul:eq(0)");};this._set_settings=function(s){settings=$.extend(true,{},settings,s);};},_fn:{},plugin:function(pname,pdata){pdata=$.extend({},{__init:$.noop,__destroy:$.noop,_fn:{},defaults:false},pdata);plugins[pname]=pdata;$.jstree.defaults[pname]=pdata.defaults;$.each(pdata._fn,function(i,val){val.plugin=pname;val.old=$.jstree._fn[i];$.jstree._fn[i]=function(){var rslt,func=val,args=Array.prototype.slice.call(arguments),evnt=new $.Event("before.jstree"),rlbk=false;if(this.data.core.locked===true&&i!=="unlock"&&i!=="is_locked"){return;} +return instances[o.closest(".jstree").data("jstree_instance_id")]||null;},_instance:function(index,container,settings){this.data={core:{}};this.get_settings=function(){return $.extend(true,{},settings);};this._get_settings=function(){return settings;};this.get_index=function(){return index;};this.get_container=function(){return container;};this.get_container_ul=function(){return container.children("ul:eq(0)");};this._set_settings=function(s){settings=$.extend(true,{},settings,s);};},_fn:{},plugin:function(pname,pdata){pdata=$.extend({},{__init:$.noop,__destroy:$.noop,_fn:{},defaults:false},pdata);plugins[pname]=pdata;$.jstree.defaults[pname]=pdata.defaults;$.each(pdata._fn,function(i,val){val.plugin=pname;val.old=$.jstree._fn[i];$.jstree._fn[i]=function(){var rslt,func=val,args=Array.prototype.slice.call(arguments),evnt=new $.Event("before.jstree"),rlbk=false;if(this.data.core.locked===true&&i!=="unlock"&&i!=="is_locked"){return;} do{if(func&&func.plugin&&$.inArray(func.plugin,this._get_settings().plugins)!==-1){break;} func=func.old;}while(func);if(!func){return;} if(i.indexOf("_")===0){rslt=func.apply(this,args);} @@ -36,7 +36,7 @@ css_string+=''+'.jstree li { height:18px; margin-left:0; margin-right:0; } '+'.j if(/msie/.test(u)&&parseInt(v,10)==7){is_ie7=true;css_string+='.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';} if(!/compatible/.test(u)&&/mozilla/.test(u)&&parseFloat(v,10)<1.9){is_ff2=true;css_string+=''+'.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; } ';} $.vakata.css.add_sheet({str:css_string,title:"jstree"});});$.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("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>"+this._get_string("loading")+"</a></li></ul>");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",$.proxy(function(event){var trgt=$(event.target);if(trgt.is("ins")&&event.pageY-trgt.offset().top<this.data.core.li_height){this.toggle_node(trgt);}},this)).bind("mousedown.jstree",$.proxy(function(){this.set_focus();},this)).bind("dblclick.jstree",function(event){var sel;if(document.selection&&document.selection.empty){document.selection.empty();} +this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>"+this._get_string("loading")+"</a></li></ul>");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",$.proxy(function(event){var trgt=$(event.target);this.toggle_node(trgt);},this)).bind("mousedown.jstree",$.proxy(function(){this.set_focus();},this)).bind("dblclick.jstree",function(event){var sel;if(document.selection&&document.selection.empty){document.selection.empty();} else{if(window.getSelection){sel=window.getSelection();try{sel.removeAllRanges();sel.collapse();}catch(err){}}}});if(this._get_settings().core.notify_plugins){this.get_container().bind("load_node.jstree",$.proxy(function(e,data){var o=this._get_node(data.rslt.obj),t=this;if(o===-1){o=this.get_container_ul();} if(!o.length){return;} o.find("li").each(function(){var th=$(this);if(th.data("jstree")){$.each(th.data("jstree"),function(plugin,values){if(t.data[plugin]&&$.isFunction(t["_"+plugin+"_notify"])){t["_"+plugin+"_notify"].call(t,th,values);}});}});},this));} @@ -45,7 +45,7 @@ if(!o.length){return;} o.find("li.jstree-open:not(:has(ul))").each(function(){t.load_node(this,$.noop,$.noop);});},this));} this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes();});},destroy:function(){var i,n=this.get_index(),s=this._get_settings(),_this=this;$.each(s.plugins,function(i,val){try{plugins[val].__destroy.apply(_this);}catch(err){}});this.__callback();if(this.is_focused()){for(i in instances){if(instances.hasOwnProperty(i)&&i!=n){instances[i].set_focus();break;}}} if(n===focused_instance){focused_instance=-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,'');});$(document).unbind(".jstree-"+n).undelegate(".jstree-"+n);instances[n]=null;delete instances[n];},_core_notify:function(n,data){if(data.opened){this.open_node(n,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 _this=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){_this.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"));}});this.__callback(_this.data.core.to_open);},save_loaded:function(){},reload_nodes:function(is_callback){var _this=this,done=true,current=[],remaining=[];if(!is_callback){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=$.map($.makeArray(this.data.core.to_open),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:");});this.data.core.to_load=$.map($.makeArray(this.data.core.to_load),function(n){return"#"+n.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);}} +this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,'');});$(document).unbind(".jstree-"+n).undelegate(".jstree-"+n);instances[n]=null;delete instances[n];},_core_notify:function(n,data){if(data.opened){this.open_node(n,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 _this=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){_this.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"));}});this.__callback(_this.data.core.to_open);},save_loaded:function(){},reload_nodes:function(is_callback){var _this=this,done=true,current=[],remaining=[];if(!is_callback){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=$.map($.makeArray(this.data.core.to_open),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:");});this.data.core.to_load=$.map($.makeArray(this.data.core.to_load),function(n){return"#"+n.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){$.each(this.data.core.to_load,function(i,val){if(val=="#"){return true;} if($(val).length){current.push(val);} else{remaining.push(val);}});if(current.length){this.data.core.to_load=remaining;$.each(current,function(i,val){if(!_this._is_loaded(val)){_this.load_node(val,function(){_this.reload_nodes(true);},function(){_this.reload_nodes(true);});done=false;}});}} @@ -107,7 +107,8 @@ if(typeof m=="string"){tmp.attr('href','#')[s.html_titles?"html":"text"](m);} else{if(!m.attr){m.attr={};} if(!m.attr.href){m.attr.href='#';} tmp.attr(m.attr)[s.html_titles?"html":"text"](m.title);if(m.language){tmp.addClass(m.language);}} -tmp.prepend("<ins class='jstree-icon'> </ins>");if(m.icon){if(m.icon.indexOf("/")===-1){tmp.children("ins").addClass(m.icon);} +tmp.prepend("<ins class='jstree-icon'> </ins>");if(!m.icon&&js.icon){m.icon=js.icon;} +if(m.icon){if(m.icon.indexOf("/")===-1){tmp.children("ins").addClass(m.icon);} else{tmp.children("ins").css("background","url('"+m.icon+"') center center no-repeat");}} d.append(tmp);});d.prepend("<ins class='jstree-icon'> </ins>");if(obj===-1){obj=this.get_container();if(position==="before"){position="first";} if(position==="after"){position="last";}} @@ -217,34 +218,34 @@ else{this.hover_node(this._get_next(o));}} return false;},"space":function(){if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").click();} return false;},"ctrl+space":function(event){event.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(event);} return false;},"shift+space":function(event){event.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(event);} -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($){$.jstree.plugin("json_data",{__init:function(){var s=this._get_settings().json_data;if(s.progressive_unload){this.get_container().bind("after_close.jstree",function(e,data){data.rslt.obj.children("ul").remove();});}},defaults:{data:false,ajax:false,correct_state:true,progressive_render:false,progressive_unload:false},_fn:{load_node:function(obj,s_call,e_call){var _this=this;this.load_node_json(obj,function(){_this.__callback({"obj":_this._get_node(obj)});s_call.call(this);},e_call);},_is_loaded:function(obj){var s=this._get_settings().json_data;obj=this._get_node(obj);return obj==-1||!obj||(!s.ajax&&!s.progressive_render&&!$.isFunction(s.data))||obj.is(".jstree-open, .jstree-leaf")||obj.children("ul").children("li").length>0;},refresh:function(obj){obj=this._get_node(obj);var s=this._get_settings().json_data;if(obj&&obj!==-1&&s.progressive_unload&&($.isFunction(s.data)||!!s.ajax)){obj.removeData("jstree-children");} -return this.__call_old();},load_node_json:function(obj,s_call,e_call){var s=this.get_settings().json_data,d,error_func=function(){},success_func=function(){};obj=this._get_node(obj);if(obj&&obj!==-1&&(s.progressive_render||s.progressive_unload)&&!obj.is(".jstree-open, .jstree-leaf")&&obj.children("ul").children("li").length===0&&obj.data("jstree-children")){d=this._parse_json(obj.data("jstree-children"),obj);if(d){obj.append(d);if(!s.progressive_unload){obj.removeData("jstree-children");}} +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($){$.jstree.plugin("json_data",{__init:function(){var s=this._get_settings().json_data;if(s.progressive_unload){this.get_container().bind("after_close.jstree",function(e,data){data.rslt.obj.children("ul").remove();});}},defaults:{data:false,ajax:false,correct_state:true,progressive_render:false,progressive_unload:false},_fn:{load_node:function(obj,s_call,e_call){var _this=this;this.load_node_json(obj,function(){_this.__callback({"obj":_this._get_node(obj)});s_call.call(this);},e_call);},_is_loaded:function(obj){var s=this._get_settings().json_data;obj=this._get_node(obj);return obj==-1||!obj||(!s.ajax&&!s.progressive_render&&!$.isFunction(s.data))||obj.is(".jstree-open, .jstree-leaf")||obj.children("ul").children("li").length>0;},refresh:function(obj){obj=this._get_node(obj);var s=this._get_settings().json_data;if(obj&&obj!==-1&&s.progressive_unload&&($.isFunction(s.data)||!!s.ajax)){obj.removeData("jstree_children");} +return this.__call_old();},load_node_json:function(obj,s_call,e_call){var s=this.get_settings().json_data,d,error_func=function(){},success_func=function(){};obj=this._get_node(obj);if(obj&&obj!==-1&&(s.progressive_render||s.progressive_unload)&&!obj.is(".jstree-open, .jstree-leaf")&&obj.children("ul").children("li").length===0&&obj.data("jstree_children")){d=this._parse_json(obj.data("jstree_children"),obj);if(d){obj.append(d);if(!s.progressive_unload){obj.removeData("jstree_children");}} this.clean_node(obj);if(s_call){s_call.call(this);} return;} -if(obj&&obj!==-1){if(obj.data("jstree-is-loading")){return;} -else{obj.data("jstree-is-loading",true);}} +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($.isFunction(s.data)):s.data.call(this,obj,$.proxy(function(d){d=this._parse_json(d,obj);if(!d){if(obj===-1||!obj){if(s.correct_state){this.get_container().children("ul").empty();}} -else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(s.correct_state){this.correct_state(obj);}} +else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(s.correct_state){this.correct_state(obj);}} if(e_call){e_call.call(this);}} else{if(obj===-1||!obj){this.get_container().children("ul").empty().append(d.children());} -else{obj.append(d).children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");} +else{obj.append(d).children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");} this.clean_node(obj);if(s_call){s_call.call(this);}}},this));break;case(!!s.data&&!s.ajax)||(!!s.data&&!!s.ajax&&(!obj||obj===-1)):if(!obj||obj==-1){d=this._parse_json(s.data,obj);if(d){this.get_container().children("ul").empty().append(d.children());this.clean_node();} else{if(s.correct_state){this.get_container().children("ul").empty();}}} if(s_call){s_call.call(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().json_data.ajax.error;if(ef){ef.call(this,x,t,e);} -if(obj!=-1&&obj.length){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(t==="success"&&s.correct_state){this.correct_state(obj);}} +if(obj!=-1&&obj.length){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(t==="success"&&s.correct_state){this.correct_state(obj);}} 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().json_data.ajax.success;if(sf){d=sf.call(this,d,t,x)||d;} if(d===""||(d&&d.toString&&d.toString().replace(/^[\s\n]+$/,"")==="")||(!$.isArray(d)&&!$.isPlainObject(d))){return error_func.call(this,x,t,"");} d=this._parse_json(d,obj);if(d){if(obj===-1||!obj){this.get_container().children("ul").empty().append(d.children());} -else{obj.append(d).children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");} +else{obj.append(d).children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");} this.clean_node(obj);if(s_call){s_call.call(this);}} else{if(obj===-1||!obj){if(s.correct_state){this.get_container().children("ul").empty();if(s_call){s_call.call(this);}}} -else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(s.correct_state){this.correct_state(obj);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="json";} +else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(s.correct_state){this.correct_state(obj);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="json";} 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_json:function(js,obj,is_callback){var d=false,p=this._get_settings(),s=p.json_data,t=p.core.html_titles,tmp,i,j,ul1,ul2;if(!js){return d;} -if(s.progressive_unload&&obj&&obj!==-1){obj.data("jstree-children",d);} +if(s.progressive_unload&&obj&&obj!==-1){obj.data("jstree_children",d);} if($.isArray(js)){d=$();if(!js.length){return false;} for(i=0,j=js.length;i<j;i++){tmp=this._parse_json(js[i],obj,true);if(tmp.length){d=d.add(tmp);}}} else{if(typeof js=="string"){js={data:js};} @@ -261,8 +262,8 @@ tmp.attr(m.attr)[t?"html":"text"](m.title);if(m.language){tmp.addClass(m.languag tmp.prepend("<ins class='jstree-icon'> </ins>");if(!m.icon&&js.icon){m.icon=js.icon;} if(m.icon){if(m.icon.indexOf("/")===-1){tmp.children("ins").addClass(m.icon);} else{tmp.children("ins").css("background","url('"+m.icon+"') center center no-repeat");}} -d.append(tmp);});d.prepend("<ins class='jstree-icon'> </ins>");if(js.children){if(s.progressive_render&&js.state!=="open"){d.addClass("jstree-closed").data("jstree-children",js.children);} -else{if(s.progressive_unload){d.data("jstree-children",js.children);} +d.append(tmp);});d.prepend("<ins class='jstree-icon'> </ins>");if(js.children){if(s.progressive_render&&js.state!=="open"){d.addClass("jstree-closed").data("jstree_children",js.children);} +else{if(s.progressive_unload){d.data("jstree_children",js.children);} if($.isArray(js.children)&&js.children.length){tmp=this._parse_json(js.children,obj,true);if(tmp.length){ul2=$("<ul />");ul2.append(tmp);d.append(ul2);}}}}} if(!is_callback){ul1=$("<ul />");ul1.append(d);d=ul1;} return d;},get_json:function(obj,li_attr,a_attr,is_callback){var result=[],s=this._get_settings(),_this=this,tmp1,tmp2,li,a,t,lang;obj=this._get_node(obj);if(!obj||obj===-1){obj=this.get_container().find("> ul > li");} @@ -399,58 +400,56 @@ else{this.check_node(e.target);} if(this.data.ui&&this.data.checkbox.noui){this.save_selected();if(this.data.cookies){this.save_cookie("select_node");}} else{e.stopImmediatePropagation();return false;}},this));},defaults:{override_ui:false,two_state:false,real_checkboxes:false,checked_parent_open:true,real_checkboxes_names:function(n){return[("check_"+(n[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(n,data){if(data.checked){this.check_node(n,false);}},_prepare_checkboxes:function(obj){obj=!obj||obj==-1?this.get_container().find("> ul > li"):this._get_node(obj);if(obj===false){return;} var c,_this=this,t,ts=this._get_settings().checkbox.two_state,rc=this._get_settings().checkbox.real_checkboxes,rcn=this._get_settings().checkbox.real_checkboxes_names;obj.each(function(){t=$(this);c=t.is("li")&&(t.hasClass("jstree-checked")||(rc&&t.children(":checked").length))?"jstree-checked":"jstree-unchecked";t.find("li").andSelf().each(function(){var $t=$(this),nm;$t.children("a"+(_this.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(ts?"jstree-unchecked":c);if(rc){if(!$t.children(":checkbox").length){nm=rcn.call(_this,$t);$t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+nm[0]+"' name='"+nm[0]+"' value='"+nm[1]+"' />");} -else{$t.children(":checkbox").addClass("jstree-real-checkbox");} -if(c==="jstree-checked"){$t.children(":checkbox").attr("checked","checked");}} -if(c==="jstree-checked"&&!ts){$t.find("li").addClass("jstree-checked");}});});if(!ts){if(obj.length===1&&obj.is("li")){this._repair_state(obj);} -if(obj.is("li")){obj.each(function(){_this._repair_state(this);});} -else{obj.find("> ul > li").each(function(){_this._repair_state(this);});} -obj.find(".jstree-checked").parent().parent().each(function(){_this._repair_state(this);});}},change_state:function(obj,state){obj=this._get_node(obj);var coll=false,rc=this._get_settings().checkbox.real_checkboxes;if(!obj||obj===-1){return false;} -state=(state===false||state===true)?state:obj.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state){if(state){obj.removeClass("jstree-checked").addClass("jstree-unchecked");if(rc){obj.children(":checkbox").removeAttr("checked");}} -else{obj.removeClass("jstree-unchecked").addClass("jstree-checked");if(rc){obj.children(":checkbox").attr("checked","checked");}}} +else{$t.children(":checkbox").addClass("jstree-real-checkbox");}} +if(!ts){if(c==="jstree-checked"||$t.hasClass("jstree-checked")||$t.children(':checked').length){$t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked",true);}} +else{if($t.hasClass("jstree-checked")||$t.children(':checked').length){$t.addClass("jstree-checked").children(":checkbox").prop("checked",true);}}});});if(!ts){obj.find(".jstree-checked").parent().parent().each(function(){_this._repair_state(this);});}},change_state:function(obj,state){obj=this._get_node(obj);var coll=false,rc=this._get_settings().checkbox.real_checkboxes;if(!obj||obj===-1){return false;} +state=(state===false||state===true)?state:obj.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state){if(state){obj.removeClass("jstree-checked").addClass("jstree-unchecked");if(rc){obj.children(":checkbox").prop("checked",false);}} +else{obj.removeClass("jstree-unchecked").addClass("jstree-checked");if(rc){obj.children(":checkbox").prop("checked",true);}}} else{if(state){coll=obj.find("li").andSelf();if(!coll.filter(".jstree-checked, .jstree-undetermined").length){return false;} -coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(rc){coll.children(":checkbox").removeAttr("checked");}} +coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(rc){coll.children(":checkbox").prop("checked",false);}} else{coll=obj.find("li").andSelf();if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length){return false;} -coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(rc){coll.children(":checkbox").attr("checked","checked");} +coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(rc){coll.children(":checkbox").prop("checked",true);} 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("li.jstree-checked, li.jstree-undetermined").length){$this.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(rc){$this.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked");} +obj.parentsUntil(".jstree","li").each(function(){var $this=$(this);if(state){if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length){$this.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(rc){$this.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false);} return false;} -else{$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(rc){$this.children(":checkbox").removeAttr("checked");}}} -else{if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length){$this.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(rc){$this.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked");} +else{$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(rc){$this.children(":checkbox").prop("checked",false);}}} +else{if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length){$this.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(rc){$this.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false);} return false;} -else{$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(rc){$this.children(":checkbox").attr("checked","checked");}}}});} +else{$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(rc){$this.children(":checkbox").prop("checked",true);}}}});} if(this.data.ui&&this.data.checkbox.noui){this.data.ui.selected=this.get_checked();} this.__callback(obj);return true;},check_node:function(obj){if(this.change_state(obj,false)){obj=this._get_node(obj);if(this._get_settings().checkbox.checked_parent_open){var t=this;obj.parents(".jstree-closed").each(function(){t.open_node(this,false,true);});} this.__callback({"obj":obj});}},uncheck_node:function(obj){if(this.change_state(obj,true)){this.__callback({"obj":this._get_node(obj)});}},check_all:function(){var _this=this,coll=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");coll.each(function(){_this.change_state(this,false);});this.__callback();},uncheck_all:function(){var _this=this,coll=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");coll.each(function(){_this.change_state(this,true);});this.__callback();},is_checked:function(obj){obj=this._get_node(obj);return obj.length?obj.is(".jstree-checked"):false;},get_checked:function(obj,get_all){obj=!obj||obj===-1?this.get_container():this._get_node(obj);return get_all||this._get_settings().checkbox.two_state?obj.find(".jstree-checked"):obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");},get_unchecked:function(obj,get_all){obj=!obj||obj===-1?this.get_container():this._get_node(obj);return get_all||this._get_settings().checkbox.two_state?obj.find(".jstree-unchecked"):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;} +if(this._get_settings().checkbox.two_state){obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked',true);return;} var rc=this._get_settings().checkbox.real_checkboxes,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.change_state(obj,false);}} else if(a===0&&b===0){this.change_state(obj,true);} else if(a===c){this.change_state(obj,false);} -else{obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(rc){obj.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked");}}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var _this=this,s=this.data.ui.to_select;s=$.map($.makeArray(s),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:");});this.deselect_all();$.each(s,function(i,val){_this.check_node(val);});this.__callback();} +else{obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(rc){obj.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false);}}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var _this=this,s=this.data.ui.to_select;s=$.map($.makeArray(s),function(n){return"#"+n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:");});this.deselect_all();$.each(s,function(i,val){_this.check_node(val);});this.__callback();} else{this.__call_old();}},save_loaded:function(){var _this=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){if(this.id){_this.data.core.to_load.push("#"+this.id);}});}}});$(function(){var css_string='.jstree .jstree-real-checkbox { display:none; } ';$.vakata.css.add_sheet({str:css_string,title:"jstree"});});})(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(){$(xm).remove();$(xs).remove();};})(xm,xs),200);};})(xm,xs,callback),100);return true;} if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor==="undefined"){xml=new DOMParser().parseFromString(xml,"text/xml");xsl=new DOMParser().parseFromString(xsl,"text/xml");} 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,new XMLSerializer().serializeToString(rs));return true;} else{processor.importStylesheet(xsl);rs=processor.transformToFragment(xml,document);callback.call(null,$("<div />").append(rs).html());return true;}} -return false;};var xsl={'nest':'<'+'?xml version="1.0" encoding="utf-8" ?>'+'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'+'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />'+'<xsl:template match="/">'+' <xsl:call-template name="nodes">'+' <xsl:with-param name="node" select="/root" />'+' </xsl:call-template>'+'</xsl:template>'+'<xsl:template name="nodes">'+' <xsl:param name="node" />'+' <ul>'+' <xsl:for-each select="$node/item">'+' <xsl:variable name="children" select="count(./item) > 0" />'+' <li>'+' <xsl:attribute name="class">'+' <xsl:if test="position() = last()">jstree-last </xsl:if>'+' <xsl:choose>'+' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>'+' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>'+' <xsl:otherwise>jstree-leaf </xsl:otherwise>'+' </xsl:choose>'+' <xsl:value-of select="@class" />'+' </xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>'+' <xsl:for-each select="content/name">'+' <a>'+' <xsl:attribute name="href">'+' <xsl:choose>'+' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>'+' <xsl:otherwise>#</xsl:otherwise>'+' </xsl:choose>'+' </xsl:attribute>'+' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>'+' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins>'+' <xsl:attribute name="class">jstree-icon '+' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>'+' </xsl:attribute>'+' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>'+' <xsl:text> </xsl:text>'+' </ins>'+' <xsl:copy-of select="./child::node()" />'+' </a>'+' </xsl:for-each>'+' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>'+' </li>'+' </xsl:for-each>'+' </ul>'+'</xsl:template>'+'</xsl:stylesheet>','flat':'<'+'?xml version="1.0" encoding="utf-8" ?>'+'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'+'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />'+'<xsl:template match="/">'+' <ul>'+' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">'+' <xsl:call-template name="nodes">'+' <xsl:with-param name="node" select="." />'+' <xsl:with-param name="is_last" select="number(position() = last())" />'+' </xsl:call-template>'+' </xsl:for-each>'+' </ul>'+'</xsl:template>'+'<xsl:template name="nodes">'+' <xsl:param name="node" />'+' <xsl:param name="is_last" />'+' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />'+' <li>'+' <xsl:attribute name="class">'+' <xsl:if test="$is_last = true()">jstree-last </xsl:if>'+' <xsl:choose>'+' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>'+' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>'+' <xsl:otherwise>jstree-leaf </xsl:otherwise>'+' </xsl:choose>'+' <xsl:value-of select="@class" />'+' </xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>'+' <xsl:for-each select="content/name">'+' <a>'+' <xsl:attribute name="href">'+' <xsl:choose>'+' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>'+' <xsl:otherwise>#</xsl:otherwise>'+' </xsl:choose>'+' </xsl:attribute>'+' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>'+' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins>'+' <xsl:attribute name="class">jstree-icon '+' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>'+' </xsl:attribute>'+' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>'+' <xsl:text> </xsl:text>'+' </ins>'+' <xsl:copy-of select="./child::node()" />'+' </a>'+' </xsl:for-each>'+' <xsl:if test="$children">'+' <ul>'+' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">'+' <xsl:call-template name="nodes">'+' <xsl:with-param name="node" select="." />'+' <xsl:with-param name="is_last" select="number(position() = last())" />'+' </xsl:call-template>'+' </xsl:for-each>'+' </ul>'+' </xsl:if>'+' </li>'+'</xsl:template>'+'</xsl:stylesheet>'},escape_xml=function(string){return string.toString().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');};$.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(obj,s_call,e_call){var _this=this;this.load_node_xml(obj,function(){_this.__callback({"obj":_this._get_node(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&&!$.isFunction(s.data))||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);}} +return false;};var xsl={'nest':'<'+'?xml version="1.0" encoding="utf-8" ?>'+'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'+'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />'+'<xsl:template match="/">'+' <xsl:call-template name="nodes">'+' <xsl:with-param name="node" select="/root" />'+' </xsl:call-template>'+'</xsl:template>'+'<xsl:template name="nodes">'+' <xsl:param name="node" />'+' <ul>'+' <xsl:for-each select="$node/item">'+' <xsl:variable name="children" select="count(./item) > 0" />'+' <li>'+' <xsl:attribute name="class">'+' <xsl:if test="position() = last()">jstree-last </xsl:if>'+' <xsl:choose>'+' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>'+' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>'+' <xsl:otherwise>jstree-leaf </xsl:otherwise>'+' </xsl:choose>'+' <xsl:value-of select="@class" />'+' </xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>'+' <xsl:for-each select="content/name">'+' <a>'+' <xsl:attribute name="href">'+' <xsl:choose>'+' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>'+' <xsl:otherwise>#</xsl:otherwise>'+' </xsl:choose>'+' </xsl:attribute>'+' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>'+' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins>'+' <xsl:attribute name="class">jstree-icon '+' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>'+' </xsl:attribute>'+' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>'+' <xsl:text> </xsl:text>'+' </ins>'+' <xsl:copy-of select="./child::node()" />'+' </a>'+' </xsl:for-each>'+' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>'+' </li>'+' </xsl:for-each>'+' </ul>'+'</xsl:template>'+'</xsl:stylesheet>','flat':'<'+'?xml version="1.0" encoding="utf-8" ?>'+'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'+'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />'+'<xsl:template match="/">'+' <ul>'+' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">'+' <xsl:call-template name="nodes">'+' <xsl:with-param name="node" select="." />'+' <xsl:with-param name="is_last" select="number(position() = last())" />'+' </xsl:call-template>'+' </xsl:for-each>'+' </ul>'+'</xsl:template>'+'<xsl:template name="nodes">'+' <xsl:param name="node" />'+' <xsl:param name="is_last" />'+' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />'+' <li>'+' <xsl:attribute name="class">'+' <xsl:if test="$is_last = true()">jstree-last </xsl:if>'+' <xsl:choose>'+' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>'+' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>'+' <xsl:otherwise>jstree-leaf </xsl:otherwise>'+' </xsl:choose>'+' <xsl:value-of select="@class" />'+' </xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>'+' <xsl:for-each select="content/name">'+' <a>'+' <xsl:attribute name="href">'+' <xsl:choose>'+' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>'+' <xsl:otherwise>#</xsl:otherwise>'+' </xsl:choose>'+' </xsl:attribute>'+' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>'+' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>'+' <xsl:for-each select="@*">'+' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">'+' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'+' </xsl:if>'+' </xsl:for-each>'+' <ins>'+' <xsl:attribute name="class">jstree-icon '+' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>'+' </xsl:attribute>'+' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>'+' <xsl:text> </xsl:text>'+' </ins>'+' <xsl:copy-of select="./child::node()" />'+' </a>'+' </xsl:for-each>'+' <xsl:if test="$children">'+' <ul>'+' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">'+' <xsl:call-template name="nodes">'+' <xsl:with-param name="node" select="." />'+' <xsl:with-param name="is_last" select="number(position() = last())" />'+' </xsl:call-template>'+' </xsl:for-each>'+' </ul>'+' </xsl:if>'+' </li>'+'</xsl:template>'+'</xsl:stylesheet>'},escape_xml=function(string){return string.toString().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');};$.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(obj,s_call,e_call){var _this=this;this.load_node_xml(obj,function(){_this.__callback({"obj":_this._get_node(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&&!$.isFunction(s.data))||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($.isFunction(s.data)):s.data.call(this,obj,$.proxy(function(d){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("a.jstree-loading").removeClass("jstree-loading");obj.append(d);obj.removeData("jstree-is-loading");} +else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.append(d);obj.removeData("jstree_is_loading");} if(s.clean_node){this.clean_node(obj);} if(s_call){s_call.call(this);}} -else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(s.correct_state){this.correct_state(obj);if(s_call){s_call.call(this);}}} +else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(s.correct_state){this.correct_state(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));},this));break;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("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(t==="success"&&s.correct_state){this.correct_state(obj);}} +if(obj!==-1&&obj.length){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(t==="success"&&s.correct_state){this.correct_state(obj);}} 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===""||(d&&d.toString&&d.toString().replace(/^[\s\n]+$/,"")==="")){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("a.jstree-loading").removeClass("jstree-loading");obj.append(d);obj.removeData("jstree-is-loading");} +else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.append(d);obj.removeData("jstree_is_loading");} if(s.clean_node){this.clean_node(obj);} if(s_call){s_call.call(this);}} -else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(s.correct_state){this.correct_state(obj);if(s_call){s_call.call(this);}}} +else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(s.correct_state){this.correct_state(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));};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);} @@ -539,28 +538,28 @@ 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().find("> ul > li").length:p.find("> 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":_this._get_node(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&&!$.isFunction(this._get_settings().html_data.data))||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);}} +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":_this._get_node(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&&!$.isFunction(this._get_settings().html_data.data))||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($.isFunction(s.data)):s.data.call(this,obj,$.proxy(function(d){if(d&&d!==""&&d.toString&&d.toString().replace(/^[\s\n]+$/,"")!==""){d=$(d);if(!d.is("ul")){d=$("<ul />").append(d);} if(obj==-1||!obj){this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");} -else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.append(d).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");obj.removeData("jstree-is-loading");} +else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.append(d).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");obj.removeData("jstree_is_loading");} this.clean_node(obj);if(s_call){s_call.call(this);}} -else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(s.correct_state){this.correct_state(obj);if(s_call){s_call.call(this);}}} +else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(s.correct_state){this.correct_state(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):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||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").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=$("<ul />").append(d);} this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").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("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(t==="success"&&s.correct_state){this.correct_state(obj);}} +if(obj!=-1&&obj.length){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(t==="success"&&s.correct_state){this.correct_state(obj);}} 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===""||(d&&d.toString&&d.toString().replace(/^[\s\n]+$/,"")==="")){return error_func.call(this,x,t,"");} if(d){d=$(d);if(!d.is("ul")){d=$("<ul />").append(d);} if(obj==-1||!obj){this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");} -else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.append(d).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");obj.removeData("jstree-is-loading");} +else{obj.children("a.jstree-loading").removeClass("jstree-loading");obj.append(d).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS";}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");obj.removeData("jstree_is_loading");} this.clean_node(obj);if(s_call){s_call.call(this);}} -else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree-is-loading");if(s.correct_state){this.correct_state(obj);if(s_call){s_call.call(this);}}} +else{if(obj&&obj!==-1){obj.children("a.jstree-loading").removeClass("jstree-loading");obj.removeData("jstree_is_loading");if(s.correct_state){this.correct_state(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);}}}}};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);}