aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html/haddock.css3
-rw-r--r--html/haddock.js4
-rw-r--r--html/minus.jpgbin0 -> 1271 bytes
-rw-r--r--html/plus.jpgbin0 -> 1512 bytes
-rw-r--r--src/HaddockHtml.hs7
5 files changed, 8 insertions, 6 deletions
diff --git a/html/haddock.css b/html/haddock.css
index b853bf76..1807a26e 100644
--- a/html/haddock.css
+++ b/html/haddock.css
@@ -35,7 +35,8 @@ TD.s15 { height: 15px; }
SPAN.keyword { text-decoration: underline; }
-BUTTON.coll { width : 2em; }
+/* Resize the buttom image to match the text size */
+IMG.coll { width : 1em; height: 1em; }
/* --------- Documentation elements ---------- */
diff --git a/html/haddock.js b/html/haddock.js
index 4f6a2e44..8dbd0a03 100644
--- a/html/haddock.js
+++ b/html/haddock.js
@@ -2,10 +2,10 @@
function toggle(button,id) {
var n = document.getElementById(id).style;
if (n.display == "none") {
- button.childNodes[0].data = "-";
+ button.src = "minus.jpg";
n.display = "inline";
} else {
- button.childNodes[0].data = "+";
+ button.src = "plus.jpg";
n.display = "none";
}
}
diff --git a/html/minus.jpg b/html/minus.jpg
new file mode 100644
index 00000000..d3fb7e32
--- /dev/null
+++ b/html/minus.jpg
Binary files differ
diff --git a/html/plus.jpg b/html/plus.jpg
new file mode 100644
index 00000000..c6b6350f
--- /dev/null
+++ b/html/plus.jpg
Binary files differ
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs
index 81235fec..a52e831b 100644
--- a/src/HaddockHtml.hs
+++ b/src/HaddockHtml.hs
@@ -43,6 +43,8 @@ cssFile, jsFile, iconFile :: String
cssFile = "haddock.css"
jsFile = "haddock.js"
iconFile = "haskell_icon.gif"
+plusFile = "plus.jpg"
+minusFile = "minus.jpg"
-- -----------------------------------------------------------------------------
-- Generating HTML documentation
@@ -95,7 +97,7 @@ copyHtmlBits odir libdir maybe_css = do
css_contents <- readFile css_file
writeFile css_destination css_contents
- mapM_ copyFile [ iconFile, jsFile ]
+ mapM_ copyFile [ iconFile, plusFile, minusFile, jsFile ]
contentsHtmlFile, indexHtmlFile :: String
@@ -1119,8 +1121,7 @@ escapeStr = flip escapeString unreserved
--
collapsebutton :: String -> Html
collapsebutton id =
- button ! [ theclass "coll", onclick ("toggle(this,'" ++ id ++ "')") ] <<
- toHtml "+"
+ image ! [ src plusFile, theclass "coll", onclick ("toggle(this,'" ++ id ++ "')") ]
collapsed :: String -> Html -> Html
collapsed id html =