From f4754968151a061b898b73090c0539fa161a0880 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 4 Nov 2010 19:30:39 +0000 Subject: [PATCH] Updated jsTree version. Auto-expanded group list onload. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8046 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/css/jstree.css | 213 ++ xCAT-UI/css/style.css | 2 +- xCAT-UI/css/tree.css | 115 - xCAT-UI/images/jstree.gif | Bin 0 -> 2944 bytes xCAT-UI/images/jstree.png | Bin 0 -> 7635 bytes xCAT-UI/js/jquery/jquery.jstree.js | 3510 ++++++++++++++++++++++++++++ xCAT-UI/js/jquery/jquery.tree.js | 2064 ---------------- xCAT-UI/js/nodes/nodes.js | 81 +- xCAT-UI/js/nodes/physical.js | 8 +- xCAT-UI/js/ui.js | 2 +- xCAT-UI/lib/ui.php | 2 +- 11 files changed, 3776 insertions(+), 2221 deletions(-) create mode 100644 xCAT-UI/css/jstree.css delete mode 100644 xCAT-UI/css/tree.css create mode 100644 xCAT-UI/images/jstree.gif create mode 100644 xCAT-UI/images/jstree.png create mode 100644 xCAT-UI/js/jquery/jquery.jstree.js delete mode 100644 xCAT-UI/js/jquery/jquery.tree.js diff --git a/xCAT-UI/css/jstree.css b/xCAT-UI/css/jstree.css new file mode 100644 index 000000000..e63de4848 --- /dev/null +++ b/xCAT-UI/css/jstree.css @@ -0,0 +1,213 @@ +/* + * jsTree default theme 1.0 + * Supported features: dots/no-dots, icons/no-icons, focused, loading + * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search + */ +.jstree-default li,.jstree-default ins { + background-image: url("../images/jstree.png"); + background-repeat: no-repeat; + background-color: transparent; +} + +.jstree-default li { + background-position: -90px 0; + background-repeat: repeat-y; +} + +.jstree-default li.jstree-last { + background: transparent; +} + +.jstree-default .jstree-open>ins { + background-position: -72px 0; +} + +.jstree-default .jstree-closed>ins { + background-position: -54px 0; +} + +.jstree-default .jstree-leaf>ins { + background-position: -36px 0; +} + +.jstree-default .jstree-hovered { + background: #e7f4f9; + border: 1px solid #d8f0fa; + padding: 0 2px 0 1px; +} + +.jstree-default .jstree-clicked { + background: #C0E2FF; + border : 1px solid #79B7E7; + padding: 0 2px 0 1px; +} + +.jstree-default a .jstree-icon { + background-position: -56px -19px; +} + +.jstree-default a.jstree-loading .jstree-icon { + background: url("../images/throbber.gif") center center no-repeat !important; +} + +.jstree-default .jstree-no-dots li,.jstree-default .jstree-no-dots .jstree-leaf>ins + { + background: transparent; +} + +.jstree-default .jstree-no-dots .jstree-open>ins { + background-position: -18px 0; +} + +.jstree-default .jstree-no-dots .jstree-closed>ins { + background-position: 0 0; +} + +.jstree-default .jstree-no-icons a .jstree-icon { + display: none; +} + +.jstree-default .jstree-search { + font-style: italic; +} + +.jstree-default .jstree-no-icons .jstree-checkbox { + display: inline-block; +} + +.jstree-default .jstree-no-checkboxes .jstree-checkbox { + display: none !important; +} + +.jstree-default .jstree-checked>a>.jstree-checkbox { + background-position: -38px -19px; +} + +.jstree-default .jstree-unchecked>a>.jstree-checkbox { + background-position: -2px -19px; +} + +.jstree-default .jstree-undetermined>a>.jstree-checkbox { + background-position: -20px -19px; +} + +.jstree-default .jstree-checked>a>.jstree-checkbox:hover { + background-position: -38px -37px; +} + +.jstree-default .jstree-unchecked>a>.jstree-checkbox:hover { + background-position: -2px -37px; +} + +.jstree-default .jstree-undetermined>a>.jstree-checkbox:hover { + background-position: -20px -37px; +} + +#vakata-dragged.jstree-default ins { + background: transparent !important; +} + +#vakata-dragged.jstree-default .jstree-ok { + background: url("../images/jstree.png") -2px -53px no-repeat !important; +} + +#vakata-dragged.jstree-default .jstree-invalid { + background: url("../images/jstree.png") -18px -53px no-repeat !important; +} + +#jstree-marker.jstree-default { + background: url("../images/jstree.png") -41px -57px no-repeat !important; +} + +.jstree-default a.jstree-search { + color: aqua; +} + +#vakata-contextmenu.jstree-default-context,#vakata-contextmenu.jstree-default-context li ul + { + background: #f0f0f0; + border: 1px solid #979797; + -moz-box-shadow: 1px 1px 2px #999; + -webkit-box-shadow: 1px 1px 2px #999; + box-shadow: 1px 1px 2px #999; +} + +#vakata-contextmenu.jstree-default-context li { + +} + +#vakata-contextmenu.jstree-default-context a { + color: black; +} + +#vakata-contextmenu.jstree-default-context a:hover,#vakata-contextmenu.jstree-default-context .vakata-hover>a + { + padding: 0 5px; + background: #e8eff7; + border: 1px solid #aecff7; + color: black; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; +} + +#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a,#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover + { + color: silver; + background: transparent; + border: 0; + padding: 1px 4px; +} + +#vakata-contextmenu.jstree-default-context li.vakata-separator { + background: white; + border-top: 1px solid #e0e0e0; + margin: 0; +} + +#vakata-contextmenu.jstree-default-context li ul { + margin-left: -4px; +} + +/* IE6 BEGIN */ +.jstree-default li,.jstree-default ins,#vakata-dragged.jstree-default .jstree-invalid,#vakata-dragged.jstree-default .jstree-ok,#jstree-marker.jstree-default + { + _background-image: url("../images/jstree.gif"); +} + +.jstree-default .jstree-open ins { + _background-position: -72px 0; +} + +.jstree-default .jstree-closed ins { + _background-position: -54px 0; +} + +.jstree-default .jstree-leaf ins { + _background-position: -36px 0; +} + +.jstree-default a ins.jstree-icon { + _background-position: -56px -19px; +} + +#vakata-contextmenu.jstree-default-context ins { + _display: none; +} + +#vakata-contextmenu.jstree-default-context li { + _zoom: 1; +} + +.jstree-default .jstree-undetermined a .jstree-checkbox { + _background-position: -20px -19px; +} + +.jstree-default .jstree-checked a .jstree-checkbox { + _background-position: -38px -19px; +} + +.jstree-default .jstree-unchecked a .jstree-checkbox { + _background-position: -2px -19px; +} +/* IE6 END */ \ No newline at end of file diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css index 9238b2cf0..a49f86aaf 100644 --- a/xCAT-UI/css/style.css +++ b/xCAT-UI/css/style.css @@ -146,7 +146,7 @@ body { font: 12px verdana, arial, helvetica, sans-serif; color: #0000FF; display: inline-table; - padding: 5px 15px 15px 5px; + padding: 5px 15px 5px 15px; /* Top right bottom left */ text-decoration: none; cursor: pointer; } diff --git a/xCAT-UI/css/tree.css b/xCAT-UI/css/tree.css deleted file mode 100644 index fdbf3f953..000000000 --- a/xCAT-UI/css/tree.css +++ /dev/null @@ -1,115 +0,0 @@ -/*** LOCKED ***/ -.tree-default .locked li a { - color: gray; -} - -/*** DOTS ***/ -.tree-default ul { - background-position: 6px 1px; - background-repeat: repeat-y; - background-image: - url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==) - ; - _background-image: url("../images/dot_for_ie.gif"); * - background-image: url("../images/dot_for_ie.gif"); -} - -.tree-default li { - background-position: -64px -16px; - background-repeat: no-repeat; - background-image: url("../images/icons.png"); -} - -/*** NO DOTS ***/ -.tree-default .no_dots,.tree-default .no_dots ul { - background: transparent; -} - -.tree-default .no_dots li.leaf { - background-image: none; - background-color: transparent; -} - -/*** OPEN or CLOSED ***/ -.tree-default li.open { - background: url("../images/icons.png") -32px -48px no-repeat; -} - -.tree-default li.closed,#jstree-dragged.tree-default li li.open { - background: url("../images/icons.png") -48px -32px no-repeat; -} - -#jstree-marker { - background-image: url("../images/icons.png"); -} - -/*** DEFAULT, HOVER, CLICKED, LOADING STATES ***/ -.tree-default li a,.tree-default li span { - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; -} - -.tree-default li a:hover,.tree-default li a.hover,.tree-default li span - { - background: #EFF5FB; - border: 1px solid #d8f0fa; - padding: 0px 3px 0px 3px; -} - -.tree-default li a.clicked,.tree-default li a.clicked:hover,.tree-default li span.clicked - { - background: #A9D0F5; - border: 1px solid #99defd; - padding: 0px 3px 0px 3px; -} - -/*** ICONS ***/ -.tree-default ins { - background-image: url("../images/icons.png"); - background-position: 0 0; - background-repeat: no-repeat; -} - -.tree-default ul li a.loading ins { - background-image: url("../images/throbber.gif") !important; - background-position: 0 0 !important; -} /* UL is added to make selector stronger */ -.tree-default li a ins.forbidden { - background-position: -16px -16px; -} - -.tree-default .locked li a ins { - background-position: 0 -48px; -} - -.tree-default li span ins { - background-position: -16px 0; -} - -#jstree-dragged.tree-default ins { - background: url("../images/icons.png") -16px -32px no-repeat; -} - -#jstree-dragged.tree-default ins.forbidden { - background: url("../images/icons.png") -16px -16px no-repeat; -} - -/*** CONTEXT MENU ***/ -.tree-default-context a ins { - background-image: url("../images/icons.png"); - background-repeat: no-repeat; - background-position: -64px -64px; -} - -.tree-default-context a ins.create { - background-position: 0 -16px; -} - -.tree-default-context a ins.rename { - background-position: -16px 0px; -} - -.tree-default-context a ins.remove { - background-position: 0 -32px; -} \ No newline at end of file diff --git a/xCAT-UI/images/jstree.gif b/xCAT-UI/images/jstree.gif new file mode 100644 index 0000000000000000000000000000000000000000..0e958d38716d93d4050a993398dec77490f836c7 GIT binary patch literal 2944 zcmV-`3xD)SNk%w1VQc_M0QUd@|Ns9T9UI-*+}hOI)X&uI>Fueesi&l;_4D=X>Ff9N z_^73+<>2S=?eg2$-Rb7+rKF~$qowBL>HGTqot@-$b)vAa-N3-zetw2ZN=<`h9~Dx1iA9(#Y7#W29s5^zQNY z@mHQyr@5v^Z9@@%1}KXkHjyloo07WIwi}EEn4Om$l>sxE8(FDGBAoytl>{Z40y?1` zR;@iNqyQcB$0153RSP`?#W!4_i2E@;Uzh|^(_*KC^Fd34k}d(%gV-cq&f zk(TFNpXh9@?t9Psr`!C!#Q%zrxLR+6GTYq7|NF z_U*{{@Xh$@y6D%T@Zqx0!<^a8r}*#F`t#hOjaS64bn@Dk-pPvG$dJ{=ne*nrpNdnv zq-VjYY^#`N%eH^y&Y01@jOE+L-@1tC)3*2P+xYF?`S0TT^5@;6S>C8);HqZcsb=7- zXy2-6;jC)mt!&?{YvHbK@!7of<gww0>FMX^=jG+);^N}n-QC*S+SS$7&CSiJsi~)@r=_K(qobptp`o9jpP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AP(Z?^nHu!BJM+*(d+im& zqq__|B+-Nu^f!^j5j@E7^*_hcL%uEZy=RGL?jlN3G7vGfsp9lKw3b- z3bx<_6hHw5J)jtOsPBX8n@4(THWYLK;Rh&8;SYE)GYH7(9D);o5pJ+8Zn*3S{5}8rcUv>Osgt z8uA{&8OU(%VSq+DvXRqCq(Fv)oO|3O0?(liK^noyPS(+mkiert#36zdAkhROc)=4} za}r9p@|CQNWoT3*%UaqpmYtbJFMh$xU-;se!1To|2qKD6kOCE^Fa;?{kxXTdLKMUt z#VMv)ifWeP6sAzcGjCZCU+jVx;0&iYk>Lx1kRlYg2!$-x$xd{_f)oTP1uUFF&wAz} z7omWKEKb4yn$G+p8MaUcGiadSxwyqI2x5v*vCEMJH(Cij3OAqkI|z zG*{zKWFVs!CrySjmSGEZx|ATP_=Kuh%r>M@YTL1aq+g3{a*M%Qv>qe6|CsI)diOgi1P=mi&SA+r-uZXggH|h$*4rCO&aD|q~tK}~5!pdWv#V>?G<}#Z(7-AJjF;TIKHoLk1 z&8FDqK#JK+Rj9%g)10Q9g?!pR`?)l<{Ij43jgde{#2W@dG@()Q1%!0t8;TalH^T9a zMLT9AZn%RS3?dC{aKjsl_Qp590gg%|WF70U^gxzikT1x=4P+rm!|(=qX+a=b zSi{xU@PvanI~vi>2DQ6!ZER;d*tlHC6VPx5Go%3uVmJeEn~;!d*!mgIP&YRgvW_4a zT-$?g0&u(FI4m4NA+?5fy1PMegTGsrsyV{rvJi!iKfK@4c(%l)P4R>j{Nk2f7Qz(h z=L8`rq#DzhM#w{M>u79a;Mhhu#vdYtCN#n2384lyU>@^pINR3N*akL!4R2NdV+ccF qh|s4|4QdF4*3gi~HB8?0oePB;MxS-nolf>ymi_E#FNj?N0suQ%s<;XO literal 0 HcmV?d00001 diff --git a/xCAT-UI/images/jstree.png b/xCAT-UI/images/jstree.png new file mode 100644 index 0000000000000000000000000000000000000000..8540175a04b0cd303e3966d1727f30ee9b8a7254 GIT binary patch literal 7635 zcmV;^9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fkHW+t9RAU$yu7c(TUvhWz>QxvW*5K{ zLQHnyXA|KI%|blr8uPtNp(fLR50pyihEsuaF<_DWz2%lnU=4@L!(m-sNdYEP*$$^0 z css_rules.length + 5) { return false; } + if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) { + if(delete_flag === true) { + if(sheet.removeRule) { sheet.removeRule(j); } + if(sheet.deleteRule) { sheet.deleteRule(j); } + return true; + } + else { return css_rules[j]; } + } + } + while (css_rules[++j]); + return false; + }, + add_css : function(rule_name, sheet) { + if($.jstree.css.get_css(rule_name, false, sheet)) { return false; } + if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); } + return $.vakata.css.get_css(rule_name); + }, + remove_css : function(rule_name, sheet) { + return $.vakata.css.get_css(rule_name, true, sheet); + }, + add_sheet : function(opts) { + var tmp; + if(opts.str) { + tmp = document.createElement("style"); + tmp.setAttribute('type',"text/css"); + if(tmp.styleSheet) { + document.getElementsByTagName("head")[0].appendChild(tmp); + tmp.styleSheet.cssText = opts.str; + } + else { + tmp.appendChild(document.createTextNode(opts.str)); + document.getElementsByTagName("head")[0].appendChild(tmp); + } + return tmp.sheet || tmp.styleSheet; + } + if(opts.url) { + if(document.createStyleSheet) { + try { tmp = document.createStyleSheet(opts.url); } catch (e) { } + } + else { + tmp = document.createElement('link'); + tmp.rel = 'stylesheet'; + tmp.type = 'text/css'; + tmp.media = "all"; + tmp.href = opts.url; + document.getElementsByTagName("head")[0].appendChild(tmp); + return tmp.styleSheet; + } + } + } + }; +})(jQuery); + +/* + * jsTree core 1.0 + */ +(function ($) { + // private variables + var instances = [], // instance array (used by $.jstree.reference/create/focused) + focused_instance = -1, // the index in the instance array of the currently focused instance + plugins = {}, // list of included plugins + prepared_move = {}, // for the move plugin + is_ie6 = false; + + // jQuery plugin wrapper (thanks to jquery UI widget function) + $.fn.jstree = function (settings) { + var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node") + args = Array.prototype.slice.call(arguments, 1), + returnValue = this; + + // extend settings and allow for multiple hashes and metadata + if(!isMethodCall && $.meta) { args.push($.metadata.get(this).jstree); } + settings = !isMethodCall && args.length ? $.extend.apply(null, [true, settings].concat(args)) : settings; + // block calls to "private" methods + if(isMethodCall && settings.substring(0, 1) == '_') { return returnValue; } + + // if a method call execute the method on all selected instances + if(isMethodCall) { + this.each(function() { + var instance = instances[$.data(this, "jstree-instance-id")], + methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance; + if(typeof methodValue !== "undefined" && (settings.indexOf("is_" === 0) || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; } + }); + } + else { + this.each(function() { + var instance_id = $.data(this, "jstree-instance-id"), + s = false; + // if an instance already exists, destroy it first + if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); } + // push a new empty object to the instances array + instance_id = parseInt(instances.push({}),10) - 1; + // store the jstree instance id to the container element + $.data(this, "jstree-instance-id", instance_id); + // clean up all plugins + if(!settings) { settings = {}; } + settings.plugins = $.isArray(settings.plugins) ? settings.plugins : $.jstree.defaults.plugins; + if($.inArray("core", settings.plugins) === -1) { settings.plugins.unshift("core"); } + + // only unique plugins (NOT WORKING) + // settings.plugins = settings.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(","); + + // extend defaults with passed data + s = $.extend(true, {}, $.jstree.defaults, settings); + s.plugins = settings.plugins; + $.each(plugins, function (i, val) { if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; } }); + // push the new object to the instances array (at the same time set the default classes to the container) and init + instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s); + // init all activated plugins for this instance + $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; }); + $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } }); + // initialize the instance + instances[instance_id].init(); + }); + } + // return the jquery selection (or if it was a method call that returned a value - the returned value) + return returnValue; + }; + // object to store exposed functions and objects + $.jstree = { + defaults : { + plugins : [] + }, + _focused : function () { return instances[focused_instance] || null; }, + _reference : function (needle) { + // get by instance id + if(instances[needle]) { return instances[needle]; } + // get by DOM (if still no luck - return null + var o = $(needle); + if(!o.length && typeof needle === "string") { o = $("#" + needle); } + if(!o.length) { return null; } + return instances[o.closest(".jstree").data("jstree-instance-id")] || null; + }, + _instance : function (index, container, settings) { + // for plugins to store data in + this.data = { core : {} }; + this.get_settings = function () { return $.extend(true, {}, settings); }; + this._get_settings = function () { return settings; }; + this.get_index = function () { return index; }; + this.get_container = function () { return container; }; + this._set_settings = function (s) { + settings = $.extend(true, {}, settings, s); + }; + }, + _fn : { }, + plugin : function (pname, pdata) { + pdata = $.extend({}, { + __init : $.noop, + __destroy : $.noop, + _fn : {}, + defaults : false + }, pdata); + plugins[pname] = pdata; + + $.jstree.defaults[pname] = pdata.defaults; + $.each(pdata._fn, function (i, val) { + val.plugin = pname; + val.old = $.jstree._fn[i]; + $.jstree._fn[i] = function () { + var rslt, + func = val, + args = Array.prototype.slice.call(arguments), + evnt = new $.Event("before.jstree"), + rlbk = false; + + // Check if function belongs to the included plugins of this instance + do { + if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; } + func = func.old; + } while(func); + if(!func) { return; } + + // a chance to stop execution (or change arguments): + // * just bind to jstree.before + // * check the additional data object (func property) + // * call event.stopImmediatePropagation() + // * return false (or an array of arguments) + rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args }); + if(rslt === false) { return; } + if(typeof rslt !== "undefined") { args = rslt; } + + // context and function to trigger events, then finally call the function + if(i.indexOf("_") === 0) { + rslt = func.apply(this, args); + } + else { + rslt = func.apply( + $.extend({}, this, { + __callback : function (data) { + this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk }); + }, + __rollback : function () { + rlbk = this.get_rollback(); + return rlbk; + }, + __call_old : function (replace_arguments) { + return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) ); + } + }), args); + } + + // return the result + return rslt; + }; + $.jstree._fn[i].old = val.old; + $.jstree._fn[i].plugin = pname; + }); + }, + rollback : function (rb) { + if(rb) { + if(!$.isArray(rb)) { rb = [ rb ]; } + $.each(rb, function (i, val) { + instances[val.i].set_rollback(val.h, val.d); + }); + } + } + }; + // set the prototype for all instances + $.jstree._fn = $.jstree._instance.prototype = {}; + + // css functions - used internally + + // load the css when DOM is ready + $(function() { + // code is copied form jQuery ($.browser is deprecated + there is a bug in IE) + var u = navigator.userAgent.toLowerCase(), + v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], + css_string = '' + + '.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; } ' + + '.jstree-rtl li { margin-left:0; margin-right:18px; } ' + + '.jstree > ul > li { margin-left:0px; } ' + + '.jstree-rtl > ul > li { margin-right:0px; } ' + + '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' + + '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' + + '.jstree a:focus { outline: none; } ' + + '.jstree a > ins { height:16px; width:16px; } ' + + '.jstree a > .jstree-icon { margin-right:3px; } ' + + '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' + + 'li.jstree-open > ul { display:block; } ' + + 'li.jstree-closed > ul { display:none; } '; + // Correct IE 6 (does not support the > CSS selector) + if(/msie/.test(u) && parseInt(v, 10) == 6) { + is_ie6 = true; + css_string += '' + + '.jstree li { height:18px; margin-left:0; margin-right:0; } ' + + '.jstree li li { margin-left:18px; } ' + + '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' + + 'li.jstree-open ul { display:block; } ' + + 'li.jstree-closed ul { display:none !important; } ' + + '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' + + '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' + + '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } '; + } + // Correct IE 7 (shifts anchor nodes onhover) + if(/msie/.test(u) && parseInt(v, 10) == 7) { + css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } '; + } + $.vakata.css.add_sheet({ str : css_string }); + }); + + // core functions (open, close, create, update, delete) + $.jstree.plugin("core", { + __init : function () { + this.data.core.to_open = $.map($.makeArray(this.get_settings().core.initially_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'); }); + }, + defaults : { + html_titles : false, + animation : 500, + initially_open : [], + rtl : false, + strings : { + loading : "Loading ...", + new_node : "New node" + } + }, + _fn : { + init : function () { + this.set_focus(); + if(this._get_settings().core.rtl) { + this.get_container().addClass("jstree-rtl").css("direction", "rtl"); + } + this.get_container().html(""); + this.data.core.li_height = this.get_container().find("ul li.jstree-closed, ul li.jstree-leaf").eq(0).height() || 18; + + this.get_container() + .delegate("li > ins", "click.jstree", $.proxy(function (event) { + var trgt = $(event.target); + if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); } + }, this)) + .bind("mousedown.jstree", $.proxy(function () { + this.set_focus(); // This used to be setTimeout(set_focus,0) - why? + }, this)) + .bind("dblclick.jstree", function (event) { + var sel; + if(document.selection && document.selection.empty) { document.selection.empty(); } + else { + if(window.getSelection) { + sel = window.getSelection(); + try { + sel.removeAllRanges(); + sel.collapse(); + } catch (err) { } + } + } + }); + this.__callback(); + this.load_node(-1, function () { this.loaded(); this.reopen(); }); + }, + destroy : function () { + var i, + n = this.get_index(), + s = this._get_settings(), + _this = this; + + $.each(s.plugins, function (i, val) { + try { plugins[val].__destroy.apply(_this); } catch(err) { } + }); + this.__callback(); + // set focus to another instance if this one is focused + if(this.is_focused()) { + for(i in instances) { + if(instances.hasOwnProperty(i) && i != n) { + instances[i].set_focus(); + break; + } + } + } + // if no other instance found + if(n === focused_instance) { focused_instance = -1; } + // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events + this.get_container() + .unbind(".jstree") + .undelegate(".jstree") + .removeData("jstree-instance-id") + .find("[class^='jstree']") + .andSelf() + .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); + // remove the actual data + instances[n] = null; + delete instances[n]; + }, + save_opened : function () { + var _this = this; + this.data.core.to_open = []; + this.get_container().find(".jstree-open").each(function () { + _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/')); + }); + this.__callback(_this.data.core.to_open); + }, + reopen : function (is_callback) { + var _this = this, + done = true, + current = [], + remaining = []; + if(!is_callback) { this.data.core.reopen = false; this.data.core.refreshing = true; } + if(this.data.core.to_open.length) { + $.each(this.data.core.to_open, function (i, val) { + if(val == "#") { return true; } + if($(val).length && $(val).is(".jstree-closed")) { current.push(val); } + else { remaining.push(val); } + }); + if(current.length) { + this.data.core.to_open = remaining; + $.each(current, function (i, val) { + _this.open_node(val, function () { _this.reopen(true); }, true); + }); + done = false; + } + } + if(done) { + // TODO: find a more elegant approach to syncronizing returning requests + if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); } + this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50); + this.data.core.refreshing = false; + } + }, + refresh : function (obj) { + var _this = this; + this.save_opened(); + if(!obj) { obj = -1; } + obj = this._get_node(obj); + if(!obj) { obj = -1; } + if(obj !== -1) { obj.children("UL").remove(); } + this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reopen(); }); + }, + // Dummy function to fire after the first load (so that there is a jstree.loaded event) + loaded : function () { + this.__callback(); + }, + // deal with focus + set_focus : function () { + var f = $.jstree._focused(); + if(f && f !== this) { + f.get_container().removeClass("jstree-focused"); + } + if(f !== this) { + this.get_container().addClass("jstree-focused"); + focused_instance = this.get_index(); + } + this.__callback(); + }, + is_focused : function () { + return focused_instance == this.get_index(); + }, + + // traverse + _get_node : function (obj) { + var $obj = $(obj, this.get_container()); + if($obj.is(".jstree") || obj == -1) { return -1; } + $obj = $obj.closest("li", this.get_container()); + return $obj.length ? $obj : false; + }, + _get_next : function (obj, strict) { + obj = this._get_node(obj); + if(obj === -1) { return this.get_container().find("> ul > li:first-child"); } + if(!obj.length) { return false; } + if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; } + + if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); } + else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); } + else { return obj.parentsUntil(".jstree","li").next("li").eq(0); } + }, + _get_prev : function (obj, strict) { + obj = this._get_node(obj); + if(obj === -1) { return this.get_container().find("> ul > li:last-child"); } + if(!obj.length) { return false; } + if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; } + + if(obj.prev("li").length) { + obj = obj.prev("li").eq(0); + while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); } + return obj; + } + else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; } + }, + _get_parent : function (obj) { + obj = this._get_node(obj); + if(obj == -1 || !obj.length) { return false; } + var o = obj.parentsUntil(".jstree", "li:eq(0)"); + return o.length ? o : -1; + }, + _get_children : function (obj) { + obj = this._get_node(obj); + if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); } + if(!obj.length) { return false; } + return obj.children("ul:eq(0)").children("li"); + }, + get_path : function (obj, id_mode) { + var p = [], + _this = this; + obj = this._get_node(obj); + if(obj === -1 || !obj || !obj.length) { return false; } + obj.parentsUntil(".jstree", "li").each(function () { + p.push( id_mode ? this.id : _this.get_text(this) ); + }); + p.reverse(); + p.push( id_mode ? obj.attr("id") : this.get_text(obj) ); + return p; + }, + + is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); }, + is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); }, + is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); }, + // open/close + open_node : function (obj, callback, skip_animation) { + obj = this._get_node(obj); + if(!obj.length) { return false; } + if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; } + var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, + t = this; + if(!this._is_loaded(obj)) { + obj.children("a").addClass("jstree-loading"); + this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback); + } + else { + if(s) { obj.children("ul").css("display","none"); } + obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"); + if(s) { obj.children("ul").stop(true).slideDown(s, function () { this.style.display = ""; }); } + this.__callback({ "obj" : obj }); + if(callback) { callback.call(); } + } + }, + close_node : function (obj, skip_animation) { + obj = this._get_node(obj); + var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation; + if(!obj.length || !obj.hasClass("jstree-open")) { return false; } + if(s) { obj.children("ul").attr("style","display:block !important"); } + obj.removeClass("jstree-open").addClass("jstree-closed"); + if(s) { obj.children("ul").stop(true).slideUp(s, function () { this.style.display = ""; }); } + this.__callback({ "obj" : obj }); + }, + toggle_node : function (obj) { + obj = this._get_node(obj); + if(obj.hasClass("jstree-closed")) { return this.open_node(obj); } + if(obj.hasClass("jstree-open")) { return this.close_node(obj); } + }, + open_all : function (obj, original_obj) { + obj = obj ? this._get_node(obj) : this.get_container(); + if(!obj || obj === -1) { obj = this.get_container(); } + if(original_obj) { + obj = obj.find("li.jstree-closed"); + } + else { + original_obj = obj; + if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); } + else { obj = obj.find("li.jstree-closed"); } + } + var _this = this; + obj.each(function () { + var __this = this; + if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, original_obj); }, true); } + else { _this.open_node(this, false, true); } + }); + // so that callback is fired AFTER all nodes are open + if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); } + }, + close_all : function (obj) { + var _this = this; + obj = obj ? this._get_node(obj) : this.get_container(); + if(!obj || obj === -1) { obj = this.get_container(); } + obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this); }); + this.__callback({ "obj" : obj }); + }, + clean_node : function (obj) { + obj = obj && obj != -1 ? $(obj) : this.get_container(); + obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li"); + obj.removeClass("jstree-last") + .filter("li:last-child").addClass("jstree-last").end() + .filter(":has(li)") + .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed"); + obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove(); + this.__callback({ "obj" : obj }); + }, + // rollback + get_rollback : function () { + this.__callback(); + return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data }; + }, + set_rollback : function (html, data) { + this.get_container().empty().append(html); + this.data = data; + this.__callback(); + }, + // Dummy functions to be overwritten by any datastore plugin included + load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); }, + _is_loaded : function (obj) { return true; }, + + // Basic operations: create + create_node : function (obj, position, js, callback, is_loaded) { + obj = this._get_node(obj); + position = typeof position === "undefined" ? "last" : position; + var d = $("
  • "), + s = this._get_settings().core, + tmp; + + if(obj !== -1 && !obj.length) { return false; } + if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; } + + this.__rollback(); + + if(typeof js === "string") { js = { "data" : js }; } + if(!js) { js = {}; } + if(js.attr) { d.attr(js.attr); } + if(js.state) { d.addClass("jstree-" + js.state); } + if(!js.data) { js.data = s.strings.new_node; } + if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); } + $.each(js.data, function (i, m) { + tmp = $(""); + if($.isFunction(m)) { m = m.call(this, js); } + if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); } + else { + if(!m.attr) { m.attr = {}; } + if(!m.attr.href) { m.attr.href = '#'; } + tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title); + if(m.language) { tmp.addClass(m.language); } + } + tmp.prepend(" "); + if(m.icon) { + if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); } + else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); } + } + d.append(tmp); + }); + d.prepend(" "); + if(obj === -1) { + obj = this.get_container(); + if(position === "before") { position = "first"; } + if(position === "after") { position = "last"; } + } + switch(position) { + case "before": obj.before(d); tmp = this._get_parent(obj); break; + case "after" : obj.after(d); tmp = this._get_parent(obj); break; + case "inside": + case "first" : + if(!obj.children("ul").length) { obj.append("