User:Cacycle/diff and User:SQL/Blanked: Difference between pages

From Wikipedia, the free encyclopedia
(Difference between pages)
Content deleted Content added
copyedit
 
Posting list of blanked pages, 1 pages Please see User:SQL/PlzFix
 
Line 1: Line 1:
<center>'''Recently Blanked Pages</center>
== Description ==
* [[:Pretty]]

|-
A free JavaScript diff implementation that has been optimized for the comparison of Wikipedia source texts. In contrast to most other diff implementations, moved text blocks are detected and their original positions are displayed. The output highlights additions (dark green) and deletions (dark red) in the new text.
|<small><center>''This is a list of article pages, that were still<br /> blank as of {{#time: h:i, j F Y|{{REVISIONTIMESTAMP}}}}''</center></small>

This script is used by the Wikipedia / [[MediaWiki]] in-browser editor [[User:Cacycle/wikEd|wikEd]] and by [[User:Cacycle/wikEdDiff|wikEdDiff]].

The code is an implementation and extension of the following basic algorithm:

: Paul Heckel: A technique for isolating differences between files
: Communications of the ACM 21(4):264 (1978)
: http://doi.acm.org/10.1145/359460.359467 (access restricted)
: Mirror: http://documents.scribd.com/docs/10ro9oowpo1h81pgh1as.pdf (open to all)

== Features ==

* Cross-browser implementation, code should work for all modern browsers.
* Additional post-pass 5 code for resolving islands caused by adding two common words at the end of sequences of common words
* Additional detection of block borders and color coding of moved blocks and their original position
** The block move detection is optimized for the shortest block being the moved one
** The indicator at the original position points into the direction of the move
* The code and the used data structures are extensively commented
* The used CSS and HTML elements are fully customizable
* Optimization steps can be switched off

== Code ==

The JavaScript code can be found under [[User:Cacycle/diff.js]].

== Supported browsers ==

The code should work for all modern browsers. The following browsers have been tested
(please add your experiences to the list):

* Mozilla Firefox 1.5.0.1, 1.5.0.7
* Mozilla SeaMonkey 1.0, 1.1.1
* Opera 8.53
* Internet Explorer 6.0.2900.2180, 7.0.5730.11
* Google Chrome 0.2.149.30
* Safari 3.1.2

== Usage ==

var htmlText = WDiffString(oldText, newText);
var htmlTextShortened = WDiffShortenOutput(htmlText);

=== Customization ===

The following variables can be set in your ''monobook.js'' before loading the diff.js script:

CSS for change indicators:

var wDiffStyleDelete = 'font-weight: normal; text-decoration: none; color: #ffffff; background-color: #990033;';
var wDiffStyleInsert = 'font-weight: normal; text-decoration: none; color: #ffffff; background-color: #009933;';
var wDiffStyleMoved = 'font-weight: bold; vertical-align: text-bottom; font-size: xx-small; padding: 0; border: solid 1px;';
var wDiffStyleBlock = [
'background-color: #ffff44;',
'background-color: #b0ff90;',
'background-color: #ffcc99;',
'background-color: #99ffff;',
'background-color: #99ccff;',
'background-color: #cc99ff;',
'background-color: #ff99cc;',
'background-color: #ffd040;',
'background-color: #d0d0d0;'
];

Html for change indicators, {number} is replaced by the block number, {block} is replaced by the block style:

<pre><nowiki>var wDiffHtmlMovedRight = '<input type="button" value=">" style="' + styleMoved + ' {block}">';
var wDiffHtmlMovedLeft = '<input type="button" value="<" style="' + styleMoved + ' {block}">';

var wDiffHtmlBlockStart = '<span style="{block}">';
var wDiffHtmlBlockEnd = '</span>';

var wDiffHtmlDeleteStart = '<span style="' + styleDelete + '">';
var wDiffHtmlDeleteEnd = '</span>';

var wDiffHtmlInsertStart = '<span style="' + styleInsert + '">';
var wDiffHtmlInsertEnd = '</span>';</nowiki></pre>

Minimal number of real words for a moved block (0 for always displaying block move indicators):

var wDiffBlockMinLength = 3;

Exclude identical sequence starts and endings from change marking:

var wDiffWordDiff = true;

Enable recursive diff to resolve problematic sequences:

var wDiffRecursiveDiff = true;

Enable block move display:

var wDiffShowBlockMoves = true;

Remove unchanged parts from final output.

Characters before diff tag to search for previous heading, paragraph, line break, cut characters:

var wDiffHeadingBefore = 1500;
var wDiffParagraphBefore = 1500;
var wDiffLineBeforeMax = 1000;
var wDiffLineBeforeMin = 500;
var wDiffBlankBeforeMax = 1000;
var wDiffBlankBeforeMin = 500;
var wDiffCharsBefore = 500;

Characters after diff tag to search for next heading, paragraph, line break, or characters:

var wDiffHeadingAfter = 1500;
var wDiffParagraphAfter = 1500;
var wDiffLineAfterMax = 1000;
var wDiffLineAfterMin = 500;
var wDiffBlankAfterMax = 1000;
var wDiffBlankAfterMin = 500;
var wDiffCharsAfter = 500;

Maximal fragment distance to join close fragments:
var wDiffFragmentJoin = 1000;
var wDiffOmittedChars = '…';
<nowiki>var wDiffOmittedLines = '<hr style="height: 2px; margin: 1em 10%;">';</nowiki>
<nowiki>var wDiffNoChange = '<hr style="height: 2px; margin: 1em 20%;">';</nowiki>

== News ==

(Newest first)
* Version 0.9.3: Fixed moved block highlighting ending at first change; fixed occasional &amp;para;s. [[User:Cacycle|Cacycle]] 02:22, 28 April 2007 (UTC)
* Version 0.9.2b: Fixes for IE and [[User:Cacycle/wikEdDiff|wikEdDiff]] compatibility. [[User:Cacycle|Cacycle]] 19:55, 15 April 2007 (UTC)
* Version 0.9.2: Variables and functions have been renamed again, they are now preceded with "wDiff" and "WDiff", respectively. New filter function ''WDiffShortenOutput()'' to remove unchanged regions from output. [[User:Cacycle|Cacycle]] 21:43, 13 April 2007 (UTC)
* Version 0.9.1: Renaming variables and functions. For compatibility reasons they are now preceded with "cDiff" and "CDiff", respectively. [[User:Cacycle|Cacycle]] 00:03, 24 March 2007 (UTC)
* Version 0.9.0: new version numbering, dead loop fix (thanks to [[User:Shamsian|Shamsian]]) [[User:Cacycle|Cacycle]] 21:43, 13 May 2006 (UTC)
* SetupDiff() is not needed anymore and has been removed.
: The code should now work for all modern browsers (thanks to [[User:Shamsian|Shamsian]]).
: Trivial changes are now handled without complex calculations. The html code and the styles of the indicators are now fully customizable. [[User:Cacycle|Cacycle]] 21:55, 27 March 2006 (UTC)
* All function names have been changed for compatibility with [[Wikipedia:Tools/Navigation popups]]. [[User:Cacycle|Cacycle]] 12:18, 8 February 2006 (UTC)

== See also ==

* [[User:Cacycle/wikEd|wikEd]], a full-featured MediaWiki-integrated text editor that adds enhanced text processing functions to edit pages. wikEd provides syntax highlighting, search and replace functions, and on-page previews and ''diff'' views
* [[User:Cacycle/wikEdDiff|wikEdDiff]], a [[wikipedia:WikiProject User scripts|user script]] that provides an improved and easier to read ''diff'' view for comparing article versions

== References ==

* [http://ejohn.org/projects/javascript-diff-algorithm/ John Resig's implementation], simple implementation without block move support and island resolving, not well adapted for Wikipedia sources
* [http://appsrv.cse.cuhk.edu.hk/~achu3/hdiff/ Modification of John Resig's algorithm by Chu Alan "sprite"] ([http://appsrv.cse.cuhk.edu.hk/~achu3/hdiff/jsdiff.js code]), contains important bugfixes but has the same limitations - Links don't appear to work anymore :-(
* [http://code.google.com/p/google-diff-match-patch/ Neil Fraser's solution], uses a completely different algorithm. This algorithm is not able to detect block moves.

== License ==
{{PD-self}}

[[Category:Wikipedia scripts]]
__INDEX__

Revision as of 03:00, 13 October 2008

Recently Blanked Pages

|-

|

This is a list of article pages, that were still
blank as of 03:00, 13 October 2008