Content deleted Content added
1.0.12 (September 10, 2014) skin/sky/cloud colored theme, new inline chunk split, new custom split, IE8 compatibility mouse/click handler, fix bubbling, fix ShortenOutput (paragraphs, headings) |
1.0.12 (September 10, 2014) fix linked flag |
||
Line 3:
// ==UserScript==
// @name wDiff
// @version 1.0.
// @date September 10, 2014
// @description improved word-based diff library with block move detection
Line 61:
.diff: diff html
symbols
.token[]: associative array (hash) of parsed tokens for passes 1 - 3, points to symbol[i] .symbol[]:
.linked: flag: at least one unique token pair has been linked
blocks[]: array of objects that holds block (consecutive text tokens) data in order of the new text
Line 486 ⟶ 489:
// new symbols object
var symbols = {
token: [],
hash: {},
};
Line 1,023 ⟶ 1,027:
if (oldEnd === undefined) { oldEnd = text.oldText.last; }
if (recursionLevel === undefined) { recursionLevel = 0; }
▲ var linked = false;
// limit recursion depth
Line 1,124 ⟶ 1,127:
text.newText.tokens[newToken].link = oldToken;
text.oldText.tokens[oldToken].link = newToken;
symbols.linked = true;
if ( (level != 'character') && (recursionLevel === 0) ) {
text.newText.tokens[newToken].unique = true;
Line 1,139 ⟶ 1,142:
// cycle trough new text tokens list
if (symbols.linked === true) {
var i = text.newText.first;
while ( (i !== null) && (text.newText.tokens[i] !== null) ) {
Line 1,251 ⟶ 1,254:
// new symbols object for sub-region
var symbolsRecurse = {
token: [],
hash: {},
linked: false
};
wDiff.CalculateDiff(text, symbolsRecurse, level, true, iStart, iEnd, jStart, jEnd, recursionLevel + 1);
Line 1,320 ⟶ 1,324:
// new symbols object for sub-region
var symbolsRecurse = {
token: [],
hash: {},
linked: false
};
wDiff.CalculateDiff(text, symbolsRecurse, level, true, iStart, iEnd, jStart, jEnd, recursionLevel + 1);
|