diff options
author | Neil Mitchell <http://www.cs.york.ac.uk/~ndm/> | 2007-01-11 17:07:09 +0000 |
---|---|---|
committer | Neil Mitchell <http://www.cs.york.ac.uk/~ndm/> | 2007-01-11 17:07:09 +0000 |
commit | 12b1c76fefc78b2a0fa54138a550c73802b1847d (patch) | |
tree | a9ab74a895daca4495d62f4c1a77b6aabac7d08b /html | |
parent | 47164db7bfd12449a31418a6f02de436e8fe4787 (diff) |
Add searching on the index page
Diffstat (limited to 'html')
-rw-r--r-- | html/haddock-util.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/html/haddock-util.js b/html/haddock-util.js index 4280d19c..fe471453 100644 --- a/html/haddock-util.js +++ b/html/haddock-util.js @@ -13,3 +13,30 @@ function toggle(button,id) n.display = "none"; } } + + +function quick_search() +{ + perform_search(false); +} + +function full_search() +{ + perform_search(true); +} + + +function perform_search(full) +{ + var text = document.getElementById("searchbox").value.toLowerCase(); + var table = document.getElementById("indexlist"); + var children = table.firstChild.childNodes; + for (var i = 0; i < children.length; i++) + { + var c = children[i]; + var s = c.firstChild.firstChild.data; + var show = s.toLowerCase().indexOf(text) != -1; + + c.style.display = (show ? "" : "none"); + } +} |