mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
* only use NowjsOperationRouter if network is available (probably needs a cleanup later)
91 lines
2.3 KiB
HTML
91 lines
2.3 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
|
|
<script src="/nowjs/now.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../lib/runtime.js" type="text/javascript" charset="utf-8"></script>
|
|
<script type="text/javascript" charset="utf-8">
|
|
var core = {};
|
|
var gui = {};
|
|
runtime.currentDirectory = function () {
|
|
return "../lib";
|
|
};
|
|
runtime.libraryPaths = function () {
|
|
return [ runtime.currentDirectory() ];
|
|
};
|
|
function html_init() {
|
|
var accumulated_waiting_time = 0;
|
|
function later_cb() {
|
|
var net = runtime.getNetwork();
|
|
if (net.networkStatus === "unavailable") {
|
|
runtime.log("no server connection available. starting disconnected.");
|
|
init();
|
|
return;
|
|
}
|
|
if (net.networkStatus !== "ready") {
|
|
if (accumulated_waiting_time > 3000) {
|
|
runtime.log("connection to server timed out. starting disconnected.");
|
|
init();
|
|
}
|
|
runtime.log("waiting...");
|
|
accumulated_waiting_time += 100;
|
|
window.setTimeout(later_cb, 100);
|
|
return;
|
|
}
|
|
runtime.log("connected to server: "+net.serverName);
|
|
runtime.getNetwork().ping();
|
|
// collabtest init
|
|
init();
|
|
}
|
|
later_cb();
|
|
}
|
|
</script>
|
|
<script src="../lib/core/Selection.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../lib/core/Cursor.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../lib/core/PositionIterator.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="../lib/gui/SelectionMover.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="test.js" type="text/javascript" charset="utf-8"></script>
|
|
<style>
|
|
div#session1 {
|
|
position: absolute;
|
|
left: 0%;
|
|
width: 90%;
|
|
overflow: auto;
|
|
background-color: gray;
|
|
}
|
|
div#avatars1 {
|
|
position: absolute;
|
|
left: 90%;
|
|
width: 10%;
|
|
background: gray;
|
|
}
|
|
div#session2 {
|
|
position: absolute;
|
|
left: 0;
|
|
width: 90%;
|
|
overflow: auto;
|
|
background: #dddddd;
|
|
}
|
|
div#avatars2 {
|
|
position: absolute;
|
|
left: 90%;
|
|
width: 10%;
|
|
background: #dddddd;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript" charset="utf-8">
|
|
window.setTimeout(html_init, 0);
|
|
</script>
|
|
<div id="session1">
|
|
<div id="odf1"></div>
|
|
</div>
|
|
<div id="avatars1"></div>
|
|
<div id="session2">
|
|
<div id="odf2"></div>
|
|
</div>
|
|
<div id="avatars2"></div>
|
|
</body>
|
|
</html>
|