* Document structure changed, so some JavaScript/CSS may need tweaking (wikibits.js updated to reflect changes).
* Parsertests updated, but don't seem to run, so someone please confirm that there are no (illusory) regressions.
* $wgStyleVersion bumped.
* (bug 7581) Update language name for cbk-zam
* (bug 7444) Update namespace translations for Telugu (te), kept old values as
alias for compatibility
+* (bug 4525) Move section links down visually to same level as headings
+ editsection links are now inside the heading elements)
== Languages updated ==
* to ensure that client-side caches don't keep obsolete copies of global
* styles.
*/
-$wgStyleVersion = '14';
+$wgStyleVersion = '15';
# Server-side caching:
$editurl = '§ion='.$section;
$url = $this->makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl );
- return "<div class=\"editsection\">[".$url."]</div>";
+ return "<span class=\"editsection\">[".$url."]</span>";
}
- /**
+ /**
* @param $title Title object.
* @param $section Integer: section number.
* @param $hint Link String: title, or default if omitted or empty
$hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'editsectionhint', htmlspecialchars( $hint ) ) . '"';
$url = $this->makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint );
- return "<div class=\"editsection\">[".$url."]</div>";
+ return "<span class=\"editsection\">[".$url."]</span>";
}
/**
if( $enoughToc && ( !isset($wgMaxTocLevel) || $toclevel<$wgMaxTocLevel ) ) {
$toc .= $sk->tocLine($anchor, $tocline, $numbering, $toclevel);
}
+ # give headline the correct <h#> tag
+ @$head[$headlineCount] .= "<a name=\"$anchor\"></a><h".$level.$matches[2][$headlineCount];
+
if( $showEditLink && ( !$istemplate || $templatetitle !== "" ) ) {
if ( empty( $head[$headlineCount] ) ) {
$head[$headlineCount] = '';
else
$head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
}
-
- # give headline the correct <h#> tag
- @$head[$headlineCount] .= "<a name=\"$anchor\"></a><h".$level.$matches[2][$headlineCount] .$headline.'</h'.$level.'>';
+ // Yes, the headline logically goes before the edit section. Why isn't it there
+ // in source? Ask the CSS people. The float gets screwed up if you do that.
+ // This might be moved to before the editsection at some point so that it will
+ // display a bit more prettily without CSS, so please don't rely on the order.
+ $head[$headlineCount] .= ' <span class="mw-headline">'.$headline.'</span></h'.$level.'>';
$headlineCount++;
if( !$istemplate )
===Smaller headline===
Blah blah
!! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Headline 1">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
+<a name="Headline_1"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline"> Headline 1 </span></h2>
+
<p>Some text
</p>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Headline 2">edit</a>]</div><a name="Headline_2"></a><h2>Headline 2</h2>
+<a name="Headline_2"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline">Headline 2</span></h2>
<p>More
</p>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=3" title="Edit section: Smaller headline">edit</a>]</div><a name="Smaller_headline"></a><h3>Smaller headline</h3>
+<a name="Smaller_headline"></a><h3><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=3" title="Edit section: Smaller headline">edit</a>]</span> <span class="mw-headline">Smaller headline</span></h3>
+
<p>Blah blah
</p>
!! end
Some text
===Another headline===
!! result
-<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
+
<ul>
<li class="toclevel-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
<ul>
<li class="toclevel-3"><a href="#Skipping_a_level"><span class="tocnumber">1.1.1</span> <span class="toctext">Skipping a level</span></a>
<ul>
<li class="toclevel-4"><a href="#Skipping_a_level_2"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Skipping a level</span></a></li>
+
</ul>
</li>
</ul>
<li class="toclevel-2"><a href="#Another_headline"><span class="tocnumber">2.1</span> <span class="toctext">Another headline</span></a></li>
</ul>
</li>
+
</ul>
-</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Headline 1">edit</a>]</div><a name="Headline_1"></a><h2> Headline 1 </h2>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Subheadline 1">edit</a>]</div><a name="Subheadline_1"></a><h3> Subheadline 1 </h3>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=3" title="Edit section: Skipping a level">edit</a>]</div><a name="Skipping_a_level"></a><h5> Skipping a level </h5>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=4" title="Edit section: Skipping a level">edit</a>]</div><a name="Skipping_a_level_2"></a><h6> Skipping a level </h6>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=5" title="Edit section: Headline 2">edit</a>]</div><a name="Headline_2"></a><h2> Headline 2 </h2>
+</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
+<a name="Headline_1"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline"> Headline 1 </span></h2>
+<a name="Subheadline_1"></a><h3><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Subheadline 1">edit</a>]</span> <span class="mw-headline"> Subheadline 1 </span></h3>
+
+<a name="Skipping_a_level"></a><h5><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=3" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline"> Skipping a level </span></h5>
+<a name="Skipping_a_level_2"></a><h6><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=4" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline"> Skipping a level </span></h6>
+<a name="Headline_2"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=5" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline"> Headline 2 </span></h2>
+
<p>Some text
</p>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=6" title="Edit section: Another headline">edit</a>]</div><a name="Another_headline"></a><h3>Another headline</h3>
-
+<a name="Another_headline"></a><h3><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=6" title="Edit section: Another headline">edit</a>]</span> <span class="mw-headline">Another headline</span></h3>
!! end
# perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
========= Level 9 Heading=========
========== Level 10 Heading==========
!! result
-<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
+
<ul>
<li class="toclevel-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
<ul>
<li class="toclevel-3"><a href="#Level_3_Heading"><span class="tocnumber">1.1.1</span> <span class="toctext">Level 3 Heading</span></a>
<ul>
<li class="toclevel-4"><a href="#Level_4_Heading"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Level 4 Heading</span></a>
+
<ul>
<li class="toclevel-5"><a href="#Level_5_Heading"><span class="tocnumber">1.1.1.1.1</span> <span class="toctext">Level 5 Heading</span></a>
<ul>
<li class="toclevel-6"><a href="#Level_6_Heading"><span class="tocnumber">1.1.1.1.1.1</span> <span class="toctext">Level 6 Heading</span></a></li>
<li class="toclevel-6"><a href="#.3D_Level_7_Heading.3D"><span class="tocnumber">1.1.1.1.1.2</span> <span class="toctext">= Level 7 Heading=</span></a></li>
<li class="toclevel-6"><a href="#.3D.3D_Level_8_Heading.3D.3D"><span class="tocnumber">1.1.1.1.1.3</span> <span class="toctext">== Level 8 Heading==</span></a></li>
+
<li class="toclevel-6"><a href="#.3D.3D.3D_Level_9_Heading.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.4</span> <span class="toctext">=== Level 9 Heading===</span></a></li>
<li class="toclevel-6"><a href="#.3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.5</span> <span class="toctext">==== Level 10 Heading====</span></a></li>
</ul>
</ul>
</li>
</ul>
+
</li>
</ul>
-</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Level 1 Heading">edit</a>]</div><a name="Level_1_Heading"></a><h1> Level 1 Heading</h1>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Level 2 Heading">edit</a>]</div><a name="Level_2_Heading"></a><h2> Level 2 Heading</h2>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: Level 3 Heading">edit</a>]</div><a name="Level_3_Heading"></a><h3> Level 3 Heading</h3>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=4" title="Edit section: Level 4 Heading">edit</a>]</div><a name="Level_4_Heading"></a><h4> Level 4 Heading</h4>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=5" title="Edit section: Level 5 Heading">edit</a>]</div><a name="Level_5_Heading"></a><h5> Level 5 Heading</h5>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=6" title="Edit section: Level 6 Heading">edit</a>]</div><a name="Level_6_Heading"></a><h6> Level 6 Heading</h6>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=7" title="Edit section: = Level 7 Heading=">edit</a>]</div><a name=".3D_Level_7_Heading.3D"></a><h6>= Level 7 Heading=</h6>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=8" title="Edit section: == Level 8 Heading==">edit</a>]</div><a name=".3D.3D_Level_8_Heading.3D.3D"></a><h6>== Level 8 Heading==</h6>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=9" title="Edit section: === Level 9 Heading===">edit</a>]</div><a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><h6>=== Level 9 Heading===</h6>
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</div><a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><h6>==== Level 10 Heading====</h6>
+</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
+<a name="Level_1_Heading"></a><h1><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Level 1 Heading">edit</a>]</span> <span class="mw-headline"> Level 1 Heading</span></h1>
+<a name="Level_2_Heading"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Level 2 Heading">edit</a>]</span> <span class="mw-headline"> Level 2 Heading</span></h2>
+
+<a name="Level_3_Heading"></a><h3><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=3" title="Edit section: Level 3 Heading">edit</a>]</span> <span class="mw-headline"> Level 3 Heading</span></h3>
+<a name="Level_4_Heading"></a><h4><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=4" title="Edit section: Level 4 Heading">edit</a>]</span> <span class="mw-headline"> Level 4 Heading</span></h4>
+<a name="Level_5_Heading"></a><h5><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=5" title="Edit section: Level 5 Heading">edit</a>]</span> <span class="mw-headline"> Level 5 Heading</span></h5>
+<a name="Level_6_Heading"></a><h6><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=6" title="Edit section: Level 6 Heading">edit</a>]</span> <span class="mw-headline"> Level 6 Heading</span></h6>
+<a name=".3D_Level_7_Heading.3D"></a><h6><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=7" title="Edit section: = Level 7 Heading=">edit</a>]</span> <span class="mw-headline">= Level 7 Heading=</span></h6>
+<a name=".3D.3D_Level_8_Heading.3D.3D"></a><h6><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=8" title="Edit section: == Level 8 Heading==">edit</a>]</span> <span class="mw-headline">== Level 8 Heading==</span></h6>
+
+<a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><h6><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=9" title="Edit section: === Level 9 Heading===">edit</a>]</span> <span class="mw-headline">=== Level 9 Heading===</span></h6>
+<a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><h6><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</span> <span class="mw-headline">==== Level 10 Heading====</span></h6>
!! end
!! test
== Foo bar ==
== Foo bar ==
!! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Foo bar">edit</a>]</div><a name="Foo_bar"></a><h2> Foo bar </h2>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Foo bar">edit</a>]</div><a name="Foo_bar_2"></a><h2> Foo bar </h2>
+<a name="Foo_bar"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline"> Foo bar </span></h2>
+<a name="Foo_bar_2"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline"> Foo bar </span></h2>
!! end
!! article
{{sections}}
==Section 4==
!! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Section 0">edit</a>]</div><a name="Section_0"></a><h2>Section 0</h2>
-<div class="editsection">[<a href="/index.php?title=Template:Sections&action=edit&section=1" title="Template:Sections">edit</a>]</div><a name="Section_1"></a><h3>Section 1</h3>
-<div class="editsection">[<a href="/index.php?title=Template:Sections&action=edit&section=2" title="Template:Sections">edit</a>]</div><a name="Section_2"></a><h2>Section 2</h2>
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Section 4">edit</a>]</div><a name="Section_4"></a><h2>Section 4</h2>
+<a name="Section_0"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Section 0">edit</a>]</span> <span class="mw-headline">Section 0</span></h2>
+
+<a name="Section_1"></a><h3><span class="editsection">[<a href="/phase3/index.php?title=Template:Sections&action=edit&section=1" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 1</span></h3>
+<a name="Section_2"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Template:Sections&action=edit&section=2" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 2</span></h2>
+<a name="Section_4"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=2" title="Edit section: Section 4">edit</a>]</span> <span class="mw-headline">Section 4</span></h2>
!! end
==Section 1==
==Section 2==
!! result
-<a name="Section_1"></a><h2>Section 1</h2>
-<a name="Section_2"></a><h2>Section 2</h2>
+<a name="Section_1"></a><h2> <span class="mw-headline">Section 1</span></h2>
+<a name="Section_2"></a><h2> <span class="mw-headline">Section 2</span></h2>
!! end
!! test
!! input
==Section with a [[Main Page|link]] in it==
!! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Section with a link in it">edit</a>]</div><a name="Section_with_a_link_in_it"></a><h2>Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</h2>
-
+<a name="Section_with_a_link_in_it"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: Section with a link in it">edit</a>]</span> <span class="mw-headline">Section with a <a href="/phase3/index.php/Main_Page" title="Main Page">link</a> in it</span></h2>
!! end
== onmouseover= ==
http://__TOC__
!! result
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: onmouseover=">edit</a>]</div><a name="onmouseover.3D"></a><h2> onmouseover= </h2>
-http://<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<a name="onmouseover.3D"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: onmouseover=">edit</a>]</span> <span class="mw-headline"> onmouseover= </span></h2>
+http://<table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
<ul>
<li class="toclevel-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
+
</ul>
-</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
+</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
!! end
==a==
{| STYLE=__TOC__
!! result
-<div class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: a">edit</a>]</div><a name="a"></a><h2>a</h2>
-<table style="__TOC__">
-<tr><td></td></tr>
-</table>
-
+<a name="a"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&action=edit&section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline">a</span></h2>
+<table style="">
+<tbody><tr><td></td></tr>
+</tbody></table>
!! end
# Known to produce bogus xml (extra </td>)
math
character entities
and much more
-Try for 100% code coverage
+Try for 100% code coverage
\ No newline at end of file
padding-bottom: 0.17em;
border-bottom: 1px solid #aaaaaa;
}
+.editsection {
+ font-weight: normal;
+ float: right;
+ margin-left: 5px;
+}
h1 { font-size: 188%; }
+h1 .editsection { font-size: 53.2%; }
h2 { font-size: 150%; }
+h2 .editsection { font-size: 66.7%; }
h3, h4, h5, h6 {
border-bottom: none;
font-weight: bold;
}
h3 { font-size: 132%; }
+h3 .editsection { font-size: 75.8%; }
h4 { font-size: 116%; }
+h4 .editsection { font-size: 86.2%; }
h5 { font-size: 100%; }
h6 { font-size: 80%; }
-.editsection {
- float: right;
- margin-left: 5px;
-}
+h6 .editsection { font-size: 125%; }
ul {
line-height: 1.5em;
#jump-to-nav {
display: none;
-}
\ No newline at end of file
+}
h1 {
color: #666666;
font-family: Verdana, Arial, sans-serif;
- font-size: 18pt; font-weight: bold; line-height: 21pt;
+ font-size: 180%; line-height: 21pt;
}
+h1 .editsection { font-size: 55.6%; }
h1.pagetitle { padding-bottom: 0; margin-bottom: 0; }
#article p.subtitle {
color: #666666; font-size: 11pt; font-weight: bold;
* common.css
* This file contains CSS settings common to Wikistandard, Nostalgia and CologneBlue
*/
+
+/* For clarity, explicitly state some recommendations from <http://www.w3.org/
+ TR/CSS21/sample.html> to make sure the editsection links scale right */
+
+h1 { font-size: 2em; }
+h2 { font-size: 1.5em; }
+h3 { font-size: 1.17em; }
+h5 { font-size: .83em; }
+h6 { font-size: .75em; }
+h1, h2, h3, h4, h5, h6 { font-weight: bolder }
+
+/* Now the custom parts */
+
+/* Make edit sections (which are inside h# tags) normal-sized */
+.editsection {
+ font-weight: normal;
+ float: right;
+ margin-left: 5px;
+}
+h1 .editsection { font-size: 50% }
+h2 .editsection { font-size: 66.7% }
+h3 .editsection { font-size: 85.5% }
+h5 .editsection { font-size: 120% }
+h6 .editsection { font-size: 133% }
+
#footer { clear: both }
/* images */
div.floatright { float: right; clear: right; margin: 0 0 1em 1em; }
font-style: italic;
}
-div.editsection {
- float: right;
- margin-left: 5px;
-}
-
/* Classes for EXIF data display */
table.mw_metadata {
margin-left: 0.5em;
h1, h2, h3, h4, h5, h6
{
- font-weight: bold;
+ font-weight: bold;
+}
+.editsection {
+ font-weight: normal;
}
p, .documentDescription {
margin-right: 1.4em;
margin-left: 0.4em;
}
-div.editsection {
+.editsection {
float: left;
margin-right: 5px;
}
function setupRightClickEdit() {
if (document.getElementsByTagName) {
- var divs = document.getElementsByTagName('div');
- for (var i = 0; i < divs.length; i++) {
- var el = divs[i];
+ var spans = document.getElementsByTagName('span');
+ for (var i = 0; i < spans.length; i++) {
+ var el = spans[i];
if(el.className == 'editsection') {
addRightClickEditHandler(el);
}
var link = el.childNodes[i];
if (link.nodeType == 1 && link.nodeName.toLowerCase() == 'a') {
var editHref = link.getAttribute('href');
-
- // find the following a
- var next = el.nextSibling;
- while (next.nodeType != 1)
- next = next.nextSibling;
-
- // find the following header
- next = next.nextSibling;
- while (next.nodeType != 1)
- next = next.nextSibling;
-
- if (next && next.nodeType == 1 &&
- next.nodeName.match(/^[Hh][1-6]$/)) {
- next.oncontextmenu = function() {
- document.location = editHref;
- return false;
+ // find the enclosing (parent) header
+ var prev = el.parentNode;
+ if (prev && prev.nodeType == 1 &&
+ prev.nodeName.match(/^[Hh][1-6]$/)) {
+ prev.oncontextmenu = function(e) {
+ if (!e) var e = window.event;
+ // e is now the event in all browsers
+ if (e.target) var targ = e.target;
+ else if (e.srcElement) var targ = e.srcElement;
+ if (targ.nodeType == 3) // defeat Safari bug
+ targ = targ.parentNode;
+ // targ is now the target element
+
+ // We don't want to deprive the noble reader of a context menu
+ // for the section edit link, do we? (Might want to extend this
+ // to all <a>'s?)
+ if (targ.nodeName.toLowerCase() != 'a'
+ || targ.parentNode.className != 'editsection') {
+ document.location = editHref;
+ return false;
+ }
}
}
}
}
}
+/*
+function addRightClickEditHandler(el) {
+ // find the enclosing (parent) header
+ var par = el.parentNode;
+ if (par && par.nodeType == 1 && par.nodeName.match(/^[Hh][1-6]$/)) {
+ par.oncontextmenu = function(e) {
+ if (!e) var e = window.event;
+ // e is now the event in all browsers
+ if (e.target) targ = e.target;
+ else if (e.srcElement) targ = e.srcElement;
+ if (targ.nodeType == 3) // defeat Safari bug
+ targ = targ.parentNode;
+ // targ is now the target element
+ // We don't want to deprive the noble reader of a context menu
+ // for the section edit link, do we? (Might want to extend this
+ // to all <a>'s.)links
+ if (targ.className != 'editsection') {
+ document.location = editHref;
+ return false;
+ }
+ }
+ }
+}
+*/
function setupCheckboxShiftClick() {
if (document.getElementsByTagName) {
h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0;
font-size:150%; }
+h1.pagetitle .editsection { font-size: 66.7%; }
h2 { font-size: 120%; }
+h2 .editsection { font-size: 83.3%; }
h2, h3, h4, h5, h6 { margin-bottom: 0;}
h3 { font-size: 106.25%; }
+h3 .editsection { font-size: 94.1%; }
h4 { font-size: 103.125%; }
+h4 .editsection { font-size: 97.0%; }
h5 { font-size: 100%; }
+h5 .editsection { font-size: 100%; }
h6 { font-size: 95%; }
-.editsection {
- float: right;
- margin-left: 5px;
-}
+h6 .editsection { font-size: 105.3%; }
hr.sep { color:gray;height:1px;background-color:gray;}
p.subpages { font-size:small;}
p.subtitle { padding-top: 0; margin-top: 0;}
border-bottom: 1px solid #aaa;
}
h1 { font-size: 188%; }
+h1 .editsection { font-size: 53%; }
h2 { font-size: 150%; }
+h2 .editsection { font-size: 67%; }
h3, h4, h5, h6 {
border-bottom: none;
font-weight: bold;
}
h3 { font-size: 132%; }
+h3 .editsection { font-size: 76%; font-weight: normal; }
h4 { font-size: 116%; }
+h4 .editsection { font-size: 86%; font-weight: normal; }
h5 { font-size: 100%; }
+h5 .editsection { font-weight: normal; }
h6 { font-size: 80%; }
+h6 .editsection { font-size: 125%; font-weight: normal; }
-div.editsection {
+.editsection {
float: right;
margin-left: 5px;
}
float: right;
clear: right;
}
-div.editsection {
+.editsection {
float: left;
margin-right: 5px;
}
+/* For clarity, explicitly state some recommendations from <http://www.w3.org/
+ TR/CSS21/sample.html> to make sure the editsection links scale right */
+
+h1 { font-size: 2em; }
+h2 { font-size: 1.5em; }
+h3 { font-size: 1.17em; }
+h5 { font-size: .83em; }
+h6 { font-size: .75em; }
+h1, h2, h3, h4, h5, h6 { font-weight: bolder }
+
+/* Now the custom parts */
+
+/* Make edit sections (which are inside h# tags) normal-sized
+ and otherwise format */
+.editsection {
+ font-weight: normal;
+ float: right;
+ margin-left: 5px;
+}
+h1 .editsection { font-size: 50% }
+h2 .editsection { font-size: 66.7% }
+h3 .editsection { font-size: 85.5% }
+h5 .editsection { font-size: 120% }
+h6 .editsection { font-size: 133% }
+
+
#toolbar {
display: none;
}