r55452 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55451‎ | r55452 | r55453 >
Date:22:01, 21 August 2009
Author:brion
Status:ok
Tags:
Comment:
Revert r53710 "* Allow suppressing "line 1" from the diffs, which can get quite annoying with many diffs"
Use of static variable here means that running multiple diffs during one request may mess things up. It should rather check if it's been added in $wgOut already.
Modified paths:
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -30,10 +30,6 @@
3131 var $mCacheHit = false; // Was the diff fetched from cache?
3232 var $htmldiff;
3333
34 - // If true, line X is not displayed when X is 1, for example to increase
35 - // readability and conserve space with many small diffs.
36 - protected $mReducedLineNumbers = false;
37 -
3834 protected $unhide = false;
3935 /**#@-*/
4036
@@ -84,10 +80,6 @@
8581 $this->unhide = $unhide;
8682 }
8783
88 - function setReducedLineNumbers( $value = true ) {
89 - $this->mReducedLineNumbers = $value;
90 - }
91 -
9284 function getTitle() {
9385 return $this->mTitle;
9486 }
@@ -645,16 +637,10 @@
646638 */
647639 function showDiffStyle() {
648640 global $wgStylePath, $wgStyleVersion, $wgOut;
649 -
650 - static $styleDone = false;
651 - if ( $styleDone === $wgOut ) return;
652 -
653641 $wgOut->addStyle( 'common/diff.css' );
654642
655643 // JS is needed to detect old versions of Mozilla to work around an annoyance bug.
656644 $wgOut->addScript( "<script type=\"text/javascript\" src=\"$wgStylePath/common/diff.js?$wgStyleVersion\"></script>" );
657 -
658 - $styleDone = $wgOut;
659645 }
660646
661647 /**
@@ -856,7 +842,6 @@
857843
858844 function localiseLineNumbersCb( $matches ) {
859845 global $wgLang;
860 - if ( $matches[1] === '1' && $this->mReducedLineNumbers ) return '';
861846 return wfMsgExt( 'lineno', 'escape', $wgLang->formatNum( $matches[1] ) );
862847 }
863848

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53710* Don't add 200 extra css/js requests when showing 100 diffs...nikerabbit11:06, 24 July 2009

Status & tagging log