diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-07-16 04:57:38 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-07-16 04:57:38 +0000 |
commit | 7832c8030a203510b89bd13fdc98eaf7279eb172 (patch) | |
tree | 4bf16d4852fd4c2c5f343563c7eb2f6a51e1da4b /html | |
parent | b67678234917d61b8393fa9b75092bfa2c399ab4 (diff) |
fixed package catpion, added style menu
Diffstat (limited to 'html')
-rw-r--r-- | html/haddock-util.js | 45 | ||||
-rw-r--r-- | html/shaddock.css | 47 | ||||
-rw-r--r-- | html/thaddock.css | 44 | ||||
-rw-r--r-- | html/xhaddock.css | 60 |
4 files changed, 173 insertions, 23 deletions
diff --git a/html/haddock-util.js b/html/haddock-util.js index 227ac4f8..326a64b9 100644 --- a/html/haddock-util.js +++ b/html/haddock-util.js @@ -136,17 +136,44 @@ function setSynopsis(filename) { if (parent.window.synopsis) { parent.window.synopsis.location = filename; } + resetStyle(); // ugly: we are using setSynopsis as a hook! } function setActiveStyleSheet(href) { - var i, a, main; - for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if(a.getAttribute("rel").indexOf("style") != -1 - && a.getAttribute("title")) { - a.disabled = true; - if(a.getAttribute("href") == href) a.disabled = false; - //a.disabled = a.getAttribute("title") != title; - } - } + var i, a, found = false; + for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("title")) { + a.disabled = true; + // need to do this always, some browsers are edge triggered + if(a.getAttribute("href") == href) { + a.disabled = false; + found = true; + } + } + } + if (!found) href = ""; + document.cookie = "style=" + href + ";path=/"; + styleMenu(false); +} + +function resetStyle() { + var nameEQ = "style="; + var s; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) s = c.substring(nameEQ.length,c.length); + } + if (s) setActiveStyleSheet(s); } + + +function styleMenu(show) { + var m = document.getElementById('style-menu'); + if (show == null) { show = m.className == "hide"; } + m.className = show ? "show" : "hide"; +} + diff --git a/html/shaddock.css b/html/shaddock.css index 3df31926..7be02966 100644 --- a/html/shaddock.css +++ b/html/shaddock.css @@ -133,7 +133,8 @@ ul.links li { white-space: nowrap; } - +.hide { display: none; } +.show { } /* Captions and Headers */ @@ -145,6 +146,14 @@ p.caption, h1, h2, h3, h4 { line-height: inherit; } +#package-header .caption { + font-size: 80%; + font-weight: bold; + padding-left: 26px; + padding-top: 2px; + padding-bottom: 3px; +} + #module-header .caption { font-weight: bold; letter-spacing: -0.02em; font-size: 201%; @@ -222,6 +231,42 @@ h4, #package-header a:hover { background-color: #C9D3DE; } #package-header li:hover { background-color: #C9D3DE; } +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; + margin: 0; + padding: 0; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background-color: #3465a4; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 0 2px 1px; + border-left: 1px solid #fffffff; + border-right: 1px solid #fffffff; + border-bottom: 1px solid #fffffff; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #ffffff; +} + #module-header { font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; color: #141B24; diff --git a/html/thaddock.css b/html/thaddock.css index c7ae7d8c..fc7cac09 100644 --- a/html/thaddock.css +++ b/html/thaddock.css @@ -22,6 +22,47 @@ body { position: relative; } +#package-header .caption { + margin-left: 30px; + padding-top: 6px; +} + + + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background-color: #eaeaea; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 0 2px 1px; + border-left: 1px solid #919191; + border-right: 1px solid #919191; + border-bottom: 1px solid #919191; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + #module-header .caption { background:transparent none repeat scroll 0 0; border:medium none; @@ -185,6 +226,9 @@ dd { padding:0; } +.hide { display: none; } +.show { } + .top, .subs { margin:0.4em 0 0 2em; padding:0; diff --git a/html/xhaddock.css b/html/xhaddock.css index 768e16a6..9901c26c 100644 --- a/html/xhaddock.css +++ b/html/xhaddock.css @@ -76,6 +76,26 @@ pre { margin-top: 0; } +ul.links { + list-style: none; + text-align: left; + position: absolute; + right: 5px; + top: 5px; + display: inline-table; +} + +ul.links li { + display: inline; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + padding: 1px 5px; +} + +.hide { display: none; } +.show { } #package-header { color: #ffffff; @@ -85,27 +105,41 @@ pre { position: relative; } +#package-header .caption { + font-weight: normal; + font-style: normal; +} #package-header a:link { color: #ffffff } #package-header a:visited { color: #ffff00 } #package-header a:hover { background-color: #6060ff; } #package-header ul.links li:hover { background-color: #6060ff; } -ul.links { - list-style: none; - text-align: left; +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { position: absolute; - right: 5px; - top: 5px; - display: inline-table; + z-index: 1; + overflow: visible; + background-color: #000099; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 2px 2px 1px; } -ul.links li { - display: inline; - border-left-width: 1px; - border-left-color: #ffffff; - border-left-style: solid; - white-space: nowrap; - padding: 1px 5px; +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; + border-top: 1px solid #ffffff; } #module-header { |