/** * jQuery org-chart/tree plugin. * * Author: Wes Nolte * http://www.tquila.com * * Based on the work of Mark Lee * http://www.capricasoftware.co.uk * * This software is licensed under the Creative Commons Attribution-ShareAlike * 3.0 License. * * See here for license terms: * http://creativecommons.org/licenses/by-sa/3.0 */ (function($) { $.fn.jOrgChart = function(options) { var opts = $.extend({}, $.fn.jOrgChart.defaults, options); var $appendTo = $(opts.chartElement); return this.each(function() { $this = $(this); var $container = $("
"); if($this.is("ul")) { buildNode($this.find("li:first"), $container, 0, opts); } else if($this.is("li")) { buildNode($this, $container, 0, opts); } $appendTo.append($container); }); }; $.fn.jOrgChart.defaults = { chartElement : 'body', depth : -1, chartClass : "jOrgChart" }; function buildNode($node, $appendTo, level, opts) { var $table = $("