r17078 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17077‎ | r17078 | r17079 >
Date:06:53, 18 October 2006
Author:simetrical
Status:old
Tags:
Comment:
* (bug 4525) Move section links down visually to same level as headings editsection links are now inside the heading elements).
* 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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)
  • /trunk/phase3/skins/chick/main.css (modified) (history)
  • /trunk/phase3/skins/common/cologneblue.css (modified) (history)
  • /trunk/phase3/skins/common/common.css (modified) (history)
  • /trunk/phase3/skins/common/commonPrint.css (modified) (history)
  • /trunk/phase3/skins/common/common_rtl.css (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)
  • /trunk/phase3/skins/common/wikistandard.css (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)
  • /trunk/phase3/skins/monobook/rtl.css (modified) (history)
  • /trunk/phase3/skins/simple/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -3147,13 +3147,15 @@
31483148 ===Smaller headline===
31493149 Blah blah
31503150 !! result
3151 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
 3151+<a name="Headline_1"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3152+
31523153 <p>Some text
31533154 </p>
3154 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
 3155+<a name="Headline_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
31553156 <p>More
31563157 </p>
3157 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
 3158+<a name="Smaller_headline"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3159+
31583160 <p>Blah blah
31593161 </p>
31603162 !! end
@@ -3172,7 +3174,8 @@
31733175 Some text
31743176 ===Another headline===
31753177 !! result
3176 -<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
 3178+<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>
 3179+
31773180 <ul>
31783181 <li class="toclevel-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
31793182 <ul>
@@ -3181,6 +3184,7 @@
31823185 <li class="toclevel-3"><a href="#Skipping_a_level"><span class="tocnumber">1.1.1</span> <span class="toctext">Skipping a level</span></a>
31833186 <ul>
31843187 <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>
 3188+
31853189 </ul>
31863190 </li>
31873191 </ul>
@@ -3192,17 +3196,19 @@
31933197 <li class="toclevel-2"><a href="#Another_headline"><span class="tocnumber">2.1</span> <span class="toctext">Another headline</span></a></li>
31943198 </ul>
31953199 </li>
 3200+
31963201 </ul>
3197 -</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
3198 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3199 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3200 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3201 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3202 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
 3202+</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 3203+<a name="Headline_1"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3204+<a name="Subheadline_1"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3205+
 3206+<a name="Skipping_a_level"></a><h5><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3207+<a name="Skipping_a_level_2"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3208+<a name="Headline_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3209+
32033210 <p>Some text
32043211 </p>
3205 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3206 -
 3212+<a name="Another_headline"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/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>
32073213 !! end
32083214
32093215 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
@@ -3220,7 +3226,8 @@
32213227 ========= Level 9 Heading=========
32223228 ========== Level 10 Heading==========
32233229 !! result
3224 -<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
 3230+<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>
 3231+
32253232 <ul>
32263233 <li class="toclevel-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
32273234 <ul>
@@ -3229,12 +3236,14 @@
32303237 <li class="toclevel-3"><a href="#Level_3_Heading"><span class="tocnumber">1.1.1</span> <span class="toctext">Level 3 Heading</span></a>
32313238 <ul>
32323239 <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>
 3240+
32333241 <ul>
32343242 <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>
32353243 <ul>
32363244 <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>
32373245 <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>
32383246 <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>
 3247+
32393248 <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>
32403249 <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>
32413250 </ul>
@@ -3246,20 +3255,23 @@
32473256 </ul>
32483257 </li>
32493258 </ul>
 3259+
32503260 </li>
32513261 </ul>
3252 -</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
3253 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3254 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3255 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3256 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3257 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3258 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3259 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3260 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3261 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3262 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
 3262+</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 3263+<a name="Level_1_Heading"></a><h1><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3264+<a name="Level_2_Heading"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
32633265
 3266+<a name="Level_3_Heading"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3267+<a name="Level_4_Heading"></a><h4><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3268+<a name="Level_5_Heading"></a><h5><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3269+
 3270+<a name="Level_6_Heading"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3271+<a name=".3D_Level_7_Heading.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3272+<a name=".3D.3D_Level_8_Heading.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3273+
 3274+<a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3275+<a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/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>
32643276 !! end
32653277
32663278 !! test
@@ -3270,9 +3282,9 @@
32713283 == Foo bar ==
32723284 == Foo bar ==
32733285 !! result
3274 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3275 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
 3286+<a name="Foo_bar"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
32763287
 3288+<a name="Foo_bar_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
32773289 !! end
32783290
32793291 !! article
@@ -3292,11 +3304,12 @@
32933305 {{sections}}
32943306 ==Section 4==
32953307 !! result
3296 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3297 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3298 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
3299 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
 3308+<a name="Section_0"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
33003309
 3310+<a name="Section_1"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3311+<a name="Section_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3312+<a name="Section_4"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
 3313+
33013314 !! end
33023315
33033316 !! test
@@ -3306,9 +3319,9 @@
33073320 ==Section 1==
33083321 ==Section 2==
33093322 !! result
3310 -<a name="Section_1"></a><h2>Section 1</h2>
3311 -<a name="Section_2"></a><h2>Section 2</h2>
 3323+<a name="Section_1"></a><h2> <span class="mw-headline">Section 1</span></h2>
33123324
 3325+<a name="Section_2"></a><h2> <span class="mw-headline">Section 2</span></h2>
33133326 !! end
33143327
33153328 !! test
@@ -3318,8 +3331,7 @@
33193332 !! input
33203333 ==Section with a [[Main Page|link]] in it==
33213334 !! result
3322 -<div class="editsection">[<a href="https://www.mediawiki.org/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="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">link</a> in it</h2>
3323 -
 3335+<a name="Section_with_a_link_in_it"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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="https://www.mediawiki.org/phase3/index.php/Main_Page" title="Main Page">link</a> in it</span></h2>
33243336 !! end
33253337
33263338
@@ -4459,12 +4471,13 @@
44604472 == onmouseover= ==
44614473 http://__TOC__
44624474 !! result
4463 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
4464 -http://<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
 4475+<a name="onmouseover.3D"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
 4476+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>
44654477 <ul>
44664478 <li class="toclevel-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
 4479+
44674480 </ul>
4468 -</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 4481+</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
44694482
44704483 !! end
44714484
@@ -4474,11 +4487,10 @@
44754488 ==a==
44764489 {| STYLE=__TOC__
44774490 !! result
4478 -<div class="editsection">[<a href="https://www.mediawiki.org/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>
4479 -<table style="&#95;_TOC&#95;_">
4480 -<tr><td></td></tr>
4481 -</table>
4482 -
 4491+<a name="a"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/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>
 4492+<table style="">
 4493+<tbody><tr><td></td></tr>
 4494+</tbody></table>
44834495 !! end
44844496
44854497 # Known to produce bogus xml (extra </td>)
@@ -5861,4 +5873,4 @@
58625874 math
58635875 character entities
58645876 and much more
5865 -Try for 100% code coverage
 5877+Try for 100% code coverage
\ No newline at end of file
Index: trunk/phase3/skins/chick/main.css
@@ -50,20 +50,26 @@
5151 padding-bottom: 0.17em;
5252 border-bottom: 1px solid #aaaaaa;
5353 }
 54+.editsection {
 55+ font-weight: normal;
 56+ float: right;
 57+ margin-left: 5px;
 58+}
5459 h1 { font-size: 188%; }
 60+h1 .editsection { font-size: 53.2%; }
5561 h2 { font-size: 150%; }
 62+h2 .editsection { font-size: 66.7%; }
5663 h3, h4, h5, h6 {
5764 border-bottom: none;
5865 font-weight: bold;
5966 }
6067 h3 { font-size: 132%; }
 68+h3 .editsection { font-size: 75.8%; }
6169 h4 { font-size: 116%; }
 70+h4 .editsection { font-size: 86.2%; }
6271 h5 { font-size: 100%; }
6372 h6 { font-size: 80%; }
64 -.editsection {
65 - float: right;
66 - margin-left: 5px;
67 -}
 73+h6 .editsection { font-size: 125%; }
6874
6975 ul {
7076 line-height: 1.5em;
@@ -482,4 +488,4 @@
483489
484490 #jump-to-nav {
485491 display: none;
486 -}
\ No newline at end of file
 492+}
Index: trunk/phase3/skins/monobook/rtl.css
@@ -41,7 +41,7 @@
4242 float: right;
4343 clear: right;
4444 }
45 -div.editsection {
 45+.editsection {
4646 float: left;
4747 margin-right: 5px;
4848 }
Index: trunk/phase3/skins/monobook/main.css
@@ -119,17 +119,23 @@
120120 border-bottom: 1px solid #aaa;
121121 }
122122 h1 { font-size: 188%; }
 123+h1 .editsection { font-size: 53%; }
123124 h2 { font-size: 150%; }
 125+h2 .editsection { font-size: 67%; }
124126 h3, h4, h5, h6 {
125127 border-bottom: none;
126128 font-weight: bold;
127129 }
128130 h3 { font-size: 132%; }
 131+h3 .editsection { font-size: 76%; font-weight: normal; }
129132 h4 { font-size: 116%; }
 133+h4 .editsection { font-size: 86%; font-weight: normal; }
130134 h5 { font-size: 100%; }
 135+h5 .editsection { font-weight: normal; }
131136 h6 { font-size: 80%; }
 137+h6 .editsection { font-size: 125%; font-weight: normal; }
132138
133 -div.editsection {
 139+.editsection {
134140 float: right;
135141 margin-left: 5px;
136142 }
Index: trunk/phase3/skins/common/common.css
@@ -2,6 +2,31 @@
33 * common.css
44 * This file contains CSS settings common to Wikistandard, Nostalgia and CologneBlue
55 */
 6+
 7+/* For clarity, explicitly state some recommendations from <http://www.w3.org/
 8+ TR/CSS21/sample.html> to make sure the editsection links scale right */
 9+
 10+h1 { font-size: 2em; }
 11+h2 { font-size: 1.5em; }
 12+h3 { font-size: 1.17em; }
 13+h5 { font-size: .83em; }
 14+h6 { font-size: .75em; }
 15+h1, h2, h3, h4, h5, h6 { font-weight: bolder }
 16+
 17+/* Now the custom parts */
 18+
 19+/* Make edit sections (which are inside h# tags) normal-sized */
 20+.editsection {
 21+ font-weight: normal;
 22+ float: right;
 23+ margin-left: 5px;
 24+}
 25+h1 .editsection { font-size: 50% }
 26+h2 .editsection { font-size: 66.7% }
 27+h3 .editsection { font-size: 85.5% }
 28+h5 .editsection { font-size: 120% }
 29+h6 .editsection { font-size: 133% }
 30+
631 #footer { clear: both }
732 /* images */
833 div.floatright { float: right; clear: right; margin: 0 0 1em 1em; }
@@ -315,11 +340,6 @@
316341 font-style: italic;
317342 }
318343
319 -div.editsection {
320 - float: right;
321 - margin-left: 5px;
322 -}
323 -
324344 /* Classes for EXIF data display */
325345 table.mw_metadata {
326346 margin-left: 0.5em;
Index: trunk/phase3/skins/common/cologneblue.css
@@ -78,8 +78,9 @@
7979 h1 {
8080 color: #666666;
8181 font-family: Verdana, Arial, sans-serif;
82 - font-size: 18pt; font-weight: bold; line-height: 21pt;
 82+ font-size: 180%; line-height: 21pt;
8383 }
 84+h1 .editsection { font-size: 55.6%; }
8485 h1.pagetitle { padding-bottom: 0; margin-bottom: 0; }
8586 #article p.subtitle {
8687 color: #666666; font-size: 11pt; font-weight: bold;
Index: trunk/phase3/skins/common/commonPrint.css
@@ -132,8 +132,11 @@
133133
134134 h1, h2, h3, h4, h5, h6
135135 {
136 - font-weight: bold;
 136+ font-weight: bold;
137137 }
 138+.editsection {
 139+ font-weight: normal;
 140+}
138141
139142 p, .documentDescription {
140143 margin: 1em 0 ! important;
Index: trunk/phase3/skins/common/wikibits.js
@@ -503,9 +503,9 @@
504504
505505 function setupRightClickEdit() {
506506 if (document.getElementsByTagName) {
507 - var divs = document.getElementsByTagName('div');
508 - for (var i = 0; i < divs.length; i++) {
509 - var el = divs[i];
 507+ var spans = document.getElementsByTagName('span');
 508+ for (var i = 0; i < spans.length; i++) {
 509+ var el = spans[i];
510510 if(el.className == 'editsection') {
511511 addRightClickEditHandler(el);
512512 }
@@ -518,27 +518,56 @@
519519 var link = el.childNodes[i];
520520 if (link.nodeType == 1 && link.nodeName.toLowerCase() == 'a') {
521521 var editHref = link.getAttribute('href');
 522+ // find the enclosing (parent) header
 523+ var prev = el.parentNode;
 524+ if (prev && prev.nodeType == 1 &&
 525+ prev.nodeName.match(/^[Hh][1-6]$/)) {
 526+ prev.oncontextmenu = function(e) {
 527+ if (!e) var e = window.event;
 528+ // e is now the event in all browsers
 529+ if (e.target) var targ = e.target;
 530+ else if (e.srcElement) var targ = e.srcElement;
 531+ if (targ.nodeType == 3) // defeat Safari bug
 532+ targ = targ.parentNode;
 533+ // targ is now the target element
522534
523 - // find the following a
524 - var next = el.nextSibling;
525 - while (next.nodeType != 1)
526 - next = next.nextSibling;
527 -
528 - // find the following header
529 - next = next.nextSibling;
530 - while (next.nodeType != 1)
531 - next = next.nextSibling;
532 -
533 - if (next && next.nodeType == 1 &&
534 - next.nodeName.match(/^[Hh][1-6]$/)) {
535 - next.oncontextmenu = function() {
536 - document.location = editHref;
537 - return false;
 535+ // We don't want to deprive the noble reader of a context menu
 536+ // for the section edit link, do we? (Might want to extend this
 537+ // to all <a>'s?)
 538+ if (targ.nodeName.toLowerCase() != 'a'
 539+ || targ.parentNode.className != 'editsection') {
 540+ document.location = editHref;
 541+ return false;
 542+ }
538543 }
539544 }
540545 }
541546 }
542547 }
 548+/*
 549+function addRightClickEditHandler(el) {
 550+ // find the enclosing (parent) header
 551+ var par = el.parentNode;
 552+ if (par && par.nodeType == 1 && par.nodeName.match(/^[Hh][1-6]$/)) {
 553+ par.oncontextmenu = function(e) {
 554+ if (!e) var e = window.event;
 555+ // e is now the event in all browsers
 556+ if (e.target) targ = e.target;
 557+ else if (e.srcElement) targ = e.srcElement;
 558+ if (targ.nodeType == 3) // defeat Safari bug
 559+ targ = targ.parentNode;
 560+ // targ is now the target element
 561+ // We don't want to deprive the noble reader of a context menu
 562+ // for the section edit link, do we? (Might want to extend this
 563+ // to all <a>'s.)links
 564+ if (targ.className != 'editsection') {
 565+ document.location = editHref;
 566+ return false;
 567+ }
 568+ }
 569+ }
 570+}
 571+*/
543572
544573 function setupCheckboxShiftClick() {
545574 if (document.getElementsByTagName) {
Index: trunk/phase3/skins/common/common_rtl.css
@@ -16,7 +16,7 @@
1717 margin-right: 1.4em;
1818 margin-left: 0.4em;
1919 }
20 -div.editsection {
 20+.editsection {
2121 float: left;
2222 margin-right: 5px;
2323 }
Index: trunk/phase3/skins/common/wikistandard.css
@@ -29,16 +29,18 @@
3030
3131 h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0;
3232 font-size:150%; }
 33+h1.pagetitle .editsection { font-size: 66.7%; }
3334 h2 { font-size: 120%; }
 35+h2 .editsection { font-size: 83.3%; }
3436 h2, h3, h4, h5, h6 { margin-bottom: 0;}
3537 h3 { font-size: 106.25%; }
 38+h3 .editsection { font-size: 94.1%; }
3639 h4 { font-size: 103.125%; }
 40+h4 .editsection { font-size: 97.0%; }
3741 h5 { font-size: 100%; }
 42+h5 .editsection { font-size: 100%; }
3843 h6 { font-size: 95%; }
39 -.editsection {
40 - float: right;
41 - margin-left: 5px;
42 -}
 44+h6 .editsection { font-size: 105.3%; }
4345 hr.sep { color:gray;height:1px;background-color:gray;}
4446 p.subpages { font-size:small;}
4547 p.subtitle { padding-top: 0; margin-top: 0;}
Index: trunk/phase3/skins/simple/main.css
@@ -1,3 +1,29 @@
 2+/* For clarity, explicitly state some recommendations from <http://www.w3.org/
 3+ TR/CSS21/sample.html> to make sure the editsection links scale right */
 4+
 5+h1 { font-size: 2em; }
 6+h2 { font-size: 1.5em; }
 7+h3 { font-size: 1.17em; }
 8+h5 { font-size: .83em; }
 9+h6 { font-size: .75em; }
 10+h1, h2, h3, h4, h5, h6 { font-weight: bolder }
 11+
 12+/* Now the custom parts */
 13+
 14+/* Make edit sections (which are inside h# tags) normal-sized
 15+ and otherwise format */
 16+.editsection {
 17+ font-weight: normal;
 18+ float: right;
 19+ margin-left: 5px;
 20+}
 21+h1 .editsection { font-size: 50% }
 22+h2 .editsection { font-size: 66.7% }
 23+h3 .editsection { font-size: 85.5% }
 24+h5 .editsection { font-size: 120% }
 25+h6 .editsection { font-size: 133% }
 26+
 27+
228 #toolbar {
329 display: none;
430 }
Index: trunk/phase3/includes/Linker.php
@@ -1046,11 +1046,11 @@
10471047 $editurl = '&section='.$section;
10481048 $url = $this->makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl );
10491049
1050 - return "<div class=\"editsection\">[".$url."]</div>";
 1050+ return "<span class=\"editsection\">[".$url."]</span>";
10511051
10521052 }
10531053
1054 - /**
 1054+ /**
10551055 * @param $title Title object.
10561056 * @param $section Integer: section number.
10571057 * @param $hint Link String: title, or default if omitted or empty
@@ -1062,7 +1062,7 @@
10631063 $hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'editsectionhint', htmlspecialchars( $hint ) ) . '"';
10641064 $url = $this->makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint );
10651065
1066 - return "<div class=\"editsection\">[".$url."]</div>";
 1066+ return "<span class=\"editsection\">[".$url."]</span>";
10671067 }
10681068
10691069 /**
Index: trunk/phase3/includes/Parser.php
@@ -3516,6 +3516,9 @@
35173517 if( $enoughToc && ( !isset($wgMaxTocLevel) || $toclevel<$wgMaxTocLevel ) ) {
35183518 $toc .= $sk->tocLine($anchor, $tocline, $numbering, $toclevel);
35193519 }
 3520+ # give headline the correct <h#> tag
 3521+ @$head[$headlineCount] .= "<a name=\"$anchor\"></a><h".$level.$matches[2][$headlineCount];
 3522+
35203523 if( $showEditLink && ( !$istemplate || $templatetitle !== "" ) ) {
35213524 if ( empty( $head[$headlineCount] ) ) {
35223525 $head[$headlineCount] = '';
@@ -3525,10 +3528,12 @@
35263529 else
35273530 $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
35283531 }
 3532+ // Yes, the headline logically goes before the edit section. Why isn't it there
 3533+ // in source? Ask the CSS people. The float gets screwed up if you do that.
 3534+ // This might be moved to before the editsection at some point so that it will
 3535+ // display a bit more prettily without CSS, so please don't rely on the order.
 3536+ $head[$headlineCount] .= ' <span class="mw-headline">'.$headline.'</span></h'.$level.'>';
35293537
3530 - # give headline the correct <h#> tag
3531 - @$head[$headlineCount] .= "<a name=\"$anchor\"></a><h".$level.$matches[2][$headlineCount] .$headline.'</h'.$level.'>';
3532 -
35333538 $headlineCount++;
35343539 if( !$istemplate )
35353540 $sectionCount++;
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1030,7 +1030,7 @@
10311031 * to ensure that client-side caches don't keep obsolete copies of global
10321032 * styles.
10331033 */
1034 -$wgStyleVersion = '14';
 1034+$wgStyleVersion = '15';
10351035
10361036 # Server-side caching:
10371037
Index: trunk/phase3/RELEASE-NOTES
@@ -55,6 +55,8 @@
5656 * (bug 7581) Update language name for cbk-zam
5757 * (bug 7444) Update namespace translations for Telugu (te), kept old values as
5858 alias for compatibility
 59+* (bug 4525) Move section links down visually to same level as headings
 60+ editsection links are now inside the heading elements)
5961
6062
6163 == Languages updated ==

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r16962* (bug 4525) Move section links down to same level as headings (editsection l...simetrical08:01, 12 October 2006