fix examples for Yjs@13

This commit is contained in:
Kevin Jahns
2018-01-25 17:28:33 -07:00
parent 1d4f283955
commit 41a88dbc43
28 changed files with 202 additions and 282 deletions

View File

@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html>
</head>
<script src="../yjs-dist.js"></script>
<script src="../../y.js"></script>
<script src='../../../y-websockets-client/y-websockets-client.js'></script>
<script src="./index.js"></script>
</head>
<body contenteditable="true">

View File

@@ -4,18 +4,14 @@ window.onload = function () {
window.yXmlType.bindToDom(document.body)
}
const persistence = new Y.IndexedDB()
// initialize a shared object. This function call returns a promise!
let y = new Y('htmleditor', {
connector: {
name: 'websockets-client',
url: 'http://127.0.0.1:1234',
room: 'html-editor'
// maxBufferLength: 100
url: 'http://127.0.0.1:1234'
}
}, persistence)
window.yXml = y
})
window.y = y
window.yXmlType = y.define('xml', Y.XmlFragment)
window.undoManager = new Y.utils.UndoManager(window.yXmlType, {
captureTimeout: 500