1 // Warnings about reading old version of documentation
3 if( $.grep( document.cookie.split(/\s*;\s*/), function(a){return a === 'old_version_warning_removed=true' ? true : false }).length === 0 ){
4 $('#old_version_warning')
6 .find('span.closebar a')
8 $('#old_version_warning').remove();
9 document.cookie="old_version_warning_removed=true";
15 // Sidebar table of contents
18 var click_func = function (e) {
20 if ($('#toc').data('opened')) {
21 $('#toc > *').animate({
22 left: '-=' + $('#toc > ul').width() + 'px'
24 $('#toc').removeData('opened');
26 $('#toc > *').animate({
27 left: '+=' + $('#toc > ul').width() + 'px'
29 $('#toc').data('opened', 1);
33 $('body').click(function () {
34 if( $('#toc').data('opened') ) $('#toc > img').mousedown();
37 var type = document.location.pathname.match(/\/doc\/html\/spec_html\/filter/) ? 'filter' : 'spec';
39 // Get the relevant table of contents
40 $.get(type === 'spec' ? 'index_toc.xml' : 'filter_toc.xml', function (xml) {
42 // Remove the main list from the DOM for performance
43 var $ul = $('#toc > ul').remove();
47 $(xml).find('c').each(function () {
49 var chapter_title = $(this).children('t').text();
50 var chapter_url = $(this).children('u').text();
52 var chapter_li = $('<li/>').append(
56 }).text(chapter_id + '. ' + chapter_title), $('<ul/>').hide()).appendTo($ul);
59 $('#toc img').fadeIn('slow', function () {
60 // Add the main list back to the DOM
61 $ul.removeClass('hidden').css('visibility', 'hidden').appendTo('#toc').css('left', '-' + $ul.width() + 'px').css('visibility', 'visible');
62 $('#toc > img').mousedown(click_func);
63 $('#toc > ul').click(click_func);
64 $('#toc, #toc a').click(function (e) {