Files
yjs/examples_all/quill/index.js

30 lines
723 B
JavaScript
Raw Normal View History

2017-05-19 02:21:50 +02:00
/* global Y, Quill */
2018-02-26 17:15:27 +01:00
let y = new Y('quill-cursors-0', {
2017-05-19 02:21:50 +02:00
connector: {
name: 'websockets-client',
2018-02-26 02:18:39 +01:00
url: 'http://127.0.0.1:1234'
2017-05-19 02:21:50 +02:00
}
2018-02-26 02:18:39 +01:00
})
2017-05-19 02:21:50 +02:00
2018-02-26 02:18:39 +01:00
let quill = new Quill('#quill-container', {
modules: {
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline'],
['image', 'code-block'],
[{ color: [] }, { background: [] }], // Snow theme fills in values
2018-02-26 02:18:39 +01:00
[{ script: 'sub' }, { script: 'super' }],
['link', 'image'],
['link', 'code-block'],
[{ list: 'ordered' }, { list: 'bullet' }]
]
},
placeholder: 'Compose an epic...',
theme: 'snow' // or 'bubble'
2017-07-05 18:33:16 +02:00
})
2018-02-26 02:18:39 +01:00
let yText = y.define('quill', Y.Text)
2018-11-25 03:17:00 +01:00
window.quillBinding = new Y.QuillBinding(yText, quill)