From 2dc69482f1afa11681db5b4c5a725652f4304795 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Mon, 15 Mar 2010 15:22:20 +1300 Subject: [PATCH] further simplification of html templates, with better RTL support --- htdocs/static/templating_template_flossmanuals.css | 153 +++++++++++++++++++-- htdocs/static/templating_template_flossmanuals.js | 39 +++--- htdocs/static/typography.css | 6 +- templates/templating_template_flossmanuals.html | 105 +++++++------- 4 files changed, 209 insertions(+), 94 deletions(-) rewrite templates/templating_template_flossmanuals.html (60%) diff --git a/htdocs/static/templating_template_flossmanuals.css b/htdocs/static/templating_template_flossmanuals.css index 58334aa..e2c7d87 100644 --- a/htdocs/static/templating_template_flossmanuals.css +++ b/htdocs/static/templating_template_flossmanuals.css @@ -64,6 +64,15 @@ font-weight: bold; } +.ds-contentcontainer { + padding: 0em .5em; +} +/*#ds-contentcontainer div { + margin-left:1.2em; + float:right; +} +*/ + #ds-layout { table-layout: fixed; width: 670px; @@ -111,31 +120,37 @@ body { } div.arrow { - position:relative; - width:50px; - top:5px; - float:left; + position:absolute; } -div.left{ - left:10px; +.arrow.left{ + left: 10px; } -div.right{ - left:528px; +.arrow.right{ + right: 10px; + text-align:right; } -#ds-contentcontainer div { - margin-left:1.2em; - float:right; +.arrow.top{ + top: 12px; +} + +.arrow.bottom{ + bottom: 12px; +} + + +div.navbar { + height: 30px; } #edit-links { color: black; border: 1px; position: absolute; - top:60px; - left:502px; + top:12px; + left:400px; } #edit-links a { @@ -146,9 +161,14 @@ div.right{ } #main { + width: 670px; + border: 5px solid #666666; + padding: 0px; + margin:0px; + background: #FFF7F0; position:absolute; - left:240px; - top:11px; + left:250px; + top:21px; } #main-content{ @@ -156,3 +176,106 @@ div.right{ } +/* Everything below here imported form typography.css */ + +img { + border:0px; +} + +body { + font-family : trebuchet,verdana, sans-serif; + font-size: 12px; + line-height:17px; +} + + +a:link { + color:#666666; +} +a:visited { + color:#000000; +} +a:active { + color:#000000; +} +a:hover { + color:#000000; +} + +pre, span.code, span.verbatim { +font-size: 12px; +line-height: 1.5em; +background-color: #FFE5CC; +border: 0px solid #000000; +margin-left : 0.5em; +margin-bottom : 20px; +margin-right : 1em; +padding-left: 1em; +padding-right: 1em; +padding-top: 0.2em; +padding-bottom: 0.2em; +color : black; +white-space: pre-wrap; /* css-3 */ +white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ +white-space: -pre-wrap; /* Opera 4-6 */ +white-space: -o-pre-wrap; /* Opera 7 */ +word-wrap: break-word; /* Internet Explorer 5.5+ */ +} + + +hr { + border : none; + background-color : #666666; + color : #000000; + height : 2px; + width:120px; + margin-left:0px; + margin-bottom: 10px; + margin-top: 10px; +} + +ul, li { + margin-bottom: 5px; + margin-top: 0px; +} + +h1, h2, h3 { + font-family : Arial, verdana, sans-serif; + font-weight : Bold; + margin-bottom: 10px; + margin-top: 0px; +} + +h1 { + font-size: 24px; + line-height: 32px; + letter-spacing: -1px; +} + +h2 { + font-size: 18px; + margin-bottom: 10px; + margin-top: 15px; + padding-top : 15px; +} + +h3 { + font-size: 14px; + margin-bottom: 5px; +} + +h4, h5, h6 {font-weight : Bold;font-size: 12px;} + +/* + * this might cause more problems that it solves, but fixed-width type + * is extremely tiny in Firefox with some sizing methods (eg with 76% + * font-sizing) +*/ + +body kbd, body tt, body code { + font-size: x-small; +} + +p { + margin-top: 1em; +} diff --git a/htdocs/static/templating_template_flossmanuals.js b/htdocs/static/templating_template_flossmanuals.js index 971794d..bde351c 100644 --- a/htdocs/static/templating_template_flossmanuals.js +++ b/htdocs/static/templating_template_flossmanuals.js @@ -1,47 +1,48 @@ -function get_chapter_list() { +function set_up_chapter_links() { var chapters = []; + var titles = []; var here = document.location; + if (/\/$/.test(here)){ + here += 'index.html'; + } + $(".menu-goes-here a").each(function (i) { if (this.href == here){ $(this).parent().css('background', '#f99b1c'); } chapters.push(this.href); + titles.push($(this).text()); }); - var prev, next; + var hide = function(){ + this.style.visibility = 'hidden'; + }; + for (var i = 0; i < chapters.length; i++){ if (chapters[i] == here){ if (i > 0){ $('.left.arrow a').each(function() { - this.href = chapters[i-1]; + this.href = chapters[i - 1]; + this.title = titles[i - 1]; }); } else{ - $('.left.arrow a').each(function() { - this.style.visibility = 'hidden'; - }); + $('.left.arrow a').each(hide); } if (i + 1 < chapters.length){ $('.right.arrow a').each(function() { - this.href = chapters[i+1]; + this.href = chapters[i + 1]; + this.title = titles[i + 1]; }); } else{ - $('.right.arrow a').each(function() { - this.style.visibility = 'hidden'; - }); + $('.right.arrow a').each(hide); } } } + //alert(titles); return chapters; -} - -var all_book_chapters = $(get_chapter_list); - -function previous(){ - return true; } -function next(){ - return true; -} +var all_book_chapters = $(set_up_chapter_links); + diff --git a/htdocs/static/typography.css b/htdocs/static/typography.css index 8e484de..8f91234 100755 --- a/htdocs/static/typography.css +++ b/htdocs/static/typography.css @@ -112,6 +112,7 @@ div.container { height: 5000px; } +/* div.left { position: absolute; top: 0px; @@ -127,6 +128,7 @@ div.top { width: 500px; height: 100%; } +*/ div.main { position: absolute; @@ -169,10 +171,6 @@ padding: .5em 1em .5em 1em; font-family: monospace; } -.ds-contentcontainer { -padding: 0em .5em .5em 0em; -} - .ds-innercontentcontainer { line-height: 1.3; diff --git a/templates/templating_template_flossmanuals.html b/templates/templating_template_flossmanuals.html dissimilarity index 60% index f2f885e..2aa1617 100644 --- a/templates/templating_template_flossmanuals.html +++ b/templates/templating_template_flossmanuals.html @@ -1,56 +1,49 @@ - - - - - - - - - - - - - - -
- -
-
- - -
-
- - -
-
- - - - -
-
-
- -
-
- - - - -
-
- -
-
-
- -
- - - + + + + + + + + + + + +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + + -- 2.11.4.GIT