New inner-line diff algorithm. Added method 'unmarkup' to clear markup. Added option: vpcolor. Fixed autoresize and resize.

This commit is contained in:
Jamie Peabody
2013-05-12 19:52:47 +01:00
parent a3e50f8d8e
commit ea2263ff29
11 changed files with 283 additions and 291 deletions

56
examples/ajax.html Normal file
View File

@@ -0,0 +1,56 @@
<!--
This example demonstrates how to set left and right editors using ajax.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" /><title>Mergely - Simple Example</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="Merge and Diff your documents with diff online and share" />
<meta name="keywords" content="diff,merge,compare,jsdiff,comparison,difference,file,text,unix,patch,algorithm,saas,longest common subsequence" />
<meta name="author" content="Jamie Peabody" />
<!-- Requires jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<!-- Requires CodeMirror -->
<script type="text/javascript" src="../lib/codemirror.js"></script>
<link type="text/css" rel="stylesheet" href="../lib/codemirror.css" />
<!-- Requires Mergely -->
<script type="text/javascript" src="../lib/mergely.js"></script>
<link type="text/css" rel="stylesheet" href="../lib/mergely.css" />
<script type="text/javascript">
$(document).ready(function () {
$('#compare').mergely({
cmsettings: { readOnly: false },
});
$.ajax({
type: 'GET', async: true, dataType: 'text',
url: 'lhs.txt',
success: function (response) {
$('#compare').mergely('lhs', response);
}
});
$.ajax({
type: 'GET', async: true, dataType: 'text',
url: 'rhs.txt',
success: function (response) {
$('#compare').mergely('rhs', response);
}
});
});
</script>
</head>
<body>
<div id="mergely-resizer">
<div id="compare">
</div>
</div>
</body>
</html>