diff --git a/js/info.css b/js/info.css index 72f46a3948..ac0e596484 100644 --- a/js/info.css +++ b/js/info.css @@ -230,6 +230,10 @@ table#keyboard-shortcuts th { right: 0; } +.text-input input { + width: 25em; +} + .error { background-color: orange; padding: 5px; diff --git a/js/info.js b/js/info.js index bf555bcf9d..7ff7ced161 100644 --- a/js/info.js +++ b/js/info.js @@ -146,10 +146,30 @@ /** @arg {NodeListOf} links */ cache_index_links: function (links) { var dict = {}; + var text0 = "", text1 = ""; // for subentries for (var i = 0; i < links.length; i += 1) { var link = links[i]; - dict[link.textContent] = href_hash (link_href (link)); + var link_cl = link.classList; + var text = link.textContent; + if (link_cl.contains("index-entry-level-2")) + { + text = text0 + ", " + text1 + ", " + text; + } + else if (link_cl.contains("index-entry-level-1")) + { + text1 = text; + text = text0 + ", " + text; + } + else + { + text0 = text; + } + var sec_link = link.nextSibling + && link.nextSibling.classList.contains("printindex-index-section") + && link.nextSibling.firstChild; + if (sec_link) + dict[text] = href_hash (link_href (sec_link)); } return { type: "cache-index-links", links: dict }; }, @@ -1457,9 +1477,9 @@ if (linkid_contains_index (linkid)) { /* Scan links that should be added to the index. */ - var index_links = document.querySelectorAll - ("td.printindex-index-section a"); - store.dispatch (actions.cache_index_links (index_links)); + var index_entries = document.querySelectorAll + ("td.printindex-index-entry"); + store.dispatch (actions.cache_index_links (index_entries)); } add_icons ();