1
vote
1answer
79 views
+50
How to show diff of two html tables using javascript?
I have a set of tabular data that has changed. Now i have both the data rendered side by side in two html tables. Now I want to highlight the columns that have changed just like in svn file diff.
I ...
0
votes
1answer
25 views
How to pass parameters to local Prettydiff.com
I've downloaded a copy of PrettyDiff to embed in my own local application, so I can compare two AJAX loaded files that are in two variables.
Unfortunately, I can't seem to make prettydiff work. ...
3
votes
1answer
122 views
Diff() between two collections in MongoDB
I have done research. I apologize if this is a duplicate question, but the solutions in other questions were not really my fit, and thus, I made a new question.
What is the best way with Javascript ...
3
votes
4answers
1k views
How can I get a list of the differences between two JavaScript object graphs?
I want to be able to get a list of all differences between two JavaScript object graphs, with the property names and values where the deltas occur.
For what it is worth, these objects are usually ...
0
votes
1answer
106 views
Applying a .patch file? (patch for a jquery-ui file)
I found a .patch file that would fix an issue I have with jQuery-ui.
However, after googling for a long, long time, I can't find any good answer to this.
(I haven't dealt with .patch files before).
...
18
votes
5answers
5k views
JavaScript based diff utility
I'm looking for a diff equivalent written in JavaScript that only returns/prints relevant lines. I don't want both full text displayed next to each other with the differences highlighted, but just ...
11
votes
4answers
1k views
Does nodejs have a working diff library or algorithm?
I'm looking for a javascript diff algorithm implementation or library, which has been tested on and works with arbitrary utf8 text files.
All of the ones I found so far (say for example, ...
-1
votes
1answer
32 views
How to implement diff for tree of strings?
How to implement a function that interprets the difference between 2 trees of strings? For example:
diff(["aaa","bbb",["ccc","ddd"],"eee"],
["aaa","bbx",["ccc","ddd"]]);
This function should ...
1
vote
1answer
29 views
Way to compare DOM/all properties before and after an event?
I am having an issue where when I repeat a 3dtransform multiple times it starts to degrade performance in strange ways.
What I want to know is -- is there some way to dump the entirety of the pages ...
4
votes
1answer
126 views
Calculate a diff patch of an array in JavaScript
I want to generate an object that will effectively be able to be applied as a patch to array A in order to produce array B.
Given a function isSame which compares two values and returns true if ...
0
votes
2answers
80 views
Javascript Line by line diff
I have this javascript code from the user Harmen.
It's amazing how such a short code makes so god job.
http://jsfiddle.net/pfYtu/
I tried to edit it to make a line by line comparison, but the code ...
6
votes
5answers
2k views
Looking for a javascript visual diff lib
i'm looking for a javascript library or a jquery plugin which makes a diff of 2 textareas (or simply 2 strings) and displays the difference side by side.
any ideas?
thx,
Peter
2
votes
1answer
225 views
Google-diff-match avoid showing new lines?
I am using diff-match http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html
To show differences between 2 pieces of html. The problem is that the script shows new line as ΒΆ
...
1
vote
0answers
61 views
dynamic DOM diff modification from ajax and liquid
I've written an implementation of Liquid that can be used dynamically within HTML, and is parsed by JavaScript. In turn, I'm using AJAX to provide a data source. This looks something like this:
...
0
votes
1answer
267 views
Looking for a JavaScript XML diff tool
The task I'm facing right now is the following: I have two XML files, which may slightly differ in structure and contents. Both XMLs are validated by the same XSD. I need to create another XML file ...
0
votes
1answer
457 views
JSON diff of large JSON data, finding some JSON as a subset of another JSON
I have a problem I'd like to solve to not have to spend a lot of manual work to analyze as an alternative.
I have 2 JSON objects (returned from different web service API or HTTP responses). There is ...
38
votes
12answers
9k views
Anyone have a diff algorithm for rendered HTML?
I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the rendered ...
1
vote
0answers
115 views
Adding an asynchronous call to google diff match patch, a synchonously built library
I'm trying to adjust the diff match patch google javascript library to make one of its calls asynchronous. The problem is that the entire library is built synchronously so that closures return objects ...
3
votes
2answers
871 views
Compare two XML files with same structure and find differences
I have two XML files. The structure of both XML files is as below:
<file1>
<table>
<name>...</name>
<columns>
...
0
votes
2answers
93 views
How to find elements in array2 that are not in array1?
I have two arrays:
var a1 = [ { ID: 2, N:0 }, { ID: 1, N:0 } ];
var a2 = [ { ID: 1, N:0 }, { ID: 2, N:0 }, { ID: 3, N:0 } ];
I need to get all elements that are on a2 but not in a1. An element here ...
6
votes
1answer
388 views
Generating a diff of two DOM elements (rather than two strings) in javascript
This works really well for strings: http://ejohn.org/projects/javascript-diff-algorithm/
And I used to do string diffing server side (in ruby), but It's really hard to also take into consideration ...
11
votes
7answers
3k views
How to push diffs of data (possibly JSON) to a server?
I am going to be periodically pushing a set of text-based data from a web-page to a server, probably as JSON.
For every push, none, some or all of the data may have changed. To reduce the amount of ...
4
votes
2answers
2k views
Highlight text diff on client?
I want to compare 2 text values on a web page and highlight the differences. Can I do this client-side, preferably with jQuery or Prototype?
3
votes
3answers
1k views
Tool for comparing minimized Javascript files
I need to compare two minimized Javascript files. Most common diff viewers list differences per line, but this isn't useful when the script is compressed to a few lines.
Are there any good tools for ...
2
votes
1answer
1k views
Getting a diff of two json-objects
Scenario: I want a function that compares two JSON-objects, and returns a JSON-object with a list of the differences and if possible more data such as coverage metrics.
var madrid = ...
1
vote
1answer
212 views
Merge two texts in javascript
What's the best way to merge two texts in javascript, without any need for user interaction in conflicts, it should be completely silent. Is there a way to do this?
8
votes
1answer
479 views
Diff between two HTML chunks: structural instead of lines/chars?
I'm looking for a JavaScript diff engine that will return the difference in the structure of two chunks of HTML. That is, instead of, "at this line, at such and such character, something happened", ...
4
votes
3answers
1k views
An efficient way to get the difference between two arrays of objects?
I have two arrays of objects:
var a = [ {'id': 20}, {'id': 15}, {'id': 10}, {'id': 17}, {'id': 23} ];
var b = [ {'id': 90}, {'id': 15}, {'id': 17}, {'id': 23} ];
I'd like to ...
6
votes
2answers
157 views
Use JavaScript to grade user response (compare two arrays)
I am working on a script to grade a user response by comparing two arrays. (It is a quiz to see how well they know information word-for-word.) I already have some of the code that I need, like making ...
4
votes
1answer
564 views
Are there any javascript libs for creating a nice structured (tree) diff for HTML?
I'm trying to come up with a solution to power a "history view" mechanism that we are using throughout a site. For the UI of this history view I'd like to show the user what changes occurred between ...
1
vote
4answers
215 views
javascript, diff function returning same string
i was wondering if somebody could help me on my diff function. its supposed to find the diff between 2 inputs. the function takes in 2 arrays so if array 1 has.. "word1", "word2" and array 2 has ...
3
votes
4answers
2k views
Is there a JS diff library against htmlstring just like google-diff-match-patch on plain text?
Currently I am using google-diff-match-patch to implement a real-time editing tool, which can synchronize texts between multiple users. Everything works great when operations are only plain texts, ...
1
vote
0answers
539 views
JavaScript : Identifying what was changed between two strings
Ok this is my problem: I want produce a rich text editor when a user can make changes to a large block of text. I then want to be able to identify not only what parts of the document were changed, but ...
2
votes
2answers
291 views
Highlight edits made to a text by the user in Javascript
I'm trying to create an editable text field in a page which highlights the edits made by the user to the text as it is being edited. For instance, text inserted or changed by the user should appear ...
2
votes
2answers
141 views
Javascript/Node.js: data patching scheme
I'm writing a little app in node. I have posts that I want wiki-like revisions for. I'm also saving the post very frequently as they're being edited, so I do not want to save full revisions on each ...
4
votes
4answers
540 views
Algorithm: optimal way to rearrange a list from one order to another?
EDIT: I'm not sure that my original question is clear enough. I need an algorithm that will compute the minimal sequence of moves to rearrange an array from one order to another. It is known that ...
3
votes
2answers
1k views
Using a diff on a document containing HTML
I'm in the brainstorming process for a system that will be used to write and edit documents (think Google Docs, but without realtime collaboration). I will be using a WYSIWYG editor, so the documents ...
1
vote
1answer
239 views
compare 4 or more files
Is there a command line utility or a php/py script that will generate a html diff so that multiple files can be compared in order to compare 4 or more files.
Each of my files have max of 10k lines ...
1
vote
1answer
102 views
Highlight/Format textareas
I'm looking to implement a live diff inside a webpage that preserves whitespace.
I've done something similar in the past using a combination of TinyMCE and JQuery in IE6 (required for that project) ...
0
votes
3answers
2k views
Need a Java and Javascript diff tool written in Java
We need an accurate diff utility for Java and Javascript files, written in Java. It should be invokable from within an Eclipse (version 3.2 or 3.3) application. Preferably we need the Java source code ...
0
votes
1answer
209 views
Javascript Textarea Monitoring / Ruby Delta Calculation
I am working on a system which needs to keep constant (and I mean constant) track of browser side changes to a textarea via AJAX requests to the server. Ideally, every character would be stored as a ...
4
votes
2answers
621 views
WYSIWYG rich text editor that supports diffs?
My web application is similar to StackOverflow in that different users frequently edit the same blob of text.
Currently we only support plain text, and therefore it's easy to show users how the text ...
0
votes
2answers
772 views
Javascipt library for syntax highlighting for code, then diffs, in HTML, at the line level?
Anyone know of a JS library that will allow me to syntax highlight a code block, then highlight line-level diffs? For example, in a subversion diff, I'd like to highlight the characters on the line ...
1
vote
3answers
1k views
What is a javascript hash table implementation that avoids object namespace collisions?
First off: I'm using a rather obscure implementation of javascript embedded as a scripting engine for Adobe InDesign CS3. This implementation sometimes diverges from "standard" javascript, hence my ...