Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active June 22, 2021 14:17
Show Gist options
  • Save velotiotech/4a0d183bdc626a27424bb7c386c71eb5 to your computer and use it in GitHub Desktop.
Save velotiotech/4a0d183bdc626a27424bb7c386c71eb5 to your computer and use it in GitHub Desktop.
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