Commit: 262e753a8f7e36ba2e7b09b498dfb6ee57502de7 Author: Hannes Magnusson <[email protected]> Tue, 28 Dec 2010 08:09:04 +0000 Parents: 3e0128b79ddbc928cfae4df2bd759b6b60d32015 Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=262e753a8f7e36ba2e7b09b498dfb6ee57502de7 Log: Generate quick toc for function reference pages (needs new PhD release to generate the anchors) Changed paths: M include/shared-manual.inc M js/common.js M styles/doc.css Diff: diff --git a/include/shared-manual.inc b/include/shared-manual.inc index a4a58ad..e4f2938 100644 --- a/include/shared-manual.inc +++ b/include/shared-manual.inc @@ -530,6 +530,7 @@ function manual_setup_beta($setup) { $_SERVER["BASE_PAGE"] = "/manual/" . $setup["head"][1] . "/" . $setup["this"][0]; site_header($setup["this"][1] . " - Manual ", array("current" => "docs", "leftmenu" => $menu)); + echo '<aside id="quicktoc"></aside>'; } function manual_header_beta(){} diff --git a/js/common.js b/js/common.js index a3198f9..bf3d814 100644 --- a/js/common.js +++ b/js/common.js @@ -35,6 +35,18 @@ $(document).ready(function() { } ); }); + if ($("#quicktoc").length) { + var l = ""; + $(".refsect1 h3").each(function() { + var id = $(this).parent().attr("id"); + l += "<li><a href='#" + id + "'>" + $(this).text() + "</a></li>"; + }); + if (l) { + $("#quicktoc").append("<h5>Quick TOC</h5><ul>" + l + "<li><a href='#usernotes'>User notes</a></li></ul>"); + } else { + $("#quicktoc").remove(); + } + } }); diff --git a/styles/doc.css b/styles/doc.css index 6cdb98d..50292e3 100644 --- a/styles/doc.css +++ b/styles/doc.css @@ -1,3 +1,10 @@ +aside#quicktoc { + padding: 10px; + width: 125px; + border: 1px solid #C3ADD9; + position: fixed; + right: 0px; +} .docs i .parameter { font-style: normal; } -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
