diff-online/index.html

64 lines
2.1 KiB
HTML
Raw Permalink Normal View History

2016-08-30 08:57:55 +03:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
2022-12-22 23:48:02 +03:00
<title>Online File Diff and Mergely</title>
2016-08-30 08:57:55 +03:00
<meta http-equiv="X-UA-Compatible" content="chrome=1, IE=edge">
2022-12-22 23:48:02 +03:00
<link rel="shortcut icon" href="favicon.ico">
2016-08-30 08:57:55 +03:00
<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" />
2022-12-22 23:48:02 +03:00
<meta name="author" content="Alexander Popov" />
2016-08-30 08:57:55 +03:00
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
2022-12-22 23:46:07 +03:00
<script type="text/javascript" src="./lib/codemirror.min.js"></script>
2016-08-30 08:57:55 +03:00
<link type="text/css" rel="stylesheet" href="./lib/codemirror.css" />
2022-12-22 23:46:07 +03:00
<script type="text/javascript" src="./lib/mergely.min.js"></script>
2016-08-30 08:57:55 +03:00
<link type="text/css" rel="stylesheet" href="./lib/mergely.css" />
</head>
<body>
<div id="mergely-resizer">
<div id="compare">
</div>
</div>
</body>
<script type="text/javascript">
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({
width: 'auto',
height: '400',
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});
$('#compare').mergely('update')
});
$(window).resize();
});
</script>
</html>