From 9931362030c9536caf5c1d04a34d428b59bf3b04 Mon Sep 17 00:00:00 2001 From: Mark Lentczner Date: Sat, 14 Aug 2010 03:44:46 +0000 Subject: build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page --- src/Haddock/Backends/Xhtml/Themes.hs | 23 +---------------------- src/Haddock/Backends/Xhtml/Utils.hs | 7 +------ 2 files changed, 2 insertions(+), 28 deletions(-) (limited to 'src/Haddock/Backends/Xhtml') diff --git a/src/Haddock/Backends/Xhtml/Themes.hs b/src/Haddock/Backends/Xhtml/Themes.hs index 512b597c..cbcf10a4 100644 --- a/src/Haddock/Backends/Xhtml/Themes.hs +++ b/src/Haddock/Backends/Xhtml/Themes.hs @@ -12,11 +12,10 @@ module Haddock.Backends.Xhtml.Themes ( Themes, getThemes, - cssFiles, styleSheet, stylePickers, styleMenu + cssFiles, styleSheet ) where -import Haddock.Backends.Xhtml.Utils (onclick) import Haddock.Options import Control.Monad (liftM) @@ -187,26 +186,6 @@ styleSheet ts = toHtml $ zipWith mkLink rels ts ] << noHtml - -stylePickers :: Themes -> [Html] -stylePickers ts = map mkPicker ts - where - mkPicker t = - let js = "setActiveStyleSheet('" ++ themeHref t ++ "'); return false;" in - anchor ! [href "#", onclick js] << themeName t - - -styleMenu :: Themes -> Maybe Html -styleMenu [] = Nothing -styleMenu [_] = Nothing -styleMenu ts = Just $ thediv ! [identifier "style-menu-holder"] << [ - anchor ! [ href "#", onclick js ] << "Style \9662", - unordList (stylePickers ts) ! [ identifier "style-menu", theclass "hide" ] - ] - where - js = "styleMenu(); return false;" - - -------------------------------------------------------------------------------- -- * Either Utilities -------------------------------------------------------------------------------- diff --git a/src/Haddock/Backends/Xhtml/Utils.hs b/src/Haddock/Backends/Xhtml/Utils.hs index edb5e659..d3b75b43 100644 --- a/src/Haddock/Backends/Xhtml/Utils.hs +++ b/src/Haddock/Backends/Xhtml/Utils.hs @@ -24,7 +24,6 @@ module Haddock.Backends.Xhtml.Utils ( hsep, - onclick, collapser, collapseId, ) where @@ -153,10 +152,6 @@ ubxparens :: Html -> Html ubxparens h = toHtml "(#" +++ h +++ toHtml "#)" -onclick :: String -> HtmlAttr -onclick = strAttr "onclick" - - dcolon, arrow, darrow, forallSymbol :: Bool -> Html dcolon unicode = toHtml (if unicode then "∷" else "::") arrow unicode = toHtml (if unicode then "→" else "->") @@ -186,7 +181,7 @@ linkedAnchor n = anchor ! [href ('#':n)] -- use cookies from JavaScript to have a more persistent state. collapser :: String -> String -> [HtmlAttr] -collapser id_ classes = [ theclass cs, onclick js ] +collapser id_ classes = [ theclass cs, strAttr "onclick" js ] where cs = unwords (words classes ++ ["collapser"]) js = "toggleSection(this,'" ++ id_ ++ "')" -- cgit v1.2.3