From 133c8c5c6d45e90ee51ea2bd889367034bcaa845 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sat, 31 Jul 2004 12:04:38 +0000 Subject: [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. --- html/Makefile | 2 +- html/haddock.css | 2 +- html/haddock.js | 16 ++++++++++------ html/minus.jpg | Bin 1271 -> 0 bytes html/plus.jpg | Bin 1512 -> 0 bytes src/HaddockHtml.hs | 4 ++-- src/HaddockUtil.hs | 4 ++-- 7 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 html/minus.jpg delete mode 100644 html/plus.jpg diff --git a/html/Makefile b/html/Makefile index 5631a5f9..b10189f0 100644 --- a/html/Makefile +++ b/html/Makefile @@ -1,6 +1,6 @@ TOP = .. include $(TOP)/mk/boilerplate.mk -INSTALL_DATAS = haddock.css haddock.js haskell_icon.gif minus.jpg plus.jpg +INSTALL_DATAS = haddock.css haddock.js haskell_icon.gif minus.gif plus.gif include $(TOP)/mk/target.mk diff --git a/html/haddock.css b/html/haddock.css index c79f9446..9ecef66d 100644 --- a/html/haddock.css +++ b/html/haddock.css @@ -36,7 +36,7 @@ TD.s15 { height: 15px; } SPAN.keyword { text-decoration: underline; } /* Resize the buttom image to match the text size */ -IMG.coll { width : 0.5em; height: 0.5em; margin-bottom: 0.125em; margin-right: 0.125em } +IMG.coll { width : 8; height: 8; margin-bottom: 1; margin-right: 2 } /* --------- Documentation elements ---------- */ diff --git a/html/haddock.js b/html/haddock.js index 8dbd0a03..4280d19c 100644 --- a/html/haddock.js +++ b/html/haddock.js @@ -1,11 +1,15 @@ // Haddock JavaScript utilities -function toggle(button,id) { +function toggle(button,id) +{ var n = document.getElementById(id).style; - if (n.display == "none") { - button.src = "minus.jpg"; - n.display = "inline"; - } else { - button.src = "plus.jpg"; + if (n.display == "none") + { + button.src = "minus.gif"; + n.display = "block"; + } + else + { + button.src = "plus.gif"; n.display = "none"; } } diff --git a/html/minus.jpg b/html/minus.jpg deleted file mode 100644 index d3fb7e32..00000000 Binary files a/html/minus.jpg and /dev/null differ diff --git a/html/plus.jpg b/html/plus.jpg deleted file mode 100644 index c6b6350f..00000000 Binary files a/html/plus.jpg and /dev/null differ diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs index 3233c408..cd0d452b 100644 --- a/src/HaddockHtml.hs +++ b/src/HaddockHtml.hs @@ -243,7 +243,7 @@ ppPrologue title (Just doc) = ppModuleTree :: String -> [ModuleTree] -> HtmlTable ppModuleTree _ ts = tda [theclass "section1"] << toHtml "Modules" - td << table ! [cellpadding 0, cellspacing 2] << htmlTable + td << vanillaTable << htmlTable where genTable htmlTable id [] = (htmlTable,id) genTable htmlTable id (x:xs) = genTable (htmlTable u) id' xs @@ -279,7 +279,7 @@ mkNode ss (Node s leaf pkg ts) id = htmlNode genSubTree :: HtmlTable -> Int -> [ModuleTree] -> (Html,Int) genSubTree htmlTable id [] = (sub_tree,id) where - sub_tree = table ! [identifier id_s, thestyle "display:none;", cellpadding 0, cellspacing 0, width "100%"] << htmlTable + sub_tree = vanillaTable ! [identifier id_s, thestyle "display:none;"] << htmlTable genSubTree htmlTable id (x:xs) = genSubTree (htmlTable u) id' xs where (u,id') = mkNode (s:ss) x id diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs index eca9e743..03796532 100644 --- a/src/HaddockUtil.hs +++ b/src/HaddockUtil.hs @@ -295,8 +295,8 @@ cssFile, iconFile, jsFile, plusFile,minusFile :: String cssFile = "haddock.css" iconFile = "haskell_icon.gif" jsFile = "haddock.js" -plusFile = "plus.jpg" -minusFile = "minus.jpg" +plusFile = "plus.gif" +minusFile = "minus.gif" ----------------------------------------------------------------------------- -- misc. -- cgit v1.2.3