Skip to content

Commit

Permalink
Merge pull request #29 from rtfpessoa/release-1.1.2
Browse files Browse the repository at this point in the history
prepare release 1.1.2
  • Loading branch information
Rodrigo Fernandes committed Oct 28, 2015
2 parents d88ff36 + 2acee77 commit 63a004f
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 34 deletions.
8 changes: 8 additions & 0 deletions dist/diff2html.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
}

.d2h-lines-added {
text-align: right;
}

.d2h-lines-added > * {
background-color: #ceffce;
border: 1px solid #b4e2b4;
color: #399839;
Expand All @@ -42,6 +46,10 @@
}

.d2h-lines-deleted {
text-align: left;
}

.d2h-lines-deleted > * {
background-color: #f7c8c8;
border: 1px solid #e9aeae;
color: #c33;
Expand Down
65 changes: 34 additions & 31 deletions dist/diff2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,29 @@
};

var diffLines = diffInput.split('\n');

/* Diff */
var oldMode = /^old mode (\d{6})/;
var newMode = /^new mode (\d{6})/;
var deletedFileMode = /^deleted file mode (\d{6})/;
var newFileMode = /^new file mode (\d{6})/;

var copyFrom = /^copy from (.+)/;
var copyTo = /^copy to (.+)/;

var renameFrom = /^rename from (.+)/;
var renameTo = /^rename to (.+)/;

var similarityIndex = /^similarity index (\d+)%/;
var dissimilarityIndex = /^dissimilarity index (\d+)%/;
var index = /^index ([0-9a-z]+)..([0-9a-z]+) (\d{6})?/;

/* Combined Diff */
var combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)..([0-9a-z]+)/;
var combinedMode = /^mode (\d{6}),(\d{6})..(\d{6})/;
var combinedNewFile = /^new file mode (\d{6})/;
var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/;

diffLines.forEach(function(line) {
// Unmerged paths, and possibly other non-diffable files
// https://github.com/scottgonzalez/pretty-diff/issues/11
Expand All @@ -290,28 +313,6 @@
return;
}

/* Diff */
var oldMode = /^old mode (\d{6})/;
var newMode = /^new mode (\d{6})/;
var deletedFileMode = /^deleted file mode (\d{6})/;
var newFileMode = /^new file mode (\d{6})/;

var copyFrom = /^copy from (.+)/;
var copyTo = /^copy to (.+)/;

var renameFrom = /^rename from (.+)/;
var renameTo = /^rename to (.+)/;

var similarityIndex = /^similarity index (\d+)%/;
var dissimilarityIndex = /^dissimilarity index (\d+)%/;
var index = /^index ([0-9a-z]+)..([0-9a-z]+) (\d{6})?/;

/* Combined Diff */
var combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)..([0-9a-z]+)/;
var combinedMode = /^mode (\d{6}),(\d{6})..(\d{6})/;
var combinedNewFile = /^new file mode (\d{6})/;
var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/;

var values = [];
if (utils.startsWith(line, 'diff')) {
startFile();
Expand Down Expand Up @@ -465,19 +466,21 @@
' <a id="' + hideId + '" class="d2h-hide" href="#' + hideId + '">+</a>\n' +
' <a id="' + showId + 'd2h-show" class="d2h-show" href="#' + showId + '">-</a>\n' +
' <div class="d2h-clear"></div>\n' +
' <div class="d2h-file-list">\n' +
' <table class="d2h-file-list">\n' +


diffFiles.map(function (file) {
return ' <div class="d2h-file-list-line">\n' +
' <div class="d2h-file-stats">\n' +
' <span class="d2h-lines-added">+' + file.addedLines + '</span>\n' +
' <span class="d2h-lines-deleted">-' + file.deletedLines + '</span>\n' +
' </div>\n' +
' <div class="d2h-file-name"><a href="#' + printerUtils.getHtmlId(file) + '">&nbsp;' + printerUtils.getDiffName(file) + '</a></div>\n' +
' </div>\n'
return ' <tr class="d2h-file-list-line">\n' +
' <td class="d2h-lines-added">\n' +
' <span>+' + file.addedLines + '</span>\n' +
' </td>\n' +
' <td class="d2h-lines-deleted">\n' +
' <span>-' + file.deletedLines + '</span>\n' +
' </td>\n' +
' <td class="d2h-file-name"><a href="#' + printerUtils.getHtmlId(file) + '">&nbsp;' + printerUtils.getDiffName(file) + '</a></td>\n' +
' </tr>\n'
}).join('\n') +
'</div></div>\n';
'</table></div>\n';
};

module.exports['FileListPrinter'] = new FileListPrinter();
Expand Down
2 changes: 1 addition & 1 deletion dist/diff2html.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/diff2html.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "diff2html",
"version": "1.1.1",
"version": "1.1.2",
"homepage": "http://rtfpessoa.github.io/diff2html/",
"description": "Fast Diff to colorized HTML",
"keywords": [
Expand Down

0 comments on commit 63a004f

Please sign in to comment.