diff-online/index.html

64 lines
1.9 KiB
HTML
Raw Permalink Normal View History

2016-08-30 08:57:55 +03:00
<!DOCTYPE html>
<html lang="en">
<head>
2022-12-23 00:56:57 +03:00
<meta charset="utf-8">
2022-12-22 23:48:02 +03:00
<title>Online File Diff and Mergely</title>
2022-12-23 00:56:57 +03:00
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2022-12-22 23:48:02 +03:00
<link rel="shortcut icon" href="favicon.ico">
2022-12-23 00:56:57 +03:00
<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">
2016-08-30 08:57:55 +03:00
</head>
<body>
<div id="mergely-resizer">
<div id="compare">
</div>
</div>
2022-12-23 00:56:57 +03:00
<script>
2016-08-30 08:57:55 +03:00
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({
2022-12-23 00:22:58 +03:00
editor_width: 'auto',
editor_height: '400',
2022-12-23 00:56:57 +03:00
license: 'mpl-separate-notice',
2016-08-30 08:57:55 +03:00
cmsettings: {
2022-12-22 23:46:07 +03:00
readOnly: false,
2016-08-30 08:57:55 +03:00
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});
2022-12-23 00:56:57 +03:00
$('#compare').mergely('update');
2016-08-30 08:57:55 +03:00
});
$(window).resize();
});
</script>
2022-12-23 00:56:57 +03:00
</body>
2016-08-30 08:57:55 +03:00
</html>