forked from lxm_front/Mergely
New inner-line diff algorithm. Added method 'unmarkup' to clear markup. Added option: vpcolor. Fixed autoresize and resize.
This commit is contained in:
56
examples/ajax.html
Normal file
56
examples/ajax.html
Normal 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>
|
||||
Reference in New Issue
Block a user