(bug 19859) Remove HTMLDiff. Could possibly be salvaged as an extension one day, but not today. DifferenceEngine and friends will need some refactoring to allow spinning this off. In the meantime, removing the mostly-broken experimental feature. Its always in the logs if anyone wants to reuse the code somewhere else one day

This commit is contained in:
Chad Horohoe 2009-10-28 18:18:05 +00:00
parent 9b4135e9f8
commit dcac5f193e
11 changed files with 13 additions and 1755 deletions

View file

@ -89,6 +89,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
maintenance
* $wgCapitalLinkOverrides added to configure per-namespace capitalization
* (bug 21172) $wgSorbsUrl can now be an array with multiple DNSBL
* $wgEnableHtmlDiff has been removed
=== New features in 1.16 ===
@ -604,6 +605,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
* User::isValidPassword now only returns boolean results, User::getPasswordValidity
can be used to get an error message string
* The error message shown in Special:ChangePassword now parses wiki markup
* (bug 19859) Removed experimental HTMLDiff feature
== API changes in 1.16 ==

View file

@ -943,11 +943,10 @@ class Article {
$rcid = $wgRequest->getVal( 'rcid' );
$diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
$purge = $wgRequest->getVal( 'action' ) == 'purge';
$htmldiff = $wgRequest->getBool( 'htmldiff' );
$unhide = $wgRequest->getInt('unhide') == 1;
$oldid = $this->getOldID();
$de = new DifferenceEngine( $this->mTitle, $oldid, $diff, $rcid, $purge, $htmldiff, $unhide );
$de = new DifferenceEngine( $this->mTitle, $oldid, $diff, $rcid, $purge, $unhide );
// DifferenceEngine directly fetched the revision:
$this->mRevIdFetched = $de->mNewid;
$de->showDiffPage( $diffOnly );

View file

@ -376,13 +376,7 @@ $wgAutoloadLocalClasses = array(
'IBM_DB2Field' => 'includes/db/DatabaseIbm_db2.php',
# includes/diff
'AncestorComparator' => 'includes/diff/HTMLDiff.php',
'AnchorToString' => 'includes/diff/HTMLDiff.php',
'ArrayDiffFormatter' => 'includes/diff/DifferenceEngine.php',
'BodyNode' => 'includes/diff/Nodes.php',
'ChangeText' => 'includes/diff/HTMLDiff.php',
'ChangeTextGenerator' => 'includes/diff/HTMLDiff.php',
'DelegatingContentHandler' => 'includes/diff/HTMLDiff.php',
'_DiffEngine' => 'includes/diff/DifferenceEngine.php',
'DifferenceEngine' => 'includes/diff/DifferenceInterface.php',
'DiffFormatter' => 'includes/diff/DifferenceEngine.php',
@ -392,27 +386,11 @@ $wgAutoloadLocalClasses = array(
'_DiffOp_Copy' => 'includes/diff/DifferenceEngine.php',
'_DiffOp_Delete' => 'includes/diff/DifferenceEngine.php',
'_DiffOp' => 'includes/diff/DifferenceEngine.php',
'DomTreeBuilder' => 'includes/diff/HTMLDiff.php',
'DummyNode' => 'includes/diff/Nodes.php',
'HTMLDiffer' => 'includes/diff/HTMLDiff.php',
'HTMLOutput' => 'includes/diff/HTMLDiff.php',
'_HWLDF_WordAccumulator' => 'includes/diff/DifferenceEngine.php',
'ImageNode' => 'includes/diff/Nodes.php',
'LastCommonParentResult' => 'includes/diff/HTMLDiff.php',
'MappedDiff' => 'includes/diff/DifferenceEngine.php',
'Modification' => 'includes/diff/HTMLDiff.php',
'NoContentTagToString' => 'includes/diff/HTMLDiff.php',
'Node' => 'includes/diff/Nodes.php',
'RangeDifference' => 'includes/diff/Diff.php',
'TableDiffFormatter' => 'includes/diff/DifferenceEngine.php',
'TagNode' => 'includes/diff/Nodes.php',
'TagToString' => 'includes/diff/HTMLDiff.php',
'TagToStringFactory' => 'includes/diff/HTMLDiff.php',
'TextNode' => 'includes/diff/Nodes.php',
'TextNodeDiffer' => 'includes/diff/HTMLDiff.php',
'TextOnlyComparator' => 'includes/diff/HTMLDiff.php',
'UnifiedDiffFormatter' => 'includes/diff/DifferenceEngine.php',
'WhiteSpaceNode' => 'includes/diff/Nodes.php',
'WikiDiff3' => 'includes/diff/Diff.php',
'WordLevelDiff' => 'includes/diff/DifferenceEngine.php',

View file

@ -2892,9 +2892,6 @@ $wgMaxTocLevel = 999;
/** Name of the external diff engine to use */
$wgExternalDiffEngine = false;
/** Whether to use inline diff */
$wgEnableHtmlDiff = false;
/** Use RC Patrolling to check for vandalism */
$wgUseRCPatrol = true;

View file

@ -359,7 +359,7 @@ class HistoryPager extends ReverseChronologicalPager {
* @return string HTML output
*/
function getStartBody() {
global $wgScript, $wgEnableHtmlDiff, $wgUser, $wgOut, $wgContLang;
global $wgScript, $wgUser, $wgOut, $wgContLang;
$this->lastRow = false;
$this->counter = 1;
$this->oldIdChecked = 0;
@ -385,34 +385,13 @@ class HistoryPager extends ReverseChronologicalPager {
wfMsg( 'showhideselectedversions' )
) . "\n";
}
if( $wgEnableHtmlDiff ) {
$this->buttons .= Xml::element( 'button',
array(
'type' => 'submit',
'name' => 'htmldiff',
'value' => '1',
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
),
wfMsg( 'visualcomparison')
) . "\n";
$this->buttons .= $this->submitButton( wfMsg( 'wikicodecomparison'),
array(
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
)
) . "\n";
} else {
$this->buttons .= $this->submitButton( wfMsg( 'compareselectedversions'),
array(
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
)
) . "\n";
}
$this->buttons .= $this->submitButton( wfMsg( 'compareselectedversions'),
array(
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
)
) . "\n";
$this->buttons .= '</div>';
$s .= $this->buttons . '<ul id="pagehistory">' . "\n";
return $s;

View file

@ -28,7 +28,6 @@ class DifferenceEngine {
var $mRevisionsLoaded = false; // Have the revisions been loaded
var $mTextLoaded = 0; // How many text blobs have been loaded, 0, 1 or 2?
var $mCacheHit = false; // Was the diff fetched from cache?
var $htmldiff;
/**
* Set this to true to add debug info to the HTML output.
@ -51,11 +50,10 @@ class DifferenceEngine {
* @param $new String: either 'prev' or 'next'.
* @param $rcid Integer: ??? FIXME (default 0)
* @param $refreshCache boolean If set, refreshes the diff cache
* @param $htmldiff boolean If set, output using HTMLDiff instead of raw wikicode diff
* @param $unhide boolean If set, allow viewing deleted revs
*/
function __construct( $titleObj = null, $old = 0, $new = 0, $rcid = 0,
$refreshCache = false, $htmldiff = false, $unhide = false )
$refreshCache = false, $unhide = false )
{
if ( $titleObj ) {
$this->mTitle = $titleObj;
@ -87,7 +85,6 @@ class DifferenceEngine {
}
$this->mRcidMarkPatrolled = intval($rcid); # force it to be an integer
$this->mRefreshCache = $refreshCache;
$this->htmldiff = $htmldiff;
$this->unhide = $unhide;
}
@ -112,7 +109,7 @@ class DifferenceEngine {
}
function showDiffPage( $diffOnly = false ) {
global $wgUser, $wgOut, $wgUseExternalEditor, $wgUseRCPatrol, $wgEnableHtmlDiff;
global $wgUser, $wgOut, $wgUseExternalEditor, $wgUseRCPatrol;
wfProfileIn( __METHOD__ );
@ -264,12 +261,6 @@ CONTROL;
$query['diffonly'] = $diffOnly;
}
$htmldiffarg = $this->htmlDiffArgument();
if( $htmldiffarg ) {
$query['htmldiff'] = $htmldiffarg['htmldiff'];
}
# Make "previous revision link"
$query['diff'] = 'prev';
$query['oldid'] = $this->mOldid;
@ -401,47 +392,8 @@ CONTROL;
$msg = $suppressed ? 'rev-suppressed-unhide-diff' : 'rev-deleted-unhide-diff';
$wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", array( $msg, $link ) );
}
# Otherwise, output the HTML diff if requested...
} else if( $wgEnableHtmlDiff && $this->htmldiff ) {
$multi = $this->getMultiNotice();
$wgOut->addHTML( '<div class="diff-switchtype">' . $sk->link(
$this->mTitle,
wfMsgHtml( 'wikicodecomparison' ),
array(
'id' => 'differences-switchtype'
),
array(
'diff' => $this->mNewid,
'oldid' => $this->mOldid,
'htmldiff' => 0
),
array(
'known',
'noclasses'
)
) . '</div>');
$wgOut->addHTML( $this->addHeader( '', $oldHeader, $newHeader, $multi ) );
# Add deletion notice if the user is viewing deleted content
if( $deleted ) {
$msg = $suppressed ? 'rev-suppressed-diff-view' : 'rev-deleted-diff-view';
$wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", $msg );
}
$this->renderHtmlDiff();
# Otherwise, output a regular diff...
} else {
if( $wgEnableHtmlDiff ) {
$wgOut->addHTML( '<div class="diff-switchtype">' . $sk->link(
$this->mTitle,
wfMsgHtml( 'visualcomparison' ),
array( 'id' => 'differences-switchtype' ),
array(
'diff' => $this->mNewid,
'oldid' => $this->mOldid,
'htmldiff' => 1
),
array( 'known', 'noclasses' )
) . '</div>');
}
# Add deletion notice if the user is viewing deleted content
$notice = '';
if( $deleted ) {
@ -517,70 +469,6 @@ CONTROL;
wfProfileOut( __METHOD__ );
}
function renderHtmlDiff() {
global $wgOut, $wgParser, $wgDebugComments;
wfProfileIn( __METHOD__ );
$this->showDiffStyle();
$wgOut->addHTML( '<h2>'.wfMsgHtml( 'visual-comparison' )."</h2>\n" );
#add deleted rev tag if needed
if( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
$wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", 'rev-deleted-text-permission' );
} else if( $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) {
$wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", 'rev-deleted-text-view' );
}
if( !$this->mNewRev->isCurrent() ) {
$oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
}
$this->loadText();
// Old revision
if( is_object( $this->mOldRev ) ) {
$wgOut->setRevisionId( $this->mOldRev->getId() );
}
$popts = $wgOut->parserOptions();
$oldTidy = $popts->setTidy( true );
$popts->setEditSection( false );
$parserOutput = $wgParser->parse( $this->mOldtext, $this->getTitle(), $popts, true, true, $wgOut->getRevisionId() );
$popts->setTidy( $oldTidy );
//only for new?
//$wgOut->addParserOutputNoText( $parserOutput );
$oldHtml = $parserOutput->getText();
wfRunHooks( 'OutputPageBeforeHTML', array( &$wgOut, &$oldHtml ) );
// New revision
if( is_object( $this->mNewRev ) ) {
$wgOut->setRevisionId( $this->mNewRev->getId() );
}
$popts = $wgOut->parserOptions();
$oldTidy = $popts->setTidy( true );
$parserOutput = $wgParser->parse( $this->mNewtext, $this->getTitle(), $popts, true, true, $wgOut->getRevisionId() );
$popts->setTidy( $oldTidy );
$wgOut->addParserOutputNoText( $parserOutput );
$newHtml = $parserOutput->getText();
wfRunHooks( 'OutputPageBeforeHTML', array( &$wgOut, &$newHtml ) );
unset($parserOutput, $popts);
$differ = new HTMLDiffer(new DelegatingContentHandler($wgOut));
$differ->htmlDiff($oldHtml, $newHtml);
if ( $wgDebugComments ) {
$wgOut->addHTML( "\n<!-- HtmlDiff Debug Output:\n" . HTMLDiffer::getDebugOutput() . " End Debug -->" );
}
wfProfileOut( __METHOD__ );
}
/**
* Show the first revision of an article. Uses normal diff headers in
* contrast to normal "old revision" display style.
@ -629,7 +517,6 @@ CONTROL;
array(
'diff' => 'next',
'oldid' => $this->mNewid,
$this->htmlDiffArgument()
),
array(
'known',
@ -648,19 +535,6 @@ CONTROL;
wfProfileOut( __METHOD__ );
}
function htmlDiffArgument(){
global $wgEnableHtmlDiff;
if($wgEnableHtmlDiff){
if($this->htmldiff){
return array( 'htmldiff' => 1 );
}else{
return array( 'htmldiff' => 0 );
}
}else{
return array();
}
}
/**
* Get the diff text, send it to $wgOut
* Returns false if the diff could not be generated, otherwise returns true

File diff suppressed because it is too large Load diff

View file

@ -1,439 +0,0 @@
<?php
/** Copyright (C) 2008 Guy Van den Broeck <guy@guyvdb.eu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
*/
/**
* Any element in the DOM tree of an HTML document.
* @ingroup DifferenceEngine
*/
class Node {
public $parent;
protected $parentTree;
public $whiteBefore = false;
public $whiteAfter = false;
function __construct($parent) {
$this->parent = $parent;
}
public function getParentTree() {
if (!isset($this->parentTree)) {
if (!is_null($this->parent)) {
$this->parentTree = $this->parent->getParentTree();
$this->parentTree[] = $this->parent;
} else {
$this->parentTree = array();
}
}
return $this->parentTree;
}
public function getLastCommonParent(Node $other) {
$result = new LastCommonParentResult();
$myParents = $this->getParentTree();
$otherParents = $other->getParentTree();
$i = 1;
$isSame = true;
$nbMyParents = count($myParents);
$nbOtherParents = count($otherParents);
while ($isSame && $i < $nbMyParents && $i < $nbOtherParents) {
if (!$myParents[$i]->openingTag === $otherParents[$i]->openingTag) {
$isSame = false;
} else {
// After a while, the index i-1 must be the last common parent
$i++;
}
}
$result->lastCommonParentDepth = $i - 1;
$result->parent = $myParents[$i - 1];
if (!$isSame || $nbMyParents > $nbOtherParents) {
// Not all tags matched, or all tags matched but
// there are tags left in this tree
$result->indexInLastCommonParent = $myParents[$i - 1]->getIndexOf($myParents[$i]);
$result->splittingNeeded = true;
} else if ($nbMyParents <= $nbOtherParents) {
$result->indexInLastCommonParent = $myParents[$i - 1]->getIndexOf($this);
}
return $result;
}
public function setParent($parent) {
$this->parent = $parent;
unset($this->parentTree);
}
public function inPre() {
$tree = $this->getParentTree();
foreach ($tree as &$ancestor) {
if ($ancestor->isPre()) {
return true;
}
}
return false;
}
}
/**
* Node that can contain other nodes. Represents an HTML tag.
* @ingroup DifferenceEngine
*/
class TagNode extends Node {
public $children = array();
public $qName;
public $attributes = array();
public $openingTag;
function __construct($parent, $qName, /*array*/ $attributes) {
parent::__construct($parent);
$this->qName = strtolower($qName);
foreach($attributes as $key => &$value){
$this->attributes[strtolower($key)] = $value;
}
return $this->openingTag = Xml::openElement($this->qName, $this->attributes);
}
public function addChildAbsolute(Node $node, $index) {
array_splice($this->children, $index, 0, array($node));
}
public function getIndexOf(Node $child) {
// don't trust array_search with objects
foreach ($this->children as $key => &$value){
if ($value === $child) {
return $key;
}
}
return null;
}
public function getNbChildren() {
return count($this->children);
}
public function getMinimalDeletedSet($id, &$allDeleted, &$somethingDeleted) {
$nodes = array();
$allDeleted = false;
$somethingDeleted = false;
$hasNonDeletedDescendant = false;
if (empty($this->children)) {
return $nodes;
}
foreach ($this->children as &$child) {
$allDeleted_local = false;
$somethingDeleted_local = false;
$childrenChildren = $child->getMinimalDeletedSet($id, $allDeleted_local, $somethingDeleted_local);
if ($somethingDeleted_local) {
$nodes = array_merge($nodes, $childrenChildren);
$somethingDeleted = true;
}
if (!$allDeleted_local) {
$hasNonDeletedDescendant = true;
}
}
if (!$hasNonDeletedDescendant) {
$nodes = array($this);
$allDeleted = true;
}
return $nodes;
}
public function splitUntil(TagNode $parent, Node $split, $includeLeft) {
$splitOccured = false;
if ($parent !== $this) {
$part1 = new TagNode(null, $this->qName, $this->attributes);
$part2 = new TagNode(null, $this->qName, $this->attributes);
$part1->setParent($this->parent);
$part2->setParent($this->parent);
$onSplit = false;
$pastSplit = false;
foreach ($this->children as &$child)
{
if ($child === $split) {
$onSplit = true;
}
if(!$pastSplit || ($onSplit && $includeLeft)) {
$child->setParent($part1);
$part1->children[] = $child;
} else {
$child->setParent($part2);
$part2->children[] = $child;
}
if ($onSplit) {
$onSplit = false;
$pastSplit = true;
}
}
$myindexinparent = $this->parent->getIndexOf($this);
if (!empty($part1->children)) {
$this->parent->addChildAbsolute($part1, $myindexinparent);
}
if (!empty($part2->children)) {
$this->parent->addChildAbsolute($part2, $myindexinparent);
}
if (!empty($part1->children) && !empty($part2->children)) {
$splitOccured = true;
}
$this->parent->removeChild($myindexinparent);
if ($includeLeft) {
$this->parent->splitUntil($parent, $part1, $includeLeft);
} else {
$this->parent->splitUntil($parent, $part2, $includeLeft);
}
}
return $splitOccured;
}
private function removeChild($index) {
unset($this->children[$index]);
$this->children = array_values($this->children);
}
public static $blocks = array('html', 'body','p','blockquote', 'h1',
'h2', 'h3', 'h4', 'h5', 'pre', 'div', 'ul', 'ol', 'li', 'table',
'tbody', 'tr', 'td', 'th', 'br');
public function copyTree() {
$newThis = new TagNode(null, $this->qName, $this->attributes);
$newThis->whiteBefore = $this->whiteBefore;
$newThis->whiteAfter = $this->whiteAfter;
foreach ($this->children as &$child) {
$newChild = $child->copyTree();
$newChild->setParent($newThis);
$newThis->children[] = $newChild;
}
return $newThis;
}
public function getMatchRatio(TagNode $other) {
$txtComp = new TextOnlyComparator($other);
return $txtComp->getMatchRatio(new TextOnlyComparator($this));
}
public function expandWhiteSpace() {
$shift = 0;
$spaceAdded = false;
$nbOriginalChildren = $this->getNbChildren();
for ($i = 0; $i < $nbOriginalChildren; ++$i) {
$child = $this->children[$i + $shift];
if ($child instanceof TagNode) {
if (!$child->isPre()) {
$child->expandWhiteSpace();
}
}
if (!$spaceAdded && $child->whiteBefore) {
$ws = new WhiteSpaceNode(null, ' ', $child->getLeftMostChild());
$ws->setParent($this);
$this->addChildAbsolute($ws,$i + ($shift++));
}
if ($child->whiteAfter) {
$ws = new WhiteSpaceNode(null, ' ', $child->getRightMostChild());
$ws->setParent($this);
$this->addChildAbsolute($ws,$i + 1 + ($shift++));
$spaceAdded = true;
} else {
$spaceAdded = false;
}
}
}
public function getLeftMostChild() {
if (empty($this->children)) {
return $this;
}
return $this->children[0]->getLeftMostChild();
}
public function getRightMostChild() {
if (empty($this->children)) {
return $this;
}
return $this->children[$this->getNbChildren() - 1]->getRightMostChild();
}
public function isPre() {
return 0 == strcasecmp($this->qName,'pre');
}
public static function toDiffLine(TagNode $node) {
return $node->openingTag;
}
}
/**
* Represents a piece of text in the HTML file.
* @ingroup DifferenceEngine
*/
class TextNode extends Node {
public $text;
public $modification;
function __construct($parent, $text) {
parent::__construct($parent);
$this->modification = new Modification(Modification::NONE);
$this->text = $text;
}
public function copyTree() {
$clone = clone $this;
$clone->setParent(null);
return $clone;
}
public function getLeftMostChild() {
return $this;
}
public function getRightMostChild() {
return $this;
}
public function getMinimalDeletedSet($id, &$allDeleted, &$somethingDeleted) {
if ($this->modification->type == Modification::REMOVED
&& $this->modification->id == $id){
$somethingDeleted = true;
$allDeleted = true;
return array($this);
}
return array();
}
public function isSameText($other) {
if (is_null($other) || ! $other instanceof TextNode) {
return false;
}
return str_replace('\n', ' ',$this->text) === str_replace('\n', ' ',$other->text);
}
public static function toDiffLine(TextNode $node) {
return str_replace('\n', ' ',$node->text);
}
}
/**
* @todo Document
* @ingroup DifferenceEngine
*/
class WhiteSpaceNode extends TextNode {
function __construct($parent, $s, Node $like = null) {
parent::__construct($parent, $s);
if(!is_null($like) && $like instanceof TextNode) {
$newModification = clone $like->modification;
$newModification->firstOfID = false;
$this->modification = $newModification;
}
}
}
/**
* Represents the root of a HTML document.
* @ingroup DifferenceEngine
*/
class BodyNode extends TagNode {
function __construct() {
parent::__construct(null, 'body', array());
}
public function copyTree() {
$newThis = new BodyNode();
foreach ($this->children as &$child) {
$newChild = $child->copyTree();
$newChild->setParent($newThis);
$newThis->children[] = $newChild;
}
return $newThis;
}
public function getMinimalDeletedSet($id, &$allDeleted, &$somethingDeleted) {
$nodes = array();
foreach ($this->children as &$child) {
$childrenChildren = $child->getMinimalDeletedSet($id,
$allDeleted, $somethingDeleted);
$nodes = array_merge($nodes, $childrenChildren);
}
return $nodes;
}
}
/**
* Represents an image in HTML. Even though images do not contain any text they
* are independent visible objects on the page. They are logically a TextNode.
* @ingroup DifferenceEngine
*/
class ImageNode extends TextNode {
public $attributes;
function __construct(TagNode $parent, /*array*/ $attrs) {
if(!array_key_exists('src', $attrs)) {
HTMLDiffer::diffDebug( "Image without a source\n" );
parent::__construct($parent, '<img></img>');
}else{
parent::__construct($parent, '<img>' . strtolower($attrs['src']) . '</img>');
}
$this->attributes = $attrs;
}
public function isSameText($other) {
if (is_null($other) || ! $other instanceof ImageNode) {
return false;
}
return $this->text === $other->text;
}
}
/**
* No-op node
* @ingroup DifferenceEngine
*/
class DummyNode extends Node {
function __construct() {
// no op
}
}

View file

@ -1563,64 +1563,8 @@ Note that using the navigation links will reset this column.',
'lineno' => 'Line $1:',
'compareselectedversions' => 'Compare selected revisions',
'showhideselectedversions' => 'Show/hide selected revisions',
'visualcomparison' => 'Visual comparison',
'wikicodecomparison' => 'Wikitext comparison',
'editundo' => 'undo',
'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown)',
'diff-movedto' => 'moved to $1',
'diff-styleadded' => '$1 style added',
'diff-added' => '$1 added',
'diff-changedto' => 'changed to $1',
'diff-movedoutof' => 'moved out of $1',
'diff-styleremoved' => '$1 style removed',
'diff-removed' => '$1 removed',
'diff-changedfrom' => 'changed from $1',
'diff-src' => 'source',
'diff-withdestination' => 'with destination $1',
'diff-with' => '&#32;with $1 $2',
'diff-with-additional' => '$1 $2', # only translate this message to other languages if you have to change it
'diff-with-final' => '&#32;and $1 $2',
'diff-width' => 'width',
'diff-height' => 'height',
'diff-p' => "a '''paragraph'''",
'diff-blockquote' => "a '''quote'''",
'diff-h1' => "a '''heading (level 1)'''",
'diff-h2' => "a '''heading (level 2)'''",
'diff-h3' => "a '''heading (level 3)'''",
'diff-h4' => "a '''heading (level 4)'''",
'diff-h5' => "a '''heading (level 5)'''",
'diff-pre' => "a '''preformatted block'''",
'diff-div' => "a '''division'''",
'diff-ul' => "an '''unordered list'''",
'diff-ol' => "an '''ordered list'''",
'diff-li' => "a '''list item'''",
'diff-table' => "a '''table'''",
'diff-tbody' => "a '''table's content'''",
'diff-tr' => "a '''row'''",
'diff-td' => "a '''cell'''",
'diff-th' => "a '''header'''",
'diff-br' => "a '''break'''",
'diff-hr' => "a '''horizontal rule'''",
'diff-code' => "a '''computer code block'''",
'diff-dl' => "a '''definition list'''",
'diff-dt' => "a '''definition term'''",
'diff-dd' => "a '''definition'''",
'diff-input' => "an '''input'''",
'diff-form' => "a '''form'''",
'diff-img' => "an '''image'''",
'diff-span' => "a '''span'''",
'diff-a' => "a '''link'''",
'diff-i' => "'''italics'''",
'diff-b' => "'''bold'''",
'diff-strong' => "'''strong'''",
'diff-em' => "'''emphasis'''",
'diff-font' => "'''font'''",
'diff-big' => "'''big'''",
'diff-del' => "'''deleted'''",
'diff-tt' => "'''fixed width'''",
'diff-sub' => "'''subscript'''",
'diff-sup' => "'''superscript'''",
'diff-strike' => "'''strikethrough'''",
# Search results
'searchresults' => 'Search results',
@ -3276,7 +3220,6 @@ Please try again.',
'accesskey-preview' => 'p', # do not translate or duplicate this message to other languages
'accesskey-diff' => 'v', # do not translate or duplicate this message to other languages
'accesskey-compareselectedversions' => 'v', # do not translate or duplicate this message to other languages
'accesskey-visualcomparison' => 'b', # do not translate or duplicate this message to other languages
'accesskey-watch' => 'w', # do not translate or duplicate this message to other languages
'accesskey-upload' => 's', # do not translate or duplicate this message to other languages
@ -3475,9 +3418,6 @@ $1',
'previousdiff' => '← Older edit',
'nextdiff' => 'Newer edit →',
# Visual comparison
'visual-comparison' => 'Visual comparison',
# Media information
'mediawarning' => "'''Warning''': This file may contain malicious code, by executing it your system may be compromised.<hr />",
'imagemaxsize' => "Image size limit:<br />''(for file description pages)''",

View file

@ -67,7 +67,6 @@ $wgIgnoredMessages = array(
'accesskey-preview',
'accesskey-diff',
'accesskey-compareselectedversions',
'accesskey-visualcomparison',
'accesskey-watch',
'accesskey-upload',
'addsection',

View file

@ -766,64 +766,7 @@ $wgMessageStructure = array(
'lineno',
'compareselectedversions',
'showhideselectedversions',
'visualcomparison',
'wikicodecomparison',
'editundo',
'diff-multi',
'diff-movedto',
'diff-styleadded',
'diff-added',
'diff-changedto',
'diff-movedoutof',
'diff-styleremoved',
'diff-removed',
'diff-changedfrom',
'diff-src',
'diff-withdestination',
'diff-with',
'diff-with-additional',
'diff-with-final',
'diff-width',
'diff-height',
'diff-p',
'diff-blockquote',
'diff-h1',
'diff-h2',
'diff-h3',
'diff-h4',
'diff-h5',
'diff-pre',
'diff-div',
'diff-ul',
'diff-ol',
'diff-li',
'diff-table',
'diff-tbody',
'diff-tr',
'diff-td',
'diff-th',
'diff-br',
'diff-hr',
'diff-code',
'diff-dl',
'diff-dt',
'diff-dd',
'diff-input',
'diff-form',
'diff-img',
'diff-span',
'diff-a',
'diff-i',
'diff-b',
'diff-strong',
'diff-em',
'diff-font',
'diff-big',
'diff-del',
'diff-tt',
'diff-sub',
'diff-sup',
'diff-strike',
),
'search' => array(
'searchresults',
@ -2262,7 +2205,6 @@ $wgMessageStructure = array(
'accesskey-preview',
'accesskey-diff',
'accesskey-compareselectedversions',
'accesskey-visualcomparison',
'accesskey-watch',
'accesskey-upload',
),
@ -2454,9 +2396,6 @@ $wgMessageStructure = array(
'previousdiff',
'nextdiff',
),
'visual-comparison' => array(
'visual-comparison',
),
'media-info' => array(
'mediawarning',
'imagemaxsize',
@ -3304,7 +3243,6 @@ Variants for Chinese language",
'variantname-kk' => 'Variants for Kazakh language',
'variantname-ku' => 'Variants for Kurdish language',
'variantname-tg' => 'Variants for Tajiki language',
'visual-comparison' => 'Visual comparison',
'media-info' => 'Media information',
'metadata' => 'Metadata',
'exif' => 'EXIF tags',