blob: d5a2246f3c85df64915b65a38de1a764676de2d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>@title@</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/github.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html.min.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans' />
</head>
<body style="font-family: 'Open Sans'">
<h1>@title@</h1>
<p>@description@</p>
<p>Download <a id="patchdownload" href="#">changes.patch</a> which can be applied with <code>git apply changes.patch</code>.</p>
<div id="diffsource" style="display:none"><!--<![CDATA[
@diffdata@
]]>-->
</div>
<div id="diff">Loading ...</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/languages/cs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.min.js"></script>
<script>
$(document).ready(function() {
var diffText = $("#diffsource")[0].childNodes[0].nodeValue;
$("#diffsource").remove();
diffText = diffText.substring(10, diffText.length - 3);
if (diffText.length == 0) {
$("#diff").text("No changes found.");
return;
}
$("#patchdownload").click(function() {
var blob = new Blob([diffText], { type: "text/plain;charset=utf-8;" });
saveAs(blob, "changes.patch");
});
var diff2htmlUi = new Diff2HtmlUI({diff: diffText});
diff2htmlUi.draw('#diff', {showFiles: true, matching: 'none'});
setTimeout(function() {
diff2htmlUi.highlightCode('#diff');
}, 100);
});
</script>
</body>
</html>
|