Release version 2.0.0-rc.5
This commit is contained in:
parent
0e5c6cd892
commit
dbd8766966
6 changed files with 240 additions and 152 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "diff2html",
|
"name": "diff2html",
|
||||||
"version": "2.0.0-rc.4",
|
"version": "2.0.0-rc.5",
|
||||||
"homepage": "http://rtfpessoa.github.io/diff2html/",
|
"homepage": "http://rtfpessoa.github.io/diff2html/",
|
||||||
"description": "Fast Diff to colorized HTML",
|
"description": "Fast Diff to colorized HTML",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
||||||
97
dist/diff2html.css
vendored
97
dist/diff2html.css
vendored
|
|
@ -16,39 +16,37 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-file-stats {
|
.d2h-file-stats {
|
||||||
display: inline;
|
display: flex;
|
||||||
text-align: center;
|
margin-left: auto;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-lines-added {
|
.d2h-lines-added {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
|
||||||
|
|
||||||
.d2h-lines-added > * {
|
|
||||||
background-color: #ceffce;
|
|
||||||
border: 1px solid #b4e2b4;
|
border: 1px solid #b4e2b4;
|
||||||
color: #399839;
|
|
||||||
border-radius: 5px 0 0 5px;
|
border-radius: 5px 0 0 5px;
|
||||||
|
color: #399839;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-lines-deleted {
|
.d2h-lines-deleted {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
|
||||||
|
|
||||||
.d2h-lines-deleted > * {
|
|
||||||
background-color: #f7c8c8;
|
|
||||||
border: 1px solid #e9aeae;
|
border: 1px solid #e9aeae;
|
||||||
color: #c33;
|
|
||||||
border-radius: 0 5px 5px 0;
|
border-radius: 0 5px 5px 0;
|
||||||
|
color: #c33;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-left: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-file-name-wrapper {
|
.d2h-file-name-wrapper {
|
||||||
display: inline-flex;
|
display: flex;
|
||||||
width: 90%;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
line-height: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-file-name {
|
.d2h-file-name {
|
||||||
|
|
@ -102,16 +100,11 @@
|
||||||
|
|
||||||
.d2h-code-side-line {
|
.d2h-code-side-line {
|
||||||
display: block;
|
display: block;
|
||||||
white-space: pre;
|
white-space: nowrap;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
margin-left: 50px;
|
margin-left: 50px;
|
||||||
/* Override HighlightJS */
|
|
||||||
/*color: inherit;*/
|
|
||||||
/*overflow-x: inherit;*/
|
|
||||||
/*background: none;*/
|
|
||||||
/* ******************** */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-code-line del,
|
.d2h-code-line del,
|
||||||
|
|
@ -249,6 +242,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-file-list-line {
|
.d2h-file-list-line {
|
||||||
|
display: flex;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,6 +252,19 @@
|
||||||
|
|
||||||
.d2h-file-list {
|
.d2h-file-list {
|
||||||
display: block;
|
display: block;
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-file-list > li {
|
||||||
|
border-bottom: #ddd solid 1px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-file-list > li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.d2h-file-switch {
|
.d2h-file-switch {
|
||||||
|
|
@ -266,6 +273,56 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.d2h-icon-wrapper {
|
||||||
|
line-height: 31px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-icon {
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-right: 10px;
|
||||||
|
fill: currentColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-deleted {
|
||||||
|
color: #c33;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-added {
|
||||||
|
color: #399839;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-changed {
|
||||||
|
color: #d0b44c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-moved {
|
||||||
|
color: #3572b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-tag {
|
||||||
|
display: flex;
|
||||||
|
font-size: 10px;
|
||||||
|
margin-left: 5px;
|
||||||
|
padding: 0 2px;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-deleted-tag {
|
||||||
|
border: #c33 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-added-tag {
|
||||||
|
border: #399839 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-changed-tag {
|
||||||
|
border: #d0b44c 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-moved-tag {
|
||||||
|
border: #3572b0 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Selection util.
|
* Selection util.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
284
dist/diff2html.js
vendored
284
dist/diff2html.js
vendored
|
|
@ -2773,41 +2773,41 @@ process.umask = function() { return 0; };
|
||||||
|
|
||||||
var printerUtils = require('./printer-utils.js').PrinterUtils;
|
var printerUtils = require('./printer-utils.js').PrinterUtils;
|
||||||
|
|
||||||
|
var hoganUtils = require('./hoganjs-utils.js').HoganJsUtils;
|
||||||
|
var baseTemplatesPath = 'file-summary';
|
||||||
|
var iconsBaseTemplatesPath = 'icon';
|
||||||
|
|
||||||
function FileListPrinter() {
|
function FileListPrinter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
FileListPrinter.prototype.generateFileList = function(diffFiles) {
|
FileListPrinter.prototype.generateFileList = function(diffFiles) {
|
||||||
return '<div class="d2h-file-list-wrapper">\n' +
|
var lineTemplate = hoganUtils.template(baseTemplatesPath, 'line');
|
||||||
' <div class="d2h-file-list-header">\n' +
|
|
||||||
' <span class="d2h-file-list-title">Files changed (' + diffFiles.length + ')  </span>\n' +
|
|
||||||
' <a class="d2h-file-switch d2h-hide">hide</a>\n' +
|
|
||||||
' <a class="d2h-file-switch d2h-show">show</a>\n' +
|
|
||||||
' </div>\n' +
|
|
||||||
' <table class="d2h-file-list">\n' +
|
|
||||||
|
|
||||||
diffFiles.map(function(file) {
|
var files = diffFiles.map(function(file) {
|
||||||
return ' <tr class="d2h-file-list-line">\n' +
|
var fileTypeName = printerUtils.getFileTypeIcon(file);
|
||||||
' <td class="d2h-lines-added">\n' +
|
var iconTemplate = hoganUtils.template(iconsBaseTemplatesPath, fileTypeName);
|
||||||
' <span>+' + file.addedLines + '</span>\n' +
|
|
||||||
' </td>\n' +
|
return lineTemplate.render({
|
||||||
' <td class="d2h-lines-deleted">\n' +
|
fileHtmlId: printerUtils.getHtmlId(file),
|
||||||
' <span>-' + file.deletedLines + '</span>\n' +
|
fileName: printerUtils.getDiffName(file),
|
||||||
' </td>\n' +
|
deletedLines: '-' + file.deletedLines,
|
||||||
' <td class="d2h-file-name-wrapper">\n' +
|
addedLines: '+' + file.addedLines
|
||||||
' <a href="#' + printerUtils.getHtmlId(file) + '" class="d2h-file-name">' +
|
}, {
|
||||||
' ' + printerUtils.getDiffName(file) +
|
fileIcon: iconTemplate
|
||||||
' </a>\n' +
|
});
|
||||||
' </td>\n' +
|
}).join('\n');
|
||||||
' </tr>\n';
|
|
||||||
}).join('\n') +
|
return hoganUtils.render(baseTemplatesPath, 'wrapper', {
|
||||||
'</table></div>\n';
|
filesNumber: diffFiles.length,
|
||||||
|
files: files
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.FileListPrinter = new FileListPrinter();
|
module.exports.FileListPrinter = new FileListPrinter();
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
},{"./printer-utils.js":28}],25:[function(require,module,exports){
|
},{"./hoganjs-utils.js":25,"./printer-utils.js":28}],25:[function(require,module,exports){
|
||||||
(function (__dirname){
|
(function (__dirname){
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
@ -2831,10 +2831,7 @@ process.umask = function() { return 0; };
|
||||||
}
|
}
|
||||||
|
|
||||||
HoganJsUtils.prototype.render = function(namespace, view, params, configuration) {
|
HoganJsUtils.prototype.render = function(namespace, view, params, configuration) {
|
||||||
var config = configuration || {};
|
var template = this.template(namespace, view, configuration);
|
||||||
var templateKey = this._templateKey(namespace, view);
|
|
||||||
|
|
||||||
var template = this._getTemplate(templateKey, config);
|
|
||||||
if (template) {
|
if (template) {
|
||||||
return template.render(params);
|
return template.render(params);
|
||||||
}
|
}
|
||||||
|
|
@ -2842,6 +2839,13 @@ process.umask = function() { return 0; };
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
HoganJsUtils.prototype.template = function(namespace, view, configuration) {
|
||||||
|
var config = configuration || {};
|
||||||
|
var templateKey = this._templateKey(namespace, view);
|
||||||
|
|
||||||
|
return this._getTemplate(templateKey, config);
|
||||||
|
};
|
||||||
|
|
||||||
HoganJsUtils.prototype._getTemplate = function(templateKey, config) {
|
HoganJsUtils.prototype._getTemplate = function(templateKey, config) {
|
||||||
var template;
|
var template;
|
||||||
|
|
||||||
|
|
@ -2932,23 +2936,36 @@ process.umask = function() { return 0; };
|
||||||
var Rematch = require('./rematch.js').Rematch;
|
var Rematch = require('./rematch.js').Rematch;
|
||||||
|
|
||||||
var hoganUtils = require('./hoganjs-utils.js').HoganJsUtils;
|
var hoganUtils = require('./hoganjs-utils.js').HoganJsUtils;
|
||||||
|
var genericTemplatesPath = 'generic';
|
||||||
var baseTemplatesPath = 'line-by-line';
|
var baseTemplatesPath = 'line-by-line';
|
||||||
|
var iconsBaseTemplatesPath = 'icon';
|
||||||
|
var tagsBaseTemplatesPath = 'tag';
|
||||||
|
|
||||||
function LineByLinePrinter(config) {
|
function LineByLinePrinter(config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
LineByLinePrinter.prototype.makeFileDiffHtml = function(file, diffs) {
|
LineByLinePrinter.prototype.makeFileDiffHtml = function(file, diffs) {
|
||||||
return hoganUtils.render(baseTemplatesPath, 'file-diff', {
|
var fileDiffTemplate = hoganUtils.template(baseTemplatesPath, 'file-diff');
|
||||||
|
var filePathTemplate = hoganUtils.template(genericTemplatesPath, 'file-path');
|
||||||
|
var fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, 'file');
|
||||||
|
var fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file));
|
||||||
|
|
||||||
|
return fileDiffTemplate.render({
|
||||||
file: file,
|
file: file,
|
||||||
fileDiffName: printerUtils.getDiffName(file),
|
|
||||||
fileHtmlId: printerUtils.getHtmlId(file),
|
fileHtmlId: printerUtils.getHtmlId(file),
|
||||||
diffs: diffs
|
diffs: diffs,
|
||||||
|
filePath: filePathTemplate.render({
|
||||||
|
fileDiffName: printerUtils.getDiffName(file)
|
||||||
|
}, {
|
||||||
|
fileIcon: fileIconTemplate,
|
||||||
|
fileTag: fileTagTemplate
|
||||||
|
})
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
LineByLinePrinter.prototype.makeLineByLineHtmlWrapper = function(content) {
|
LineByLinePrinter.prototype.makeLineByLineHtmlWrapper = function(content) {
|
||||||
return hoganUtils.render(baseTemplatesPath, 'wrapper', {'content': content});
|
return hoganUtils.render(genericTemplatesPath, 'wrapper', {'content': content});
|
||||||
};
|
};
|
||||||
|
|
||||||
LineByLinePrinter.prototype.generateLineByLineJsonHtml = function(diffFiles) {
|
LineByLinePrinter.prototype.generateLineByLineJsonHtml = function(diffFiles) {
|
||||||
|
|
@ -2974,9 +2991,11 @@ process.umask = function() { return 0; };
|
||||||
});
|
});
|
||||||
|
|
||||||
LineByLinePrinter.prototype.makeColumnLineNumberHtml = function(block) {
|
LineByLinePrinter.prototype.makeColumnLineNumberHtml = function(block) {
|
||||||
return hoganUtils.render(baseTemplatesPath, 'column-line-number', {
|
return hoganUtils.render(genericTemplatesPath, 'column-line-number', {
|
||||||
diffParser: diffParser,
|
diffParser: diffParser,
|
||||||
block: utils.escape(block.header)
|
blockHeader: block.header,
|
||||||
|
lineClass: 'd2h-code-linenumber',
|
||||||
|
contentClass: 'd2h-code-line'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -3089,18 +3108,25 @@ process.umask = function() { return 0; };
|
||||||
};
|
};
|
||||||
|
|
||||||
LineByLinePrinter.prototype.makeLineHtml = function(type, oldNumber, newNumber, content, prefix) {
|
LineByLinePrinter.prototype.makeLineHtml = function(type, oldNumber, newNumber, content, prefix) {
|
||||||
return hoganUtils.render(baseTemplatesPath, 'line',
|
var lineNumberTemplate = hoganUtils.render(baseTemplatesPath, 'numbers', {
|
||||||
|
oldNumber: utils.valueOrEmpty(oldNumber),
|
||||||
|
newNumber: utils.valueOrEmpty(newNumber)
|
||||||
|
});
|
||||||
|
|
||||||
|
return hoganUtils.render(genericTemplatesPath, 'line',
|
||||||
{
|
{
|
||||||
type: type,
|
type: type,
|
||||||
oldNumber: utils.valueOrEmpty(oldNumber),
|
lineClass: 'd2h-code-linenumber',
|
||||||
newNumber: utils.valueOrEmpty(newNumber),
|
contentClass: 'd2h-code-line',
|
||||||
prefix: prefix && utils.convertWhiteSpaceToNonBreakingSpace(prefix),
|
prefix: prefix && utils.convertWhiteSpaceToNonBreakingSpace(prefix),
|
||||||
content: content && utils.convertWhiteSpaceToNonBreakingSpace(content)
|
content: content && utils.convertWhiteSpaceToNonBreakingSpace(content),
|
||||||
|
lineNumber: lineNumberTemplate
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
LineByLinePrinter.prototype._generateEmptyDiff = function() {
|
LineByLinePrinter.prototype._generateEmptyDiff = function() {
|
||||||
return hoganUtils.render(baseTemplatesPath, 'empty-diff', {
|
return hoganUtils.render(genericTemplatesPath, 'empty-diff', {
|
||||||
|
contentClass: 'd2h-code-line',
|
||||||
diffParser: diffParser
|
diffParser: diffParser
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -3207,6 +3233,25 @@ process.umask = function() { return 0; };
|
||||||
return 'unknown/file/path';
|
return 'unknown/file/path';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PrinterUtils.prototype.getFileTypeIcon = function(file) {
|
||||||
|
var templateName = 'file-changed';
|
||||||
|
|
||||||
|
if (file.isRename) {
|
||||||
|
templateName = 'file-renamed';
|
||||||
|
} else if (file.isCopy) {
|
||||||
|
templateName = 'file-renamed';
|
||||||
|
} else if (file.isNew) {
|
||||||
|
templateName = 'file-added';
|
||||||
|
} else if (file.isDeleted) {
|
||||||
|
templateName = 'file-deleted';
|
||||||
|
} else if (file.newName !== file.oldName) {
|
||||||
|
// If file is not Added, not Deleted and the names changed it must be a rename :)
|
||||||
|
templateName = 'file-renamed';
|
||||||
|
}
|
||||||
|
|
||||||
|
return templateName;
|
||||||
|
};
|
||||||
|
|
||||||
PrinterUtils.prototype.diffHighlight = function(diffLine1, diffLine2, config) {
|
PrinterUtils.prototype.diffHighlight = function(diffLine1, diffLine2, config) {
|
||||||
var linePrefix1, linePrefix2, unprefixedLine1, unprefixedLine2;
|
var linePrefix1, linePrefix2, unprefixedLine1, unprefixedLine2;
|
||||||
|
|
||||||
|
|
@ -3479,6 +3524,12 @@ process.umask = function() { return 0; };
|
||||||
var utils = require('./utils.js').Utils;
|
var utils = require('./utils.js').Utils;
|
||||||
var Rematch = require('./rematch.js').Rematch;
|
var Rematch = require('./rematch.js').Rematch;
|
||||||
|
|
||||||
|
var hoganUtils = require('./hoganjs-utils.js').HoganJsUtils;
|
||||||
|
var genericTemplatesPath = 'generic';
|
||||||
|
var baseTemplatesPath = 'side-by-side';
|
||||||
|
var iconsBaseTemplatesPath = 'icon';
|
||||||
|
var tagsBaseTemplatesPath = 'tag';
|
||||||
|
|
||||||
var matcher = Rematch.rematch(function(a, b) {
|
var matcher = Rematch.rematch(function(a, b) {
|
||||||
var amod = a.content.substr(1);
|
var amod = a.content.substr(1);
|
||||||
var bmod = b.content.substr(1);
|
var bmod = b.content.substr(1);
|
||||||
|
|
@ -3491,67 +3542,48 @@ process.umask = function() { return 0; };
|
||||||
}
|
}
|
||||||
|
|
||||||
SideBySidePrinter.prototype.makeDiffHtml = function(file, diffs) {
|
SideBySidePrinter.prototype.makeDiffHtml = function(file, diffs) {
|
||||||
return '<div id="' + printerUtils.getHtmlId(file) + '" class="d2h-file-wrapper" data-lang="' + file.language + '">\n' +
|
var fileDiffTemplate = hoganUtils.template(baseTemplatesPath, 'file-diff');
|
||||||
' <div class="d2h-file-header">\n' +
|
var filePathTemplate = hoganUtils.template(genericTemplatesPath, 'file-path');
|
||||||
' <span class="d2h-file-stats">\n' +
|
var fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, 'file');
|
||||||
' <span class="d2h-lines-added">\n' +
|
var fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file));
|
||||||
' <span>+' + file.addedLines + '</span>\n' +
|
|
||||||
' </span>\n' +
|
return fileDiffTemplate.render({
|
||||||
' <span class="d2h-lines-deleted">\n' +
|
file: file,
|
||||||
' <span>-' + file.deletedLines + '</span>\n' +
|
fileHtmlId: printerUtils.getHtmlId(file),
|
||||||
' </span>\n' +
|
diffs: diffs,
|
||||||
' </span>\n' +
|
filePath: filePathTemplate.render({
|
||||||
' <span class="d2h-file-name-wrapper">\n' +
|
fileDiffName: printerUtils.getDiffName(file)
|
||||||
' <span class="d2h-file-name">' + printerUtils.getDiffName(file) + '</span>\n' +
|
}, {
|
||||||
' </span>\n' +
|
fileIcon: fileIconTemplate,
|
||||||
' </div>\n' +
|
fileTag: fileTagTemplate
|
||||||
' <div class="d2h-files-diff">\n' +
|
})
|
||||||
' <div class="d2h-file-side-diff">\n' +
|
});
|
||||||
' <div class="d2h-code-wrapper">\n' +
|
|
||||||
' <table class="d2h-diff-table">\n' +
|
|
||||||
' <tbody class="d2h-diff-tbody">\n' +
|
|
||||||
' ' + diffs.left +
|
|
||||||
' </tbody>\n' +
|
|
||||||
' </table>\n' +
|
|
||||||
' </div>\n' +
|
|
||||||
' </div>\n' +
|
|
||||||
' <div class="d2h-file-side-diff">\n' +
|
|
||||||
' <div class="d2h-code-wrapper">\n' +
|
|
||||||
' <table class="d2h-diff-table">\n' +
|
|
||||||
' <tbody class="d2h-diff-tbody">\n' +
|
|
||||||
' ' + diffs.right +
|
|
||||||
' </tbody>\n' +
|
|
||||||
' </table>\n' +
|
|
||||||
' </div>\n' +
|
|
||||||
' </div>\n' +
|
|
||||||
' </div>\n' +
|
|
||||||
' </div>\n';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SideBySidePrinter.prototype.generateSideBySideJsonHtml = function(diffFiles) {
|
SideBySidePrinter.prototype.generateSideBySideJsonHtml = function(diffFiles) {
|
||||||
var that = this;
|
var that = this;
|
||||||
return '<div class="d2h-wrapper">\n' +
|
|
||||||
diffFiles.map(function(file) {
|
|
||||||
|
|
||||||
var diffs;
|
var content = diffFiles.map(function(file) {
|
||||||
if (file.blocks.length) {
|
var diffs;
|
||||||
diffs = that.generateSideBySideFileHtml(file);
|
if (file.blocks.length) {
|
||||||
} else {
|
diffs = that.generateSideBySideFileHtml(file);
|
||||||
diffs = that.generateEmptyDiff();
|
} else {
|
||||||
}
|
diffs = that.generateEmptyDiff();
|
||||||
|
}
|
||||||
|
|
||||||
return that.makeDiffHtml(file, diffs);
|
return that.makeDiffHtml(file, diffs);
|
||||||
}).join('\n') +
|
}).join('\n');
|
||||||
'</div>\n';
|
|
||||||
|
return hoganUtils.render(genericTemplatesPath, 'wrapper', {'content': content});
|
||||||
};
|
};
|
||||||
|
|
||||||
SideBySidePrinter.prototype.makeSideHtml = function(blockHeader) {
|
SideBySidePrinter.prototype.makeSideHtml = function(blockHeader) {
|
||||||
return '<tr>\n' +
|
return hoganUtils.render(genericTemplatesPath, 'column-line-number', {
|
||||||
' <td class="d2h-code-side-linenumber ' + diffParser.LINE_TYPE.INFO + '"></td>\n' +
|
diffParser: diffParser,
|
||||||
' <td class="' + diffParser.LINE_TYPE.INFO + '">\n' +
|
blockHeader: blockHeader,
|
||||||
' <div class="d2h-code-side-line ' + diffParser.LINE_TYPE.INFO + '">' + blockHeader + '</div>\n' +
|
lineClass: 'd2h-code-side-linenumber',
|
||||||
' </td>\n' +
|
contentClass: 'd2h-code-side-line'
|
||||||
'</tr>\n';
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SideBySidePrinter.prototype.generateSideBySideFileHtml = function(file) {
|
SideBySidePrinter.prototype.generateSideBySideFileHtml = function(file) {
|
||||||
|
|
@ -3562,7 +3594,7 @@ process.umask = function() { return 0; };
|
||||||
|
|
||||||
file.blocks.forEach(function(block) {
|
file.blocks.forEach(function(block) {
|
||||||
|
|
||||||
fileHtml.left += that.makeSideHtml(utils.escape(block.header));
|
fileHtml.left += that.makeSideHtml(block.header);
|
||||||
fileHtml.right += that.makeSideHtml('');
|
fileHtml.right += that.makeSideHtml('');
|
||||||
|
|
||||||
var oldLines = [];
|
var oldLines = [];
|
||||||
|
|
@ -3576,7 +3608,7 @@ process.umask = function() { return 0; };
|
||||||
var comparisons = oldLines.length * newLines.length;
|
var comparisons = oldLines.length * newLines.length;
|
||||||
var maxComparisons = that.config.matchingMaxComparisons || 2500;
|
var maxComparisons = that.config.matchingMaxComparisons || 2500;
|
||||||
var doMatching = comparisons < maxComparisons && (that.config.matching === 'lines' ||
|
var doMatching = comparisons < maxComparisons && (that.config.matching === 'lines' ||
|
||||||
that.config.matching === 'words');
|
that.config.matching === 'words');
|
||||||
|
|
||||||
if (doMatching) {
|
if (doMatching) {
|
||||||
matches = matcher(oldLines, newLines);
|
matches = matcher(oldLines, newLines);
|
||||||
|
|
@ -3699,40 +3731,26 @@ process.umask = function() { return 0; };
|
||||||
return fileHtml;
|
return fileHtml;
|
||||||
};
|
};
|
||||||
|
|
||||||
SideBySidePrinter.prototype.makeSingleLineHtml = function(type, number, htmlContent, htmlPrefix) {
|
|
||||||
return '<tr>\n' +
|
|
||||||
' <td class="d2h-code-side-linenumber ' + type + '">' + number + '</td>\n' +
|
|
||||||
' <td class="' + type + '">' +
|
|
||||||
' <div class="d2h-code-side-line ' + type + '">' + htmlPrefix + htmlContent + '</div>' +
|
|
||||||
' </td>\n' +
|
|
||||||
' </tr>\n';
|
|
||||||
};
|
|
||||||
|
|
||||||
SideBySidePrinter.prototype.generateSingleLineHtml = function(type, number, content, prefix) {
|
SideBySidePrinter.prototype.generateSingleLineHtml = function(type, number, content, prefix) {
|
||||||
var htmlPrefix = '';
|
return hoganUtils.render(genericTemplatesPath, 'line',
|
||||||
if (prefix) {
|
{
|
||||||
htmlPrefix = '<span class="d2h-code-line-prefix">' + prefix + '</span>';
|
type: type,
|
||||||
}
|
lineClass: 'd2h-code-side-linenumber',
|
||||||
|
contentClass: 'd2h-code-side-line',
|
||||||
var htmlContent = '';
|
prefix: prefix && utils.convertWhiteSpaceToNonBreakingSpace(prefix),
|
||||||
if (content) {
|
content: content && utils.convertWhiteSpaceToNonBreakingSpace(content),
|
||||||
htmlContent = '<span class="d2h-code-line-ctn">' + content + '</span>';
|
lineNumber: number
|
||||||
}
|
});
|
||||||
|
|
||||||
return this.makeSingleLineHtml(type, number, htmlContent, htmlPrefix);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SideBySidePrinter.prototype.generateEmptyDiff = function() {
|
SideBySidePrinter.prototype.generateEmptyDiff = function() {
|
||||||
var fileHtml = {};
|
var fileHtml = {};
|
||||||
fileHtml.right = '';
|
fileHtml.right = '';
|
||||||
|
|
||||||
fileHtml.left = '<tr>\n' +
|
fileHtml.left = hoganUtils.render(genericTemplatesPath, 'empty-diff', {
|
||||||
' <td class="' + diffParser.LINE_TYPE.INFO + '">' +
|
contentClass: 'd2h-code-side-line',
|
||||||
' <div class="d2h-code-side-line ' + diffParser.LINE_TYPE.INFO + '">' +
|
diffParser: diffParser
|
||||||
'File without changes' +
|
});
|
||||||
' </div>' +
|
|
||||||
' </td>\n' +
|
|
||||||
'</tr>\n';
|
|
||||||
|
|
||||||
return fileHtml;
|
return fileHtml;
|
||||||
};
|
};
|
||||||
|
|
@ -3741,15 +3759,29 @@ process.umask = function() { return 0; };
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
},{"./diff-parser.js":22,"./printer-utils.js":28,"./rematch.js":29,"./utils.js":32}],31:[function(require,module,exports){
|
},{"./diff-parser.js":22,"./hoganjs-utils.js":25,"./printer-utils.js":28,"./rematch.js":29,"./utils.js":32}],31:[function(require,module,exports){
|
||||||
(function (global){
|
(function (global){
|
||||||
(function() {
|
(function() {
|
||||||
if (!!!global.browserTemplates) global.browserTemplates = {};
|
if (!!!global.browserTemplates) global.browserTemplates = {};
|
||||||
var Hogan = require("hogan.js");global.browserTemplates["line-by-line-column-line-number"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<tr>");t.b("\n" + i);t.b(" <td class=\"d2h-code-linenumber ");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\"></td>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"d2h-code-line ");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b(t.t(t.f("blockHeader",c,p,0)));t.b("</div>");t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b("</tr>");return t.fl(); },partials: {}, subs: { }});
|
var Hogan = require("hogan.js");global.browserTemplates["file-summary-line"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"d2h-file-list-line\">");t.b("\n" + i);t.b(" <span class=\"d2h-file-name-wrapper\">");t.b("\n" + i);t.b(" <span>");t.b(t.rp("<fileIcon0",c,p,""));t.b("</span>");t.b("\n" + i);t.b(" <a href=\"#");t.b(t.v(t.f("fileHtmlId",c,p,0)));t.b("\" class=\"d2h-file-name\">");t.b(t.v(t.f("fileName",c,p,0)));t.b("</a>");t.b("\n" + i);t.b(" <span class=\"d2h-file-stats\">");t.b("\n" + i);t.b(" <span class=\"d2h-lines-added\">");t.b(t.v(t.f("addedLines",c,p,0)));t.b("</span>");t.b("\n" + i);t.b(" <span class=\"d2h-lines-deleted\">");t.b(t.v(t.f("deletedLines",c,p,0)));t.b("</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b("</li>");return t.fl(); },partials: {"<fileIcon0":{name:"fileIcon", partials: {}, subs: { }}}, subs: { }});
|
||||||
global.browserTemplates["line-by-line-empty-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<tr>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"d2h-code-line ");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" File without changes");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b("</tr>");return t.fl(); },partials: {}, subs: { }});
|
global.browserTemplates["file-summary-wrapper"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"d2h-file-list-wrapper\">");t.b("\n" + i);t.b(" <div class=\"d2h-file-list-header\">");t.b("\n" + i);t.b(" <span class=\"d2h-file-list-title\">Files changed (");t.b(t.v(t.f("filesNumber",c,p,0)));t.b(")</span>");t.b("\n" + i);t.b(" <a class=\"d2h-file-switch d2h-hide\">hide</a>");t.b("\n" + i);t.b(" <a class=\"d2h-file-switch d2h-show\">show</a>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" <ol class=\"d2h-file-list\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("files",c,p,0)));t.b("\n" + i);t.b(" </ol>");t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
||||||
global.browserTemplates["line-by-line-file-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"");t.b(t.v(t.f("fileHtmlId",c,p,0)));t.b("\" class=\"d2h-file-wrapper\" data-lang=\"");t.b(t.v(t.d("file.language",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"d2h-file-header\">");t.b("\n" + i);t.b(" <span class=\"d2h-file-stats\">");t.b("\n" + i);t.b(" <span class=\"d2h-lines-added\">");t.b("\n" + i);t.b(" <span>+");t.b(t.v(t.d("file.addedLines",c,p,0)));t.b("</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" <span class=\"d2h-lines-deleted\">");t.b("\n" + i);t.b(" <span>-");t.b(t.v(t.d("file.deletedLines",c,p,0)));t.b("</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" <span class=\"d2h-file-name-wrapper\">");t.b("\n" + i);t.b(" <span class=\"d2h-file-name\"> ");t.b(t.v(t.f("fileDiffName",c,p,0)));t.b("</span>");t.b("\n" + i);t.b(" </span>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" <div class=\"d2h-file-diff\">");t.b("\n" + i);t.b(" <div class=\"d2h-code-wrapper\">");t.b("\n" + i);t.b(" <table class=\"d2h-diff-table\">");t.b("\n" + i);t.b(" <tbody class=\"d2h-diff-tbody\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("diffs",c,p,0)));t.b("\n" + i);t.b(" </tbody>");t.b("\n" + i);t.b(" </table>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
global.browserTemplates["generic-column-line-number"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<tr>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.f("lineClass",c,p,0)));t.b(" ");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\"></td>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"");t.b(t.v(t.f("contentClass",c,p,0)));t.b(" ");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b(t.t(t.f("blockHeader",c,p,0)));t.b("</div>");t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b("</tr>");return t.fl(); },partials: {}, subs: { }});
|
||||||
global.browserTemplates["line-by-line-line"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<tr>");t.b("\n" + i);t.b(" <td class=\"d2h-code-linenumber ");t.b(t.v(t.f("type",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"line-num1\">");t.b(t.v(t.f("oldNumber",c,p,0)));t.b("</div>");t.b("\n" + i);t.b(" <div class=\"line-num2\">");t.b(t.v(t.f("newNumber",c,p,0)));t.b("</div>");t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.f("type",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"d2h-code-line ");t.b(t.v(t.f("type",c,p,0)));t.b("\">");t.b("\n" + i);if(t.s(t.f("prefix",c,p,1),c,p,0,253,329,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" <span class=\"d2h-code-line-prefix\">");t.b(t.t(t.f("prefix",c,p,0)));t.b("</span>");t.b("\n" + i);});c.pop();}if(t.s(t.f("content",c,p,1),c,p,0,361,435,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" <span class=\"d2h-code-line-ctn\">");t.b(t.t(t.f("content",c,p,0)));t.b("</span>");t.b("\n" + i);});c.pop();}t.b(" </div>");t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b("</tr>");return t.fl(); },partials: {}, subs: { }});
|
global.browserTemplates["generic-empty-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<tr>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"");t.b(t.v(t.f("contentClass",c,p,0)));t.b(" ");t.b(t.v(t.d("diffParser.LINE_TYPE.INFO",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" File without changes");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b("</tr>");return t.fl(); },partials: {}, subs: { }});
|
||||||
global.browserTemplates["line-by-line-wrapper"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"d2h-wrapper\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("content",c,p,0)));t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
global.browserTemplates["generic-file-path"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<span class=\"d2h-file-name-wrapper\">");t.b("\n" + i);t.b(" <span class=\"d2h-icon-wrapper\">");t.b(t.rp("<fileIcon0",c,p,""));t.b("</span>");t.b("\n" + i);t.b(" <span class=\"d2h-file-name\">");t.b(t.v(t.f("fileDiffName",c,p,0)));t.b("</span>");t.b("\n" + i);t.b(t.rp("<fileTag1",c,p," "));t.b("</span>");return t.fl(); },partials: {"<fileIcon0":{name:"fileIcon", partials: {}, subs: { }},"<fileTag1":{name:"fileTag", partials: {}, subs: { }}}, subs: { }});
|
||||||
|
global.browserTemplates["generic-line"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<tr>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.f("lineClass",c,p,0)));t.b(" ");t.b(t.v(t.f("type",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("lineNumber",c,p,0)));t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b(" <td class=\"");t.b(t.v(t.f("type",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"");t.b(t.v(t.f("contentClass",c,p,0)));t.b(" ");t.b(t.v(t.f("type",c,p,0)));t.b("\">");t.b("\n" + i);if(t.s(t.f("prefix",c,p,1),c,p,0,171,247,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" <span class=\"d2h-code-line-prefix\">");t.b(t.t(t.f("prefix",c,p,0)));t.b("</span>");t.b("\n" + i);});c.pop();}if(t.s(t.f("content",c,p,1),c,p,0,279,353,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" <span class=\"d2h-code-line-ctn\">");t.b(t.t(t.f("content",c,p,0)));t.b("</span>");t.b("\n" + i);});c.pop();}t.b(" </div>");t.b("\n" + i);t.b(" </td>");t.b("\n" + i);t.b("</tr>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["generic-wrapper"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"d2h-wrapper\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("content",c,p,0)));t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["icon-file-added"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<svg aria-hidden=\"true\" class=\"d2h-icon d2h-added\" height=\"16\" title=\"added\" version=\"1.1\" viewBox=\"0 0 14 16\"");t.b("\n" + i);t.b(" width=\"14\">");t.b("\n" + i);t.b(" <path d=\"M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z\"></path>");t.b("\n" + i);t.b("</svg>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["icon-file-changed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<svg aria-hidden=\"true\" class=\"d2h-icon d2h-changed\" height=\"16\" title=\"modified\" version=\"1.1\"");t.b("\n" + i);t.b(" viewBox=\"0 0 14 16\" width=\"14\">");t.b("\n" + i);t.b(" <path d=\"M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z\"></path>");t.b("\n" + i);t.b("</svg>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["icon-file-deleted"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<svg aria-hidden=\"true\" class=\"d2h-icon d2h-deleted\" height=\"16\" title=\"removed\" version=\"1.1\"");t.b("\n" + i);t.b(" viewBox=\"0 0 14 16\" width=\"14\">");t.b("\n" + i);t.b(" <path d=\"M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z\"></path>");t.b("\n" + i);t.b("</svg>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["icon-file-renamed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<svg aria-hidden=\"true\" class=\"d2h-icon d2h-moved\" height=\"16\" title=\"renamed\" version=\"1.1\"");t.b("\n" + i);t.b(" viewBox=\"0 0 14 16\" width=\"14\">");t.b("\n" + i);t.b(" <path d=\"M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z\"></path>");t.b("\n" + i);t.b("</svg>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["icon-file"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<svg aria-hidden=\"true\" class=\"d2h-icon\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\">");t.b("\n" + i);t.b(" <path d=\"M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z\"></path>");t.b("\n" + i);t.b("</svg>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["line-by-line-file-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"");t.b(t.v(t.f("fileHtmlId",c,p,0)));t.b("\" class=\"d2h-file-wrapper\" data-lang=\"");t.b(t.v(t.d("file.language",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"d2h-file-header\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("filePath",c,p,0)));t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" <div class=\"d2h-file-diff\">");t.b("\n" + i);t.b(" <div class=\"d2h-code-wrapper\">");t.b("\n" + i);t.b(" <table class=\"d2h-diff-table\">");t.b("\n" + i);t.b(" <tbody class=\"d2h-diff-tbody\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("diffs",c,p,0)));t.b("\n" + i);t.b(" </tbody>");t.b("\n" + i);t.b(" </table>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["line-by-line-numbers"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"line-num1\">");t.b(t.v(t.f("oldNumber",c,p,0)));t.b("</div>");t.b("\n" + i);t.b("<div class=\"line-num2\">");t.b(t.v(t.f("newNumber",c,p,0)));t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["side-by-side-file-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"");t.b(t.v(t.f("fileHtmlId",c,p,0)));t.b("\" class=\"d2h-file-wrapper\" data-lang=\"");t.b(t.v(t.d("file.language",c,p,0)));t.b("\">");t.b("\n" + i);t.b(" <div class=\"d2h-file-header\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("filePath",c,p,0)));t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" <div class=\"d2h-files-diff\">");t.b("\n" + i);t.b(" <div class=\"d2h-file-side-diff\">");t.b("\n" + i);t.b(" <div class=\"d2h-code-wrapper\">");t.b("\n" + i);t.b(" <table class=\"d2h-diff-table\">");t.b("\n" + i);t.b(" <tbody class=\"d2h-diff-tbody\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.d("diffs.left",c,p,0)));t.b("\n" + i);t.b(" </tbody>");t.b("\n" + i);t.b(" </table>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" <div class=\"d2h-file-side-diff\">");t.b("\n" + i);t.b(" <div class=\"d2h-code-wrapper\">");t.b("\n" + i);t.b(" <table class=\"d2h-diff-table\">");t.b("\n" + i);t.b(" <tbody class=\"d2h-diff-tbody\">");t.b("\n" + i);t.b(" ");t.b(t.t(t.d("diffs.right",c,p,0)));t.b("\n" + i);t.b(" </tbody>");t.b("\n" + i);t.b(" </table>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b("</div>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["tag-file-added"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<span class=\"d2h-tag d2h-added d2h-added-tag\">ADDED</span>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["tag-file-changed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<span class=\"d2h-tag d2h-changed d2h-changed-tag\">CHANGED</span>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["tag-file-deleted"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<span class=\"d2h-tag d2h-deleted d2h-deleted-tag\">DELETED</span>");return t.fl(); },partials: {}, subs: { }});
|
||||||
|
global.browserTemplates["tag-file-renamed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<span class=\"d2h-tag d2h-moved d2h-moved-tag\">RENAMED</span>");return t.fl(); },partials: {}, subs: { }});
|
||||||
module.exports = global.browserTemplates;
|
module.exports = global.browserTemplates;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
|
||||||
2
dist/diff2html.min.css
vendored
2
dist/diff2html.min.css
vendored
|
|
@ -1 +1 @@
|
||||||
.d2h-code-line-prefix,.line-num1{float:left}.d2h-wrapper{text-align:left}.d2h-file-header{padding:5px 10px;border-bottom:1px solid #d8d8d8;background-color:#f7f7f7}.d2h-file-stats{display:inline;text-align:center}.d2h-lines-added{text-align:right}.d2h-lines-added>*{background-color:#ceffce;border:1px solid #b4e2b4;color:#399839;border-radius:5px 0 0 5px;padding:2px}.d2h-lines-deleted{text-align:left}.d2h-lines-deleted>*{background-color:#f7c8c8;border:1px solid #e9aeae;color:#c33;border-radius:0 5px 5px 0;padding:2px}.d2h-file-name-wrapper{display:inline-flex;width:90%;font-family:"Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px}.d2h-file-name{line-height:33px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.d2h-file-diff,.d2h-file-side-diff{overflow-x:scroll;overflow-y:hidden}.d2h-file-wrapper{border:1px solid #ddd;border-radius:3px;margin-bottom:1em}.d2h-diff-table{width:100%;border-collapse:collapse;font-family:Menlo,Consolas,monospace;font-size:13px}.d2h-diff-tbody>tr>td>div{height:16px;line-height:16px}.d2h-files-diff{width:100%}.d2h-file-side-diff{display:inline-block;width:50%;margin-right:-4px}.d2h-code-line{display:block;white-space:nowrap;padding:0 10px;margin-left:80px}.d2h-code-side-line{display:block;white-space:pre;padding:0 10px;height:18px;line-height:18px;margin-left:50px}.d2h-code-line del,.d2h-code-side-line del{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#ffb6ba;border-radius:.2em}.d2h-code-line ins,.d2h-code-side-line ins{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#97f295;border-radius:.2em}.d2h-code-line-ctn,.d2h-code-line-prefix{background:0 0;padding:0}.d2h-code-linenumber,.d2h-code-side-linenumber{position:absolute;height:18px;line-height:18px;background-color:#fff;text-align:right;color:rgba(0,0,0,.3);cursor:pointer}.line-num1,.line-num2{width:40px;padding-left:3px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.line-num2{float:right}.d2h-code-linenumber{box-sizing:border-box;width:86px;padding-left:2px;padding-right:2px;border:solid #eee;border-width:0 1px}.d2h-code-side-linenumber{box-sizing:border-box;width:56px;padding-left:5px;padding-right:5px;border:solid #eee;border-width:0 1px;overflow:hidden;text-overflow:ellipsis}.d2h-file-list-header,.d2h-file-list-line{text-align:left}.d2h-del{background-color:#fee8e9;border-color:#e9aeae}.d2h-ins{background-color:#dfd;border-color:#b4e2b4}.d2h-info{background-color:#f8fafd;color:rgba(0,0,0,.3);border-color:#d5e4f2}.d2h-file-diff .d2h-del.d2h-change{background-color:#fdf2d0}.d2h-file-diff .d2h-ins.d2h-change{background-color:#ded}.d2h-file-list-wrapper{margin-bottom:10px}.d2h-file-list-wrapper a{text-decoration:none;color:#3572b0}.d2h-file-list-wrapper a:visited{color:#3572b0}.d2h-file-list-title{font-weight:700}.d2h-file-list-line .d2h-file-name{line-height:21px}.d2h-file-list{display:block}.d2h-file-switch{display:none;font-size:10px;cursor:pointer}.selecting-left .d2h-code-line,.selecting-left .d2h-code-line *,.selecting-left .d2h-code-side-line,.selecting-left .d2h-code-side-line *,.selecting-right td.d2h-code-linenumber,.selecting-right td.d2h-code-linenumber *,.selecting-right td.d2h-code-side-linenumber,.selecting-right td.d2h-code-side-linenumber *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.selecting-left .d2h-code-line ::selection .selecting-right td.d2h-code-linenumber::selection,.selecting-left .d2h-code-line::selection,.selecting-left .d2h-code-side-line ::selection,.selecting-left .d2h-code-side-line::selection,.selecting-right td.d2h-code-side-linenumber ::selection,.selecting-right td.d2h-code-side-linenumber::selection{background:0 0}
|
.d2h-code-line-prefix,.line-num1{float:left}.d2h-wrapper{text-align:left}.d2h-file-header{padding:5px 10px;border-bottom:1px solid #d8d8d8;background-color:#f7f7f7}.d2h-file-stats{display:flex;margin-left:auto;font-size:14px}.d2h-lines-added{text-align:right;border:1px solid #b4e2b4;border-radius:5px 0 0 5px;color:#399839;padding:2px;vertical-align:middle}.d2h-lines-deleted{text-align:left;border:1px solid #e9aeae;border-radius:0 5px 5px 0;color:#c33;padding:2px;vertical-align:middle;margin-left:1px}.d2h-file-name-wrapper{display:flex;align-items:center;width:100%;font-family:"Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:15px}.d2h-file-name{line-height:33px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.d2h-file-diff,.d2h-file-side-diff{overflow-x:scroll;overflow-y:hidden}.d2h-file-wrapper{border:1px solid #ddd;border-radius:3px;margin-bottom:1em}.d2h-diff-table{width:100%;border-collapse:collapse;font-family:Menlo,Consolas,monospace;font-size:13px}.d2h-diff-tbody>tr>td>div{height:16px;line-height:16px}.d2h-files-diff{width:100%}.d2h-file-side-diff{display:inline-block;width:50%;margin-right:-4px}.d2h-code-line,.d2h-code-side-line{display:block;white-space:nowrap;padding:0 10px}.d2h-code-line{margin-left:80px}.d2h-code-side-line{height:18px;line-height:18px;margin-left:50px}.d2h-code-line del,.d2h-code-side-line del{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#ffb6ba;border-radius:.2em}.d2h-code-line ins,.d2h-code-side-line ins{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#97f295;border-radius:.2em}.d2h-code-line-ctn,.d2h-code-line-prefix{background:0 0;padding:0}.d2h-code-linenumber,.d2h-code-side-linenumber{position:absolute;height:18px;line-height:18px;background-color:#fff;text-align:right;color:rgba(0,0,0,.3);cursor:pointer}.line-num1,.line-num2{width:40px;padding-left:3px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.line-num2{float:right}.d2h-code-linenumber{box-sizing:border-box;width:86px;padding-left:2px;padding-right:2px;border:solid #eee;border-width:0 1px}.d2h-code-side-linenumber{box-sizing:border-box;width:56px;padding-left:5px;padding-right:5px;border:solid #eee;border-width:0 1px;overflow:hidden;text-overflow:ellipsis}.d2h-del{background-color:#fee8e9;border-color:#e9aeae}.d2h-ins{background-color:#dfd;border-color:#b4e2b4}.d2h-info{background-color:#f8fafd;color:rgba(0,0,0,.3);border-color:#d5e4f2}.d2h-file-diff .d2h-del.d2h-change{background-color:#fdf2d0}.d2h-file-diff .d2h-ins.d2h-change{background-color:#ded}.d2h-file-list-wrapper{margin-bottom:10px}.d2h-file-list-wrapper a{text-decoration:none;color:#3572b0}.d2h-file-list-wrapper a:visited{color:#3572b0}.d2h-file-list-header{text-align:left}.d2h-file-list-title{font-weight:700}.d2h-file-list-line{display:flex;text-align:left}.d2h-file-list-line .d2h-file-name{line-height:21px}.d2h-file-list{display:block;list-style:none;padding:0;margin:0}.d2h-file-list>li{border-bottom:#ddd solid 1px;padding:5px 10px;margin:0}.d2h-file-list>li:last-child{border-bottom:none}.d2h-file-switch{display:none;font-size:10px;cursor:pointer}.d2h-icon-wrapper{line-height:31px}.d2h-icon{vertical-align:middle;margin-right:10px;fill:currentColor}.d2h-deleted{color:#c33}.d2h-added{color:#399839}.d2h-changed{color:#d0b44c}.d2h-moved{color:#3572b0}.d2h-tag{display:flex;font-size:10px;margin-left:5px;padding:0 2px;background-color:#fff}.d2h-deleted-tag{border:1px solid #c33}.d2h-added-tag{border:1px solid #399839}.d2h-changed-tag{border:1px solid #d0b44c}.d2h-moved-tag{border:1px solid #3572b0}.selecting-left .d2h-code-line,.selecting-left .d2h-code-line *,.selecting-left .d2h-code-side-line,.selecting-left .d2h-code-side-line *,.selecting-right td.d2h-code-linenumber,.selecting-right td.d2h-code-linenumber *,.selecting-right td.d2h-code-side-linenumber,.selecting-right td.d2h-code-side-linenumber *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.selecting-left .d2h-code-line ::selection .selecting-right td.d2h-code-linenumber::selection,.selecting-left .d2h-code-line::selection,.selecting-left .d2h-code-side-line ::selection,.selecting-left .d2h-code-side-line::selection,.selecting-right td.d2h-code-side-linenumber ::selection,.selecting-right td.d2h-code-side-linenumber::selection{background:0 0}
|
||||||
5
dist/diff2html.min.js
vendored
5
dist/diff2html.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "diff2html",
|
"name": "diff2html",
|
||||||
"version": "2.0.0-rc.4",
|
"version": "2.0.0-rc.5",
|
||||||
"homepage": "http://rtfpessoa.github.io/diff2html/",
|
"homepage": "http://rtfpessoa.github.io/diff2html/",
|
||||||
"description": "Fast Diff to colorized HTML",
|
"description": "Fast Diff to colorized HTML",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue