r19742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19741‎ | r19742 | r19743 >
Date:21:47, 3 February 2007
Author:hashar
Status:old
Tags:
Comment:
Fix #6844: Semantically correct tags for diffchanges (<ins> && <del>)
Bumps wgStyleVersion to 55.
Patch by Messi <messias+spam@gmail.com>
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/normal/RandomTest.php (modified) (history)
  • /trunk/phase3/skins/chick/main.css (modified) (history)
  • /trunk/phase3/skins/common/common.css (modified) (history)
  • /trunk/phase3/skins/common/commonPrint.css (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)
  • /trunk/phase3/skins/simple/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES
@@ -168,6 +168,7 @@
169169 edit in a batch group. Isolated and patched by Travis Derouin.
170170 * Fix for paths in 1.4->1.5 special-case updater script
171171 * (bug 8789) AJAX search: IE users can now use the return key
 172+* (bug 6844) Use <ins> and <del> tags to emphase the differences
172173
173174
174175 == Languages updated ==
Index: trunk/phase3/skins/chick/main.css
@@ -415,7 +415,8 @@
416416 background:#eeeeee;
417417 font-size: smaller;
418418 }
419 -span.diffchange { color: red; }
 419+ins.diffchange { color: red; text-decoration: none; }
 420+del.diffchange { color: red; text-decoration: none; }
420421
421422 a.external { color: #3366bb; }
422423
Index: trunk/phase3/skins/monobook/main.css
@@ -591,10 +591,16 @@
592592 background: #eee;
593593 font-size: smaller;
594594 }
595 -span.diffchange {
 595+ins.diffchange {
596596 color: red;
597597 font-weight: bold;
 598+ text-decoration: none;
598599 }
 600+del.diffchange {
 601+ color: red;
 602+ font-weight: bold;
 603+ text-decoration: none;
 604+}
599605
600606 /*
601607 ** keep the whitespace in front of the ^=, hides rule from konqueror
Index: trunk/phase3/skins/common/commonPrint.css
@@ -283,5 +283,13 @@
284284 background:#eeeeee;
285285 font-size: smaller;
286286 }
287 -span.diffchange { color: silver; font-weight: bold; text-decoration: underline; }
288 -
 287+ins.diffchange {
 288+ color: silver;
 289+ font-weight: bold;
 290+ text-decoration: underline;
 291+}
 292+del.diffchange {
 293+ color: silver;
 294+ font-weight: bold;
 295+ text-decoration: underline;
 296+}
Index: trunk/phase3/skins/common/common.css
@@ -125,7 +125,16 @@
126126 background:#eeeeee;
127127 font-size: 94%;
128128 }
129 -span.diffchange { color: red; font-weight: bold; }
 129+ins.diffchange {
 130+ color: red;
 131+ font-weight: bold;
 132+ text-decoration: none;
 133+}
 134+del.diffchange {
 135+ color: red;
 136+ font-weight: bold;
 137+ text-decoration: none;
 138+}
130139
131140 img { border: none; }
132141 img.tex { vertical-align: middle; }
Index: trunk/phase3/skins/simple/main.css
@@ -268,7 +268,8 @@
269269 background-color: #f8ffaa;
270270 }
271271
272 -span.diffchange { background-color: #FFCDF3; }
 272+ins.diffchange { background-color: #FFCDF3; text-decoration: none; }
 273+del.diffchange { background-color: #FFCDF3; text-decoration: none; }
273274 .autocomment { color: grey; }
274275 #pagehistory span.user {
275276 margin-left: 1.4em;
Index: trunk/phase3/includes/DifferenceEngine.php
@@ -1558,9 +1558,12 @@
15591559
15601560 function _flushGroup ($new_tag) {
15611561 if ($this->_group !== '') {
1562 - if ($this->_tag == 'mark')
1563 - $this->_line .= '<span class="diffchange">' .
1564 - htmlspecialchars ( $this->_group ) . '</span>';
 1562+ if ($this->_tag == 'ins')
 1563+ $this->_line .= '<ins class="diffchange">' .
 1564+ htmlspecialchars ( $this->_group ) . '</ins>';
 1565+ elseif ($this->_tag == 'del')
 1566+ $this->_line .= '<del class="diffchange">' .
 1567+ htmlspecialchars ( $this->_group ) . '</del>';
15651568 else
15661569 $this->_line .= htmlspecialchars ( $this->_group );
15671570 }
@@ -1664,7 +1667,7 @@
16651668 if ($edit->type == 'copy')
16661669 $orig->addWords($edit->orig);
16671670 elseif ($edit->orig)
1668 - $orig->addWords($edit->orig, 'mark');
 1671+ $orig->addWords($edit->orig, 'del');
16691672 }
16701673 $lines = $orig->getLines();
16711674 wfProfileOut( $fname );
@@ -1680,7 +1683,7 @@
16811684 if ($edit->type == 'copy')
16821685 $closing->addWords($edit->closing);
16831686 elseif ($edit->closing)
1684 - $closing->addWords($edit->closing, 'mark');
 1687+ $closing->addWords($edit->closing, 'ins');
16851688 }
16861689 $lines = $closing->getLines();
16871690 wfProfileOut( $fname );
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1110,7 +1110,7 @@
11111111 * to ensure that client-side caches don't keep obsolete copies of global
11121112 * styles.
11131113 */
1114 -$wgStyleVersion = '54';
 1114+$wgStyleVersion = '55';
11151115
11161116
11171117 # Server-side caching:
Index: trunk/phase3/includes/normal/RandomTest.php
@@ -69,7 +69,7 @@
7070 $formatter = new TableDiffFormatter();
7171 $funky = $formatter->format( $diffs );
7272 $matches = array();
73 - preg_match_all( '/<span class="diffchange">(.*?)<\/span>/', $funky, $matches );
 73+ preg_match_all( '/<(?:ins|del) class="diffchange">(.*?)<\/span>/', $funky, $matches );
7474 foreach( $matches[1] as $bit ) {
7575 $hex = bin2hex( $bit );
7676 echo "\t$hex\n";

Follow-up revisions

RevisionCommit summaryAuthorDate
r19766Cleanup from r19742:...brion18:42, 4 February 2007