forked from lxm_front/Mergely
51 lines
1.6 KiB
HTML
51 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" /><title>Mergely - Example visibility</title>
|
|
<meta http-equiv="X-UA-Compatible" content="chrome=1, IE=edge">
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
|
<meta name="description" content="" />
|
|
<meta name="keywords" content="mergely,diff,merge,compare" />
|
|
<meta name="author" content="Jamie Peabody" />
|
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
|
|
<!-- CodeMirror peer dependency -->
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.0/codemirror.min.js"></script>
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.0/addon/search/searchcursor.min.js"></script>
|
|
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.0/codemirror.min.css" />
|
|
|
|
<!-- Mergely -->
|
|
<link type="text/css" rel="stylesheet" href="/lib/mergely.css" />
|
|
<script type="text/javascript" src="/lib/mergely.js"></script>
|
|
|
|
<style type="text/css">
|
|
html, body {
|
|
height: 100%;
|
|
margin: 0;
|
|
}
|
|
#compare {
|
|
height: inherit;
|
|
visibility: hidden;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="compare"></div>
|
|
|
|
<script>
|
|
const doc = new Mergely('#compare');
|
|
doc.once('updated', () => {
|
|
fetch('/examples/macbeth.txt')
|
|
.then(response => response.text())
|
|
.then(macbeth => {
|
|
doc.lhs(macbeth.replace(/filthy/g, 'dirty'));
|
|
doc.rhs(macbeth);
|
|
});
|
|
doc.once('updated', () => {
|
|
document.getElementById('compare').style.visibility = 'visible';
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|