/* * jsTree 0.9.5 * * Copyright (c) 2008 Ivan Bozhanov (vakata.com) * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Date: 2009-01-03 * */ // browser fix jQuery.browser = {}; jQuery.browser.mozilla = /mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase()); jQuery.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase()); jQuery.browser.opera = /opera/.test(navigator.userAgent.toLowerCase()); jQuery.browser.msie = /msie/.test(navigator.userAgent.toLowerCase()); // jQuery plugin jQuery.fn.tree = function (opts) { return this.each(function() { if(tree_component.inst && tree_component.inst[jQuery(this).attr('id')]) tree_component.inst[jQuery(this).attr('id')].destroy(); if(opts !== false) { var tmp = new tree_component(); tmp.init(this, opts); } }); }; // core function tree_component () { // instance manager if(typeof tree_component.inst == "undefined") { tree_component.cntr = 0; tree_component.inst = new Array(); tree_component.drop = new Array(); tree_component.focusInst = function () { return tree_component.inst[tree_component.focused]; } tree_component.mousedown = function(event) { var _this = tree_component.focusInst(); if(!_this) return; var tmp = jQuery(event.target); if(tree_component.drop.length && tmp.is("." + tree_component.drop.join(", .")) ) { _this.drag = jQuery("