Recommit r53710 without the hack for preventing style sheets being added multiple...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 24 Aug 2009 05:37:40 +0000 (05:37 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 24 Aug 2009 05:37:40 +0000 (05:37 +0000)
includes/diff/DifferenceEngine.php

index 50391a1..e49a860 100644 (file)
@@ -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] ) );
        }