From: Antoine Musso Date: Sat, 3 Feb 2007 21:47:53 +0000 (+0000) Subject: Fix #6844: Semantically correct tags for diffchanges ( && ) X-Git-Tag: 1.31.0-rc.0~54143 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=fe7d2d15d48e67b74a91401974a9452f4c9f017d;p=lhc%2Fweb%2Fwiklou.git Fix #6844: Semantically correct tags for diffchanges ( && ) Bumps wgStyleVersion to 55. Patch by Messi --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 81d87edde9..97d3ff5e71 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -168,6 +168,7 @@ lighter making things easier to read. edit in a batch group. Isolated and patched by Travis Derouin. * Fix for paths in 1.4->1.5 special-case updater script * (bug 8789) AJAX search: IE users can now use the return key +* (bug 6844) Use and tags to emphase the differences == Languages updated == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index fc99c0ae93..df57c77014 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1110,7 +1110,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '54'; +$wgStyleVersion = '55'; # Server-side caching: diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 1d3e413a8d..d218917c33 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -1558,9 +1558,12 @@ class _HWLDF_WordAccumulator { function _flushGroup ($new_tag) { if ($this->_group !== '') { - if ($this->_tag == 'mark') - $this->_line .= '' . - htmlspecialchars ( $this->_group ) . ''; + if ($this->_tag == 'ins') + $this->_line .= '' . + htmlspecialchars ( $this->_group ) . ''; + elseif ($this->_tag == 'del') + $this->_line .= '' . + htmlspecialchars ( $this->_group ) . ''; else $this->_line .= htmlspecialchars ( $this->_group ); } @@ -1664,7 +1667,7 @@ class WordLevelDiff extends MappedDiff if ($edit->type == 'copy') $orig->addWords($edit->orig); elseif ($edit->orig) - $orig->addWords($edit->orig, 'mark'); + $orig->addWords($edit->orig, 'del'); } $lines = $orig->getLines(); wfProfileOut( $fname ); @@ -1680,7 +1683,7 @@ class WordLevelDiff extends MappedDiff if ($edit->type == 'copy') $closing->addWords($edit->closing); elseif ($edit->closing) - $closing->addWords($edit->closing, 'mark'); + $closing->addWords($edit->closing, 'ins'); } $lines = $closing->getLines(); wfProfileOut( $fname ); diff --git a/includes/normal/RandomTest.php b/includes/normal/RandomTest.php index d6a6e86764..de61b6f88d 100644 --- a/includes/normal/RandomTest.php +++ b/includes/normal/RandomTest.php @@ -69,7 +69,7 @@ function showDiffs( $a, $b ) { $formatter = new TableDiffFormatter(); $funky = $formatter->format( $diffs ); $matches = array(); - preg_match_all( '/(.*?)<\/span>/', $funky, $matches ); + preg_match_all( '/<(?:ins|del) class="diffchange">(.*?)<\/span>/', $funky, $matches ); foreach( $matches[1] as $bit ) { $hex = bin2hex( $bit ); echo "\t$hex\n"; diff --git a/skins/chick/main.css b/skins/chick/main.css index af4a6fae22..4e92b98632 100644 --- a/skins/chick/main.css +++ b/skins/chick/main.css @@ -415,7 +415,8 @@ td.diff-context { background:#eeeeee; font-size: smaller; } -span.diffchange { color: red; } +ins.diffchange { color: red; text-decoration: none; } +del.diffchange { color: red; text-decoration: none; } a.external { color: #3366bb; } diff --git a/skins/common/common.css b/skins/common/common.css index f05a4a5f62..85d81296d1 100644 --- a/skins/common/common.css +++ b/skins/common/common.css @@ -125,7 +125,16 @@ td.diff-context { background:#eeeeee; font-size: 94%; } -span.diffchange { color: red; font-weight: bold; } +ins.diffchange { + color: red; + font-weight: bold; + text-decoration: none; +} +del.diffchange { + color: red; + font-weight: bold; + text-decoration: none; +} img { border: none; } img.tex { vertical-align: middle; } diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css index 48673c0728..2bd7e989b4 100644 --- a/skins/common/commonPrint.css +++ b/skins/common/commonPrint.css @@ -283,5 +283,13 @@ td.diff-context { background:#eeeeee; font-size: smaller; } -span.diffchange { color: silver; font-weight: bold; text-decoration: underline; } - +ins.diffchange { + color: silver; + font-weight: bold; + text-decoration: underline; +} +del.diffchange { + color: silver; + font-weight: bold; + text-decoration: underline; +} diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 8b6a39fcf1..83e296a0e3 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -591,9 +591,15 @@ td.diff-context { background: #eee; font-size: smaller; } -span.diffchange { +ins.diffchange { color: red; font-weight: bold; + text-decoration: none; +} +del.diffchange { + color: red; + font-weight: bold; + text-decoration: none; } /* diff --git a/skins/simple/main.css b/skins/simple/main.css index 03b0da9e8f..8e9f413f88 100644 --- a/skins/simple/main.css +++ b/skins/simple/main.css @@ -268,7 +268,8 @@ td.diff-deletedline { background-color: #f8ffaa; } -span.diffchange { background-color: #FFCDF3; } +ins.diffchange { background-color: #FFCDF3; text-decoration: none; } +del.diffchange { background-color: #FFCDF3; text-decoration: none; } .autocomment { color: grey; } #pagehistory span.user { margin-left: 1.4em;