64 lines
1.9 KiB
HTML
64 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Online File Diff and Mergely</title>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<link rel="shortcut icon" href="favicon.ico">
|
|
<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="Alexander Popov">
|
|
<script src="./lib/jquery.min.js"></script>
|
|
<script src="./lib/codemirror.min.js"></script>
|
|
<link type="text/css" rel="stylesheet" href="./lib/codemirror.min.css">
|
|
<script src="./lib/mergely.min.js"></script>
|
|
<link type="text/css" rel="stylesheet" href="./lib/mergely.css">
|
|
</head>
|
|
<body>
|
|
<div id="mergely-resizer">
|
|
<div id="compare">
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function getWinHeight() {
|
|
var winHeight = 0;
|
|
if (window.innerHeight)
|
|
winHeight = window.innerHeight;
|
|
else if ((document.body) && (document.body.clientHeight))
|
|
winHeight = document.body.clientHeight;
|
|
return winHeight;
|
|
}
|
|
function getWinWidth() {
|
|
var winWidth = 0;
|
|
if (window.innerWidth)
|
|
winWidth = window.innerWidth;
|
|
else if ((document.body) && (document.body.clientWidth))
|
|
winWidth = document.body.clientWidth;
|
|
return winWidth;
|
|
}
|
|
$(document).ready(function () {
|
|
$('#compare').mergely({
|
|
editor_width: 'auto',
|
|
editor_height: '400',
|
|
license: 'mpl-separate-notice',
|
|
cmsettings: {
|
|
readOnly: false,
|
|
lineWrapping: true,
|
|
},
|
|
lhs: function(setValue) {
|
|
setValue('welcome here, I\'m huster.\n the site is diff.hust.cc .');
|
|
},
|
|
rhs: function(setValue) {
|
|
setValue('welcome here, I\'m not huster.\n the domain is hust.cc .');
|
|
}
|
|
});
|
|
$(window).resize(function() {
|
|
$('#compare').mergely('options', {height:getWinHeight() - 30, width:getWinWidth() - 30});
|
|
$('#compare').mergely('update');
|
|
});
|
|
$(window).resize();
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|