Index: trunk/phase3/skins/chick/main.css |
— | — | @@ -397,25 +397,6 @@ |
398 | 398 | background-color:#f9f9f9; |
399 | 399 | border:1px dashed #aaaaaa; |
400 | 400 | } |
401 | | -/* |
402 | | -** Diff rendering |
403 | | -*/ |
404 | | -table.diff { background:white; } |
405 | | -td.diff-otitle { background:#ffffff; } |
406 | | -td.diff-ntitle { background:#ffffff; } |
407 | | -td.diff-addedline { |
408 | | - background:#ccffcc; |
409 | | - font-size: smaller; |
410 | | -} |
411 | | -td.diff-deletedline { |
412 | | - background:#ffffaa; |
413 | | - font-size: smaller; |
414 | | -} |
415 | | -td.diff-context { |
416 | | - background:#eeeeee; |
417 | | - font-size: smaller; |
418 | | -} |
419 | | -.diffchange { color: red; text-decoration: none; } |
420 | 401 | |
421 | 402 | a.external { color: #3366bb; } |
422 | 403 | |
Index: trunk/phase3/skins/monobook/handheld.css |
— | — | @@ -542,29 +542,6 @@ |
543 | 543 | } |
544 | 544 | |
545 | 545 | /* |
546 | | -** Diff rendering |
547 | | -*/ |
548 | | -table.diff, td.diff-otitle, td.diff-ntitle { |
549 | | - background-color: white; |
550 | | -} |
551 | | -td.diff-addedline { |
552 | | - background: #cfc; |
553 | | - font-size: smaller; |
554 | | -} |
555 | | -td.diff-deletedline { |
556 | | - background: #ffa; |
557 | | - font-size: smaller; |
558 | | -} |
559 | | -td.diff-context { |
560 | | - background: #eee; |
561 | | - font-size: smaller; |
562 | | -} |
563 | | -.diffchange { |
564 | | - color: red; |
565 | | - font-weight: bold; |
566 | | -} |
567 | | - |
568 | | -/* |
569 | 546 | ** keep the whitespace in front of the ^=, hides rule from konqueror |
570 | 547 | ** this is css3, the validator doesn't like it when validating as css2 |
571 | 548 | */ |
Index: trunk/phase3/skins/monobook/main.css |
— | — | @@ -582,34 +582,6 @@ |
583 | 583 | } |
584 | 584 | |
585 | 585 | /* |
586 | | -** Diff rendering |
587 | | -*/ |
588 | | -table.diff, td.diff-otitle, td.diff-ntitle { |
589 | | - background-color: white; |
590 | | -} |
591 | | -td.diff-addedline { |
592 | | - background: #cfc; |
593 | | - font-size: smaller; |
594 | | -} |
595 | | -td.diff-deletedline { |
596 | | - background: #ffa; |
597 | | - font-size: smaller; |
598 | | -} |
599 | | -td.diff-context { |
600 | | - background: #eee; |
601 | | - font-size: smaller; |
602 | | -} |
603 | | -.diffchange { |
604 | | - color: red; |
605 | | - font-weight: bold; |
606 | | - text-decoration: none; |
607 | | -} |
608 | | - |
609 | | -table.diff td div { |
610 | | - overflow: auto; |
611 | | -} |
612 | | - |
613 | | -/* |
614 | 586 | ** keep the whitespace in front of the ^=, hides rule from konqueror |
615 | 587 | ** this is css3, the validator doesn't like it when validating as css2 |
616 | 588 | */ |
Index: trunk/phase3/skins/common/common.css |
— | — | @@ -110,27 +110,6 @@ |
111 | 111 | border:1px dashed #aaaaaa; |
112 | 112 | } |
113 | 113 | |
114 | | -table.diff { background:white; } |
115 | | -td.diff-otitle { background:#cccccc; } |
116 | | -td.diff-ntitle { background:#cccccc; } |
117 | | -td.diff-addedline { |
118 | | - background:#ccffcc; |
119 | | - font-size: 94%; |
120 | | -} |
121 | | -td.diff-deletedline { |
122 | | - background:#ffffaa; |
123 | | - font-size: 94%; |
124 | | -} |
125 | | -td.diff-context { |
126 | | - background:#eeeeee; |
127 | | - font-size: 94%; |
128 | | -} |
129 | | -.diffchange { |
130 | | - color: red; |
131 | | - font-weight: bold; |
132 | | - text-decoration: none; |
133 | | -} |
134 | | - |
135 | 114 | img { border: none; } |
136 | 115 | img.tex { vertical-align: middle; } |
137 | 116 | span.texhtml { font-family: serif; } |
Index: trunk/phase3/skins/common/diff.css |
— | — | @@ -0,0 +1,54 @@ |
| 2 | +/* |
| 3 | +** Diff rendering |
| 4 | +*/ |
| 5 | +table.diff, td.diff-otitle, td.diff-ntitle { |
| 6 | + background-color: white; |
| 7 | +} |
| 8 | +td.diff-otitle, |
| 9 | +td.diff-ntitle { |
| 10 | + text-align: center; |
| 11 | +} |
| 12 | +td.diff-marker { |
| 13 | + text-align: right; |
| 14 | +} |
| 15 | +td.diff-addedline { |
| 16 | + background: #cfc; |
| 17 | + font-size: smaller; |
| 18 | +} |
| 19 | +td.diff-deletedline { |
| 20 | + background: #ffa; |
| 21 | + font-size: smaller; |
| 22 | +} |
| 23 | +td.diff-context { |
| 24 | + background: #eee; |
| 25 | + font-size: smaller; |
| 26 | +} |
| 27 | +.diffchange { |
| 28 | + color: red; |
| 29 | + font-weight: bold; |
| 30 | + text-decoration: none; |
| 31 | +} |
| 32 | + |
| 33 | +table.diff { |
| 34 | + border: none; |
| 35 | + width: 98%; |
| 36 | + border-spacing: 4px; |
| 37 | + |
| 38 | + /* Fixed layout is required to ensure that cells containing long URLs |
| 39 | + don't widen in Safari, Internet Explorer, or iCab */ |
| 40 | + table-layout: fixed; |
| 41 | +} |
| 42 | +table.diff td { |
| 43 | + padding: 0; |
| 44 | +} |
| 45 | +table.diff col.diff-marker { |
| 46 | + width: 2%; |
| 47 | +} |
| 48 | +table.diff col.diff-content { |
| 49 | + width: 48%; |
| 50 | +} |
| 51 | +table.diff td div { |
| 52 | + /* Scrollbars will be added for very wide cells |
| 53 | + instead of text overflowing or widening */ |
| 54 | + overflow: auto; |
| 55 | +} |
Property changes on: trunk/phase3/skins/common/diff.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 56 | + native |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -74,6 +74,13 @@ |
75 | 75 | function addMeta( $name, $val ) { array_push( $this->mMetatags, array( $name, $val ) ); } |
76 | 76 | function addKeyword( $text ) { array_push( $this->mKeywords, $text ); } |
77 | 77 | function addScript( $script ) { $this->mScripts .= "\t\t".$script; } |
| 78 | + function addStyle( $style ) { |
| 79 | + global $wgStylePath; |
| 80 | + $this->addLink( |
| 81 | + array( |
| 82 | + 'rel' => 'stylesheet', |
| 83 | + 'href' => $wgStylePath . '/' . $style ) ); |
| 84 | + } |
78 | 85 | |
79 | 86 | /** |
80 | 87 | * Add a self-contained script tag with the given contents |
Index: trunk/phase3/includes/DifferenceEngine.php |
— | — | @@ -96,6 +96,7 @@ |
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
| 100 | + $wgOut->addStyle( 'common/diff.css' ); |
100 | 101 | $wgOut->setArticleFlag( false ); |
101 | 102 | if ( ! $this->loadRevisionData() ) { |
102 | 103 | $t = $this->mTitle->getPrefixedText() . " (Diff: {$this->mOldid}, {$this->mNewid})"; |
— | — | @@ -488,10 +489,14 @@ |
489 | 490 | $ntitle = '<span class="history-deleted">'.$ntitle.'</span>'; |
490 | 491 | } |
491 | 492 | $header = " |
492 | | - <table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'> |
| 493 | + <table class='diff'> |
| 494 | + <col class='diff-marker' /> |
| 495 | + <col class='diff-content' /> |
| 496 | + <col class='diff-marker' /> |
| 497 | + <col class='diff-content' /> |
493 | 498 | <tr> |
494 | | - <td colspan='2' width='50%' align='center' class='diff-otitle'>{$otitle}</td> |
495 | | - <td colspan='2' width='50%' align='center' class='diff-ntitle'>{$ntitle}</td> |
| 499 | + <td colspan='2' class='diff-otitle'>{$otitle}</td> |
| 500 | + <td colspan='2' class='diff-ntitle'>{$ntitle}</td> |
496 | 501 | </tr> |
497 | 502 | "; |
498 | 503 | |
— | — | @@ -1738,18 +1743,26 @@ |
1739 | 1744 | |
1740 | 1745 | # HTML-escape parameter before calling this |
1741 | 1746 | function addedLine( $line ) { |
1742 | | - return "<td>+</td><td class='diff-addedline'><div>{$line}</div></td>"; |
| 1747 | + return $this->wrapLine( '+', 'diff-addedline', $line ); |
1743 | 1748 | } |
1744 | 1749 | |
1745 | 1750 | # HTML-escape parameter before calling this |
1746 | 1751 | function deletedLine( $line ) { |
1747 | | - return "<td>-</td><td class='diff-deletedline'><div>{$line}</div></td>"; |
| 1752 | + return $this->wrapLine( '-', 'diff-deletedline', $line ); |
1748 | 1753 | } |
1749 | 1754 | |
1750 | 1755 | # HTML-escape parameter before calling this |
1751 | 1756 | function contextLine( $line ) { |
1752 | | - return "<td> </td><td class='diff-context'><div>{$line}</div></td>"; |
| 1757 | + return $this->wrapLine( ' ', 'diff-context', $line ); |
1753 | 1758 | } |
| 1759 | + |
| 1760 | + private function wrapLine( $marker, $class, $line ) { |
| 1761 | + if( $line !== '' ) { |
| 1762 | + // The <div> wrapper is needed for 'overflow: auto' style to scroll properly |
| 1763 | + $line = "<div>$line</div>"; |
| 1764 | + } |
| 1765 | + return "<td class='diff-marker'>$marker</td><td class='$class'>$line</td>"; |
| 1766 | + } |
1754 | 1767 | |
1755 | 1768 | function emptyLine() { |
1756 | 1769 | return '<td colspan="2"> </td>'; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1125,7 +1125,7 @@ |
1126 | 1126 | * to ensure that client-side caches don't keep obsolete copies of global |
1127 | 1127 | * styles. |
1128 | 1128 | */ |
1129 | | -$wgStyleVersion = '68'; |
| 1129 | +$wgStyleVersion = '69'; |
1130 | 1130 | |
1131 | 1131 | |
1132 | 1132 | # Server-side caching: |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -58,8 +58,10 @@ |
59 | 59 | * (bug 9417) Uploading new versions of images when using Postgres no longer |
60 | 60 | throws warnings. |
61 | 61 | * (bug 9908) Using tsearch2 with Postgres 8.1 no longer gives an error. |
62 | | -* (bug 1438) Fix for diff table layout on very wide lines for Gecko and |
63 | | - Opera-based browsers (incomplete, does not fix KHTML or MSIE) |
| 62 | +* (bug 1438) Fix for diff table layout on very wide lines. |
| 63 | + Diff style rules have been broken out to common/diff.css, |
| 64 | + and the dupes removed from the default skin files. |
| 65 | + Skins can still override the default rules. |
64 | 66 | |
65 | 67 | |
66 | 68 | == MediaWiki API changes since 1.10 == |
Index: trunk/extensions/SemanticMediaWiki/skins/mw-skins/ontoskin/handheld.css |
— | — | @@ -541,28 +541,6 @@ |
542 | 542 | border: 1px dashed #aaa; |
543 | 543 | } |
544 | 544 | |
545 | | -/* |
546 | | -** Diff rendering |
547 | | -*/ |
548 | | -table.diff, td.diff-otitle, td.diff-ntitle { |
549 | | - background-color: white; |
550 | | -} |
551 | | -td.diff-addedline { |
552 | | - background: #cfc; |
553 | | - font-size: smaller; |
554 | | -} |
555 | | -td.diff-deletedline { |
556 | | - background: #ffa; |
557 | | - font-size: smaller; |
558 | | -} |
559 | | -td.diff-context { |
560 | | - background: #eee; |
561 | | - font-size: smaller; |
562 | | -} |
563 | | -.diffchange { |
564 | | - color: red; |
565 | | - font-weight: bold; |
566 | | -} |
567 | 545 | |
568 | 546 | /* |
569 | 547 | ** keep the whitespace in front of the ^=, hides rule from konqueror |
Index: trunk/extensions/sampleskin/main.css |
— | — | @@ -392,25 +392,6 @@ |
393 | 393 | background-color:#f9f9f9; |
394 | 394 | border:1px dashed #aaaaaa; |
395 | 395 | } |
396 | | -/* |
397 | | -** Diff rendering |
398 | | -*/ |
399 | | -table.diff { background:white; } |
400 | | -td.diff-otitle { background:#ffffff; } |
401 | | -td.diff-ntitle { background:#ffffff; } |
402 | | -td.diff-addedline { |
403 | | - background:#ccffcc; |
404 | | - font-size: smaller; |
405 | | -} |
406 | | -td.diff-deletedline { |
407 | | - background:#ffffaa; |
408 | | - font-size: smaller; |
409 | | -} |
410 | | -td.diff-context { |
411 | | - background:#eeeeee; |
412 | | - font-size: smaller; |
413 | | -} |
414 | | -span.diffchange { color: red; } |
415 | 396 | |
416 | 397 | a.external { color: #3366bb; } |
417 | 398 | |