/** * Quick & dirty table of contents and JS source links */ $(document).ready(function() { var sections = $('#toc .sections'); var tmpl = sections.find('.template'); $('h5').each(function() { tmpl.clone().removeClass('template') .find('a') .attr('href', '#' + this.parentNode.id) .text($(this).text()) .end() .appendTo(sections); $(this).append('Back to TOC'); }); $('h5').each(function() { $(this).after([ '
', 'View JS Source', '
' ].join('')); }); }); $.log = function(sel, msg) { var d = new Date(); $(sel).prepend([ '