MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
InlineDiffFormatter Class Reference

Extends standard Table-formatted DiffFormatter of core to enable Inline-Diff format of MF with only one column. More...

+ Inheritance diagram for InlineDiffFormatter:
+ Collaboration diagram for InlineDiffFormatter:

Protected Member Functions

 blockHeader ( $xbeg, $xlen, $ybeg, $ylen)
 Get the header of diff block.
 
 added ( $lines)
 Get a div element with a complete new added line as content.
 
 deleted ( $lines)
 Get a div with a line which is deleted completly.
 
 context ( $lines)
 Get a div with some changed content.
 
 wrapLine ( $marker, $class, $line)
 Convert all spaces to a forced blank.
 
 lineOrNbsp ( $line)
 Adds a forced blank to line, if the line is empty.
 
 changed ( $orig, $closing)
 Get a div with changed content (not complete added or deleted line) @inheritDoc.
 

Detailed Description

Extends standard Table-formatted DiffFormatter of core to enable Inline-Diff format of MF with only one column.

Deprecated:
1.35.0

Member Function Documentation

◆ added()

InlineDiffFormatter::added (   $lines)
protected

Get a div element with a complete new added line as content.

Complete line will be appear with green background. @inheritDoc

Parameters
array$linesWith changed lines

◆ blockHeader()

InlineDiffFormatter::blockHeader (   $xbeg,
  $xlen,
  $ybeg,
  $ylen 
)
protected

Get the header of diff block.

Remember: Given line numbers will not be visible, it's a one column diff style. @inheritDoc

Parameters
int$xbegline number of left side to compare with
int$xlenNumber of trailing lines after the changed line on left side
int$ybegright side line number to compare with
int$ylenNumber of trailing lines after the changed line on right side
Returns
string

◆ changed()

InlineDiffFormatter::changed (   $orig,
  $closing 
)
protected

Get a div with changed content (not complete added or deleted line) @inheritDoc.

Parameters
string[]$origOld content to compare with
string[]$closingNew content to compare with

◆ context()

InlineDiffFormatter::context (   $lines)
protected

Get a div with some changed content.

Line will appear with white and the changed context in red (for deleted chars) and green (for added chars) background. @inheritDoc

Parameters
array$linesWith edited lines

◆ deleted()

InlineDiffFormatter::deleted (   $lines)
protected

Get a div with a line which is deleted completly.

This line will be appear with complete red background. @inheritDoc

Parameters
array$linesWith deleted lines

◆ lineOrNbsp()

InlineDiffFormatter::lineOrNbsp (   $line)
protected

Adds a forced blank to line, if the line is empty.

Parameters
string$lineLine to edit
Returns
string

◆ wrapLine()

InlineDiffFormatter::wrapLine (   $marker,
  $class,
  $line 
)
protected

Convert all spaces to a forced blank.

If line is empty creates at least one forced space.

Parameters
string$markerUnused
string$classUnused
string$lineContent of the line
Returns
string

The documentation for this class was generated from the following file: