From 28c9a747797dae738cd6fe1a97c29e1591564112 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 30 Apr 2005 06:41:09 +0000 Subject: [PATCH] * Fix up the TOC markup a bit. Moved the outer box back from
to , as the inline-size workarounds would break a lot of pages which use floated-right sidebars. Make TOC styles available as a class .toc, so the #toc doesn't need to be (ab)used to create alternates with the same style. --- includes/ImagePage.php | 10 ++-- includes/Linker.php | 7 ++- skins/common/common.css | 102 ++++++++++++++++++++++++---------------- skins/monobook/main.css | 80 +++++++++++-------------------- 4 files changed, 98 insertions(+), 101 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index e4747a3064..4560214b44 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -56,12 +56,12 @@ class ImagePage extends Article { function showTOC() { global $wgOut, $wgShowEXIF, $wgLang; - $r= '
'.wfMsg( 'toc' ).'
'; - $r .= '' . $wgLang->getNStext( NS_IMAGE ) . ' - '; - $r .= '' . wfMsg( 'imghistory' ) . ' - '; - $r .= '' . wfMsg( 'imagelinks' ) . ''; + $r= '
'.htmlspecialchars( wfMsg( 'toc' )) .'
'; + $r .= '' . htmlspecialchars( $wgLang->getNStext( NS_IMAGE ) ) . ' - '; + $r .= '' . htmlspecialchars( wfMsg( 'imghistory' ) ) . ' - '; + $r .= '' . htmlspecialchars( wfMsg( 'imagelinks' ) ) . ''; if ( $wgShowEXIF ) { - $r .= ' - ' . wfMsg( 'exifdata' ) . ''; + $r .= ' - ' . htmlspecialchars( wfMsg( 'exifdata' ) ) . ''; } diff --git a/includes/Linker.php b/includes/Linker.php index dcd9cc0df0..c65aa6d180 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -718,18 +718,17 @@ class Linker { /** @todo document */ function tocList($toc) { - return "
\n" + return "
" . "

" . wfMsg('toc') . "

\n" . $toc - . "\n\n" + . "\n
\n" . '' - . "
\n"; + . "\n"; } /** @todo document */ diff --git a/skins/common/common.css b/skins/common/common.css index 8ff514ba3a..1eac63d857 100644 --- a/skins/common/common.css +++ b/skins/common/common.css @@ -100,51 +100,38 @@ img { border: none; } img.tex { vertical-align: middle; } span.texhtml { font-family: serif; } -/* IE/mac fixes */ -#toc { - display: inline-table; -} -#toc h2, #toc div, #toc ul, #toc li { - float: left; - clear: left; -} -@media all { - #toc { - display: block; - text-align: center; - } - #toc * { - float: none!important; - } -} -/* end IE/mac fixes */ -#toc { - border: 1px solid #88a; - background-color: #f7f8ff; - padding: 5px; - font-size: 95%; - float: left; +#toc, +.toc { + border: 1px solid #bba; + background-color: #f7f8ff; + padding: 5px; + font-size: 95%; + text-align: center; } -#toc h2 { - display: inline; - border: none; - padding: 0; - font-size: 100%; - font-weight: bold; +#toc h2, +.toc h2 { + display: inline; + border: none; + padding: 0; + font-size: 100%; + font-weight: bold; } -#toc ul { - list-style-type: none; - list-style-image: none; - margin-left: 0; - padding-left: 0; - text-align: left; +#toc ul, +.toc ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding-left: 0; + text-align: left; } -#toc ul ul { - margin: 0 0 0 2em; +#toc ul ul, +.toc ul ul { + margin: 0 0 0 2em; } -#toc .toctoggle { - font-size: 95%; +#toc .toctoggle, +.toc .toctoggle { + font-size: 94%; } @@ -324,3 +311,38 @@ li span.deleted { color: #888; font-style: italic; } + + +/* Classes for EXIF data display */ +table.exif { + margin-left: 0.5em; +} + +table.exif caption { font-weight: bold; } +table.exif th { font-weight: normal; } +table.exif td { padding: 0.1em; } + +table.exif { + border: none; + border-collapse: collapse; +} +table.exif td, table.exif th { + border: 1px solid #aaaaaa; + padding-left: 4px; + padding-right: 4px; +} +table.exif th { + background-color: #f9f9f9; +} +table.exif td { + background-color: #fcfcfc; +} +table.exif td.spacer { + background: inherit; + border-top: none; + border-bottom: none; +} + +.visualClear { + clear: both; +} diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 66c645ac59..788368f952 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -311,62 +311,38 @@ table.small { ** content styles */ -/* IE/mac fixes */ -#toc { - display: inline-table; -} -#toc div, #toc h2, #toc ul, #toc li, #toc a { - float: left; - clear: left; -} -#toc .toctoggle * { - float: none; - clear: none; -} -#toc h2 { - margin-right: .3em; -} -@media all { - #toc { - display: block; - text-align: center; - } - #toc * { - float: none !important; - } - #toc h2 { - margin-right: 0; - } +#toc, +.toc { + border: 1px solid #aaa; + background-color: #f9f9f9; + padding: 5px; + font-size: 95%; + text-align: center; } -/* end IE/mac fixes */ - -#toc { - border: 1px solid #aaa; - background-color: #f9f9f9; - padding: 5px; - font-size: 95%; - float: left; +#toc h2, +.toc h2 { + display: inline; + border: none; + padding: 0; + font-size: 100%; + font-weight: bold; } -#toc h2 { - display: inline; - border: none; - padding: 0; - font-size: 100%; - font-weight: bold; +#toc ul, +.toc ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding-left: 0; + text-align: left; } -#toc ul { - list-style-type: none; - list-style-image: none; - margin-left: 0; - padding-left: 0; - text-align: left; +#toc ul ul, +.toc ul ul { + margin: 0 0 0 2em; } -#toc ul ul { - margin: 0 0 0 2em; +#toc .toctoggle, +.toc .toctoggle { + font-size: 94%; } -#toc .toctoggle { - font-size: 94%; - } /* images */ @@ -1144,6 +1120,6 @@ table.exif td.spacer { text-indent: -2em; } -div.imagepagetoc table { +div.imagepagetoc table.toc { margin-bottom: 1em; } -- 2.20.1