Sha256: 4ed7b1d51e6a1174d0f40cd5677d961e2ac7e2c2365502a70e08c282205be943
Contents?: true
Size: 1.24 KB
Versions: 5
Compression:
Stored size: 1.24 KB
Contents
// "THE BEER-WARE LICENSE" (Revision 42): m-widmer@gmx wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Manuel Widmer $(document).ready(function(){$("[class=rtoconly],[class=bothtoc]").each(function(b){var a=$(this);type=a.attr("class");a.attr("id",type+b);$("#rtoc").append("<a href='#"+type+b+"'>"+a.html()+"</a> <br />\n")});h3index=h2index=h1index=0;$("h1, h2, h3, a.h2, a.h1").each(function(b){var a=$(this);void 0==a.attr("id")&&a.attr("id","title"+b);if("h1"==a.prop("tagName"))h1index+=1,h3index=h2index=0,a.prepend(h1index+" "),$("#ltoc").append("<br />\n"),lasth1="#"+a.attr("id"),lasth1cont=a.html();else if("h2"== a.prop("tagName"))h2index+=1,h3index=0,a.prepend(h1index+"."+h2index+" "),lasth2="#"+a.attr("id"),lasth2cont=a.html();else if("h3"==a.prop("tagName"))h3index+=1,a.prepend(h1index+"."+h2index+"."+h3index+" ");else{if("h1"==a.attr("class"))return a.attr("href",lasth1),a.html(lasth1cont),0;if("h2"==a.attr("class"))return a.attr("href",lasth2),a.html(lasth2cont),0}if("rtoconly"==a.attr("class"))return 0;$("#ltoc").append("<a id='link"+b+"' href='#"+a.attr("id")+"' >"+a.html()+"</a> <br />\n");return 0})});
Version data entries
5 entries across 5 versions & 1 rubygems