From 22f142a99c098ce1d54f4cbc6e2baf9936541055 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 24 Aug 2009 05:37:40 +0000 Subject: [PATCH] Recommit r53710 without the hack for preventing style sheets being added multiple times (is not possible with OutputPage::addStyle in the first place) --- includes/diff/DifferenceEngine.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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] ) ); } -- 2.20.1