Merge Commit
This commit is contained in:
commit
18bd75de0a
8 changed files with 101 additions and 35 deletions
49
dist/diff2html.css
vendored
49
dist/diff2html.css
vendored
|
|
@ -93,6 +93,15 @@
|
||||||
margin-bottom: -8px;
|
margin-bottom: -8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.d2h-wrapped-file-side-diff {
|
||||||
|
display: inline-block;
|
||||||
|
overflow-x: scroll;
|
||||||
|
overflow-y: hidden;
|
||||||
|
width: 100%;
|
||||||
|
margin-right: -4px;
|
||||||
|
margin-bottom: -8px;
|
||||||
|
}
|
||||||
|
|
||||||
.d2h-code-line {
|
.d2h-code-line {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
@ -107,6 +116,14 @@
|
||||||
margin-left: 50px;
|
margin-left: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.d2h-wrapped-code-side-line {
|
||||||
|
display: inline-block;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding: 0 10px;
|
||||||
|
width:720px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.d2h-wrapped-code-side-line del,
|
||||||
.d2h-code-line del,
|
.d2h-code-line del,
|
||||||
.d2h-code-side-line del {
|
.d2h-code-side-line del {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
@ -116,6 +133,7 @@
|
||||||
border-radius: 0.2em;
|
border-radius: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.d2h-wrapped-code-side-line ins,
|
||||||
.d2h-code-line ins,
|
.d2h-code-line ins,
|
||||||
.d2h-code-side-line ins {
|
.d2h-code-side-line ins {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
@ -142,6 +160,15 @@
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.d2h-wrapped-code-line-ctn {
|
||||||
|
display: inline;
|
||||||
|
background: none;
|
||||||
|
padding: 0;
|
||||||
|
word-wrap: break-word;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
.line-num1 {
|
.line-num1 {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
float: left;
|
float: left;
|
||||||
|
|
@ -190,6 +217,22 @@
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.d2h-wrapped-code-side-linenumber {
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
width: 56px;
|
||||||
|
padding-left: 25px;
|
||||||
|
padding-right: 5px;
|
||||||
|
background-color: #fff;
|
||||||
|
color: rgba(0, 0, 0, 0.3);
|
||||||
|
text-align: right;
|
||||||
|
border: solid #eeeeee;
|
||||||
|
border-width: 0 1px 0 1px;
|
||||||
|
cursor: pointer;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes Highlight
|
* Changes Highlight
|
||||||
*/
|
*/
|
||||||
|
|
@ -331,6 +374,8 @@
|
||||||
.selecting-right td.d2h-code-linenumber *,
|
.selecting-right td.d2h-code-linenumber *,
|
||||||
.selecting-left .d2h-code-side-line,
|
.selecting-left .d2h-code-side-line,
|
||||||
.selecting-left .d2h-code-side-line *,
|
.selecting-left .d2h-code-side-line *,
|
||||||
|
.selecting-left .d2h-wrapped-code-side-line,
|
||||||
|
.selecting-left .d2h-wrapped-code-side-line *,
|
||||||
.selecting-right td.d2h-code-side-linenumber,
|
.selecting-right td.d2h-code-side-linenumber,
|
||||||
.selecting-right td.d2h-code-side-linenumber * {
|
.selecting-right td.d2h-code-side-linenumber * {
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
|
|
@ -344,6 +389,8 @@
|
||||||
.selecting-left .d2h-code-line *::-moz-selection,
|
.selecting-left .d2h-code-line *::-moz-selection,
|
||||||
.selecting-right td.d2h-code-linenumber::-moz-selection,
|
.selecting-right td.d2h-code-linenumber::-moz-selection,
|
||||||
.selecting-left .d2h-code-side-line::-moz-selection,
|
.selecting-left .d2h-code-side-line::-moz-selection,
|
||||||
|
.selecting-left .d2h-wrapped-code-side-line *::-moz-selection,
|
||||||
|
.selecting-left .d2h-wrapped-code-side-line::-moz-selection,
|
||||||
.selecting-left .d2h-code-side-line *::-moz-selection,
|
.selecting-left .d2h-code-side-line *::-moz-selection,
|
||||||
.selecting-right td.d2h-code-side-linenumber::-moz-selection,
|
.selecting-right td.d2h-code-side-linenumber::-moz-selection,
|
||||||
.selecting-right td.d2h-code-side-linenumber *::-moz-selection {
|
.selecting-right td.d2h-code-side-linenumber *::-moz-selection {
|
||||||
|
|
@ -355,6 +402,8 @@
|
||||||
.selecting-right td.d2h-code-linenumber::selection,
|
.selecting-right td.d2h-code-linenumber::selection,
|
||||||
.selecting-left .d2h-code-side-line::selection,
|
.selecting-left .d2h-code-side-line::selection,
|
||||||
.selecting-left .d2h-code-side-line *::selection,
|
.selecting-left .d2h-code-side-line *::selection,
|
||||||
|
.selecting-left .d2h-wrapped-code-side-line::selection,
|
||||||
|
.selecting-left .d2h-wrapped-code-side-line *::selection,
|
||||||
.selecting-right td.d2h-code-side-linenumber::selection,
|
.selecting-right td.d2h-code-side-linenumber::selection,
|
||||||
.selecting-right td.d2h-code-side-linenumber *::selection {
|
.selecting-right td.d2h-code-side-linenumber *::selection {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|
|
||||||
34
dist/diff2html.js
vendored
34
dist/diff2html.js
vendored
|
|
@ -454,21 +454,21 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
/*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
|
/*istanbul ignore end*/ // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
|
||||||
//
|
//
|
||||||
// Ranges and exceptions:
|
// Ranges and exceptions:
|
||||||
// Latin-1 Supplement, 0080–00FF
|
// Latin-1 Supplement, 0080?00FF
|
||||||
// - U+00D7 × Multiplication sign
|
// - U+00D7 × Multiplication sign
|
||||||
// - U+00F7 ÷ Division sign
|
// - U+00F7 ÷ Division sign
|
||||||
// Latin Extended-A, 0100–017F
|
// Latin Extended-A, 0100?017F
|
||||||
// Latin Extended-B, 0180–024F
|
// Latin Extended-B, 0180?024F
|
||||||
// IPA Extensions, 0250–02AF
|
// IPA Extensions, 0250?02AF
|
||||||
// Spacing Modifier Letters, 02B0–02FF
|
// Spacing Modifier Letters, 02B0?02FF
|
||||||
// - U+02C7 ˇ ˇ Caron
|
// - U+02C7 ? ˇ Caron
|
||||||
// - U+02D8 ˘ ˘ Breve
|
// - U+02D8 ? ˘ Breve
|
||||||
// - U+02D9 ˙ ˙ Dot Above
|
// - U+02D9 ? ˙ Dot Above
|
||||||
// - U+02DA ˚ ˚ Ring Above
|
// - U+02DA ? ˚ Ring Above
|
||||||
// - U+02DB ˛ ˛ Ogonek
|
// - U+02DB ? ˛ Ogonek
|
||||||
// - U+02DC ˜ ˜ Small Tilde
|
// - U+02DC ? ˜ Small Tilde
|
||||||
// - U+02DD ˝ ˝ Double Acute Accent
|
// - U+02DD ? ˝ Double Acute Accent
|
||||||
// Latin Extended Additional, 1E00–1EFF
|
// Latin Extended Additional, 1E00?1EFF
|
||||||
var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
|
var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
|
||||||
|
|
||||||
var reWhitespace = /\S/;
|
var reWhitespace = /\S/;
|
||||||
|
|
@ -6296,14 +6296,14 @@ module.exports = toPlainObject;
|
||||||
var newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator);
|
var newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator);
|
||||||
|
|
||||||
if (finalPrefix.length && finalSuffix.length) {
|
if (finalPrefix.length && finalSuffix.length) {
|
||||||
return finalPrefix + separator + '{' + oldRemainingPath + ' → ' + newRemainingPath + '}' + separator + finalSuffix;
|
return finalPrefix + separator + '{' + oldRemainingPath + ' ? ' + newRemainingPath + '}' + separator + finalSuffix;
|
||||||
} else if (finalPrefix.length) {
|
} else if (finalPrefix.length) {
|
||||||
return finalPrefix + separator + '{' + oldRemainingPath + ' → ' + newRemainingPath + '}';
|
return finalPrefix + separator + '{' + oldRemainingPath + ' ? ' + newRemainingPath + '}';
|
||||||
} else if (finalSuffix.length) {
|
} else if (finalSuffix.length) {
|
||||||
return '{' + oldRemainingPath + ' → ' + newRemainingPath + '}' + separator + finalSuffix;
|
return '{' + oldRemainingPath + ' ? ' + newRemainingPath + '}' + separator + finalSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
return oldFilename + ' → ' + newFilename;
|
return oldFilename + ' ? ' + newFilename;
|
||||||
} else if (newFilename && !isDevNullName(newFilename)) {
|
} else if (newFilename && !isDevNullName(newFilename)) {
|
||||||
return newFilename;
|
return newFilename;
|
||||||
} else if (oldFilename) {
|
} else if (oldFilename) {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
|
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
|
||||||
|
|
||||||
<!-- diff2html -->
|
<!-- diff2html -->
|
||||||
<link rel="stylesheet" type="text/css" href="assets/diff2html.min.css">
|
<link rel="stylesheet" type="text/css" href="assets/diff2html.css">
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -240,16 +240,16 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
|
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>-->
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/scala.min.js"></script>
|
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/scala.min.js"></script>-->
|
||||||
|
|
||||||
<!-- diff2html -->
|
<!-- diff2html -->
|
||||||
<script type="text/javascript" src="assets/diff2html.min.js"></script>
|
<script type="text/javascript" src="assets/diff2html.js"></script>
|
||||||
<script type="text/javascript" src="assets/diff2html-ui.min.js"></script>
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<script type="text/javascript" src="demo.min.js"></script>
|
<script type="text/javascript" src="demo.js"></script>
|
||||||
|
<script type="text/javascript" src="hljs.js"></script>
|
||||||
|
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>-->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
28
docs/demo.js
28
docs/demo.js
|
|
@ -485,7 +485,6 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Improves browser compatibility
|
// Improves browser compatibility
|
||||||
require('whatwg-fetch');
|
require('whatwg-fetch');
|
||||||
|
|
||||||
var searchParam = 'diff';
|
var searchParam = 'diff';
|
||||||
|
|
||||||
var $container = $('.container');
|
var $container = $('.container');
|
||||||
|
|
@ -639,11 +638,26 @@ $(document).ready(function() {
|
||||||
cache: 'default'
|
cache: 'default'
|
||||||
})
|
})
|
||||||
.then(function(res) {
|
.then(function(res) {
|
||||||
return res.text();
|
// return res.text();
|
||||||
|
return "diff --git a/README b/README\nindex 771ef03..1f8b36b 100644\n--- a/README\n+++ b/README\n@@ -8,16 +8,17 @@\n matchingMaxComparisons: perform at most this much comparisons for line matching a block of changes, default is 2500\n maxLineLengthHighlight: only perform diff changes highlight if lines are smaller than this, default is 10000\n templates: object with previously compiled templates to replace parts of the html\n-rawTemplates: object with raw not compiled templates to replace parts of the html\n+\n+Transpilation\n+\n+CoffeeScript 2 generates JavaScript that uses the latest, modern syntax. The runtime or browsers where you want your code to run might not support all of that syntax. In that case, we want to convert modern JavaScript into older JavaScript that will run in older versions of Node or older browsers; for example, { a } = obj into a = obj.a. This is done via transpilers like Babel, Bublé or Traceur Compiler.\n+\n+Quickstart\n+\n+From the root of your project:\n+\n+npm install --save-dev babel-core babel-preset-env\n+echo '{ \"presets\": [\"env\"] }' > .babelrc\n+coffee --compile --transpile --inline-map some-file.coffee\n For more information regarding the possible templates look into src/templates\n \n-character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child \n-\n-choose chr chunk class cleanup clear client clob clob_base clone close cluster\t\t\n-id cluster_probability cluster_set clustering coalesce \n-\t\t\n-coercibility col collate collation collect colu colum column column_value columns columns_updated comment \n-\n-commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws \n-\n-concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees \n";
|
||||||
})
|
})
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
var container = '#url-diff-container';
|
var container = 'url-diff-container';
|
||||||
var diff2htmlUi = new Diff2HtmlUI({diff: data});
|
|
||||||
|
var diffJson = Diff2Html.getJsonFromDiff(data);
|
||||||
|
var diff2html = Diff2Html.getPrettyHtml(diffJson, {
|
||||||
|
inputFormat: 'json',
|
||||||
|
outputFormat: "side-by-side",
|
||||||
|
matching: 'none',
|
||||||
|
lineFolding: true,
|
||||||
|
matchWordsThreshold: 1
|
||||||
|
});
|
||||||
|
document.getElementById(container).innerHTML = diff2html;
|
||||||
|
var codeLines = document.getElementById(container).getElementsByClassName("d2h-code-line-ctn");
|
||||||
|
[].forEach.call(codeLines, function(line) {
|
||||||
|
hljs.highlightBlock(line);
|
||||||
|
});
|
||||||
|
// var diff2htmlUi = new Diff2HtmlUI({diff: data});
|
||||||
|
|
||||||
if (outputFormat === 'side-by-side') {
|
if (outputFormat === 'side-by-side') {
|
||||||
$container.css({'width': '100%'});
|
$container.css({'width': '100%'});
|
||||||
|
|
@ -676,9 +690,9 @@ $(document).ready(function() {
|
||||||
|
|
||||||
params['synchronisedScroll'] = params['synchronisedScroll'] || true;
|
params['synchronisedScroll'] = params['synchronisedScroll'] || true;
|
||||||
|
|
||||||
diff2htmlUi.draw(container, params);
|
// diff2htmlUi.draw(container, params);
|
||||||
diff2htmlUi.fileListCloseable(container, params['fileListCloseable'] || false);
|
// diff2htmlUi.fileListCloseable(container, params['fileListCloseable'] || false);
|
||||||
params['highlight'] && diff2htmlUi.highlightCode(container);
|
// params['highlight'] && diff2htmlUi.highlightCode(container);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
3
docs/hljs.js
Normal file
3
docs/hljs.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue