diff --git a/examples/indexeddb/index.html b/examples/indexeddb/index.html new file mode 100644 index 00000000..e2218850 --- /dev/null +++ b/examples/indexeddb/index.html @@ -0,0 +1,21 @@ + + + + + +
+ + + + + + + diff --git a/examples/indexeddb/index.js b/examples/indexeddb/index.js new file mode 100644 index 00000000..b307579b --- /dev/null +++ b/examples/indexeddb/index.js @@ -0,0 +1,24 @@ +/* global Y, CodeMirror */ + +// initialize a shared object. This function call returns a promise! +Y({ + db: { + name: 'memory' + }, + connector: { + name: 'websockets-client', + room: 'codemirror-example' + }, + sourceDir: '/bower_components', + share: { + codemirror: 'Text' // y.share.codemirror is of type Y.Text + } +}).then(function (y) { + window.yCodeMirror = y + + var editor = CodeMirror(document.querySelector('#codeMirrorContainer'), { + mode: 'javascript', + lineNumbers: true + }) + y.share.codemirror.bindCodeMirror(editor) +})