TOC rendered as an unordered list.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1693 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-07-22 19:40:47 +00:00
parent a17b62b455
commit 5564dfbbd5
3 changed files with 17 additions and 13 deletions

View File

@ -6,6 +6,10 @@
<style>
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
ul.toc { padding: 4px; margin-left: 0; }
ul.toc li { list-style-type:none; }
ul.toc li.heading2 { margin-left: 1em; }
ul.toc li.heading3 { margin-left: 2em; }
</style>
</head>
<body>

View File

@ -81,16 +81,16 @@ module Redmine
div_class = 'toc'
div_class << ' right' if $1 == '>'
div_class << ' left' if $1 == '<'
out = "<div class=\"#{div_class}\">"
out = "<ul class=\"#{div_class}\">"
@toc.each_with_index do |heading, index|
# remove wiki links from the item
toc_item = heading.last.gsub(/(\[\[|\]\])/, '')
# remove styles
# eg. %{color:red}Triggers% => Triggers
toc_item.gsub! %r[%\{[^\}]*\}([^%]+)%], '\\1'
out << "<a href=\"##{index+1}\" class=\"heading#{heading.first}\">#{toc_item}</a>"
out << "<li class=\"heading#{heading.first}\"><a href=\"##{index+1}\">#{toc_item}</a></li>\n"
end
out << '</div>'
out << '</ul>'
out
end
end

View File

@ -461,31 +461,31 @@ div.wiki pre {
overflow-x: auto;
}
div.wiki div.toc {
div.wiki ul.toc {
background-color: #ffffdd;
border: 1px solid #e4e4e4;
padding: 4px;
line-height: 1.2em;
margin-bottom: 12px;
margin-right: 12px;
margin-left: 0;
display: table
}
* html div.wiki div.toc { width: 50%; } /* IE6 doesn't autosize div */
* html div.wiki ul.toc { width: 50%; } /* IE6 doesn't autosize div */
div.wiki div.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
div.wiki div.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
div.wiki ul.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
div.wiki ul.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
div.wiki ul.toc li { list-style-type:none;}
div.wiki ul.toc li.heading2 { margin-left: 6px; }
div.wiki ul.toc li.heading3 { margin-left: 12px; font-size: 0.8em; }
div.wiki div.toc a {
display: block;
div.wiki ul.toc a {
font-size: 0.9em;
font-weight: normal;
text-decoration: none;
color: #606060;
}
div.wiki div.toc a:hover { color: #c61a1a; text-decoration: underline;}
div.wiki div.toc a.heading2 { margin-left: 6px; }
div.wiki div.toc a.heading3 { margin-left: 12px; font-size: 0.8em; }
div.wiki ul.toc a:hover { color: #c61a1a; text-decoration: underline;}
/***** My page layout *****/
.block-receiver {