Release version 2.0.7

This commit is contained in:
Rodrigo Fernandes 2016-10-08 16:55:55 +01:00
parent 7d02e67f3b
commit 1e22a3ec8f
6 changed files with 20 additions and 7 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "diff2html", "name": "diff2html",
"version": "2.0.6", "version": "2.0.7",
"homepage": "https://diff2html.xyz", "homepage": "https://diff2html.xyz",
"description": "Fast Diff to colorized HTML", "description": "Fast Diff to colorized HTML",
"keywords": [ "keywords": [

View file

@ -33,10 +33,11 @@
Diff2HtmlUI.prototype.draw = function(targetId, config) { Diff2HtmlUI.prototype.draw = function(targetId, config) {
var cfg = config || {}; var cfg = config || {};
cfg.inputFormat = 'json';
var $target = this._getTarget(targetId); var $target = this._getTarget(targetId);
$target.html(Diff2Html.getPrettyHtml(diffJson, cfg)); $target.html(Diff2Html.getPrettyHtml(diffJson, cfg));
synchronisedScroll($target, config); synchronisedScroll($target, cfg);
}; };
function synchronisedScroll($target, config) { function synchronisedScroll($target, config) {

File diff suppressed because one or more lines are too long

13
dist/diff2html.js vendored
View file

@ -2572,6 +2572,8 @@ process.umask = function() { return 0; };
var dissimilarityIndex = /^dissimilarity index (\d+)%/; var dissimilarityIndex = /^dissimilarity index (\d+)%/;
var index = /^index ([0-9a-z]+)\.\.([0-9a-z]+)\s*(\d{6})?/; var index = /^index ([0-9a-z]+)\.\.([0-9a-z]+)\s*(\d{6})?/;
var binaryFiles = /^Binary files (.*) and (.*) differ/;
/* Combined Diff */ /* Combined Diff */
var combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)\.\.([0-9a-z]+)/; var combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)\.\.([0-9a-z]+)/;
var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/;
@ -2701,6 +2703,10 @@ process.umask = function() { return 0; };
currentFile.newName = values[1]; currentFile.newName = values[1];
} }
currentFile.isRename = true; currentFile.isRename = true;
} else if ((values = binaryFiles.exec(line))) {
currentFile.isBinary = true;
currentFile.oldName = _getFilename(null, values[1], [config.srcPrefix]);
currentFile.newName = _getFilename(null, values[2], [config.dstPrefix]);
} else if ((values = similarityIndex.exec(line))) { } else if ((values = similarityIndex.exec(line))) {
currentFile.unchangedPercentage = values[1]; currentFile.unchangedPercentage = values[1];
} else if ((values = dissimilarityIndex.exec(line))) { } else if ((values = dissimilarityIndex.exec(line))) {
@ -2760,7 +2766,12 @@ process.umask = function() { return 0; };
} }
function _getFilename(linePrefix, line, prefixes) { function _getFilename(linePrefix, line, prefixes) {
var FilenameRegExp = new RegExp('^' + linePrefix + ' "?(.+?)"?$'); var FilenameRegExp;
if (linePrefix) {
FilenameRegExp = new RegExp('^' + linePrefix + ' "?(.+?)"?$');
} else {
FilenameRegExp = new RegExp('^"?(.+?)"?$');
}
var filename; var filename;
var values = FilenameRegExp.exec(line); var values = FilenameRegExp.exec(line);

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "diff2html", "name": "diff2html",
"version": "2.0.6", "version": "2.0.7",
"homepage": "https://diff2html.xyz", "homepage": "https://diff2html.xyz",
"description": "Fast Diff to colorized HTML", "description": "Fast Diff to colorized HTML",
"keywords": [ "keywords": [