User:Cacycle/wikEdDiff



wikEdDiff is a user script that provides an improved and easier to read diff view for comparing article versions on Wikipedia and other MediaWiki installations. wikEdDiff has also been integrated into wikEd, a full-featured JavaScript in-browser editor. wikEdDiff is based on the wikEd diff library. wikEdDiff is also a demo and technology preview for a possible integration of this diff style into the official Wikipedia software.

Features

 * Additions, deletions, and block moves are highlighted by color in the same text
 * Block moves and character differences are detected
 * Unchanged regions are omitted from the output
 * Highly optimized for MediaWiki source texts

Use
wikEdDiff displays the following button above the standard diff view: . After pushing this button, the program fetches the diff versions in the background using Ajax and displays an improved diff right below the button. The button state is saved and remembered. By double-clicking empty space inside the diff texts or the preview you can jump to the edit field.

Gadget
The easiest way to install wikEdDiff for logged-in users at the English Wikipedia is as a gadget. Under the Gadgets tab at Special:Preferences, select "wikEdDiff, improved diff view between article versions (not needed if wikEd is used)". Then click "Save".

Manual
The following describes a manual installation. It is not needed if the above gadget method is used.

Add the following code snippets to your User:YourUsername/common.js page. This installation code works for all MediaWiki installations. You need a user account and you have to be logged in in order to install and use wikEdDiff. After saving, you have to refresh (bypass) your browser's cache to see the changes: hold down Shift while clicking Reload (or press Ctrl-Shift-R).


 * Please do not copy the complete wikEdDiff program code to your page
 * Users of the in-browser editor wikEd do not need to install wikEdDiff


 * 1. Log in under your username
 * 2. If you are on the English Wikipedia, please click the following link to edit your User:YourUsername/common.js page: [//en.wikipedia.org/w/index.php?title=Special:Mypage/common.js&action=edit Special:Mypage/common.js], otherwise open the page by hand
 * 3. Add the following code to that edit page:


 * On very old non-Wikipedia wikis you might have to use the old-fashioned way instead:


 * If there is already code on your User:YourUsername/common.js page, please make sure not to paste the installation code inside /*...*/ comments.
 * 4. Save the page
 * 5. Refresh your browser's cache: hold down Shift while clicking Reload (or press Ctrl-Shift-R)
 * 6. The wikEdDiff button [[Image:wikEdDiff.png]] should now be displayed above every standard diff display

Code
The wikEdDiff JavaScript code can be found under User:Cacycle/wikEdDiff.js. wikEdDiff is based on the wikEd diff library. If you like the way it displays diff views, please help to integrate it into the MediaWiki software by translating the diff.js library into PHP or C. A detailed documentation of the library can be found on wikEd diff and in the source code wikEd diff.js.

Customization
The diff routines as well as the wikEdDiff program are highly user-configurable. All user-configurable settings are listed at the beginning of the code (diff.js and wikEdDiff.js).

The following wikEdDiff global variables can be set on your User:YourUsername/common.js page above the loading code.


 * Please see the wikEd diff library for customization of styles and colors and diff algorithm settings
 *  Please include  only once

diff.js library URL:

wikEdDiff css rules:

Use local copies of images for testing (set to true in local copy of edit page):

Path to local images for testing:

Path to images:

Image filenames:

User readable texts:

Show complete unshortened article diff text:

Copyright
wikEdDiff has been released into the public domain.