extranet/public/libs/jstree/jstree.min.js
2012-11-19 12:00:06 +00:00

4 lines
91 KiB
JavaScript

/*! jstree - v1.0.0 - 2012-10-01
* http://jstree.com
* Copyright (c) 2012 Ivan Bozhanov; Licensed MIT, GPL */
(function(e){e.vakata={}})(jQuery),function(e){e.fn.vakata_reverse=[].reverse}(jQuery),function(e){jQuery.expr[":"].vakata_icontains=function(e,t,n){return(e.textContent||e.innerText||"").toLowerCase().indexOf(n[3].toLowerCase())>=0}}(jQuery),function(e){e.vakata.array_remove=function(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,r),e}}(jQuery),function(e){e.vakata.array_unique=function(e){var t=[],n,r,i;for(n=0,i=e.length;n<i;n++){for(r=0;r<=n;r++)if(e[n]===e[r])break;r===n&&t.push(e[n])}return t}}(jQuery),function(e){e.vakata.attributes=function(t,n){t=e(t)[0];var r=n?{}:[];return e.each(t.attributes,function(t,i){if(e.inArray(i.nodeName.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])!==-1)return;i.nodeValue!==null&&e.trim(i.nodeValue)!==""&&(n?r[i.nodeName]=i.nodeValue:r.push(i.nodeName))}),r}}(jQuery),function(e){var t;e.vakata.get_scrollbar_width=function(){var n,r;return t||(/msie/.test(navigator.userAgent.toLowerCase())?(n=e('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),r=e('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),t=n.width()-r.width(),n.add(r).remove()):(n=e("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200}),t=100-n.width(),n.parent().remove())),t}}(jQuery),function(e){e.vakata.css={get_css:function(e,t,n){e=e.toLowerCase();var r=n.cssRules||n.rules,i=0;do{if(r.length&&i>r.length+5)return!1;if(r[i].selectorText&&r[i].selectorText.toLowerCase()===e)return t===!0?(n.removeRule&&n.removeRule(i),n.deleteRule&&n.deleteRule(i),!0):r[i]}while(r[++i]);return!1},add_css:function(t,n){return e.jstree.css.get_css(t,!1,n)?!1:(n.insertRule?n.insertRule(t+" { }",0):n.addRule(t,null,0),e.vakata.css.get_css(t))},remove_css:function(t,n){return e.vakata.css.get_css(t,!0,n)},add_sheet:function(t){var n=!1,r=!0;if(t.str)return t.title&&(n=e("style[id='"+t.title+"-stylesheet']")[0]),n?r=!1:(n=document.createElement("style"),n.setAttribute("type","text/css"),t.title&&n.setAttribute("id",t.title+"-stylesheet")),n.styleSheet?r?(document.getElementsByTagName("head")[0].appendChild(n),n.styleSheet.cssText=t.str):n.styleSheet.cssText=n.styleSheet.cssText+" "+t.str:(n.appendChild(document.createTextNode(t.str)),document.getElementsByTagName("head")[0].appendChild(n)),n.sheet||n.styleSheet;if(t.url){if(!document.createStyleSheet)return n=document.createElement("link"),n.rel="stylesheet",n.type="text/css",n.media="all",n.href=t.url,document.getElementsByTagName("head")[0].appendChild(n),n.styleSheet;try{n=document.createStyleSheet(t.url)}catch(i){}}}}}(jQuery),function(e){var t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1};e.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5},_trigger:function(t,n){var r=e.vakata.dnd._get();r.event=n,e(document).triggerHandler("dnd_"+t+".vakata",r)},_get:function(){return{data:t.data,element:t.element,helper:t.helper}},_clean:function(){t.helper&&t.helper.remove(),t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),t={element:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1},e(document).unbind("mousemove",e.vakata.dnd.drag),e(document).unbind("mouseup",e.vakata.dnd.stop)},_scroll:function(n){if(!t.scroll_e||!t.scroll_l&&!t.scroll_t)return t.scroll_i&&(clearInterval(t.scroll_i),t.scroll_i=!1),!1;if(!t.scroll_i)return t.scroll_i=setInterval(e.vakata.dnd._scroll,100),!1;if(n===!0)return!1;var r=t.scroll_e.scrollTop(),i=t.scroll_e.scrollLeft();t.scroll_e.scrollTop(r+t.scroll_t*e.vakata.dnd.settings.scroll_speed),t.scroll_e.scrollLeft(i+t.scroll_l*e.vakata.dnd.settings.scroll_speed),(r!==t.scroll_e.scrollTop()||i!==t.scroll_e.scrollLeft())&&e.vakata.dnd._trigger("scroll",t.scroll_e)},start:function(n,r,i){t.is_drag&&e.vakata.dnd.stop({});try{n.currentTarget.unselectable="on",n.currentTarget.onselectstart=function(){return!1},n.currentTarget.style&&(n.currentTarget.style.MozUserSelect="none")}catch(s){}return t.init_x=n.pageX,t.init_y=n.pageY,t.data=r,t.is_down=!0,t.element=n.currentTarget,i!==!1&&(t.helper=e("<div id='vakata-dnd'></div>").html(i).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(document).bind("mousemove",e.vakata.dnd.drag),e(document).bind("mouseup",e.vakata.dnd.stop),!1},drag:function(n){if(!t.is_down)return;if(!t.is_drag){if(!(Math.abs(n.pageX-t.init_x)>e.vakata.dnd.settings.threshold||Math.abs(n.pageY-t.init_y)>e.vakata.dnd.settings.threshold))return;t.helper&&(t.helper.appendTo("body"),t.helper_w=t.helper.outerWidth()),t.is_drag=!0,e.vakata.dnd._trigger("start",n)}var r=!1,i=!1,s=!1,o=!1,u=!1,a=!1,f=!1,l=!1,c=!1,h=!1;t.scroll_t=0,t.scroll_l=0,t.scroll_e=!1;var p=e(n.target).parentsUntil("body").andSelf().vakata_reverse().filter(function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var r=e(this),i=r.offset();this.scrollHeight>this.offsetHeight&&(i.top+r.height()-n.pageY<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=1),n.pageY-i.top<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(i.left+r.width()-n.pageX<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=1),n.pageX-i.left<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=-1));if(t.scroll_t||t.scroll_l)return t.scroll_e=e(this),!1});if(!t.scroll_e){r=e(document),i=e(window),s=r.height(),o=i.height(),u=r.width(),a=i.width(),f=r.scrollTop(),l=r.scrollLeft(),s>o&&n.pageY-f<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=-1),s>o&&o-(n.pageY-f)<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_t=1),u>a&&n.pageX-l<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=-1),u>a&&a-(n.pageX-l)<e.vakata.dnd.settings.scroll_proximity&&(t.scroll_l=1);if(t.scroll_t||t.scroll_l)t.scroll_e=r}t.scroll_e&&e.vakata.dnd._scroll(!0),t.helper&&(c=parseInt(n.pageY+e.vakata.dnd.settings.helper_top,10),h=parseInt(n.pageX+e.vakata.dnd.settings.helper_left,10),s&&c+25>s&&(c=s-50),u&&h+t.helper_w>u&&(h=u-(t.helper_w+2)),t.helper.css({left:h+"px",top:c+"px"})),e.vakata.dnd._trigger("move",n)},stop:function(n){t.is_drag&&e.vakata.dnd._trigger("stop",n),e.vakata.dnd._clean()}}}(jQuery),function(e){e.vakata.xslt=function(t,n){var r=!1,i,s,o;if(r===!1&&window.ActiveXObject)try{r=new ActiveXObject("Msxml2.XSLTemplate"),s=new ActiveXObject("Msxml2.DOMDocument"),s.loadXML(t),o=new ActiveXObject("Msxml2.FreeThreadedDOMDocument"),o.loadXML(n),r.stylesheet=o,i=r.createProcessor(),i.input=s,i.transform(),r=i.output}catch(u){}return t=e.parseXML(t),n=e.parseXML(n),r===!1&&typeof XSLTProcessor!="undefined"&&(i=new XSLTProcessor,i.importStylesheet(n),r=i.transformToFragment(t,document),r=e("<div />").append(r).html()),r===!1&&typeof t.transformNode!="undefined"&&(r=t.transformNode(n)),r}}(jQuery),typeof jQuery.hotkeys=="undefined"&&function(e){function t(e){if(typeof e.data!="string")return;var t=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(!(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&e.target.type!=="text"))return;var r=e.type!=="keypress"&&jQuery.vakata_hotkeys.specialKeys[e.which],i=String.fromCharCode(e.which).toLowerCase(),s,o="",u={};e.altKey&&r!=="alt"&&(o+="alt+"),e.ctrlKey&&r!=="ctrl"&&(o+="ctrl+"),e.metaKey&&!e.ctrlKey&&r!=="meta"&&(o+="meta+"),e.shiftKey&&r!=="shift"&&(o+="shift+"),r?u[o+r]=!0:(u[o+i]=!0,u[o+jQuery.vakata_hotkeys.shiftNums[i]]=!0,o==="shift+"&&(u[jQuery.vakata_hotkeys.shiftNums[i]]=!0));for(var a=0,f=n.length;a<f;a++)if(u[n[a]])return t.apply(this,arguments)}}e.vakata_hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:t}})}(jQuery),function(e){var t=!1,n={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};e.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(t){e(document).triggerHandler("context_"+t+".vakata",{reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}})},_execute:function(e){return e=n.items[e],e&&!e._disabled&&e.action?e.action.call(null,{item:e,reference:n.reference,element:n.element,position:{x:n.position_x,y:n.position_y}}):!1},_parse:function(t,r){if(!t)return!1;r||(n.html="",n.items=[]);var i="",s=!1,o;return r&&(i+="<ul>"),e.each(t,function(t,r){if(!r)return!0;n.items.push(r),!s&&r.separator_before&&(i+="<li class='vakata-context-separator'><a href='#' "+(e.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;</a></li>"),s=!1,i+="<li class='"+(r._class||"")+(r._disabled?" vakata-contextmenu-disabled ":"")+"'>",i+="<a href='#' rel='"+(n.items.length-1)+"'>",e.vakata.context.settings.icons&&(i+="<ins ",r.icon&&(r.icon.indexOf("/")!==-1?i+=" style='background:url(\""+r.icon+"\") center center no-repeat' ":i+=" class='"+r.icon+"' "),i+=">&#160;</ins><span>&#160;</span>"),i+=r.label+"</a>",r.submenu&&(o=e.vakata.context._parse(r.submenu,!0),o&&(i+=o)),i+="</li>",r.separator_after&&(i+="<li class='vakata-context-separator'><a href='#' "+(e.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;</a></li>",s=!0)}),i=i.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),r&&(i+="</ul>"),r||(n.html=i,e.vakata.context._trigger("parse")),i.length>10?i:!1},_show_submenu:function(n){n=e(n);if(!n.length||!n.children("ul").length)return;var r=n.children("ul"),i=n.offset().left+n.outerWidth(),s=n.offset().top,o=r.width(),u=r.height(),a=e(window).width()+e(window).scrollLeft(),f=e(window).height()+e(window).scrollTop();t?n[i-(o+10+n.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):n[i+o+10>a?"addClass":"removeClass"]("vakata-context-right"),s+u+10>f&&r.css("bottom","-1px"),r.show()},show:function(r,i,s){n.element&&n.element.length&&n.element.width("");switch(!0){case!i&&!r:return!1;case!!i&&!!r:n.reference=r,n.position_x=i.x,n.position_y=i.y;break;case!i&&!!r:n.reference=r;var o=r.offset();n.position_x=o.left+r.outerHeight(),n.position_y=o.top;break;case!!i&&!r:n.position_x=i.x,n.position_y=i.y}!!r&&!s&&e(r).data("vakata_contextmenu")&&(s=e(r).data("vakata_contextmenu")),e.vakata.context._parse(s)&&n.element.html(n.html);if(n.items.length){var u=n.element,a=n.position_x,f=n.position_y,l=u.width(),c=u.height(),h=e(window).width()+e(window).scrollLeft(),p=e(window).height()+e(window).scrollTop();t&&(a-=u.outerWidth(),a<e(window).scrollLeft()+20&&(a=e(window).scrollLeft()+20)),a+l+20>h&&(a=h-(l+20)),f+c+20>p&&(f=p-(c+20)),n.element.css({left:a,top:f}).show().width(n.element.outerWidth()),n.is_visible=!0,e.vakata.context._trigger("show")}},hide:function(){n.is_visible&&(n.element.hide().find("ul").hide(),n.is_visible=!1,e.vakata.context._trigger("hide"))}},e(function(){t=e("body").css("direction")==="rtl";var r=!1,i='.vakata-context { display:none; _width:1px; } .vakata-context, .vakata-context ul { margin:0; padding:2px; position:absolute; background:#f5f5f5; border:1px solid #979797; -moz-box-shadow:5px 5px 4px -4px #666666; -webkit-box-shadow:2px 2px 2px #999999; box-shadow:2px 2px 2px #999999; }.vakata-context ul { list-style:none; left:100%; margin-top:-2.7em; margin-left:-4px; } .vakata-context li.vakata-context-right ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context li { list-style:none; display:inline; }.vakata-context li a { display:block; padding:0 2em 0 2em; text-decoration:none; width:auto; color:black; white-space:nowrap; line-height:2.4em; -moz-text-shadow:1px 1px 0px white; -webkit-text-shadow:1px 1px 0px white; text-shadow:1px 1px 0px white; -moz-border-radius:1px; -webkit-border-radius:1px; border-radius:1px; }.vakata-context li a:hover { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li.vakata-context-hover > a { position:relative; background-color:#e8eff7; -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }.vakata-context li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); background-position:right center; background-repeat:no-repeat; } .vakata-context li.vakata-context-separator a, .vakata-context li.vakata-context-separator a:hover { background:white; border:0; border-top:1px solid #e2e3e3; height:1px; min-height:1px; max-height:1px; padding:0; margin:0 0 0 2.4em; border-left:1px solid #e0e0e0; _overflow:hidden; -moz-text-shadow:0 0 0 transparent; -webkit-text-shadow:0 0 0 transparent; text-shadow:0 0 0 transparent; -moz-box-shadow:0 0 0 transparent; -webkit-box-shadow:0 0 0 transparent; box-shadow:0 0 0 transparent; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0; }.vakata-context li.vakata-contextmenu-disabled a, .vakata-context li.vakata-contextmenu-disabled a:hover { color:silver; background-color:transparent; border:0; box-shadow:0 0 0; }.vakata-context li a ins { text-decoration:none; display:inline-block; width:2.4em; height:2.4em; background:transparent; margin:0 0 0 -2em; } .vakata-context li a span { display:inline-block; width:1px; height:2.4em; background:white; margin:0 0.5em 0 0; border-left:1px solid #e2e3e3; _overflow:hidden; } .vakata-context-rtl ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } .vakata-context-rtl li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); background-position:left center; background-repeat:no-repeat; } .vakata-context-rtl li.vakata-context-separator a { margin:0 2.4em 0 0; border-left:0; border-right:1px solid #e2e3e3;} .vakata-context-rtl li.vakata-context-left ul { right:auto; left:100%; margin-left:-4px; margin-right:auto; } .vakata-context-rtl li a ins { margin:0 -2em 0 0; } .vakata-context-rtl li a span { margin:0 0 0 0.5em; border-left-color:white; background:#e2e3e3; } ';e.vakata.css.add_sheet({str:i,title:"vakata-context"}),n.element=e("<ul class='vakata-context'></ul>"),n.element.delegate("li","mouseenter",function(t){t.stopImmediatePropagation();if(e.contains(this,t.relatedTarget))return;r&&clearTimeout(r),n.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),e(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").andSelf().addClass("vakata-context-hover"),e.vakata.context._show_submenu(this)}).delegate("li","mouseleave",function(t){if(e.contains(this,t.relatedTarget))return;e(this).find(".vakata-context-hover").andSelf().removeClass("vakata-context-hover")}).bind("mouseleave",function(t){e(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),e.vakata.context.settings.hide_onmouseleave&&(r=setTimeout(function(t){return function(){e.vakata.context.hide()}}(this),e.vakata.context.settings.hide_onmouseleave))}).delegate("a","click",function(e){e.preventDefault()}).delegate("a","mouseup",function(t){!e(this).blur().parent().hasClass("vakata-context-disabled")&&e.vakata.context._execute(e(this).attr("rel"))!==!1&&e.vakata.context.hide()}).appendTo("body"),e(document).bind("mousedown",function(t){n.is_visible&&!e.contains(n.element[0],t.target)&&e.vakata.context.hide()}).bind("context_show.vakata",function(e,r){n.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),t&&n.element.addClass("vakata-context-rtl").css("direction","rtl"),n.element.find("ul").hide().end()}),(typeof e.hotkeys!="undefined"||typeof e.vakata_hotkeys!="undefined")&&e(document).bind("keydown","up",function(e){if(n.is_visible){var t=n.element.find("ul:visible").andSelf().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first();t.length||(t=n.element.find("ul:visible").andSelf().last().children("li:not(.vakata-context-separator)").last()),t.addClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault()}}).bind("keydown","down",function(e){if(n.is_visible){var t=n.element.find("ul:visible").andSelf().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first();t.length||(t=n.element.find("ul:visible").andSelf().last().children("li:not(.vakata-context-separator)").first()),t.addClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault()}}).bind("keydown","right",function(e){n.is_visible&&(n.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault())}).bind("keydown","left",function(e){n.is_visible&&(n.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover"),e.stopImmediatePropagation(),e.preventDefault())}).bind("keydown","esc",function(t){e.vakata.context.hide(),t.preventDefault()}).bind("keydown","space",function(e){n.element.find(".vakata-context-hover").last().children("a").click(),e.preventDefault()})})}(jQuery),function(e){var t=function(e){var t=/["\\\x00-\x1f\x7f-\x9f]/g,n={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return e.match(t)?'"'+e.replace(t,function(e){var t=n[e];return typeof t=="string"?t:(t=e.charCodeAt(),"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16))})+'"':'"'+e+'"'};e.vakata.json={encode:function(n){if(n===null)return"null";var r=[],i;switch(typeof n){case"undefined":return undefined;case"number":case"boolean":return n+"";case"string":return t(n);case"object":if(e.isFunction(n.toJSON))return e.vakata.json.encode(n.toJSON());if(n.constructor===Date)return'"'+n.getUTCFullYear()+"-"+String("0"+(n.getUTCMonth()+1)).slice(-2)+"-"+String("0"+n.getUTCDate()).slice(-2)+"T"+String("0"+n.getUTCHours()).slice(-2)+":"+String("0"+n.getUTCMinutes()).slice(-2)+":"+String("0"+n.getUTCSeconds()).slice(-2)+"."+String("00"+n.getUTCMilliseconds()).slice(-3)+'Z"';if(n.constructor===Array){for(i=0;i<n.length;i++)r.push(e.vakata.json.encode(n[i])||"null");return"["+r.join(",")+"]"}return e.each(n,function(n,i){if(e.isFunction(i))return!0;n=typeof n=="number"?'"'+n+'"':t(n),i=e.vakata.json.encode(i),r.push(n+":"+i)}),"{"+r.join(", ")+"}"}},decode:function(t){return e.parseJSON(t)}}}(jQuery),function(e){e.vakata.cookie=function(t,n,r){var i,s,o,u;if(arguments.length>1&&String(n)!=="[object Object]"){r=e.extend({},r);if(n===null||n===undefined)r.expires=-1;return typeof r.expires=="number"&&(i=r.expires,s=r.expires=new Date,s.setDate(s.getDate()+i)),n=String(n),document.cookie=[encodeURIComponent(t),"=",r.raw?n:encodeURIComponent(n),r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}return r=n||{},u=r.raw?function(e){return e}:decodeURIComponent,(o=(new RegExp("(?:^|; )"+encodeURIComponent(t)+"=([^;]*)")).exec(document.cookie))?u(o[1]):null}}(jQuery),function(e){function f(){var t=!1;if("localStorage"in window)try{window.localStorage.setItem("_tmptest","tmpval"),t=!0,window.localStorage.removeItem("_tmptest")}catch(i){}if(t)try{window.localStorage&&(n=window.localStorage,u="localStorage")}catch(s){}else if("globalStorage"in window)try{window.globalStorage&&(n=window.globalStorage[window.location.hostname],u="globalStorage")}catch(o){}else{r=document.createElement("link");if(r.addBehavior){r.style.behavior="url(#default#userData)",document.getElementsByTagName("head")[0].appendChild(r);try{r.load("jStorage");var a="{}";a=r.getAttribute("jStorage"),n.jStorage=a,u="userDataBehavior"}catch(f){}}!u&&(!!e.vakata.cookie("__vjstorage")||e.vakata.cookie("__vjstorage","{}",{expires:365})&&e.vakata.cookie("__vjstorage")==="{}")&&(r=null,n.jStorage=e.vakata.cookie("__vjstorage"),u="cookie");if(!u){r=null;return}}l(),p()}function l(){if(n.jStorage)try{t=o(String(n.jStorage))}catch(e){n.jStorage="{}"}else n.jStorage="{}";i=n.jStorage?String(n.jStorage).length:0}function c(){try{n.jStorage=s(t),u==="userDataBehavior"&&(r.setAttribute("jStorage",n.jStorage),r.save("jStorage")),u==="cookie"&&e.vakata.cookie("__vjstorage",n.jStorage,{expires:365}),i=n.jStorage?String(n.jStorage).length:0}catch(o){}}function h(e){if(!e||typeof e!="string"&&typeof e!="number")throw new TypeError("Key name must be string or numeric");if(e==="__jstorage_meta")throw new TypeError("Reserved key name");return!0}function p(){var e=+(new Date),n,r,i=Infinity,s=!1;a!==!1&&clearTimeout(a);if(!t.__jstorage_meta||typeof t.__jstorage_meta.TTL!="object")return;r=t.__jstorage_meta.TTL;for(n in r)r.hasOwnProperty(n)&&(r[n]<=e?(delete r[n],delete t[n],s=!0):r[n]<i&&(i=r[n]));i!==Infinity&&(a=setTimeout(p,i-e)),s&&c()}var t={},n={jStorage:"{}"},r=null,i=0,s=e.vakata.json.encode,o=e.vakata.json.decode,u=!1,a=!1;e.vakata.storage={version:"0.1.6.1",set:function(e,n){return h(e),t[e]=n,c(),n},get:function(e,n){return h(e),e in t?t[e]:typeof n=="undefined"?null:n},del:function(e){return h(e),e in t?(delete t[e],t.__jstorage_meta&&typeof t.__jstorage_meta.TTL=="object"&&e in t.__jstorage_meta.TTL&&delete t.__jstorage_meta.TTL[e],c(),!0):!1},setTTL:function(e,n){var r=+(new Date);return h(e),n=Number(n)||0,e in t?(t.__jstorage_meta||(t.__jstorage_meta={}),t.__jstorage_meta.TTL||(t.__jstorage_meta.TTL={}),n>0?t.__jstorage_meta.TTL[e]=r+n:delete t.__jstorage_meta.TTL[e],c(),p(),!0):!1},flush:function(){return t={},c(),!0},storageObj:function(){function e(){}return e.prototype=t,new e},index:function(){var n=[],r;return e.each(t,function(e,t){e!=="__jstorage_meta"&&n.push(e)}),n},storageSize:function(){return i},currentBackend:function(){return u},storageAvailable:function(){return!!u}},f()}(jQuery),function(e){e.vakata.pretty_date={lang:{ago:"Ago",from:"From Now",now:"Just Now",minute:"Minute",minutes:"Minutes",hour:"Hour",hours:"Hours",day:"Day",days:"Days",week:"Week",weeks:"Weeks",month:"Month",months:"Months",year:"Year",years:"Years"},parse:function(t,n){t=new Date(t.replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\+\d\d\:\d\d$/,"")),n=n||new Date;var r=e.vakata.pretty_date.lang,i=[[60,r.now],[3600,r.minute,r.minutes,60],[86400,r.hour,r.hours,3600],[604800,r.day,r.days,86400],[2628e3,r.week,r.weeks,604800],[31536e3,r.month,r.months,2628e3],[Infinity,r.year,r.years,31536e3]],s=(n-t+n.getTimezoneOffset()*6e4)/1e3,o=function(e,t){var n=.1;return e>=t&&e<=t*(1+n)?t:e},u;s<0?(s=Math.abs(s),u=" "+r.from):u=" "+r.ago;for(var a=0,f=i[0];i[a];f=i[++a])if(s<f[0]){if(a===0)return f[1];var l=Math.ceil(o(s,f[3])/f[3]);return l+" "+(l!==1?f[2]:f[1])+(a>0?u:"")}},init:function(t,n){e("time, [datetime]").vakata_pretty_date(n),setInterval(function(){e("time, [datetime]").vakata_pretty_date(n)},t||6e4)}},e.fn.vakata_pretty_date=function(t,n){return t||(t="%{s}"),this.each(function(){var r=jQuery(this),i=e.vakata.pretty_date.parse(r.attr("datetime"),n);i&&(i=t.replace("%{s}",i),r.html()!==i&&r.html(i))})}}(jQuery),function(e){e.vakata.selection={get:function(e){if(window.getSelection){if(e)return window.getSelection().toString();var t=window.getSelection(),n=t.getRangeAt&&t.rangeCount?t.getRangeAt(0):document.createRange(),r=document.createElement("div");return t.getRangeAt||(n.setStart(t.anchorNode,t.anchorOffset),n.setEnd(t.focusNode,t.focusOffset)),r.appendChild(n.cloneContents()),r.innerHTML}return document.selection?document.selection.createRange()[e?"text":"htmlText"]:""},elm_get:function(e){e=typeof e=="string"?document.getElementById(e):e,e.jquery&&(e=e.get(0));if("selectionStart"in e)return{start:e.selectionStart,end:e.selectionEnd,length:e.selectionEnd-e.selectionStart,text:e.value.substr(e.selectionStart,e.selectionEnd-e.selectionStart)};if(!document.selection)return{start:e.value.length,end:e.value.length,length:0,text:""};e.focus();var t=document.selection.createRange(),n=!1,r=!1,i,s,o,u;if(t&&t.parentElement()===e)return i=e.value.length,s=e.value.replace(/\r\n/g,"\n"),n=e.createTextRange(),n.moveToBookmark(t.getBookmark()),r=e.createTextRange(),r.collapse(!1),n.compareEndPoints("StartToEnd",r)>-1?o=u=i:(o=-n.moveStart("character",-i),o+=s.slice(0,o).split("\n").length-1,n.compareEndPoints("EndToEnd",r)>-1?u=i:(u=-n.moveEnd("character",-i),u+=s.slice(0,u).split("\n").length-1)),s=e.value.slice(o,u),{start:o,end:u,length:s.length,text:s}},elm_set:function(t,n,r){t=typeof t=="string"?document.getElementById(t):t,t.jquery&&(t=t.get(0));if("selectionStart"in t)t.focus(),t.selectionStart=n,t.selectionEnd=r;else if(document.selection){t.focus();var i=t.createTextRange(),s=t.value.replace(/\r\n/g,"\n");n-=s.slice(0,n).split("\n").length-1,r-=s.slice(0,r).split("\n").length-1,i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",n),i.select()}return e.vakata.selection.elm_get(t)},elm_replace:function(t,n){t=typeof t=="string"?document.getElementById(t):t,t.jquery&&(t=t.get(0));var r=e.vakata.selection.elm_get(t),i=r.start,s=i+n.length;return t.value=t.value.substr(0,i)+n+t.value.substr(r.end,t.value.length),e.vakata.selection.elm_set(t,i,s),{start:i,end:s,length:n.length,text:n}},elm_get_caret:function(t){return e.vakata.selection.elm_get(t).end},elm_set_caret:function(t,n){return e.vakata.selection.elm_set(t,n,n)},elm_get_caret_position:function(t){t=typeof t=="string"?document.getElementById(t):t,t.jquery&&(t=t.get(0));var n=e.vakata.selection.elm_get_caret(t),r=t.value.substring(0,n).replace(/&/g,"&amp;").replace(/</ig,"&lt;").replace(/>/ig,"&gt;").replace(/\r/g,"").replace(/\t/g,"&#10;").replace(/\n/ig,"<br />"),i=e.vakata.get_scrollbar_width(),s=e(t).width(),o=e(t).height();return t.scrollHeight>o&&(s-=i),t.scrollWidth>s&&(o-=i),t=e(t),t=e("<div />").html(r).css({background:"red",width:s+"px",height:"auto",position:"absolute",left:"0px",top:"-10000px",fontSize:t.css("fontSize"),fontFamily:t.css("fontFamily"),fontWeight:t.css("fontWeight"),fontVariant:t.css("fontVariant"),fontStyle:t.css("fontStyle"),textTransform:t.css("textTransform"),lineHeight:t.css("lineHeight"),whiteSpace:"pre-wrap"}),t.append('<span class="caret">&nbsp;</span>').appendTo("body"),r=t.find("span.caret"),n=r.offset(),n.top=n.top+1e4+r.height(),t.remove(),n}}}(jQuery),function(e){e.fn.vakata_highlight=function(t){var n=this;return typeof t=="string"&&(t=[t]),e.isArray(t)&&(t={words:t}),t=e.extend(!0,{},{css_class:"vakata-highlight",words:[],color:"#99ccff"},t),t.words.length&&this.each(function(){var n=e(this);e.each(t.words,function(r,i){var s=!1;typeof t.color=="string"&&(s=t.color),e.isArray(t.color)&&typeof t.color[r]=="string"&&(s=t.color[r]),n.find(':vakata_icontains("'+i.replace(/\"/ig,"")+'")').filter("strong, span, li, p, h1, h2, h3, h4, h5, h6, div, u, em, i, dt, dd").contents().filter(function(){return this.nodeType===3}).each(function(){if(this.nodeValue.toLowerCase().indexOf(i.toLowerCase())>=0){this.nodeValue=this.nodeValue.replace(new RegExp("("+i.replace(/([\-.*+?\^${}()|\[\]\/\\])/g,"\\$1")+")","ig"),"|{{{$1}}}|");var n=e(this).parent();n.html(n.html().replace(/\|\{\{\{/g,'<span class="'+t.css_class+" "+t.css_class+"-"+r+'" '+(typeof s=="string"?' style="background:'+s+';" ':"")+">").replace(/\}\}\}\|/g,"</span>"))}})})}),n}}(jQuery),function(){"use strict";if(!jQuery)throw"jsTree: jQuery not included.";if(jQuery.jstree)return;(function(e){var t=[],n=-1,r={},i={};e.jstree={VERSION:"1.0.0",IS_IE6:jQuery.browser.msie&&parseInt(jQuery.browser.version,10)===6,IS_IE7:jQuery.browser.msie&&parseInt(jQuery.browser.version,10)===6,IS_FF2:jQuery.browser.mozilla&&parseFloat(jQuery.browser.version,10)<1.9,__construct:function(n){var i={},s={},o=[],u=[],a=0;return n=e(n),e.jstree._reference(n)&&e.jstree.__destruct(n),e.extend.apply(null,[!0,i].concat(Array.prototype.slice.call(arguments,1),n.data("jstree")||{})),o=e.isArray(i.plugins)?i.plugins:e.jstree.defaults.plugins.slice(),o=e.vakata.array_unique(o),i=e.extend(!0,{},e.jstree.defaults,i),e.each(r,function(t,n){t!=="core"&&e.inArray(t,o)===-1?(i[t]=null,delete i[t]):(u.push(t),s[t]={})}),i.plugins=u,a=parseInt(t.push({}),10)-1,n.data("jstree_instance_id",a).addClass("jstree jstree-"+a),this.data=s,this.get_index=function(){return a},this.get_container=function(){return n},this.get_container_ul=function(){return n.children("ul:eq(0)")},this.get_settings=function(t){return t?i:e.extend(!0,{},i)},this.__trigger=function(e,t){if(!e)return;return t||(t={}),typeof e=="string"&&(e=e.replace(".jstree","")+".jstree"),t.inst=this,this.get_container().triggerHandler(e,t)},t[a]=this,e.each(u,function(e,n){r[n]&&r[n].__construct.apply(t[a])}),this.__trigger("__construct"),e.jstree._focus(a),this},__destruct:function(i){i=e.jstree._reference(i);if(!i)return!1;var s=i.get_settings(),o=i.get_index(),u=0;if(n===o){for(u in t)if(t.hasOwnProperty(u)&&u!==o){e.jstree._focus(u);break}n===o&&e.jstree._focus(!1)}return e.each(s.plugins,function(e,t){try{r[t].__destruct.apply(i)}catch(n){}}),i.__trigger("__destruct"),i.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")}),e(document).unbind(".jstree-"+o).undelegate(".jstree-"+o),delete t[o],!0},__call:function(t,n,r){t=e.jstree._reference(t);if(!t||!e.isFunction(t[n]))return;return t[n].apply(t,r)},_reference:function(n){if(t[n])return t[n];var r=e(n);return!r.length&&typeof n=="string"&&(r=e("#"+n)),r.length?t[r.closest(".jstree").data("jstree_instance_id")]||null:null},_focused:function(){return t[n]||null},_focus:function(r){return r===!1?(t[n].get_container().removeClass("jstree-focused"),t[n].__trigger("_defocus"),n=-1,!1):(r=e.jstree._reference(r),!r||r.get_index()===n?!1:(n!==-1&&(t[n].get_container().removeClass("jstree-focused"),t[n].__trigger("_defocus")),n=r.get_index(),r.get_container().addClass("jstree-focused"),r.__trigger("_focus"),!0))},plugin:function(t,n){n=e.extend({},{__construct:e.noop,__destuct:e.noop,_fn:{},defaults:!1},n),r[t]=n,e.jstree.defaults[t]=n.defaults,e.each(n._fn,function(n,r){r.plugin=t,r.old=i[n],i[n]=function(){var t,i=r,s=Array.prototype.slice.call(arguments),o=new e.Event("before.jstree"),u=this.get_settings(!0).plugins;do{if(i&&i.plugin&&e.inArray(i.plugin,u)!==-1)break;i=i.old}while(i);if(!i)return;if(n.indexOf("_")===0)t=i.apply(this,s);else{t=this.__trigger(o,{func:n,args:s,plugin:i.plugin});if(t===!1)return;t=i.apply(e.extend({},this,{__callback:function(e){return this.__trigger(n,{args:s,rslt:e,plugin:i.plugin}),e},__call_old:function(e){return i.old.apply(this,e?Array.prototype.slice.call(arguments,1):s)}}),s)}return t},i[n].old=r.old,i[n].plugin=t})},defaults:{plugins:[]}},e.fn.jstree=function(t){var n=typeof t=="string",r=Array.prototype.slice.call(arguments,1),i=this;return this.each(function(){if(n){var s=e.jstree.__call(this,t,r);if(typeof s!="undefined"&&(t.indexOf(!1)||s!==!0&&s!==!1))return i=s,!1}else n=new e.jstree.__construct(this,t)}),i},i=e.jstree.__construct.prototype,e.expr[":"].jstree=function(t,n,r){return typeof e(t).data("jstree_instance_id")!="undefined"}})(jQuery),function(e){var t=!1,n=!1;e(function(){e.jstree.SCROLLBAR_WIDTH=e.vakata.get_scrollbar_width()}),e.jstree.plugin("core",{__construct:function(){this.data.core.rtl=this.get_container().css("direction")==="rtl",this.data.core.rtl&&this.get_container().addClass("jstree-rtl"),this.data.core.ready=!1,e.support.touch&&this.get_container().addTouch(),this.get_container().bind("__construct.jstree",e.proxy(function(){setTimeout(e.proxy(function(){this&&this.init()},this),0)},this)).bind("before.jstree",e.proxy(function(e,t){if(!/^is_locked|unlock$/.test(t.func)&&this.data.core.locked)return e.stopImmediatePropagation(),!1},this)).bind("create_node.jstree",e.proxy(function(e,t){this.clean_node(t.rslt.obj)},this)).bind("load_node.jstree",e.proxy(function(e,t){if(t.rslt.status){if(t.rslt.obj===-1){var n=this.get_container_ul().detach();this.clean_node(n.children("li")),this.get_container().prepend(n)}else this.clean_node(t.rslt.obj.find("> ul > li"));!this.data.core.ready&&!this.get_container_ul().find(".jstree-loading:eq(0)").length&&(this.data.core.ready=!0,this.__trigger("__ready"))}},this)).bind("__loaded.jstree",e.proxy(function(e,t){t.inst.get_container_ul().children("li").each(function(){t.inst.correct_node(this)})},this)).bind("open_node.jstree",e.proxy(function(e,t){t.rslt.obj.find("> ul > li").each(function(){t.inst.correct_node(this)})},this)).bind("mousedown.jstree",e.proxy(function(){e.jstree._focus(this.get_index())},this)).bind("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var e=window.getSelection();try{e.removeAllRanges(),e.collapse()}catch(t){}}}).delegate(".jstree-ocl","click.jstree",e.proxy(function(e){this.toggle_node(e.target)},this))},__destruct:function(){},defaults:{strings:!1,check_callback:!0,animation:100},_fn:{_get_string:function(t){var n=this.get_settings(!0).core.strings;return e.isFunction(n)?n.call(this,t):n&&n[t]?n[t]:t},init:function(){this.data.core.original_container_html=this.get_container().find(" > ul > li").clone(!0),this.data.core.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType===3&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.get_container().html("<ul><li class='jstree-loading'><a href='#'>"+this._get_string("Loading ...")+"</a></li></ul>"),this.clean_node(-1),this.data.core.li_height=this.get_container_ul().children("li:eq(0)").height()||18,this.load_node(-1,function(){this.__trigger("__loaded")})},lock:function(){this.data.core.locked=!0,this.get_container().addClass("jstree-locked"),this.__callback()},unlock:function(){this.data.core.locked=!1,this.get_container().removeClass("jstree-locked"),this.__callback()},is_locked:function(){return this.data.core.locked},get_node:function(t){var n=e(t,this.get_container());return n.is(".jstree")||t===-1?-1:(n=n.closest("li",this.get_container()),n.length?n:!1)},get_next:function(e,t){return e=this.get_node(e),e===-1?this.get_container_ul().children("li:eq(0)"):!e||!e.length?!1:t?e.nextAll("li").size()>0?e.nextAll("li:eq(0)"):!1:e.hasClass("jstree-open")?e.find("li:eq(0)"):e.nextAll("li").size()>0?e.nextAll("li:eq(0)"):e.parentsUntil(".jstree","li").next("li").eq(0)},get_prev:function(e,t){e=this.get_node(e);if(e===-1)return this.get_container().find("> ul > li:last-child");if(!e||!e.length)return!1;if(t)return e.prevAll("li").length>0?e.prevAll("li:eq(0)"):!1;if(e.prev("li").length){e=e.prev("li").eq(0);while(e.hasClass("jstree-open"))e=e.children("ul:eq(0)").children("li:last");return e}var n=e.parentsUntil(".jstree","li:eq(0)");return n.length?n:!1},get_parent:function(e){e=this.get_node(e);if(e===-1||!e||!e.length)return!1;var t=e.parentsUntil(".jstree","li:eq(0)");return t.length?t:-1},get_children:function(e){return e=this.get_node(e),e===-1?this.get_container_ul().children("li"):!e||!e.length?!1:e.find("> ul > li")},is_parent:function(e){return e=this.get_node(e),e&&e!==-1&&(e.find("> ul > li:eq(0)").length||e.hasClass("jstree-closed"))},is_loaded:function(e){return e=this.get_node(e),e&&(e===-1&&!this.get_container().find("> ul > li.jstree-loading").length||e!==-1&&!e.hasClass("jstree-loading")&&(e.find("> ul > li").length||e.hasClass("jstree-leaf")))},is_loading:function(e){return e=this.get_node(e),e&&(e===-1&&this.get_container().find("> ul > li.jstree-loading").length||e!==-1&&e.hasClass("jstree-loading"))},is_open:function(e){return e=this.get_node(e),e&&e!==-1&&e.hasClass("jstree-open")},is_closed:function(e){return e=this.get_node(e),e&&e!==-1&&e.hasClass("jstree-closed")},is_leaf:function(e){return e=this.get_node(e),e&&e!==-1&&e.hasClass("jstree-leaf")},load_node:function(t,n){return t=this.get_node(t),t?(t!==-1&&t.addClass("jstree-loading"),this._load_node(t,e.proxy(function(e){t!==-1&&t.removeClass("jstree-loading"),this.__callback({obj:t,status:e}),n&&n.call(this,t,e)},this)),!0):(n.call(this,t,!1),!1)},_load_node:function(e,t){e===-1&&this.get_container_ul().empty().append(this.data.core.original_container_html.clone(!0)),t.call(null,!0)},open_node:function(t,n,r){t=this.get_node(t),r=(typeof r).toLowerCase()==="undefined"?this.get_settings().core.animation:r;if(t===-1||!t||!t.length)return!1;if(!this.is_closed(t))return n&&n.call(this,t,!1),!1;if(!this.is_loaded(t))this.load_node(t,function(e,t){return t?this.open_node(e,n,r):n?n.call(this,e,!1):!1});else{var i=this;t.children("ul").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").children("ul").stop(!0,!0).slideDown(e.jstree.IS_IE6?0:r,function(){this.style.display="",i.__trigger("__after_open",{rslt:{obj:t}})}),n&&n.call(this,t,!0),this.__callback({obj:t})}},close_node:function(t,n){t=this.get_node(t),n=(typeof n).toLowerCase()==="undefined"?this.get_settings().core.animation:n;if(!t||!t.length||!this.is_open(t))return!1;var r=this;t.children("ul").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").children("ul").stop(!0,!0).slideUp(e.jstree.IS_IE6?0:n,function(){this.style.display="",r.__trigger("__after_close",{rslt:{obj:t}})}),this.__callback({obj:t})},toggle_node:function(e){if(this.is_closed(e))return this.open_node(e);if(this.is_open(e))return this.close_node(e)},open_all:function(e,t,n){e=e?this.get_node(e):-1,e=!e||e===-1?this.get_container_ul():e,n=n||e;var r=this;e=this.is_closed(e)?e.find("li.jstree-closed").andSelf():e.find("li.jstree-closed"),e.each(function(){r.open_node(this,r.is_loaded(this)?!1:function(e){this.open_all(e,t,n)},t||0)}),n.find("li.jstree-closed").length===0&&this.__callback({obj:n})},close_all:function(e,t){e=e?this._get_node(e):-1;var n=!e||e===-1?this.get_container_ul():e,r=this;n=this.is_open(n)?n.find("li.jstree-open").andSelf():n.find("li.jstree-open"),n.each(function(){r.close_node(this,t||0)}),this.__callback({obj:e})},clean_node:function(t){t=this.get_node(t),t=!t||t===-1?this.get_container().find("li"):t.find("li").andSelf();var n=this;return t.each(function(){var t=e(this),r=t.data("jstree"),i=r&&r.opened||t.hasClass("jstree-open")?"open":r&&r.closed||t.children("ul").length?"closed":"leaf";r&&r.opened&&delete r.opened,r&&r.closed&&delete r.closed,t.removeClass("jstree-open jstree-closed jstree-leaf jstree-last"),t.children("a").length?e.trim(t.children("a").attr("href"))||t.children("a").attr("href","#"):(t.contents().filter(function(){return this.nodeType===3||this.tagName!=="UL"}).wrapAll('<a href="#"></a>'),t.children("a").html(t.children("a").html().replace(/[\s\t\n]+$/,""))),t.children("ins.jstree-ocl").length||t.prepend("<ins class='jstree-icon jstree-ocl'>&#160;</ins>"),t.is(":last-child")&&t.addClass("jstree-last");switch(i){case"leaf":t.addClass("jstree-leaf");break;case"closed":t.addClass("jstree-open"),n.close_node(t,0);break;case"open":t.addClass("jstree-closed"),n.open_node(t,!1,0)}})},correct_node:function(t,n){return t=this.get_node(t),!t||t===-1&&!n?!1:(t===-1?t=this.get_container().find("li"):t=n?t.find("li").andSelf():t,t.each(function(){var t=e(this);switch(!0){case t.hasClass("jstree-open")&&!t.find("> ul > li").length:t.removeClass("jstree-open").addClass("jstree-leaf").children("ul").remove();break;case t.hasClass("jstree-leaf")&&!!t.find("> ul > li").length:t.removeClass("jstree-leaf").addClass("jstree-closed")}t[t.is(":last-child")?"addClass":"removeClass"]("jstree-last")}),t)},scroll_to_node:function(t){var n=this.get_container()[0],r;if(n.scrollHeight>n.offsetHeight){t=this.get_node(t);if(!t||t===-1||!t.length||!t.is(":visible"))return;r=t.offset().top-this.get_container().offset().top,r<0&&(n.scrollTop=n.scrollTop+r-1),r+this.data.core.li_height+(n.scrollWidth>n.offsetWidth?e.jstree.SCROLLBAR_WIDTH:0)>n.offsetHeight&&(n.scrollTop=n.scrollTop+(r-n.offsetHeight+this.data.core.li_height+1+(n.scrollWidth>n.offsetWidth?e.jstree.SCROLLBAR_WIDTH:0)))}},get_state:function(){var e={open:[],scroll:{left:this.get_container().scrollLeft(),top:this.get_container().scrollTop()}};return this.get_container_ul().find(".jstree-open").each(function(){this.id&&e.open.push(this.id)}),e},set_state:function(t,n){if(t){if(e.isArray(t.open)){var r=!0,i=this;return e.each(t.open.concat([]),function(n,s){s=document.getElementById(s),s&&(i.is_loaded(s)?(i.is_closed(s)&&i.open_node(s,!1,0),e.vakata.array_remove(t.open,n)):(i.is_loading(s)||i.open_node(s,e.proxy(function(){this.set_state(t)},i),0),r=!1))}),r&&(delete t.open,this.set_state(t,n)),!1}return t.scroll?(t.scroll&&typeof t.scroll.left!="undefined"&&this.get_container().scrollLeft(t.scroll.left),t.scroll&&typeof t.scroll.top!="undefined"&&this.get_container().scrollTop(t.scroll.top),delete t.scroll,delete t.open,this.set_state(t,n),!1):e.isEmptyObject(t)?(n&&n.call(this),this.__callback(),!1):!0}return!1},refresh:function(){this.data.core.state=this.get_state(),this.load_node(-1,function(t,n){n&&this.set_state(e.extend(!0,{},this.data.core.state),function(){this.__trigger("refresh")}),this.data.core.state=null})},get_text:function(t,n){return t=this.get_node(t),!t||t===-1||!t.length?!1:(t=t.children("a:eq(0)").clone(),t.children(".jstree-icon").remove(),t=t[n?"text":"html"](),t=e("<div />")[n?"text":"html"](t),t.html())},set_text:function(e,t){e=this.get_node(e);if(!e||e===-1||!e.length)return!1;e=e.children("a:eq(0)");var n=e.children("INS").clone();return e.html(t).prepend(n),this.__callback({obj:e,text:t}),!0},parse_json:function(t){var n,r,i,s;if(e.isArray(t))return i=e("<ul />"),s=this,e.each(t,function(e,t){i.append(s.parse_json(t))}),i;typeof t=="undefined"&&(t={}),typeof t=="string"&&(t={title:t}),t.li_attr||(t.li_attr={}),t.a_attr||(t.a_attr={}),t.a_attr.href||(t.a_attr.href="#"),t.title||(t.title=this._get_string("New node")),n=e("<li />").attr(t.li_attr),r=e("<a />").attr(t.a_attr).html(t.title),i=e("<ul />"),t.data&&!e.isEmptyObject(t.data)&&n.data(t.data);if(t.children===!0||e.isArray(t.children)||n.data("jstree")&&e.isArray(n.data("jstree").children))n.data("jstree")||n.data("jstree",{}),n.data("jstree").closed=!0;return n.append(r),e.isArray(t.children)&&(e.each(t.children,e.proxy(function(e,t){i.append(this.parse_json(t))},this)),n.append(i)),n},get_json:function(t,n){t=typeof t!="undefined"?this.get_node(t):!1,!n&&(!t||t===-1)&&(t=this.get_container_ul().children("li"));var r,i,s={},o={},u={};return!t||!t.length?!1:t.length>1||!n?(r=[],i=this,t.each(function(){r.push(i.get_json(e(this),!0))}),r):(u=e.vakata.attributes(t,!0),e.each(u,function(t,n){if(t==="id")return s[t]=n,!0;n=e.trim(n.replace(/\bjstree[^ ]*/ig,"").replace(/\s+$/ig," ")),n.length&&(s[t]=n)}),u=e.vakata.attributes(t.children("a"),!0),e.each(u,function(t,n){if(t==="id")return o[t]=n,!0;n=e.trim(n.replace(/\bjstree[^ ]*/ig,"").replace(/\s+$/ig," ")),n.length&&(o[t]=n)}),r={title:this.get_text(t),data:e.extend(!0,{},t.data()||{}),children:!1,li_attr:s,a_attr:o},r.data.jstree||(r.data.jstree={}),this.is_open(t)&&(r.data.jstree.opened=!0),this.is_closed(t)&&(r.data.jstree.closed=!0),t=t.find("> ul > li"),t.length&&(r.children=[],i=this,t.each(function(){r.children.push(i.get_json(e(this),!0))})),r)},create_node:function(e,t,n,r,i){e=this.get_node(e),n=typeof n=="undefined"?"last":n;if(e!==-1&&!e.length)return!1;if(!n.match(/^(before|after)$/)&&!i&&!this.is_loaded(e))return this.load_node(e,function(){this.create_node(e,t,n,r,!0)});var s=this.parse_json(t),o=e===-1?this.get_container():e;e===-1&&(n==="before"&&(n="first"),n==="after"&&(n="last"));switch(n){case"before":n=e.index(),e=this.get_parent(e);break;case"after":n=e.index()+1,e=this.get_parent(e);break;case"inside":case"first":n=0;break;case"last":n=o.children("ul").children("li").length;break;default:n||(n=0)}return this.check("create_node",s,e,n)?(o=e===-1?this.get_container():e,o.children("ul").length||o.append("<ul />"),o.children("ul").children("li").eq(n).length?o.children("ul").children("li").eq(n).before(s):o.children("ul").append(s),this.correct_node(e,!0),r&&r.call(this,s),this.__callback({obj:s,parent:e,position:s.index()}),s):!1},rename_node:function(e,t){e=this.get_node(e);var n=this.get_text(e);if(!this.check("rename_node",e,this.get_parent(e),t))return!1;e&&e.length&&(this.set_text(e,t),this.__callback({obj:e,title:t,old:n}))},delete_node:function(e){e=this.get_node(e);if(!e||e===-1||!e.length)return!1;var t=this.get_parent(e),n=this.get_prev(e);return this.check("delete_node",e,t,e.index())?(e=e.detach(),this.correct_node(t),this.correct_node(n),this.__callback({obj:e,prev:n,parent:t}),e):!1},check:function(t,n,r,i){var s=t.match(/^move_node|copy_node|create_node$/i)?r:n,o=this.get_settings().core.check_callback;if(o===!1||e.isFunction(o)&&o.call(this,t,n,r,i)===!1)return!1;s=s===-1?this.get_container().data("jstree"):s.data("jstree");if(s&&s.functions&&s.functions[t]){s=s.functions[t],e.isFunction(s)&&(s=s.call(this,t,n,r,i));if(s===!1)return!1}switch(t){case"create_node":break;case"rename_node":break;case"move_node":s=r===-1?this.get_container():r,s=s.children("ul").children("li");if(s.length&&s.index(n)!==-1&&(i===n.index()||i===n.index()+1))return!1;if(r!==-1&&r.parentsUntil(".jstree","li").andSelf().index(n)!==-1)return!1;break;case"copy_node":break;case"delete_node":}return!0},move_node:function(t,n,r,i,s){t=this.get_node(t),n=this.get_node(n),r=typeof r=="undefined"?0:r;if(!t||t===-1||!t.length)return!1;if(n!==-1&&!n.length)return!1;if(!r.toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(n))return this.load_node(n,function(){this.move_node(t,n,r,i,!0)});var o=this.get_parent(t),u=!r.toString().match(/^(before|after)$/)||n===-1?n:this.get_parent(n),a=e.jstree._reference(t),f=n===-1?this:e.jstree._reference(n),l=a.get_index()!==f.get_index();u===-1&&(n=f.get_container(),r==="before"&&(r="first"),r==="after"&&(r="last"));switch(r){case"before":r=n.index();break;case"after":r=n.index()+1;break;case"inside":case"first":r=0;break;case"last":r=n.children("ul").children("li").length;break;default:r||(r=0)}return this.check("move_node",t,u,r)?(n.children("ul").length||n.append("<ul />"),n.children("ul").children("li").eq(r).length?n.children("ul").children("li").eq(r).before(t):n.children("ul").append(t),l&&(t.find(".jstree-icon, .jstree-ocl").remove(),this.clean_node(t)),a.correct_node(o,!0),f.correct_node(u,!0),i&&i.call(this,t,u,t.index()),this.__callback({obj:t,parent:u,position:t.index(),old_parent:o,is_multi:l,old_instance:a,new_instance:f}),!0):!1},copy_node:function(t,n,r,i,s){t=this.get_node(t),n=this.get_node(n),r=typeof r=="undefined"?"last":r;if(!t||t===-1||!t.length)return!1;if(n!==-1&&!n.length)return!1;if(!r.toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(n))return this.load_node(n,function(){this.copy_node(t,n,r,i,!0)});var o=t,u=this.get_parent(t),a=!r.toString().match(/^(before|after)$/)||n===-1?n:this.get_parent(n),f=e.jstree._reference(t),l=n===-1?this:e.jstree._reference(n),c=f.get_index()!==l.get_index();t=t.clone(!0),t.find("*[id]").andSelf().each(function(){this.id&&(this.id="copy_"+this.id)}),a===-1&&(n=l.get_container(),r==="before"&&(r="first"),r==="after"&&(r="last"));switch(r){case"before":r=n.index();break;case"after":r=n.index()+1;break;case"inside":case"first":r=0;break;case"last":r=n.children("ul").children("li").length;break;default:r||(r=0)}return this.check("copy_node",o,a,r)?(n.children("ul").length||n.append("<ul />"),n.children("ul").children("li").eq(r).length?n.children("ul").children("li").eq(r).before(t):n.children("ul").append(t),c&&t.find(".jstree-icon, .jstree-ocl").remove(),l.clean_node(t),l.correct_node(a,!0),i&&i.call(this,t,a,t.index(),o),this.__callback({obj:t,parent:a,old_parent:u,position:t.index(),original:o,is_multi:c,old_instance:f,new_instance:l}),!0):!1},cut:function(e){e=this.get_node(e);if(!e||e===-1||!e.length)return!1;t=e,n="move_node",this.__callback({obj:e})},copy:function(e){e=this.get_node(e);if(!e||e===-1||!e.length)return!1;t=e,n="copy_node",this.__callback({obj:e})},can_paste:function(){return n!==!1&&t!==!1},paste:function(e){e=this.get_node(e);if(!e||!n||!n.match(/^(copy_node|move_node)$/)||!t)return!1;this[n](t,e),this.__callback({obj:e,nodes:t,mode:n}),t=!1,n=!1},edit:function(t,n){t=this.get_node(t);if(!t||t===-1||!t.length)return!1;t.parentsUntil(".jstree",".jstree-closed").each(e.proxy(function(e,t){this.open_node(t,!1,0)},this));var r=this.data.core.rtl,i=this.get_container().width(),s=t.children("a:eq(0)"),o=t.children("ins"),u=s.children("ins"),a=o.width()*o.length,f=u.width()*u.length,l=typeof n=="string"?n:this.get_text(t),c=e("<div />",{css:{position:"absolute",top:"-200px",left:r?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),h=t.css("position","relative").append(e("<input />",{value:l,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:r?"auto":a+f+4+"px",right:r?a+f+4+"px":"auto",top:"0px",height:this.data.core.li_height-2+"px",lineHeight:this.data.core.li_height-2+"px",width:"150px"},blur:e.proxy(function(){var e=t.children(".jstree-rename-input"),n=e.val();n===""&&(n=l),c.remove(),e.remove(),this.rename_node(t,n),t.css("position","")},this),keyup:function(e){var t=e.keyCode||e.which;if(t===27){this.value=l,this.blur();return}if(t===13){this.blur();return}h.width(Math.min(c.text("pW"+this.value).width(),i))},keypress:function(e){var t=e.keyCode||e.which;if(t===13)return!1}})).children(".jstree-rename-input"),p={fontFamily:s.css("fontFamily")||"",fontSize:s.css("fontSize")||"",fontWeight:s.css("fontWeight")||"",fontStyle:s.css("fontStyle")||"",fontStretch:s.css("fontStretch")||"",fontVariant:s.css("fontVariant")||"",letterSpacing:s.css("letterSpacing")||"",wordSpacing:s.css("wordSpacing")||""};this.set_text(t,""),c.css(p),h.css(p).width(Math.min(c.text("pW"+h[0].value).width(),i))[0].select()}}}),e(function(){var t=".jstree * { -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; }.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree .jstree-icon { display:inline-block; text-decoration:none; margin:0; padding:0; vertical-align:top; } .jstree .jstree-ocl { width:18px; height:18px; text-align:center; line-height:18px; cursor:pointer; vertical-align:top; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";if(e.jstree.IS_IE6){try{document.execCommand("BackgroundImageCache",!1,!0)}catch(n){}t+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } "}e.jstree.IS_IE7&&(t+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "),e.jstree.IS_FF2&&(t+=".jstree .jstree-icon { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } "),e.vakata.css.add_sheet({str:t,title:"jstree"})})}(jQuery)}(),function(e){e.jstree.plugin("checkbox",{__construct:function(){this.get_container().bind("__construct.jstree",e.proxy(function(){},this)).bind("move_node.jstree, copy_node.jstree",function(t,n){n.rslt.old_instance&&n.rslt.old_parent&&e.isFunction(n.rslt.old_instance.checkbox_repair)&&n.rslt.old_instance.checkbox_repair(n.rslt.old_parent),n.rslt.new_instance&&e.isFunction(n.rslt.new_instance.checkbox_repair)&&n.rslt.new_instance.checkbox_repair(n.rslt.parent)}).bind("delete_node.jstree",function(e,t){this.checkbox_repair(t.rslt.parent)}).delegate("a","click.jstree",e.proxy(function(e){e.preventDefault(),e.currentTarget.blur();var t=this.get_node(e.currentTarget);this.toggle_check(t)},this))},defaults:{three_state:!0},_fn:{check_node:function(e){e=this.get_node(e),e.find(" > a > .jstree-checkbox").removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked").children(":checkbox").prop("checked",!0).prop("indeterminate",!1),this.checkbox_repair(e),this.__callback({obj:e})},uncheck_node:function(e){e=this.get_node(e),e.find(" > a > .jstree-checkbox").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",!1).prop("indeterminate",!1),this.checkbox_repair(e),this.__callback({obj:e})},toggle_check:function(e){e=e.find(" > a > .jstree-checkbox").removeClass("jstree-undetermined").toggleClass("jstree-checked"),e.hasClass("jstree-checked")?this.check_node():this.uncheck_node()},uncheck_all:function(t){var n=t?e(t).find(".jstree-checked").closest("li"):this.get_container().find(".jstree-checked").closest("li");n.children(".jstree-checkbox").removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",!1).prop("indeterminate",!1),this.__callback({obj:n})},checkbox_repair:function(t){if(!this.get_settings(!0).checkbox.three_state)return!1;if(!t||t===-1)t=this.get_container_ul().children("li");if(t.length>1){t.each(e.proxy(function(t,n){this.checkbox_repair(e(n))},this));return}var n=t.find(" > a > .jstree-checkbox"),r=!0,i,s,o,u,a;!n.hasClass("jstree-checked")&&!n.hasClass("jstree-unchecked")&&(i=this.get_parent(t),i&&i!==-1&&i.length&&i.find("> a > .jstree-checked").length?n.addClass("jstree-checked"):n.addClass("jstree-unchecked"),r=!1),n.hasClass("jstree-checked")&&t.find(".jstree-checkbox").removeClass("jstree-undetermined jstree-unchecked").addClass("jstree-checked").children(":checkbox").prop("checked",!0).prop("indeterminate",!1),n.hasClass("jstree-unchecked")&&t.find(".jstree-checkbox").removeClass("jstree-undetermined jstree-checked").addClass("jstree-unchecked").children(":checkbox").prop("checked",!1).prop("indeterminate",!1);while(r){t=this.get_parent(t);if(!t||t===-1||!t.length)return;s=t.find(" > ul > li"),o=s.find(" > a > .jstree-checked").length,u=s.find(" > a > .jstree-unchecked").length,a=s.find(" > a > .jstree-undetermined").length,s=s.length;if(o+u+a<s)return;if(u===s){n=t.find(" > a > .jstree-checkbox");if(n.hasClass("jstree-unchecked"))return;n.removeClass("jstree-undetermined jstree-checked").addClass("jstree-unchecked").children(":checkbox").prop("checked",!1).prop("indeterminate",!1);continue}if(o===s){n=t.find(" > a > .jstree-checkbox");if(n.hasClass("jstree-checked"))return;n.removeClass("jstree-undetermined jstree-unchecked").addClass("jstree-checked").children(":checkbox").prop("checked",!0).prop("indeterminate",!1);continue}t.parentsUntil(".jstree","li").andSelf().find(" > a > .jstree-checkbox").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined").children(":checkbox").prop("checked",!1).prop("undetermined",!0);return}},clean_node:function(t){t=this.__call_old();var n=this;return t=t.each(function(){var t=e(this),r=t.data("jstree");t.find(" > a > .jstree-checkbox").remove(),t.children("a").prepend("<ins class='jstree-icon jstree-checkbox "+(r&&r.checkbox&&r.checkbox.checked===!0?"jstree-checked":"")+(r&&r.checkbox&&r.checkbox.checked===!1||!n.get_settings(!0).checkbox.three_state?"jstree-unchecked":"")+" '><input class='jstree-check' type='checkbox' "+(r&&r.checkbox&&r.checkbox.checked?' checked="checked" ':"")+" name='"+(r&&r.checkbox&&typeof r.checkbox.name!="undefined"?r.checkbox.name:"jstree[]")+"' value='"+(r&&r.checkbox&&typeof r.checkbox.value!="undefined"?r.checkbox.value:t.attr("id"))+"' /></ins>")}),n.checkbox_repair(t),t},get_state:function(){var e=this.__call_old();return e.checkbox=[],this.get_container().find(".jstree-checked").closest("li").each(function(){this.id&&e.checkbox.push(this.id)}),e},set_state:function(t,n){if(this.__call_old()){if(t.checkbox){var r=this;return this.uncheck_all(),e.each(t.checkbox,function(e,t){r.check_node(document.getElementById(t))}),this.checkbox_repair(),delete t.checkbox,this.set_state(t,n),!1}return!0}return!1},get_json:function(e,t){var n=this.__call_old(),r;return t&&(r=e.find("> a > ins > :checkbox"),n.data.jstree.checkbox={},n.data.jstree.checkbox.checked=r.parent().hasClass("jstree-checked"),r.attr("name")!=="jstree[]"&&(n.data.checkbox.name=r.attr("name")),r.val()!==e.attr("id")&&(n.data.checkbox.value=r.val())),n}}}),e(function(){var t=".jstree a > .jstree-checkbox { height:16px; width:16px; margin-right:1px; } .jstree-rtl a > .jstree-checkbox { margin-right:0; margin-left:1px; } .jstree .jstree-check { margin:0; padding:0; border:0; display:inline; vertical-align:text-bottom; } ";e.jstree.IS_IE6&&(t+=".jstree li a .jstree-checkbox { height:16px; width:16px; background:transparent; margin-right:1px; } .jstree-rtl li a .jstree-checkbox { margin-right:0; margin-left:1px; } "),e.vakata.css.add_sheet({str:t,title:"jstree"})}),e.jstree.defaults.plugins.push("checkbox")}(jQuery),function(e){e.jstree.plugin("contextmenu",{__construct:function(){this.get_container().delegate("a","contextmenu.jstree",e.proxy(function(e){e.preventDefault(),this.is_loading(e.currentTarget)||this.show_contextmenu(e.currentTarget,e.pageX,e.pageY)},this)).delegate("a","click.jstree",e.proxy(function(e){this.data.contextmenu.visible&&this._hide_contextmenu()},this)),e(document).bind("context_hide.vakata",e.proxy(function(){this.data.contextmenu=!1},this))},__destruct:function(){this.data.contextmenu&&this._hide_contextmenu()},defaults:{select_node:!0,show_at_node:!0,items:function(t){return{create:{separator_before:!1,separator_after:!0,label:"Create",action:function(t){var n=e.jstree._reference(t.reference),r=n.get_node(t.reference);n.create_node(r,{},"last",function(e){setTimeout(function(){n.edit(e)},0)})}},rename:{separator_before:!1,separator_after:!1,label:"Rename",action:function(t){var n=e.jstree._reference(t.reference),r=n.get_node(t.reference);n.edit(r)}},remove:{separator_before:!1,icon:!1,separator_after:!1,label:"Delete",action:function(t){var n=e.jstree._reference(t.reference),r=n.get_node(t.reference);n.data.ui&&n.is_selected(r)&&(r=n.get_selected()),n.delete_node(r)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var n=e.jstree._reference(t.reference),r=n.get_node(t.reference);this.data.ui&&n.is_selected(r)&&(r=n.get_selected()),n.cut(r)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var n=e.jstree._reference(t.reference),r=n.get_node(t.reference);this.data.ui&&n.is_selected(r)&&(r=n.get_selected()),n.copy(r)}},paste:{separator_before:!1,icon:!1,_disabled:!this.can_paste(),separator_after:!1,label:"Paste",action:function(t){var n=e.jstree._reference(t.reference),r=n.get_node(t.reference);n.paste(r)}}}}}}},_fn:{show_contextmenu:function(t,n,r){t=this.get_node(t);var i=this.get_settings().contextmenu,s=t.children("a:visible:eq(0)"),o=!1,u=!1;if(i.show_at_node||typeof n=="undefined"||typeof r=="undefined")o=s.offset(),n=o.left,r=o.top+this.data.core.li_height;i.select_node&&this.data.ui&&!this.is_selected(t)&&(this.deselect_all(),this.select_node(t)),u=t.data("jstree")&&t.data("jstree").contextmenu?t.data("jstree").contextmenu:i.items,e.isFunction(u)&&(u=u.call(this,t)),e(document).one("context_show.vakata",e.proxy(function(t,n){var r="jstree-contextmenu";this.data.themes.theme&&(r+=" jstree-"+this.data.themes.theme+"-contextmenu"),e(n.element).addClass(r)},this)),this.data.contextmenu.visible=!0,e.vakata.context.show(s,{x:n,y:r},u),this.__callback({obj:t,x:n,y:r})}}}),e.jstree.defaults.plugins.push("contextmenu")}(jQuery),function(e){e.jstree.plugin("dnd",{__construct:function(){this.get_container().delegate("a","mousedown",e.proxy(function(t){var n=this.get_node(t.target);if(n&&n!==-1&&n.length&&t.which===1)return this.get_container().trigger("mousedown.jstree"),e.vakata.dnd.start(t,{jstree:!0,origin:this,obj:n},'<div id="jstree-dnd" class="'+(this.data.themes?"jstree-"+this.get_theme():"")+'"><ins class="jstree-icon jstree-er">&#160;</ins>'+this.get_text(t.currentTarget,!0)+'<ins class="jstree-copy" style="display:none;">+</ins></div>')},this))},defaults:{copy_modifier:"ctrl",open_timeout:500}}),e(function(){var t=!1,n=!1,r=e('<div id="jstree-marker">&#160;</div>').hide().appendTo("body");e(document).bind("dnd_start.vakata",function(e,n){t=!1}).bind("dnd_move.vakata",function(i,s){n&&clearTimeout(n);if(!s.data.jstree)return;if(s.event.target.id&&s.event.target.id==="jstree-marker")return;var o=e.jstree._reference(s.event.target),u=!1,a=!1,f=!1,l,c,h,p,d,v;if(o&&o.data&&o.data.dnd){r.attr("class",o.data.themes?"jstree-"+o.get_theme():""),s.helper.children().attr("class",o.data.themes?"jstree-"+o.get_theme():"").find(".jstree-copy:eq(0)")[s.event[s.data.origin.get_settings().dnd.copy_modifier+"Key"]?"show":"hide"]();if(s.event.target===o.get_container()[0]||s.event.target===o.get_container_ul()[0]){if(o.check(s.event[s.data.origin.get_settings().dnd.copy_modifier+"Key"]?"copy_node":"move_node",s.data.obj,-1,"last")){t={ins:o,par:-1,pos:"last"},r.hide(),s.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok");return}}else{u=e(s.event.target).closest("a");if(u&&u.length&&u.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")){a=u.offset(),f=s.event.pageY-a.top,h=u.height(),f<h/3?v=["b","i","a"]:f>h-h/3?v=["a","i","b"]:v=f>h/2?["i","a","b"]:["i","b","a"],e.each(v,function(e,i){switch(i){case"b":l=a.left-6,c=a.top-5,p=o.get_parent(u),d=u.parent().index();break;case"i":l=a.left-2,c=a.top-5+h/2+1,p=u.parent(),d=0;break;case"a":l=a.left-6,c=a.top-5+h+2,p=o.get_parent(u),d=u.parent().index()+1}if(o.check(s.event[s.data.origin.get_settings().dnd.copy_modifier+"Key"]?"copy_node":"move_node",s.data.obj,p,d))return i==="i"&&u.parent().is(".jstree-closed")&&o.get_settings(!0).dnd.open_timeout&&(n=setTimeout(function(e,t){return function(){e.open_node(t)}}(o,u),o.get_settings(!0).dnd.open_timeout)),t={ins:o,par:p,pos:d},r.css({left:l+"px",top:c+"px"}).show(),s.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),v=!0,!1});if(v===!0)return}}}t=!1,s.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),r.hide()}).bind("dnd_scroll.vakata",function(e,n){if(!n.data.jstree)return;r.hide(),t=!1,n.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er")}).bind("dnd_stop.vakata",function(e,i){n&&clearTimeout(n);if(!i.data.jstree)return;r.hide(),t&&t.ins[i.event[i.data.origin.get_settings().dnd.copy_modifier+"Key"]?"copy_node":"move_node"](i.data.obj,t.par,t.pos)}).bind("keyup keydown",function(t,n){n=e.vakata.dnd._get(),n.data&&n.data.jstree&&n.helper.find(".jstree-copy:eq(0)")[t[n.data.origin.get_settings().dnd.copy_modifier+"Key"]?"show":"hide"]()});var i="#jstree-marker { position: absolute; top:0; left:0; margin:0; padding:0; border-right:0; border-top:5px solid transparent; border-bottom:5px solid transparent; border-left:5px solid; width:0; height:0; font-size:0; line-height:0; _border-top-color:pink; _border-botton-color:pink; _filter:chroma(color=pink); } #jstree-dnd { line-height:16px; margin:0; padding:4px; } #jstree-dnd .jstree-icon, #jstree-dnd .jstree-copy { display:inline-block; text-decoration:none; margin:0 2px 0 0; padding:0; width:16px; height:16px; } #jstree-dnd .jstree-ok { background:green; } #jstree-dnd .jstree-er { background:red; } #jstree-dnd .jstree-copy { margin:0 2px 0 2px; }";e.vakata.css.add_sheet({str:i,title:"jstree"})}),e.jstree.defaults.plugins.push("dnd")}(jQuery),function(e){function n(t,n){var r=e.jstree._focused(),i;if(r&&r.data&&r.data.hotkeys&&r.data.hotkeys.enabled){i=r.get_settings(!0).hotkeys[t];if(i)return i.call(r,n)}return!0}if(typeof e.hotkeys=="undefined"&&typeof e.vakata_hotkeys=="undefined")throw"jsTree hotkeys: jQuery hotkeys plugin not included.";var t=[];e.jstree.plugin("hotkeys",{__construct:function(){if(!this.data.ui)throw"jsTree hotkeys: jsTree UI plugin not included.";e.each(this.get_settings(!0).hotkeys,function(r,i){i!==!1&&e.inArray(r,t)===-1&&(e(document).bind("keydown",r,function(e){return n(r,e)}),t.push(r))}),this.get_container().bind("lock.jstree",e.proxy(function(){this.data.hotkeys.enabled&&(this.data.hotkeys.enabled=!1,this.data.hotkeys.revert=!0)},this)).bind("unlock.jstree",e.proxy(function(){this.data.hotkeys.revert&&(this.data.hotkeys.enabled=!0)},this)),this.enable_hotkeys()},defaults:{up:function(){var e=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this.get_prev(e)),!1},"ctrl+up":function(){var e=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this.get_prev(e)),!1},"shift+up":function(){var e=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this.get_prev(e)),!1},down:function(){var e=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this.get_next(e)),!1},"ctrl+down":function(){var e=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this.get_next(e)),!1},"shift+down":function(){var e=this.data.ui.hovered||this.data.ui.last_selected||-1;return this.hover_node(this.get_next(e)),!1},left:function(){var e=this.data.ui.hovered||this.data.ui.last_selected;return e&&(e.hasClass("jstree-open")?this.close_node(e):this.hover_node(this.get_prev(e))),!1},"ctrl+left":function(){var e=this.data.ui.hovered||this.data.ui.last_selected;return e&&(e.hasClass("jstree-open")?this.close_node(e):this.hover_node(this.get_prev(e))),!1},"shift+left":function(){var e=this.data.ui.hovered||this.data.ui.last_selected;return e&&(e.hasClass("jstree-open")?this.close_node(e):this.hover_node(this.get_prev(e))),!1},right:function(){var e=this.data.ui.hovered||this.data.ui.last_selected;return e&&e.length&&(e.hasClass("jstree-closed")?this.open_node(e):this.hover_node(this.get_next(e))),!1},"ctrl+right":function(){var e=this.data.ui.hovered||this.data.ui.last_selected;return e&&e.length&&(e.hasClass("jstree-closed")?this.open_node(e):this.hover_node(this.get_next(e))),!1},"shift+right":function(){var e=this.data.ui.hovered||this.data.ui.last_selected;return e&&e.length&&(e.hasClass("jstree-closed")?this.open_node(e):this.hover_node(this.get_next(e))),!1},space:function(){return this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").click(),!0},"ctrl+space":function(e){return e.type="click",this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(e),!1},"shift+space":function(e){return e.type="click",this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(e),!1}},_fn:{enable_hotkeys:function(){this.data.hotkeys.enabled=!0},disable_hotkeys:function(){this.data.hotkeys.enabled=!1}}}),e.jstree.defaults.plugins.push("hotkeys")}(jQuery),function(e){e.jstree.plugin("html",{defaults:{data:!1,ajax:!1},_fn:{_append_html_data:function(t,n){return n=e(n),!n||!n.length||!n.is("ul, li")?!1:(t=this.get_node(t),t===-1&&(t=this.get_container()),t.length?(t.children("ul").length||t.append("<ul />"),t.children("ul").empty().append(n.is("ul")?n.children("li"):n),!0):!1)},_load_node:function(t,n){var r=!1,i=this.get_settings().html;t=this.get_node(t);if(!t)return!1;switch(!0){case!i.data&&!i.ajax:return t===-1&&this._append_html_data(-1,this.data.core.original_container_html.clone(!0)),n.call(this,!0);case e.isFunction(i.data):return i.data.call(this,t,e.proxy(function(e){return n.call(this,this._append_html_data(t,e))},this));case!!i.data&&!i.ajax||!!i.data&&!!i.ajax&&t===-1:return n.call(this,this._append_html_data(t,i.data));case!i.data&&!!i.ajax||!!i.data&&!!i.ajax&&t!==-1:return i.ajax.success=e.proxy(function(r,i,s){var o=this.get_settings().html.ajax;e.isFunction(o.success)&&(r=o.success.call(this,r,i,s)||r),n.call(this,this._append_html_data(t,r))},this),i.ajax.error=e.proxy(function(t,r,i){var s=this.get_settings().html.ajax;e.isFunction(s.error)&&s.error.call(this,t,r,i),n.call(this,!1)},this),i.ajax.dataType||(i.ajax.dataType="html"),e.isFunction(i.ajax.url)&&(i.ajax.url=i.ajax.url.call(this,t)),e.isFunction(i.ajax.data)&&(i.ajax.data=i.ajax.data.call(this,t)),e.ajax(i.ajax)}}}}),e.jstree.defaults.plugins.push("html")}(jQuery),function(e){e.jstree.plugin("json",{__construct:function(){this.get_container().bind("__after_close.jstree",e.proxy(function(t,n){var r=e(n.rslt.obj);this.get_settings(!0).json.progressive_unload&&(r.data("jstree").children=this.get_json(r)[0].children,r.children("ul").remove())},this))},defaults:{data:!1,ajax:!1,progressive_render:!1,progressive_unload:!1},_fn:{parse_json:function(t){var n=this.get_settings(!0).json;return e.isArray(t.children)&&n.progressive_render&&(t.data||(t.data={}),t.data.jstree||(t.data.jstree={}),t.data.jstree.children=t.children,t.children=!0),this.__call_old(!0,t)},_append_json_data:function(e,t){return e=this.get_node(e),e===-1&&(e=this.get_container()),t=this.parse_json(t),!t||!e.length?!1:(e.children("ul").length||e.append("<ul />"),e.children("ul").empty().append(t.is("li")?t:t.children("li")),!0)},_load_node:function(t,n){var r=!1,i=this.get_settings().json;t=this.get_node(t);if(!t)return!1;switch(!0){case t===-1&&this.get_container().data("jstree")&&e.isArray(this.get_container().data("jstree").children):return r=this.get_container().data("jstree").children,this.get_container().data("jstree").children=null,n.call(this,this._append_json_data(t,r));case t!==-1&&t.length&&t.data("jstree")&&e.isArray(t.data("jstree").children):return r=t.data("jstree").children,t.data("jstree").children=null,n.call(this,this._append_json_data(t,r));case!i.data&&!i.ajax:throw"Neither data nor ajax settings supplied.";case e.isFunction(i.data):return i.data.call(this,t,e.proxy(function(e){return n.call(this,this._append_json_data(t,e))},this));case!!i.data&&!i.ajax||!!i.data&&!!i.ajax&&t===-1:return n.call(this,this._append_json_data(t,i.data));case!i.data&&!!i.ajax||!!i.data&&!!i.ajax&&t!==-1:return i.ajax.success=e.proxy(function(r,i,s){var o=this.get_settings().json.ajax;e.isFunction(o.success)&&(r=o.success.call(this,r,i,s)||r),n.call(this,this._append_json_data(t,r))},this),i.ajax.error=e.proxy(function(t,r,i){var s=this.get_settings().json.ajax;e.isFunction(s.error)&&s.error.call(this,t,r,i),n.call(this,!1)},this),i.ajax.dataType||(i.ajax.dataType="json"),e.isFunction(i.ajax.url)&&(i.ajax.url=i.ajax.url.call(this,t)),e.isFunction(i.ajax.data)&&(i.ajax.data=i.ajax.data.call(this,t)),e.ajax(i.ajax)}}}})}(jQuery),function(e){var t=!1,n=0;e.jstree.plugin("rules",{__construct:function(){},defaults:{check_max_depth:!0,check_max_children:!0,check_valid_children:!0,types:{}},_fn:{get_rules:function(e){e=this.get_node(e);if(e===-1)return e=this.get_container(),e=e.data("jstree"),{type:!1,max_depth:e&&e.max_depth?e.max_depth:-1,max_children:e&&e.max_children?e.max_children:-1,valid_children:e&&e.valid_children?e.valid_children:-1};if(!e||!e.length)return!1;e=e.data("jstree");var t=this.get_settings().rules,n=this.get_type(e),r={type:n,max_depth:-1,max_children:-1,valid_children:-1};return n&&t[n]&&(t[n].max_depth&&(r.max_depth=t[n].max_depth),t[n].max_children&&(r.max_children=t[n].max_children),t[n].valid_children&&(r.valid_children=t[n].valid_children)),e&&e.max_depth&&(r.max_depth=e.max_depth),e&&e.max_children&&(r.max_children=e.max_children),e&&e.valid_children&&(r.valid_children=e.valid_children),r},get_type:function(e){return e=this.get_node(e),e===-1&&(e=this.get_container()),!e||!e.length?!1:(e=e.data("jstree"),e&&e.type?e.type:!1)},set_type:function(e,t){e=this.get_node(e),e===-1&&(e=this.get_container());if(!e||!e.length)return!1;var n=e.data("jstree");return n||(n={}),n.type=t,e.data("jstree",n),!0},check:function(r,i,s,o){if(this.__call_old()===!1)return!1;var u=!1,a=this.get_settings().rules,f=this,l=!1,c=0;switch(r){case"create_node":case"move_node":case"copy_node":if(a.check_max_children||a.check_valid_children||a.check_max_depth)u=this.get_rules(s);if(a.check_max_children&&typeof u.max_children!="undefined"&&u.max_children!==-1&&s.find("> ul > li").not(r==="move_node"?i:null).length+i.length>u.max_children)return!1;if(a.check_valid_children&&typeof u.valid_children!="undefined"&&u.valid_children!==-1){if(!e.isArray(u.valid_children))return!1;i.each(function(){if(e.inArray(f.get_type(this),u.valid_children)===-1)return f=!1,!1});if(f===!1)return!1}if(a.check_max_depth&&typeof u.max_depth!="undefined"&&u.max_depth!==-1){if(u.max_depth===0)return!1;c=0;if(t!==i){l=i;while(l.length>0)l=l.find("> ul > li"),c++;n=c,t=i}else c=n;l=0,s.children("a:eq(0)").parentsUntil(".jstree","li").each(function(e){var t=f.get_rules(this);if(typeof t.max_depth!="undefined"&&t.max_depth>=0&&t+e>t.max_depth)return f=!1,!1;l=e});if(f===!1)return!1;f=this.get_rules(-1);if(typeof f.max_depth!="undefined"&&f.max_depth>=0&&c+l>f.max_depth)return!1}}return!0}}}),e.jstree.defaults.plugins.push("rules")}(jQuery),function(e){e.jstree.plugin("sort",{__construct:function(){this.get_container().bind("load_node.jstree",e.proxy(function(e,t){var n=this.get_node(t.rslt.obj);n=n===-1?this.get_container_ul():n.children("ul"),this._sort(n,!0)},this)).bind("rename_node.jstree create_node.jstree",e.proxy(function(e,t){this._sort(t.rslt.obj.parent(),!1)},this)).bind("move_node.jstree copy_node.jstree",e.proxy(function(e,t){var n=t.rslt.parent===-1?this.get_container_ul():t.rslt.parent.children("ul");this._sort(n,!1)},this))},defaults:function(e,t){return this.get_text(e,!0)>this.get_text(t,!0)?1:-1},_fn:{_sort:function(t,n){var r=this.get_settings(!0).sort,i=this;t.append(e.makeArray(t.children("li")).sort(e.proxy(r,i))),t.children("li").each(function(){i.correct_node(this,!1)}),n&&(t.find("> li > ul").each(function(){i._sort(e(this))}),i.correct_node(t.children("li"),!0))}}}),e.jstree.defaults.plugins.push("sort")}(jQuery),function(e){e.jstree.plugin("state",{__construct:function(){if(typeof e.vakata.storage=="undefined")throw"jsTree state plugin: vakata storage helper not included.";this.get_container().bind("__loaded.jstree",e.proxy(function(e,t){this.restore_state()},this)).bind("__ready.jstree",e.proxy(function(t,n){this.get_container().bind(this.get_settings(!0).state.events,e.proxy(function(){this.save_state()},this))},this))},defaults:{key:"jstree",events:"select_node.jstree open_node.jstree close_node.jstree deselect_node.jstree deselect_all.jstree check_node.jstree uncheck_node.jstree uncheck_all.jstree"},_fn:{save_state:function(){var t=this.get_settings(!0).state;e.vakata.storage.set(t.key,this.get_state())},restore_state:function(){var t=this.get_settings(!0).state,n=e.vakata.storage.get(t.key);!n||this.set_state(n)}}})}(jQuery),function(e){var t=[];e.jstree.THEMES_DIR=!1,e.jstree.plugin("themes",{__construct:function(){this.get_container().bind("__construct.jstree",e.proxy(function(){var e=this.get_settings(!0).themes;this.data.themes.dots=e.dots,this.data.themes.icons=e.icons,e.url===!1&&e.theme===!1&&(e.theme=this.data.core.rtl?"default-rtl":"default"),this.set_theme(e.theme,e.url,e.no_load)},this)).bind("__construct.jstree __ready.jstree __loaded.jstree",e.proxy(function(){this[this.data.themes.dots?"show_dots":"hide_dots"](),this[this.data.themes.icons?"show_icons":"hide_icons"]()},this))},defaults:{theme:!1,url:!1,no_load:!1,dots:!0,icons:!0},_fn:{set_theme:function(n,r,i){if(!n)return!1;r||(r=e.jstree.THEMES_DIR+n+"/style.css"),!i&&e.inArray(r,t)===-1&&(e.vakata.css.add_sheet({url:r}),t.push(r)),this.data.themes.theme!==n&&(this.get_container().removeClass("jstree-"+this.data.themes.theme),this.data.themes.theme=n),this.get_container().addClass("jstree-"+n),this.__callback(n)},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=!0,this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=!1,this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){this.data.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this.data.themes.icons=!0,this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=!1,this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){this.data.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(e,t){return e=this.get_node(e),!e||e===-1||!e.length?!1:(e=e.find("> a > .jstree-themeicon"),t===!1?this.hide_icon(e):t.indexOf("/")===-1?e.addClass(t).attr("rel",t):e.css("background","url('"+t+"') center center no-repeat").attr("rel",t),!0)},get_icon:function(e){return e=this.get_node(e),!e||e===-1||!e.length?null:(e=e.find("> a > .jstree-themeicon"),e.hasClass("jstree-themeicon-hidden")?!1:(e=e.attr("rel"),e&&e.length?e:null))},hide_icon:function(e){return e=this.get_node(e),!e||e===-1||!e.length?!1:(e.find("> a > .jstree-themeicon").addClass("jstree-themeicon-hidden"),!0)},show_icon:function(e){return e=this.get_node(e),!e||e===-1||!e.length?!1:(e.find("> a > .jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0)},clean_node:function(t){t=this.__call_old();var n=this;return t.each(function(){var t=e(this),r=t.data("jstree");t.find("> a > ins.jstree-themeicon").length||t.children("a").prepend("<ins class='jstree-icon jstree-themeicon'>&#160;</ins>"),r&&typeof r.icon!="undefined"&&(n.set_icon(t,r.icon),delete r.icon)})},get_state:function(){var e=this.__call_old();return e.themes={theme:this.get_theme(),icons:this.data.themes.icons,dots:this.data.themes.dots},e},set_state:function(e,t){return this.__call_old()?e.themes?(e.themes.theme&&this.set_theme(e.themes.theme),typeof e.themes.dots!="undefined"&&this[e.themes.dots?"show_dots":"hide_dots"](),typeof e.themes.icons!="undefined"&&this[e.themes.icons?"show_icons":"hide_icons"](),delete e.themes,this.set_state(e,t),!1):!0:!1},get_json:function(e,t){var n=this.__call_old(),r;return t&&(r=this.get_icon(e),typeof r!="undefined"&&r!==null&&(n.data.jstree.icon=r)),n}}}),e(function(){e.jstree.THEMES_DIR===!1&&e("script").each(function(){if(this.src.toString().match(/jstree[^\/]*?\.js(\?.*)?$/))return e.jstree.THEMES_DIR=this.src.toString().replace(/jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/",!1}),e.jstree.THEMES_DIR===!1&&(e.jstree.THEMES_DIR="themes/");var t=".jstree a { text-decoration:none; } .jstree a > .jstree-themeicon { height:16px; width:16px; margin-right:3px; } .jstree-rtl a > .jstree-themeicon { margin-left:3px; margin-right:0; } .jstree .jstree-no-icons .jstree-themeicon, .jstree .jstree-themeicon-hidden { display:none; } ";e.jstree.IS_IE6&&(t+=".jstree li a .jstree-themeicon { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a .jstree-themeicon { margin-right:0px; margin-left:3px; } "),e.vakata.css.add_sheet({str:t,title:"jstree"})}),e.jstree.defaults.plugins.push("themes")}(jQuery),function(e){e.jstree.plugin("ui",{__construct:function(){this.data.ui.selected=e(),this.data.ui.hovered=null,this.data.ui.last_selected=!1,this.get_container().delegate("a","click.jstree",e.proxy(function(e,t){e.preventDefault(),e.currentTarget.blur();var n=this.get_settings(!0).ui;t&&(n.select_multiple_modifier!=="on"&&n.select_multiple_modifier!==!1&&t[n.select_multiple_modifier+"Key"]&&(e[n.select_multiple_modifier+"Key"]=t[n.select_multiple_modifier+"Key"]),n.select_range_modifier!=="on"&&n.select_range_modifier!==!1&&t[n.select_range_modifier+"Key"]&&(e[n.select_range_modifier+"Key"]=t[n.select_range_modifier+"Key"]));var r=this.get_node(e.currentTarget),i=this.is_selected(r),s=n.select_multiple_modifier==="on"||n.select_multiple_modifier!==!1&&e&&e[n.select_multiple_modifier+"Key"],o=n.select_range_modifier==="on"||n.select_range_modifier!==!1&&e&&e[n.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==r[0]&&this.data.ui.last_selected.parent()[0]===r.parent()[0];switch(!0){case o&&this.data.ui.last_selected!==!1:this.select_range(r);break;case o&&this.data.ui.last_selected===!1:this.select_one(r);break;case i&&s:this.deselect_node(r);break;default:this.select_one(r,s)}},this)).delegate("a","mouseenter.jstree",e.proxy(function(e){this.hover_node(e.target)},this)).delegate("a","mouseleave.jstree",e.proxy(function(e){this.dehover_node(e.target)},this)).bind("delete_node.jstree",e.proxy(function(t,n){var r=this.get_node(n.rslt.obj),i=r&&r.length?r.find("a.jstree-clicked"):e(),s=this;i.each(function(){s.deselect_node(this)})},this)).bind("move_node.jstree",e.proxy(function(e,t){t.rslt.cy&&t.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")},this))},defaults:{select_multiple_modifier:"ctrl",select_range_modifier:"shift",disable_nested_selection:!0},_fn:{get_node:function(e,t){return typeof e=="undefined"||e===null?t?this.data.ui.selected:this.data.ui.last_selected:this.__call_old()},hover_node:function(e){e=this.get_node(e);if(!e||!e.length||this.is_loading(e))return!1;e.hasClass("jstree-hovered")||this.dehover_node(),this.data.ui.hovered=e.children("a").addClass("jstree-hovered").parent(),this.scroll_to_node(e),this.__callback({obj:e})},dehover_node:function(){var e=this.data.ui.hovered,t;if(!e||!e.length)return!1;t=e.children("a").removeClass("jstree-hovered").parent(),this.data.ui.hovered[0]===t[0]&&(this.data.ui.hovered=null),this.__callback({obj:e})},select_node:function(e){var t=this;e=this.get_node(e);if(e===-1||!e||!e.length||this.is_loading(e))return!1;e.children("a").addClass("jstree-clicked"),this.data.ui.last_selected=e,this.data.ui.selected=this.data.ui.selected.add(e),e.parents(".jstree-closed").each(function(){t.open_node(this,!1,0)}),this.__callback({obj:e})},deselect_node:function(e){e=this.get_node(e);if(!e||!e.length)return!1;this.is_selected(e)&&(e.children("a").removeClass("jstree-clicked"),this.data.ui.selected=this.data.ui.selected.not(e),this.data.ui.last_selected.get(0)===e.get(0)&&(this.data.ui.last_selected=this.data.ui.selected.eq(0)),this.__callback({obj:e}))},deselect_all:function(t){var n=t?e(t).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();n.children("a.jstree-clicked").removeClass("jstree-clicked"),this.data.ui.selected=e(),this.data.ui.last_selected=!1,this.__callback({obj:n})},is_selected:function(e){return this.data.ui.selected.index(this.get_node(e))>=0},get_selected:function(t){return t?e(t).find("a.jstree-clicked").parent():this.data.ui.selected},select_range:function(e,t,n){var r=this,i,s;return e=this.get_node(e),t||(s=!0,t=this.data.ui.last_selected),t=this.get_node(t),e===-1||!e||!e.length||this.is_loading(e)?!1:t===-1||!t||!t.length||this.is_loading(t)?!1:(n||this.deselect_all(),i=e.index()<t.index(),t.addClass("jstree-last-selected"),e=e[i?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf().add(".jstree-last-selected"),t.removeClass("jstree-last-selected"),i||(e=e.vakata_reverse()),e.length?(e.each(function(){r.select_node(this)}),s&&(this.data.ui.last_selected=t),this.__callback({obj:e}),!0):!1)},select_one:function(e,t){e=this.get_node(e);if(e===-1||!e||!e.length||this.is_loading(e))return!1;if(!t)this.deselect_all();else if(this.get_settings(!0).ui.disable_nested_selection&&(e.parentsUntil(".jstree","li").children("a.jstree-clicked:eq(0)").length||e.children("ul").find("a.jstree-clicked:eq(0)").length))return!1;return this.select_node(e),this.__callback({obj:e}),!0},clean_node:function(t){t=this.__call_old();var n=this;return t.each(function(){var t=e(this),r=t.data("jstree");t.find(".jstree-clicked").removeClass("jstree-clicked"),r&&r.selected&&(setTimeout(function(){n.select_node(t)},0),delete r.selected)})},get_state:function(){var e=this.__call_old();return e.selected=[],this.data.ui.selected.each(function(){e.selected.push(this.id)}),e},set_state:function(t,n){if(this.__call_old()){if(t.selected){var r=this;return this.deselect_all(),e.each(t.selected,function(e,t){r.select_node(document.getElementById(t))}),delete t.selected,this.set_state(t,n),!1}return!0}return!1},get_json:function(e,t){var n=this.__call_old();return t&&this.is_selected(e)&&(n.data.jstree.selected=!0),n}}}),e.jstree.defaults.plugins.push("ui")}(jQuery),function(e){e.jstree.plugin("unique",{_fn:{check:function(t,n,r,i){if(!this.__call_old())return!1;r=r===-1?this.get_container():r;var s=t==="rename_node"?e("<div />").html(i).text():this.get_text(n,!0),o=[],u=this;r.children("ul").children("li").each(function(){o.push(u.get_text(this,!0))});switch(t){case"delete_node":return!0;case"rename_node":case"copy_node":return e.inArray(s,o)===-1;case"move_node":return r.children("ul").children("li").index(n)!==-1||e.inArray(s,o)===-1}return!0}}}),e.jstree.defaults.plugins.push("unique")}(jQuery),function(e){e.jstree.plugin("wholerow",{__construct:function(){if(!this.data.ui)throw"jsTree wholerow: jsTree UI plugin not included.";this.data.themes&&this.get_container().bind("set_state.jstree",e.proxy(function(){this.hide_dots()},this)),this.get_container().bind("__ready.jstree",e.proxy(function(){var t=this;e(function(){t.get_container_ul().addClass("jstree-wholerow-ul"),e.vakata.css.add_sheet({str:".jstree-"+t.get_index()+" .jstree-wholerow { height:"+t.data.core.li_height+"px; }",title:"jstree"})})},this)).bind("deselect_all.jstree",e.proxy(function(e,t){this.get_container().find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).bind("select_node.jstree deselect_node.jstree ",e.proxy(function(t,n){n.rslt.obj.each(function(){e(this).children(".jstree-wholerow")[t.type==="select_node"?"addClass":"removeClass"]("jstree-wholerow-clicked")})},this)).bind("hover_node.jstree dehover_node.jstree",e.proxy(function(t,n){this.get_container().find(".jstree-wholerow-hovered").removeClass("jstree-wholerow-hovered"),t.type==="hover_node"&&n.rslt.obj.each(function(){e(this).children(".jstree-wholerow").addClass("jstree-wholerow-hovered")})},this)).delegate(".jstree-wholerow","click.jstree",function(t){t.stopImmediatePropagation(),e(t.currentTarget).closest("li").children("a:eq(0)").trigger("click",t)}).delegate(".jstree-leaf > .jstree-ocl","click.jstree",e.proxy(function(t){t.stopImmediatePropagation(),e(t.currentTarget).closest("li").children("a:eq(0)").trigger("click",t)},this)).delegate("li","mouseover.jstree",e.proxy(function(t){return t.stopImmediatePropagation(),e(t.currentTarget).closest("li").children(".jstree-hovered, .jstree-clicked").length?!1:(this.hover_node(t.currentTarget),!1)},this)).delegate("li","mouseleave.jstree",e.proxy(function(e){this.dehover_node(e.currentTarget)},this))},defaults:{},__destroy:function(){this.get_container().find(".jstree-wholerow").remove()},_fn:{clean_node:function(t){t=this.__call_old();var n=this;return t.each(function(){var t=e(this);t.find("> .jstree-wholerow").length||t.prepend("<div class='jstree-wholerow' style='position:absolute;' unselectable='on'>&#160;</div>")})}}}),e(function(){e.vakata.css.add_sheet({str:".jstree .jstree-wholerow-ul { position:relative; display:inline-block; min-width:100%; }.jstree-wholerow-ul li > a, .jstree-wholerow-ul li > ins { position:relative; }.jstree-wholerow-ul .jstree-wholerow { width:100%; cursor:pointer; position:absolute; left:0; user-select:none;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; }",title:"jstree"})}),e.jstree.defaults.plugins.push("wholerow")}(jQuery),function(e){var t={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) &gt; 0" /> <li> <xsl:for-each select="@*"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:for-each> <a> <xsl:for-each select="./content/@*"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:for-each> <xsl:copy-of select="./content/child::node()" /> </a> <xsl:if test="$children"><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:call-template> </xsl:for-each> </ul></xsl:template><xsl:template name="nodes"> <xsl:param name="node" /> <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" /> <li> <xsl:for-each select="@*"> <xsl:if test="name() != \'parent_id\'"> <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> </xsl:if> </xsl:for-each> <a> <xsl:for-each select="./content/@*"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:for-each> <xsl:copy-of select="./content/child::node()" /> </a> <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:call-template> </xsl:for-each> </ul> </xsl:if> </li></xsl:template></xsl:stylesheet>'},n=function(e){return e.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};e.jstree.plugin("xml",{defaults:{xsl:"flat",data:!1,ajax:!1},_fn:{_append_xml_data:function(n,r){return r=e.vakata.xslt(r,t[this.get_settings().xml.xsl]),r===!1?!1:(r=e(r),!r||!r.length||!r.is("ul, li")?!1:(n=this.get_node(n),n===-1&&(n=this.get_container()),n.length?(n.children("ul").length||n.append("<ul />"),n.children("ul").empty().append(r.is("ul")?r.children("li"):r),!0):!1))},_load_node:function(t,n){var r=!1,i=this.get_settings().xml;t=this.get_node(t);if(!t)return!1;switch(!0){case e.isFunction(i.data):return i.data.call(this,t,e.proxy(function(e){return n.call(this,this._append_xml_data(t,e))},this));case!!i.data&&!i.ajax||!!i.data&&!!i.ajax&&t===-1:return n.call(this,this._append_xml_data(t,i.data));case!i.data&&!!i.ajax||!!i.data&&!!i.ajax&&t!==-1:return i.ajax.success=e.proxy(function(r,i,s){var o=this.get_settings().xml.ajax;e.isFunction(o.success)&&(r=o.success.call(this,r,i,s)||r),n.call(this,this._append_xml_data(t,r))},this),i.ajax.error=e.proxy(function(t,r,i){var s=this.get_settings().xml.ajax;e.isFunction(s.error)&&s.error.call(this,t,r,i),n.call(this,!1)},this),i.ajax.dataType||(i.ajax.dataType="xml"),e.isFunction(i.ajax.url)&&(i.ajax.url=i.ajax.url.call(this,t)),e.isFunction(i.ajax.data)&&(i.ajax.data=i.ajax.data.call(this,t)),e.ajax(i.ajax)}},get_xml:function(t,r,i){var s="";return t||(t="flat"),typeof i=="undefined"?(r=this.get_json(r),e.each(r,e.proxy(function(e,n){s+=this.get_xml(t,n,!0)},this)),'<?xml version="1.0" encoding="utf-8" ?><root>'+s+"</root>"):(s+="<item",t==="flat"&&i!==!0&&(s+=' parent_id="'+n(i)+'"'),r.data&&!e.isEmptyObject(r.data)&&e.each(r.data,function(t,r){e.isEmptyObject(r)||(s+=" data-"+t+'="'+n(e.vakata.json.encode(r))+'"')}),e.each(r.li_attr,function(e,t){s+=" "+e+'="'+n(t)+'"'}),s+=">",s+="<content",e.each(r.a_attr,function(e,t){s+=" "+e+'="'+n(t)+'"'}),s+="><![CDATA["+r.title+"]]></content>",t==="flat"&&(s+="</item>"),r.children&&e.each(r.children,e.proxy(function(e,n){s+=this.get_xml(t,n,r.li_attr&&r.li_attr.id?r.li_attr.id:!0)},this)),t==="nest"&&(s+="</item>"),s)}}}),e.jstree.defaults.plugins.push("xml")}(jQuery),function(e){e.jstree.plugin("z_no_clean",{_fn:{clean_node:function(e){return!1}}}),e.jstree.defaults.plugins.push("z_no_clean")}(jQuery);