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