From: Niklas Laxström Date: Mon, 24 Aug 2009 05:37:40 +0000 (+0000) Subject: Recommit r53710 without the hack for preventing style sheets being added multiple... X-Git-Tag: 1.31.0-rc.0~40082 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=22f142a99c098ce1d54f4cbc6e2baf9936541055;p=lhc%2Fweb%2Fwiklou.git Recommit r53710 without the hack for preventing style sheets being added multiple times (is not possible with OutputPage::addStyle in the first place) --- diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 50391a117b..e49a860fc3 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -30,6 +30,10 @@ class DifferenceEngine { var $mCacheHit = false; // Was the diff fetched from cache? var $htmldiff; + // If true, line X is not displayed when X is 1, for example to increase + // readability and conserve space with many small diffs. + protected $mReducedLineNumbers = false; + protected $unhide = false; /**#@-*/ @@ -80,6 +84,10 @@ class DifferenceEngine { $this->unhide = $unhide; } + function setReducedLineNumbers( $value = true ) { + $this->mReducedLineNumbers = $value; + } + function getTitle() { return $this->mTitle; } @@ -842,6 +850,7 @@ CONTROL; function localiseLineNumbersCb( $matches ) { global $wgLang; + if ( $matches[1] === '1' && $this->mReducedLineNumbers ) return ''; return wfMsgExt( 'lineno', 'escape', $wgLang->formatNum( $matches[1] ) ); }