$(document).ready(function () { var height = $(document).height(); $('#content').css('min-height', function(){ return height; }); // insert breaker only for the first data/class/function found. var apibreaker = false; $('div.body dl[class]').each(function (i1, elem) { // theses are first level class: attribute and method are inside class. if (!$(elem).hasClass('data') && !$(elem).hasClass('class') && !$(elem).hasClass('exception') && !$(elem).hasClass('function')) return; // dont accept dl inside dl if ($(elem).parents().filter('dl').length > 0) return; $(elem).addClass('api-level'); if ( apibreaker == true ) return; $('
') .attr('id', 'api') .html( $('

API ' + 'Collapse All ⇑' + 'Hide Description ⇑' + '

') ) .insertBefore(elem); apibreaker = true; }); $('div.body dl[class] dt').hover( function() { $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); } ); if ( apibreaker == true ) { var apilink = $('
» Jump to API
'); apilink.insertAfter($('div.body h1:first')); } $('#api-toggle-all').click(function() { if ($(this).hasClass('showed')) { $('div.body dl.api-level > dd').slideUp(); $(this).removeClass('showed'); $(this).html('Expand All ⇓'); $.cookie('kivy.toggleall', 'true'); } else { $('div.body dl.api-level > dd').slideDown(); $(this).addClass('showed'); $(this).html('Collapse All ⇑'); $.cookie('kivy.toggleall', 'false'); } }); $('#api-toggle-desc').click(function() { if ($(this).hasClass('showed')) { $('div.body dl.api-level > dd > dl > dd').slideUp(); $(this).removeClass('showed'); $(this).html('Show Descriptions ⇓'); $.cookie('kivy.toggledesc', 'true'); } else { $('div.body dl.api-level > dd > dl > dd').slideDown(); $(this).addClass('showed'); $(this).html('Hide Descriptions ⇑'); $.cookie('kivy.toggledesc', 'false'); } console.log($.cookie('kivy.toggledesc')); }); $('div.body dl dt').click(function() { $(this).next().slideToggle(); }); if ( $.cookie('kivy.toggledesc') == 'true' ) { $('div.body dl.api-level > dd > dl > dd').hide(); $('#api-toggle-desc').removeClass('showed'); $('#api-toggle-desc').html('Show Descriptions ⇓'); } if ( $.cookie('kivy.toggleall') == 'true' ) { $('div.body dl.api-level > dd').hide(); $('#api-toggle').removeClass('showed'); $('#api-toggle').html('Expand All ⇓'); } //$('div.body dl[class]:first-child').hide(); /** $('dl[class]:first-child > a[class="headerlink"]').each(function(i1, elem) { console.log(i1); console.log(elem); $(elem).each(function(i2, e) { var eid = $(e).attr('id'); $(e).removeAttr('id'); $('
').attr('id', eid).addClass('anchor').insertBefore(e); }); }); **/ // if it's an API page, show the module name. var pagename = location.pathname.split('/'); pagename = pagename[pagename.length - 1]; if (pagename.search('api-') == 0) { pagename = pagename.substr(4, pagename.length - 9); var modulename = $('
Module: ' + pagename + '
') modulename.insertAfter($('div.body h1:first')); } });