aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNeil Mitchell <http://www.cs.york.ac.uk/~ndm/>2007-01-11 17:07:09 +0000
committerNeil Mitchell <http://www.cs.york.ac.uk/~ndm/>2007-01-11 17:07:09 +0000
commit12b1c76fefc78b2a0fa54138a550c73802b1847d (patch)
treea9ab74a895daca4495d62f4c1a77b6aabac7d08b /src
parent47164db7bfd12449a31418a6f02de436e8fe4787 (diff)
Add searching on the index page
Diffstat (limited to 'src')
-rw-r--r--src/Haddock/Backends/Html.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs
index 36be7909..d46e0df4 100644
--- a/src/Haddock/Backends/Html.hs
+++ b/src/Haddock/Backends/Html.hs
@@ -413,11 +413,12 @@ ppHtmlIndex odir doctitle maybe_package maybe_html_help_format
let html =
header (documentCharacterEncoding +++
thetitle (toHtml (doctitle ++ " (Index)")) +++
- styleSheet) +++
+ styleSheet +++
+ (script ! [src jsFile, thetype "text/javascript"] $ noHtml)) +++
body << vanillaTable << (
simpleHeader doctitle maybe_contents_url Nothing
maybe_source_url maybe_wiki_url </>
- index_html
+ search_box </> index_html
)
writeFile (pathJoin [odir, indexHtmlFile]) (renderHtml html)
@@ -430,7 +431,14 @@ ppHtmlIndex odir doctitle maybe_package maybe_html_help_format
Just "devhelp" -> return ()
Just format -> fail ("The "++format++" format is not implemented")
where
- index_html = td << table ! [cellpadding 0, cellspacing 5] <<
+ -- colspan 2, marginheight 5
+ search_box :: HtmlTable
+ search_box = tda [colspan 2, thestyle "padding-top:5px;"] << search
+ where
+ search :: Html
+ search = "Search: " +++ input ! [identifier "searchbox", strAttr "onkeyup" "quick_search()"] +++ " " +++ input ! [value "Search", thetype "button", onclick "full_search()"]
+
+ index_html = td << table ! [identifier "indexlist", cellpadding 0, cellspacing 5] <<
aboves (map indexElt index)
indexInitialLetterLinks =