* (bug 4525) Move section links down visually to same level as headings editsection...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 18 Oct 2006 06:53:19 +0000 (06:53 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 18 Oct 2006 06:53:19 +0000 (06:53 +0000)
* 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.

15 files changed:
RELEASE-NOTES
includes/DefaultSettings.php
includes/Linker.php
includes/Parser.php
maintenance/parserTests.txt
skins/chick/main.css
skins/common/cologneblue.css
skins/common/common.css
skins/common/commonPrint.css
skins/common/common_rtl.css
skins/common/wikibits.js
skins/common/wikistandard.css
skins/monobook/main.css
skins/monobook/rtl.css
skins/simple/main.css

index d800f79..327c101 100644 (file)
@@ -55,6 +55,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (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 ==
index 50694b6..97a8a2a 100644 (file)
@@ -1030,7 +1030,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '14';
+$wgStyleVersion = '15';
 
 # Server-side caching:
 
index bc5fb64..53deb39 100644 (file)
@@ -1046,11 +1046,11 @@ class Linker {
                $editurl = '&section='.$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
@@ -1062,7 +1062,7 @@ class Linker {
                $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>";
        }
 
        /**
index 8457680..2d18684 100644 (file)
@@ -3516,6 +3516,9 @@ class Parser
                        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] = '';
@@ -3525,9 +3528,11 @@ class Parser
                                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 )
index 7f3336e..d06dead 100644 (file)
@@ -3147,13 +3147,15 @@ More
 ===Smaller headline===
 Blah blah
 !! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;section=3" title="Edit section: Smaller headline">edit</a>]</span> <span class="mw-headline">Smaller headline</span></h3>
+
 <p>Blah blah
 </p>
 !! end
@@ -3172,7 +3174,8 @@ title=[[Parser test script]]
 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>
@@ -3181,6 +3184,7 @@ Some text
 <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>
@@ -3192,17 +3196,19 @@ Some text
 <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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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'
@@ -3220,7 +3226,8 @@ Handling of sections up to level 6 and beyond
 ========= 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>
@@ -3229,12 +3236,14 @@ Handling of sections up to level 6 and beyond
 <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>
@@ -3246,20 +3255,23 @@ Handling of sections up to level 6 and beyond
 </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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</span> <span class="mw-headline">==== Level 10 Heading====</span></h6>
 !! end
 
 !! test
@@ -3270,9 +3282,9 @@ title=[[Parser test script]]
 == Foo bar ==
 == Foo bar ==
 !! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline"> Foo bar </span></h2>
 !! end
 
 !! article
@@ -3292,10 +3304,11 @@ __NOTOC__
 {{sections}}
 ==Section 4==
 !! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;section=2" title="Edit section: Section 4">edit</a>]</span> <span class="mw-headline">Section 4</span></h2>
 
 !! end
 
@@ -3306,9 +3319,9 @@ __NOEDITSECTION__
 ==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
@@ -3318,8 +3331,7 @@ title=[[Parser test script]]
 !! input
 ==Section with a [[Main Page|link]] in it==
 !! result
-<div class="editsection">[<a href="/index.php?title=Parser_test_script&amp;action=edit&amp;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&amp;action=edit&amp;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
 
 
@@ -4459,12 +4471,13 @@ Fuzz testing: Parser14
 == onmouseover= ==
 http://__TOC__
 !! result
-<div class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;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&amp;action=edit&amp;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
 
@@ -4474,11 +4487,10 @@ Fuzz testing: Parser14-table
 ==a==
 {| STYLE=__TOC__
 !! result
-<div class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: a">edit</a>]</div><a name="a"></a><h2>a</h2>
-<table style="&#95;_TOC&#95;_">
-<tr><td></td></tr>
-</table>
-
+<a name="a"></a><h2><span class="editsection">[<a href="/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;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>)
@@ -5861,4 +5873,4 @@ more tables
 math
 character entities
 and much more
-Try for 100% code coverage
+Try for 100% code coverage
\ No newline at end of file
index 00cab81..6b52f4a 100644 (file)
@@ -50,20 +50,26 @@ h1, h2, h3, h4, h5, h6 {
     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;
@@ -482,4 +488,4 @@ div.gallerytext {
 
 #jump-to-nav {
   display: none;
-}
\ No newline at end of file
+}
index 0c0b21d..c71eb2d 100644 (file)
@@ -78,8 +78,9 @@ td.bottom {
 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;
index 64dbff7..2fa3ce9 100644 (file)
@@ -2,6 +2,31 @@
  * 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; }
@@ -315,11 +340,6 @@ li span.deleted {
        font-style: italic;
 }
 
-div.editsection {
-       float: right;
-       margin-left: 5px;
-}
-
 /* Classes for EXIF data display */
 table.mw_metadata {
        margin-left: 0.5em;
index 1bda4fd..314ff55 100644 (file)
@@ -132,7 +132,10 @@ ul {
 
 h1, h2, h3, h4, h5, h6
 {
-    font-weight: bold;
+       font-weight: bold;
+}
+.editsection {
+       font-weight: normal;
 }
 
 p, .documentDescription {
index 651c4dc..54186bb 100644 (file)
@@ -16,7 +16,7 @@ fieldset.operaprefsection {
     margin-right: 1.4em;
     margin-left: 0.4em;
 }
-div.editsection {
+.editsection {
        float: left;
        margin-right: 5px;
 }
index 3a8fd6c..7846fff 100644 (file)
@@ -503,9 +503,9 @@ function akeytt() {
 
 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);
                        }
@@ -518,27 +518,56 @@ function 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) {
index dd39eba..2e18a89 100644 (file)
@@ -29,16 +29,18 @@ textarea { overflow: auto; }
 
 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;}
index 6b57ed9..78c9a4a 100644 (file)
@@ -119,17 +119,23 @@ h1, h2, h3, h4, h5, h6 {
        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;
 }
index bf88e43..f4a6768 100644 (file)
@@ -41,7 +41,7 @@ html>body .portlet {
        float: right;
        clear: right;
 }
-div.editsection {
+.editsection {
        float: left;
        margin-right: 5px;
 }
index e389dfa..079cb45 100644 (file)
@@ -1,3 +1,29 @@
+/* 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;
 }