wikEd |
---|
![]() |
Installation |
wikEd diff |
Program code |
Project |
Gadgets |
|
Translations |
|
This is the discussion page for the improved diff for Wikipedia article revisions wikEdDiff and its diff library wikEd diff. Feel free to leave your comments, suggestions, and bug reports at the end of this page.
Archived discussions from this page: 1
Archives: no archives yet ( create) |
|
.
test case -- Jeremyb ( talk) 15:53, 18 August 2014 (UTC)
The scripts seems to cause the page to scroll when I attempt to select a word in a diff by double clicking over it. Helder 01:01, 1 September 2014 (UTC)
Could you allow the script to be used on Special:ComparePages too? Helder 01:26, 1 September 2014 (UTC)
if(mw.util.getParamValue('diff')!==null){ ... }
around the call which imports your script.
Helder
12:21, 9 September 2014 (UTC)Red-green is the commonest form of colour-blindness. Please check your colour combinations against web standards, using tools recommended at WP:COLOUR. The Accessibility wikiproject can advise further. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 22:40, 1 September 2014 (UTC)
Due to recent changes, diffs with no content are collapsed to the left.
Please fix, thanks. Gary ( talk · scripts) 05:45, 3 September 2014 (UTC)
Gary, Helder, Dsimic: fixed in wikEdDiff 0.9.31, thanks for reporting this. Cacycle ( talk) 20:51, 8 September 2014 (UTC)
Hey everyone! Unfortunately, there seems to be a bug in the recently improved wikEdDiff, which is by the way much better than it was before! Here are two examples where differences aren't correctly displayed:
Hope it helps, as there's obviously something wrong. — Dsimic ( talk | contribs) 19:35, 8 September 2014 (UTC)
There seems to be another bug, which feels like it was introduced with the wikEdDiff 1.2 release. Please have a look at this diff that shows an example of way too much unchanged text included after the last changed/compared segment. — Dsimic ( talk | contribs) 23:02, 14 October 2014 (UTC)
If I open a diff ( example) and run the following code on console (instead on my personal/global JS)
importScript('User:Cacycle/wikEdDiff.js');
the button does not appear. The same problem happens if I use
mw.loader.load( '//en.wikipedia.org/?title=User:Cacycle/wikEdDiff.js&action=raw&ctype=text/javascript' );
The line
wikEd.DiffAddEventListener(window, 'load', wikEd.DiffSetup, false);
is executed, but the function wikEd.DiffSetup
is never called.
Helder
12:38, 9 September 2014 (UTC)
importScript('User:Cacycle/wikEdDiff.js');
from the console now works in version 0.9.33.
Cacycle (
talk)
15:48, 12 September 2014 (UTC)Hello again! Please have a look at this diff; changes made to {{ Talk archive navigation}} templates aren't recognized down to the word level, and instead of displaying that only "August" was changed to "September", wikEdDiff displays whole-line changes. On the other hand, "old shool" diff shows word-level changes. It would be nice to have wikEdDiff display word-level changes as well, if possible. — Dsimic ( talk | contribs) 19:43, 10 September 2014 (UTC)
Hi Cacycle.
I was excited to see the new version of WikEdDiff. Love the new way of showing moved text and the fact that it shows this Honda Accord diff perfectly.
I thought I would share with you two diffs that may help you tweak the code.
Eliminating the false positive in the Foldamer diff while enabling detection of the moves in the Tom Jones diff sounds like a big ask but I thought I'd see what you made of it.
Yaris678 ( talk) 14:05, 9 September 2014 (UTC)
Here are two more test cases:
Yaris678 ( talk) 08:06, 16 September 2014 (UTC) (overwiting a post from 11:59, 15 September 2014)
var wDiff; if (wDiff === undefined) { wDiff = {}; } wDiff.unitTesting = true;
to your common.js to see the results in your browser console). These tests says that Tom Jones as well as Logistic regression are formally correct (they do not say these are the "best" (i.e. most intuitive) options). As for the "formula": the basic procedure and the optimizations cannot be described in a few sentences. But in general, corresponding word blocks are determined, then it is calculated which of them are fixed (black on white) and which of them are moved (gray) by minimizing the total moved block length. After that, deletions and insertions are sorted-in in a way that is most intuitive for humans. Then, in order to scrap false-positive correspondings, blocks that are too short and/or consist of common words are eliminated by splitting them into insertion/deletion pairs and the whole process is repeated until nothing changes. For details simply check the code, it is extensively commented.
Cacycle (
talk)
22:07, 21 September 2014 (UTC)I've used the improved inline diff as my primary display of changes since the day I discovered it was available, and had been very happy with it; but recently I've become more and more frustrated at having to re-learn the display conventions every time I sign in to Wikipedia.
Could you publish the CSS tag and class details, along with the various historical color settings, so that a user can just put them into his common.css settings once and for all? I would really prefer to continue to use this tool, but if I can't achieve any degree of stability in the user interface, I'm afraid it becomes more of a problem than it's worth.
Unician
∇
03:54, 11 September 2014 (UTC)
wDiff.coloredBlocks = true;
to my
User:Dsimic/common.js and tried with clearing the browser cache, but unfortunately it doesn't seem to work as I still have pale colors in wikEdDiff. Could it be that I've misunderstood what the rainbow color scheme is? Any suggestions, please? —
Dsimic (
talk |
contribs)
19:08, 13 September 2014 (UTC)Unician, Dsimic: I have added the newline sign back in, you can see it when hovering over the block. Also, I have made blank-only changes darker so hat they are now easily visible. Dsimic: If you still want to change the colors, then you have to set the insert/delete styles (wDiff.styleDelete and wDiff.styleInsert). wDiff.coloredBlocks refers to moved block coloring (previously rainbow colors, now all-gray). Cacycle ( talk) 02:11, 14 September 2014 (UTC)
Thank you, Cacycle, for updating the wikEdDiff customizations in my common.js! However, what happened to the customization descriptions in User:Cacycle/diff § Customization section, a large portion of them was deleted? — Dsimic ( talk | contribs) 13:14, 10 October 2014 (UTC)
Hi, I was directed to you to let you know show improved diff view is not working for the most recent version of Safari for windows 7 available. Here's a diff https://en.wikipedia.org/?title=Wikipedia%3AHelp_desk&diff=628731807&oldid=628716392 that doesn't work, although the green delta does appear. I was told to let you know which version of safari I have. I am not sure how to do that, all I can say is that this has stopped working recently and I have windows 7. This has happened before and been quickly fixed if you check the help page archives. Thanks. μηδείς ( talk) 01:37, 8 October 2014 (UTC)
Hi μηδείς: Please could you update to the latest wikEdDiff/wikEd diff versions ( Wikipedia:bypass your cache) and check your browser console for wikEd diff-related errors? Thanks, Cacycle ( talk) 13:22, 10 October 2014 (UTC)
In diff page, DiffLinkify of some is not working. It is work in deletedline, but it is not working in other parts. Thank you. -- Frozen-mikan ( talk) 09:01, 17 October 2014 (UTC)
This looks like a particularly odd false positive. A single character (n) is shown as moved several paragraphs.
Yaris678 ( talk) 12:07, 24 November 2014 (UTC)
wikEdDiff doesn't work at all for most of the diffs I try it out on. The page just shows "loading" status forever, with the green triangle never appearing. For example it works here in diff 1, but in the next edit on the same article, diff 2 , it fails to load. The strangest thing is this problem is not entirely consistent. I got diff 2 to load twice by using the Twinkle "next edit" link from diff 1. But it didn't work the third time, and it doesn't seem to ever work for diff 2 when I try to get there from the "View History" page for the article. TBSchemer ( talk) 22:38, 18 December 2014 (UTC)
TBSchemer: Please could you provide a full error report (e.g. see User_talk:Cacycle/wikEd#wikEd_Bug_reports for the required infos). Thanks - Cacycle ( talk) 11:42, 22 February 2015 (UTC)
This is an interesting false negative. I was generally impressed with how this diff detects the moved text blocks. However, if you look at the bottom, you will see </syntaxhighlight> being removed and then immediately added. Yaris678 ( talk) 22:16, 21 December 2014 (UTC)
This script is trying to access the deprecated globals wgServer
, wgArticlePath
, wgScriptPath
and wgCurRevisionId
wgPageName instead of using mw.config.get('wg...')
to acess them (check the multiple warnings in the console).
Helder
23:23, 14 January 2015 (UTC)
When editing a page, there are five buttons:
Save page Show preview Show changes Submit Query Cancel
Clicking Show changes gives a diff view, but I'm not seeing the
button like I do for ordinary diffs. This would be very helpful if it were there.
Eman235/
talk
21:37, 4 February 2015 (UTC)
I played with the below options of the wikEd-diff-tool:
- "Reject blocks if too short and common"
- "Words: reject blocks if shorter"
- "Maximum rejection cycles"
- "Repeated diff"
- "Recursive diff"
...but could not see any effects. Are these non-functional in the online demo?
Also, the "moved text" recognition is too sensitive in some cases (it detects single words erroneusly as moved that are actually edits). Is there something that can be done such that only whole blocks of text are recognized as moved but not single words?
84.56.98.120 ( talk) 20:45, 21 April 2015 (UTC)
Please see User:Cacycle/diff for a more detailed explanation of the options. In short: the options mainly play a role in the fine tuning of very complex cases with many changes and block moves. Also, diffing is - and cannot be - an exact science and there will always be ambiguities. The program does its best to guess your intentions, but it still is a relatively simple program. Cacycle ( talk) 09:43, 27 April 2015 (UTC)
Hi there. First off, thanks for this great piece of software.
The documentation for changing the styling:
var wikEdConfig = {}; wikEdConfig.diffCSS = { .... }
... does not reflect the content of
wikEdDiff.js: There is no mention of wikEdConfig
og the diffCSS
property in the code. There is, however, mention of a wikEdDiffConfig
that is assumed to be a global variable. If this one is present, it will be deep-copied into this.config
. This seems the most likely interpretation.
It seems that there is only one property related to styling called stylesheet
that contains a string of all the style. If one wants to change the styling, one has to add a <style />
tag and write !important
in case the styling conflicts with the default, or completely redefine the stylesheet
property of the config. It would be nice if there was something in-between like the documentation suggests. I.e., if a CSS property is listed, use it, otherwise use the default. Just a suggestion.
Also, why are there both the classes .wikEdDiffDeleteBlank
/ .wikEdDiffInsertBlank
and .wikEdDiffNewline
and .wikEdDiffSpace
? From the internal variable regExpBlanks
, I would assume it has to do with unicode-compatible whitespace detection. Is this because one should be able to differentiate between regular spacing and unicode spacing?
Kindly, Doc Daneeka ( talk) 10:28, 1 July 2015 (UTC)
wikEdConfig
and wikEdConfig.diffCSS
are mentioned in the
wikEdDiff.js code and changing the styles works fine for me. As for the classes: these are needed for displaying whitespace symbols on hovering.
Cacycle (
talk)
16:51, 20 July 2015 (UTC)I've been playing with this handy tool and testing it with large texts (300kb), with mostly great results.
There is, however, room for some improvements:
I've also noticed IE9 hogged the CPU after diff was complete, becoming mostly unresponsive, while up-to-date FF worked flawlessly.
Cheers, — Preceding unsigned comment added by 94.126.240.2 ( talk) 08:12, 10 July 2015 (UTC)
Hello! Please have a look at this diff, it clearly shows some room for improvements in wikEdDiff. If possible, it would be much better not to display changes as two text moves, and be closer to how the "traditional" diff displays those changes. Hope you'll find this report helpful. — Dsimic ( talk | contribs) 08:38, 25 July 2015 (UTC)
Hello! Would it be possible to configure wikEdDiff to display the diffs using a monospaced font? I already had a look at the JavaScript source code, and it seems like it should be configurable, but thought to ask here before spending a lot of time on trials and errors. Any help would be appreciated! — Dsimic ( talk | contribs) 18:10, 16 August 2015 (UTC)
window.wikEdConfig = {};
wikEd.config.diffCSS = {
'.wikEdDiffFragment': 'font-family: monospace,Courier;'
};
On all pages I visit on Wikipedia, I get the following in my Console: "Use of "wgServer" is deprecated. Use mw.config instead."
I'm guessing it's probably this script? Since it gets the wg variables directly, rather than through mw.config.get.
Any chance the script could be updated to use mw.config.get?
Thanks! Gary ( talk · scripts) 18:41, 22 August 2015 (UTC)
Hello, I have ported the great wikEdDiff library to Python: python-wikeddiff. Is it OK to use "wikEdDiff" as part of the port's name? Should I change anything else in the description or licensing?
I don't plan to do any further development on the diff engine, except for writing an ANSI color formatter. I will try to keep the port in sync with fixes to the JavaScript library and report back any issues relevant to the original code.
Are you also interested in simplifications of the data structures and algorithms to possibly make other ports more easy? For instance, there is no direct counterpart for null
in Python (and many other languages) and mixing true
, false
and null
for assumably boolean variables (e.g. the .fixed
property of groups) is probably not the greatest idea. I think that the only relevant place (the main loop in the insertMarks
method/function) can be fixed by considering also the .oldNumber
property in addition to .fixed
(see
[2]).
-- Lahwaacz ( talk) 10:09, 16 September 2015 (UTC)
Hello, sorry for asking such a common question, but.. How to change the colors? In the manual it is said to use CSS, but adding styles to my common.css does not help. Firebug says that styles are defined as inline, !important cant`t help neither. Adding some variables to the js is not clear, because wikEdDiffConfig.stylesheet is defined as a plain text and I don`t know how to customize it partly. Thanks for the answer. The-city-not-present ( talk) 20:00, 27 November 2015 (UTC)
Moreover, for using !important I get a warning, I shouldn`t do this? The-city-not-present ( talk) 20:04, 27 November 2015 (UTC)
Sorry for false representation, !important started to work, maybe I did some typo when first tried this. The-city-not-present ( talk) 20:06, 27 November 2015 (UTC)
MediaWiki:Gadget-wikEdDiff.js
of my own MediaWiki installationsel.collapseToEnd();
Uncaught InvalidStateError: Failed to execute 'collapseToEnd' on 'Selection': there is no selection.wikEd.DiffWrapperHandler @ load.php?debug=false&lang=en&modules=ext.gadget.DotsSyntaxHighlighter%2CwikEdDiff|ext.headertabs|jq…:49
$wgResourceLoaderDebug = true;
in my LocalSettings.php (?debug=true
as parameter does not work in version comparison)
-- Escalator~enwikibooks ( talk) 09:25, 14 January 2016 (UTC)
wikEdDiff is on the fritz. Go to any English Wikipedia talk page → click on New section link at top of page → click on the Changes or Show changes button at the bottom of the edit window → enable wikEdDiff → page appears to be blanked.
See Phabricator for screen shot. Cheers! {{u|
Checkingfax}} {
Talk}
14:22, 20 February 2016 (UTC)
@
Cacycle,
Edgars2007, and
Redrose64: {{u|
Checkingfax}} {
Talk}
14:27, 20 February 2016 (UTC)
{{u|
Checkingfax}} {
Talk}
22:56, 22 February 2016 (UTC)Hi
Cacycle. In
this diff on
Kazi Nazrul Islam, the single column improved wikEdDiff is showing (no difference) but the edit history showed a 48b change so I knew there should be a difference so I scrolled down to the 2-column standard Wikipedia diff view and sure enough there were lots of little changes. Cheers! {{u|
Checkingfax}} {
Talk}
03:24, 24 February 2016 (UTC)
Hi,
Cacycle. The wide diff
here shows me adding HTML escape codes for non-breaking spaces, which I did not add. You can see in the normal diff view, below the wide diff view, that I did not add them. Ping me back. Cheers! {{u|
Checkingfax}} {
Talk}
19:43, 15 April 2016 (UTC)
Is it possible to show diff after the line "(n intermediate revisions by k users not shown)"? Otherwise when the diff is large one can think that this is the difference made only by the last edit. Example: [3]. Alexei Kopylov ( talk) 17:49, 15 June 2016 (UTC)
When using the RevisionSlider and WikEdDiff together WikEdDiff will not function correctly when the RevisionSlider is used to load a new diff. This can be fixed by adding a simple hook listener to your copy.
You can find the relevant phabricator ticket here which contains the code that you will need to add to your copy of the script (in most cases). Please also use this ticket for further questions & discussion.
·addshore· talk to me! 11:35, 23 September 2016 (UTC)Here is a diff
[4] which merely converts HTML table syntax <th> </th> <tr> </tr> <td> </td>
into pipe synthax ! |- |
, leaving the table content intact. wikEdDiff parses it spectacularly well - except for several rows where the user added a trailing white space to cell contents, which wikEdDiff treats as a block move (see Church Organ, Funk Guitar, and Telephone). I played with the
wikEdDiff online tool to see if tweaking the parameters would help, but no luck. Is there a simple fix for this?--
Dmitry (
talk•
contibs)
22:14, 6 October 2016 (UTC)
It has been a while (maybe more than a month) that I'm having problems with wikEdDiff. The tool does not show most of the times, apparently at random. After reloading several times the diff page, eventually it would show up. I am using Google Chrome (last version) and I activated the tool from Preferences>Gadgets. It seems I have the same problem also on Firefox and Edge. It is a great tool and I am really missing it, so I would really like to fix this! Thanks for all the work!! -- Ita140188 ( talk) 17:11, 7 November 2016 (UTC)
I also have had this problem for some time (a month or three?). It used to be random, but lately it seems not to work at all. Since I'm stubbornly still using Internet Explorer 11 on Windows 10, I had assumed you'd simply stopped supporting it. -- Ørjan ( talk) 05:18, 26 November 2016 (UTC)
Any updates on this? I've noticed wikEdDiff working sporadically for the past few months now. Recently it stubbornly refuses to work on Wikipedia no matter what I do, though for some reason it works fine on Wikia (Strange cause I usually expect things to break on Wikia, given their history). — k6ka 🍁 ( Talk · Contributions) 20:24, 18 December 2016 (UTC)
Can wikEdDiff show differences on the rendered HTML (i.e. how the page appears in the article), as opposed to showing differences on the raw wikitext and HTML markup? John P New 22:14, 6 April 2017 (UTC) — Preceding unsigned comment added by John p new ( talk • contribs)
About a month ago, I switched from Firefox to Pale Moon, a fork of that project. Since then, wikEdDiff doesn't work—which I consider strange, because wikEd doesn't seem any different. None of the other Wikipedia preferences, gadgets, or scripts I have seem to have been impacted negatively by the change in browsers.
When I click on the button with the green triangle to show the improved diff, the text box opens with three dots in it. In Firefox that would last a second or so and the diff would appear in the text box. In Pale Moon, nothing happens except that the cursor spins if I hold it over the button with the green triangle. If I click on the button again, the text box closes and the cursor stops spinning.
I use Pale Moon 27.5.1 in Windows 7. I have a host of warnings in the Error Console, of which these are a few examples:
Warning: Error in parsing value for 'background-image'. Declaration dropped.
Warning: Expected 'none', URL, or filter function but found 'progid'. Error in parsing value for 'filter'. Declaration dropped.
Warning: Unknown property 'zoom'. Declaration dropped.
Warning: Expected ';' or '}' to terminate declaration but found '!'. Declaration dropped.
I've never looked at the Error Console before, so I don't know if I've had warnings in the past or if that's something new to Pale Moon.
Any suggestions would be appreciated. I can provide a list of my browser extensions if that would be helpful. Thank you. — Malik Shabazz Talk/ Stalk 05:56, 3 November 2017 (UTC)
Inside the diff function the is a little mistake at line 944:
if ( newString.substr( -1 ) === '\n' && oldString.substr( -1 === '\n' ) ) {
And here the correction:
if ( newString.substr( -1 ) === '\n' && oldString.substr( -1 ) === '\n' ) {
I like this so much!
It might be helpful to
Hello. There is a new bug in the tool, and I'll be glad if you could fix it. Reproduction steps:
Thank you, IKhitron ( talk) 16:40, 9 July 2019 (UTC)
Same behavior in the "standard" part of the diff, but only if this gadget is enabled. The problem doesn't affect me—I don't double-click anything to select it—but I just wanted to note this as it might help with diagnosis. ― Mandruss ☎ 16:53, 9 July 2019 (UTC)
This is one of the most used gadgets and I've found new users find it much more intuitive than the standard paragraph-by-paragraph viewer (especially for small changes). Is there the possibility for it to be activated by default? T.Shafee(Evo&Evo) talk 05:34, 11 July 2019 (UTC)
Maybe it's just me, but I don't see the green triangle anymore. No errors in the console. Opencooper ( talk) 18:50, 27 August 2021 (UTC)
If there is a remote version of the page inside the diff, the difference is shown incorrectly: example. Kalendar ( talk) 11:02, 15 December 2021 (UTC)
Error in example:
diff:
{{{!}} style="background:transparent" → {{(!}} style="background:transparent"
en:User:Cacycle/wikEdDiff:
{
{{(!}} style="background:transparent"
-- Kalendar ( talk) 11:37, 15 December 2021 (UTC)
![]() | This
edit request to
User:Cacycle/diff.js has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Change this block to support dark mode better:
'.wikEdDiffFragment {' +
'white-space: pre-wrap; background: #fff; border: #bbb solid; ' +
to the following:
'.wikEdDiffFragment {' +
'white-space: pre-wrap; background-color: var(--background-color-base, #fff); border: #bbb solid; ' +
Side by side:
− | 'white-space: pre-wrap; background | + | 'white-space: pre-wrap; background-color: var(--background-color-base, #fff); border: #bbb solid; ' + |
There may be other adjustments needed or desirable, but this is the bare minimum. Izno ( talk) 01:59, 13 July 2024 (UTC)
wikEd |
---|
![]() |
Installation |
wikEd diff |
Program code |
Project |
Gadgets |
|
Translations |
|
This is the discussion page for the improved diff for Wikipedia article revisions wikEdDiff and its diff library wikEd diff. Feel free to leave your comments, suggestions, and bug reports at the end of this page.
Archived discussions from this page: 1
Archives: no archives yet ( create) |
|
.
test case -- Jeremyb ( talk) 15:53, 18 August 2014 (UTC)
The scripts seems to cause the page to scroll when I attempt to select a word in a diff by double clicking over it. Helder 01:01, 1 September 2014 (UTC)
Could you allow the script to be used on Special:ComparePages too? Helder 01:26, 1 September 2014 (UTC)
if(mw.util.getParamValue('diff')!==null){ ... }
around the call which imports your script.
Helder
12:21, 9 September 2014 (UTC)Red-green is the commonest form of colour-blindness. Please check your colour combinations against web standards, using tools recommended at WP:COLOUR. The Accessibility wikiproject can advise further. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 22:40, 1 September 2014 (UTC)
Due to recent changes, diffs with no content are collapsed to the left.
Please fix, thanks. Gary ( talk · scripts) 05:45, 3 September 2014 (UTC)
Gary, Helder, Dsimic: fixed in wikEdDiff 0.9.31, thanks for reporting this. Cacycle ( talk) 20:51, 8 September 2014 (UTC)
Hey everyone! Unfortunately, there seems to be a bug in the recently improved wikEdDiff, which is by the way much better than it was before! Here are two examples where differences aren't correctly displayed:
Hope it helps, as there's obviously something wrong. — Dsimic ( talk | contribs) 19:35, 8 September 2014 (UTC)
There seems to be another bug, which feels like it was introduced with the wikEdDiff 1.2 release. Please have a look at this diff that shows an example of way too much unchanged text included after the last changed/compared segment. — Dsimic ( talk | contribs) 23:02, 14 October 2014 (UTC)
If I open a diff ( example) and run the following code on console (instead on my personal/global JS)
importScript('User:Cacycle/wikEdDiff.js');
the button does not appear. The same problem happens if I use
mw.loader.load( '//en.wikipedia.org/?title=User:Cacycle/wikEdDiff.js&action=raw&ctype=text/javascript' );
The line
wikEd.DiffAddEventListener(window, 'load', wikEd.DiffSetup, false);
is executed, but the function wikEd.DiffSetup
is never called.
Helder
12:38, 9 September 2014 (UTC)
importScript('User:Cacycle/wikEdDiff.js');
from the console now works in version 0.9.33.
Cacycle (
talk)
15:48, 12 September 2014 (UTC)Hello again! Please have a look at this diff; changes made to {{ Talk archive navigation}} templates aren't recognized down to the word level, and instead of displaying that only "August" was changed to "September", wikEdDiff displays whole-line changes. On the other hand, "old shool" diff shows word-level changes. It would be nice to have wikEdDiff display word-level changes as well, if possible. — Dsimic ( talk | contribs) 19:43, 10 September 2014 (UTC)
Hi Cacycle.
I was excited to see the new version of WikEdDiff. Love the new way of showing moved text and the fact that it shows this Honda Accord diff perfectly.
I thought I would share with you two diffs that may help you tweak the code.
Eliminating the false positive in the Foldamer diff while enabling detection of the moves in the Tom Jones diff sounds like a big ask but I thought I'd see what you made of it.
Yaris678 ( talk) 14:05, 9 September 2014 (UTC)
Here are two more test cases:
Yaris678 ( talk) 08:06, 16 September 2014 (UTC) (overwiting a post from 11:59, 15 September 2014)
var wDiff; if (wDiff === undefined) { wDiff = {}; } wDiff.unitTesting = true;
to your common.js to see the results in your browser console). These tests says that Tom Jones as well as Logistic regression are formally correct (they do not say these are the "best" (i.e. most intuitive) options). As for the "formula": the basic procedure and the optimizations cannot be described in a few sentences. But in general, corresponding word blocks are determined, then it is calculated which of them are fixed (black on white) and which of them are moved (gray) by minimizing the total moved block length. After that, deletions and insertions are sorted-in in a way that is most intuitive for humans. Then, in order to scrap false-positive correspondings, blocks that are too short and/or consist of common words are eliminated by splitting them into insertion/deletion pairs and the whole process is repeated until nothing changes. For details simply check the code, it is extensively commented.
Cacycle (
talk)
22:07, 21 September 2014 (UTC)I've used the improved inline diff as my primary display of changes since the day I discovered it was available, and had been very happy with it; but recently I've become more and more frustrated at having to re-learn the display conventions every time I sign in to Wikipedia.
Could you publish the CSS tag and class details, along with the various historical color settings, so that a user can just put them into his common.css settings once and for all? I would really prefer to continue to use this tool, but if I can't achieve any degree of stability in the user interface, I'm afraid it becomes more of a problem than it's worth.
Unician
∇
03:54, 11 September 2014 (UTC)
wDiff.coloredBlocks = true;
to my
User:Dsimic/common.js and tried with clearing the browser cache, but unfortunately it doesn't seem to work as I still have pale colors in wikEdDiff. Could it be that I've misunderstood what the rainbow color scheme is? Any suggestions, please? —
Dsimic (
talk |
contribs)
19:08, 13 September 2014 (UTC)Unician, Dsimic: I have added the newline sign back in, you can see it when hovering over the block. Also, I have made blank-only changes darker so hat they are now easily visible. Dsimic: If you still want to change the colors, then you have to set the insert/delete styles (wDiff.styleDelete and wDiff.styleInsert). wDiff.coloredBlocks refers to moved block coloring (previously rainbow colors, now all-gray). Cacycle ( talk) 02:11, 14 September 2014 (UTC)
Thank you, Cacycle, for updating the wikEdDiff customizations in my common.js! However, what happened to the customization descriptions in User:Cacycle/diff § Customization section, a large portion of them was deleted? — Dsimic ( talk | contribs) 13:14, 10 October 2014 (UTC)
Hi, I was directed to you to let you know show improved diff view is not working for the most recent version of Safari for windows 7 available. Here's a diff https://en.wikipedia.org/?title=Wikipedia%3AHelp_desk&diff=628731807&oldid=628716392 that doesn't work, although the green delta does appear. I was told to let you know which version of safari I have. I am not sure how to do that, all I can say is that this has stopped working recently and I have windows 7. This has happened before and been quickly fixed if you check the help page archives. Thanks. μηδείς ( talk) 01:37, 8 October 2014 (UTC)
Hi μηδείς: Please could you update to the latest wikEdDiff/wikEd diff versions ( Wikipedia:bypass your cache) and check your browser console for wikEd diff-related errors? Thanks, Cacycle ( talk) 13:22, 10 October 2014 (UTC)
In diff page, DiffLinkify of some is not working. It is work in deletedline, but it is not working in other parts. Thank you. -- Frozen-mikan ( talk) 09:01, 17 October 2014 (UTC)
This looks like a particularly odd false positive. A single character (n) is shown as moved several paragraphs.
Yaris678 ( talk) 12:07, 24 November 2014 (UTC)
wikEdDiff doesn't work at all for most of the diffs I try it out on. The page just shows "loading" status forever, with the green triangle never appearing. For example it works here in diff 1, but in the next edit on the same article, diff 2 , it fails to load. The strangest thing is this problem is not entirely consistent. I got diff 2 to load twice by using the Twinkle "next edit" link from diff 1. But it didn't work the third time, and it doesn't seem to ever work for diff 2 when I try to get there from the "View History" page for the article. TBSchemer ( talk) 22:38, 18 December 2014 (UTC)
TBSchemer: Please could you provide a full error report (e.g. see User_talk:Cacycle/wikEd#wikEd_Bug_reports for the required infos). Thanks - Cacycle ( talk) 11:42, 22 February 2015 (UTC)
This is an interesting false negative. I was generally impressed with how this diff detects the moved text blocks. However, if you look at the bottom, you will see </syntaxhighlight> being removed and then immediately added. Yaris678 ( talk) 22:16, 21 December 2014 (UTC)
This script is trying to access the deprecated globals wgServer
, wgArticlePath
, wgScriptPath
and wgCurRevisionId
wgPageName instead of using mw.config.get('wg...')
to acess them (check the multiple warnings in the console).
Helder
23:23, 14 January 2015 (UTC)
When editing a page, there are five buttons:
Save page Show preview Show changes Submit Query Cancel
Clicking Show changes gives a diff view, but I'm not seeing the
button like I do for ordinary diffs. This would be very helpful if it were there.
Eman235/
talk
21:37, 4 February 2015 (UTC)
I played with the below options of the wikEd-diff-tool:
- "Reject blocks if too short and common"
- "Words: reject blocks if shorter"
- "Maximum rejection cycles"
- "Repeated diff"
- "Recursive diff"
...but could not see any effects. Are these non-functional in the online demo?
Also, the "moved text" recognition is too sensitive in some cases (it detects single words erroneusly as moved that are actually edits). Is there something that can be done such that only whole blocks of text are recognized as moved but not single words?
84.56.98.120 ( talk) 20:45, 21 April 2015 (UTC)
Please see User:Cacycle/diff for a more detailed explanation of the options. In short: the options mainly play a role in the fine tuning of very complex cases with many changes and block moves. Also, diffing is - and cannot be - an exact science and there will always be ambiguities. The program does its best to guess your intentions, but it still is a relatively simple program. Cacycle ( talk) 09:43, 27 April 2015 (UTC)
Hi there. First off, thanks for this great piece of software.
The documentation for changing the styling:
var wikEdConfig = {}; wikEdConfig.diffCSS = { .... }
... does not reflect the content of
wikEdDiff.js: There is no mention of wikEdConfig
og the diffCSS
property in the code. There is, however, mention of a wikEdDiffConfig
that is assumed to be a global variable. If this one is present, it will be deep-copied into this.config
. This seems the most likely interpretation.
It seems that there is only one property related to styling called stylesheet
that contains a string of all the style. If one wants to change the styling, one has to add a <style />
tag and write !important
in case the styling conflicts with the default, or completely redefine the stylesheet
property of the config. It would be nice if there was something in-between like the documentation suggests. I.e., if a CSS property is listed, use it, otherwise use the default. Just a suggestion.
Also, why are there both the classes .wikEdDiffDeleteBlank
/ .wikEdDiffInsertBlank
and .wikEdDiffNewline
and .wikEdDiffSpace
? From the internal variable regExpBlanks
, I would assume it has to do with unicode-compatible whitespace detection. Is this because one should be able to differentiate between regular spacing and unicode spacing?
Kindly, Doc Daneeka ( talk) 10:28, 1 July 2015 (UTC)
wikEdConfig
and wikEdConfig.diffCSS
are mentioned in the
wikEdDiff.js code and changing the styles works fine for me. As for the classes: these are needed for displaying whitespace symbols on hovering.
Cacycle (
talk)
16:51, 20 July 2015 (UTC)I've been playing with this handy tool and testing it with large texts (300kb), with mostly great results.
There is, however, room for some improvements:
I've also noticed IE9 hogged the CPU after diff was complete, becoming mostly unresponsive, while up-to-date FF worked flawlessly.
Cheers, — Preceding unsigned comment added by 94.126.240.2 ( talk) 08:12, 10 July 2015 (UTC)
Hello! Please have a look at this diff, it clearly shows some room for improvements in wikEdDiff. If possible, it would be much better not to display changes as two text moves, and be closer to how the "traditional" diff displays those changes. Hope you'll find this report helpful. — Dsimic ( talk | contribs) 08:38, 25 July 2015 (UTC)
Hello! Would it be possible to configure wikEdDiff to display the diffs using a monospaced font? I already had a look at the JavaScript source code, and it seems like it should be configurable, but thought to ask here before spending a lot of time on trials and errors. Any help would be appreciated! — Dsimic ( talk | contribs) 18:10, 16 August 2015 (UTC)
window.wikEdConfig = {};
wikEd.config.diffCSS = {
'.wikEdDiffFragment': 'font-family: monospace,Courier;'
};
On all pages I visit on Wikipedia, I get the following in my Console: "Use of "wgServer" is deprecated. Use mw.config instead."
I'm guessing it's probably this script? Since it gets the wg variables directly, rather than through mw.config.get.
Any chance the script could be updated to use mw.config.get?
Thanks! Gary ( talk · scripts) 18:41, 22 August 2015 (UTC)
Hello, I have ported the great wikEdDiff library to Python: python-wikeddiff. Is it OK to use "wikEdDiff" as part of the port's name? Should I change anything else in the description or licensing?
I don't plan to do any further development on the diff engine, except for writing an ANSI color formatter. I will try to keep the port in sync with fixes to the JavaScript library and report back any issues relevant to the original code.
Are you also interested in simplifications of the data structures and algorithms to possibly make other ports more easy? For instance, there is no direct counterpart for null
in Python (and many other languages) and mixing true
, false
and null
for assumably boolean variables (e.g. the .fixed
property of groups) is probably not the greatest idea. I think that the only relevant place (the main loop in the insertMarks
method/function) can be fixed by considering also the .oldNumber
property in addition to .fixed
(see
[2]).
-- Lahwaacz ( talk) 10:09, 16 September 2015 (UTC)
Hello, sorry for asking such a common question, but.. How to change the colors? In the manual it is said to use CSS, but adding styles to my common.css does not help. Firebug says that styles are defined as inline, !important cant`t help neither. Adding some variables to the js is not clear, because wikEdDiffConfig.stylesheet is defined as a plain text and I don`t know how to customize it partly. Thanks for the answer. The-city-not-present ( talk) 20:00, 27 November 2015 (UTC)
Moreover, for using !important I get a warning, I shouldn`t do this? The-city-not-present ( talk) 20:04, 27 November 2015 (UTC)
Sorry for false representation, !important started to work, maybe I did some typo when first tried this. The-city-not-present ( talk) 20:06, 27 November 2015 (UTC)
MediaWiki:Gadget-wikEdDiff.js
of my own MediaWiki installationsel.collapseToEnd();
Uncaught InvalidStateError: Failed to execute 'collapseToEnd' on 'Selection': there is no selection.wikEd.DiffWrapperHandler @ load.php?debug=false&lang=en&modules=ext.gadget.DotsSyntaxHighlighter%2CwikEdDiff|ext.headertabs|jq…:49
$wgResourceLoaderDebug = true;
in my LocalSettings.php (?debug=true
as parameter does not work in version comparison)
-- Escalator~enwikibooks ( talk) 09:25, 14 January 2016 (UTC)
wikEdDiff is on the fritz. Go to any English Wikipedia talk page → click on New section link at top of page → click on the Changes or Show changes button at the bottom of the edit window → enable wikEdDiff → page appears to be blanked.
See Phabricator for screen shot. Cheers! {{u|
Checkingfax}} {
Talk}
14:22, 20 February 2016 (UTC)
@
Cacycle,
Edgars2007, and
Redrose64: {{u|
Checkingfax}} {
Talk}
14:27, 20 February 2016 (UTC)
{{u|
Checkingfax}} {
Talk}
22:56, 22 February 2016 (UTC)Hi
Cacycle. In
this diff on
Kazi Nazrul Islam, the single column improved wikEdDiff is showing (no difference) but the edit history showed a 48b change so I knew there should be a difference so I scrolled down to the 2-column standard Wikipedia diff view and sure enough there were lots of little changes. Cheers! {{u|
Checkingfax}} {
Talk}
03:24, 24 February 2016 (UTC)
Hi,
Cacycle. The wide diff
here shows me adding HTML escape codes for non-breaking spaces, which I did not add. You can see in the normal diff view, below the wide diff view, that I did not add them. Ping me back. Cheers! {{u|
Checkingfax}} {
Talk}
19:43, 15 April 2016 (UTC)
Is it possible to show diff after the line "(n intermediate revisions by k users not shown)"? Otherwise when the diff is large one can think that this is the difference made only by the last edit. Example: [3]. Alexei Kopylov ( talk) 17:49, 15 June 2016 (UTC)
When using the RevisionSlider and WikEdDiff together WikEdDiff will not function correctly when the RevisionSlider is used to load a new diff. This can be fixed by adding a simple hook listener to your copy.
You can find the relevant phabricator ticket here which contains the code that you will need to add to your copy of the script (in most cases). Please also use this ticket for further questions & discussion.
·addshore· talk to me! 11:35, 23 September 2016 (UTC)Here is a diff
[4] which merely converts HTML table syntax <th> </th> <tr> </tr> <td> </td>
into pipe synthax ! |- |
, leaving the table content intact. wikEdDiff parses it spectacularly well - except for several rows where the user added a trailing white space to cell contents, which wikEdDiff treats as a block move (see Church Organ, Funk Guitar, and Telephone). I played with the
wikEdDiff online tool to see if tweaking the parameters would help, but no luck. Is there a simple fix for this?--
Dmitry (
talk•
contibs)
22:14, 6 October 2016 (UTC)
It has been a while (maybe more than a month) that I'm having problems with wikEdDiff. The tool does not show most of the times, apparently at random. After reloading several times the diff page, eventually it would show up. I am using Google Chrome (last version) and I activated the tool from Preferences>Gadgets. It seems I have the same problem also on Firefox and Edge. It is a great tool and I am really missing it, so I would really like to fix this! Thanks for all the work!! -- Ita140188 ( talk) 17:11, 7 November 2016 (UTC)
I also have had this problem for some time (a month or three?). It used to be random, but lately it seems not to work at all. Since I'm stubbornly still using Internet Explorer 11 on Windows 10, I had assumed you'd simply stopped supporting it. -- Ørjan ( talk) 05:18, 26 November 2016 (UTC)
Any updates on this? I've noticed wikEdDiff working sporadically for the past few months now. Recently it stubbornly refuses to work on Wikipedia no matter what I do, though for some reason it works fine on Wikia (Strange cause I usually expect things to break on Wikia, given their history). — k6ka 🍁 ( Talk · Contributions) 20:24, 18 December 2016 (UTC)
Can wikEdDiff show differences on the rendered HTML (i.e. how the page appears in the article), as opposed to showing differences on the raw wikitext and HTML markup? John P New 22:14, 6 April 2017 (UTC) — Preceding unsigned comment added by John p new ( talk • contribs)
About a month ago, I switched from Firefox to Pale Moon, a fork of that project. Since then, wikEdDiff doesn't work—which I consider strange, because wikEd doesn't seem any different. None of the other Wikipedia preferences, gadgets, or scripts I have seem to have been impacted negatively by the change in browsers.
When I click on the button with the green triangle to show the improved diff, the text box opens with three dots in it. In Firefox that would last a second or so and the diff would appear in the text box. In Pale Moon, nothing happens except that the cursor spins if I hold it over the button with the green triangle. If I click on the button again, the text box closes and the cursor stops spinning.
I use Pale Moon 27.5.1 in Windows 7. I have a host of warnings in the Error Console, of which these are a few examples:
Warning: Error in parsing value for 'background-image'. Declaration dropped.
Warning: Expected 'none', URL, or filter function but found 'progid'. Error in parsing value for 'filter'. Declaration dropped.
Warning: Unknown property 'zoom'. Declaration dropped.
Warning: Expected ';' or '}' to terminate declaration but found '!'. Declaration dropped.
I've never looked at the Error Console before, so I don't know if I've had warnings in the past or if that's something new to Pale Moon.
Any suggestions would be appreciated. I can provide a list of my browser extensions if that would be helpful. Thank you. — Malik Shabazz Talk/ Stalk 05:56, 3 November 2017 (UTC)
Inside the diff function the is a little mistake at line 944:
if ( newString.substr( -1 ) === '\n' && oldString.substr( -1 === '\n' ) ) {
And here the correction:
if ( newString.substr( -1 ) === '\n' && oldString.substr( -1 ) === '\n' ) {
I like this so much!
It might be helpful to
Hello. There is a new bug in the tool, and I'll be glad if you could fix it. Reproduction steps:
Thank you, IKhitron ( talk) 16:40, 9 July 2019 (UTC)
Same behavior in the "standard" part of the diff, but only if this gadget is enabled. The problem doesn't affect me—I don't double-click anything to select it—but I just wanted to note this as it might help with diagnosis. ― Mandruss ☎ 16:53, 9 July 2019 (UTC)
This is one of the most used gadgets and I've found new users find it much more intuitive than the standard paragraph-by-paragraph viewer (especially for small changes). Is there the possibility for it to be activated by default? T.Shafee(Evo&Evo) talk 05:34, 11 July 2019 (UTC)
Maybe it's just me, but I don't see the green triangle anymore. No errors in the console. Opencooper ( talk) 18:50, 27 August 2021 (UTC)
If there is a remote version of the page inside the diff, the difference is shown incorrectly: example. Kalendar ( talk) 11:02, 15 December 2021 (UTC)
Error in example:
diff:
{{{!}} style="background:transparent" → {{(!}} style="background:transparent"
en:User:Cacycle/wikEdDiff:
{
{{(!}} style="background:transparent"
-- Kalendar ( talk) 11:37, 15 December 2021 (UTC)
![]() | This
edit request to
User:Cacycle/diff.js has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Change this block to support dark mode better:
'.wikEdDiffFragment {' +
'white-space: pre-wrap; background: #fff; border: #bbb solid; ' +
to the following:
'.wikEdDiffFragment {' +
'white-space: pre-wrap; background-color: var(--background-color-base, #fff); border: #bbb solid; ' +
Side by side:
− | 'white-space: pre-wrap; background | + | 'white-space: pre-wrap; background-color: var(--background-color-base, #fff); border: #bbb solid; ' + |
There may be other adjustments needed or desirable, but this is the bare minimum. Izno ( talk) 01:59, 13 July 2024 (UTC)