Last active
June 22, 2021 14:17
-
-
Save velotiotech/4a0d183bdc626a27424bb7c386c71eb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('load', () => { | |
// ### ABOVE CODE HERE ### | |
const editorContainer = document.getElementById('editor'); | |
const toolbarOptions = [ | |
['bold', 'italic', 'underline', 'strike'], // toggled buttons | |
['blockquote', 'code-block'], | |
[{ 'header': 1 }, { 'header': 2 }], // custom button values | |
[{ 'list': 'ordered' }, { 'list': 'bullet' }], | |
[{ 'script': 'sub' }, { 'script': 'super' }], // superscript/subscript | |
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent | |
[{ 'direction': 'rtl' }], // text direction | |
// array for drop-downs, empty array = defaults | |
[{ 'size': [] }], | |
[{ 'header': [1, 2, 3, 4, 5, 6, false] }], | |
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme | |
[{ 'font': [] }], | |
[{ 'align': [] }], | |
['image', 'video'], | |
['clean'] // remove formatting button | |
]; | |
const editor = new Quill(editorContainer, { | |
modules: { | |
cursors: true, | |
toolbar: toolbarOptions, | |
history: { | |
userOnly: true // only user changes will be undone or redone. | |
} | |
}, | |
placeholder: "collab-edit-test", | |
theme: "snow" | |
}); | |
const binding = new QuillBinding(type, editor, provider.awareness); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment