diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-02-06 13:08:38 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-02-06 13:09:33 +0300 |
commit | 08bf1c9de74ad0d6e502d767b603cc2dffae781d (patch) | |
tree | cc8bd5073162c6d58cf13efe77e20e4f0e6f44a8 | |
parent | df97235cae23398d16ce9b40a7b2f405c1229c1e (diff) |
Add alignment as formatting option in text editor
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r-- | package-lock.json | 9 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | src/components/TextEditor.vue | 15 |
3 files changed, 13 insertions, 12 deletions
diff --git a/package-lock.json b/package-lock.json index 0922d43bd..0d790191f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3025,6 +3025,15 @@ "@bundle-analyzer/core": "^0.5.1" } }, + "@ckeditor/ckeditor5-alignment": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-alignment/-/ckeditor5-alignment-16.0.0.tgz", + "integrity": "sha512-yf04et0jSZ4Khhzl/t3GXLbsNMTH0qnyvcDDyIXm8Tu4Qec6c6h2xeCWBNp9cz0gab/91bYFtWReKd/swztMtg==", + "requires": { + "@ckeditor/ckeditor5-core": "^16.0.0", + "@ckeditor/ckeditor5-ui": "^16.0.0" + } + }, "@ckeditor/ckeditor5-basic-styles": { "version": "16.0.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-basic-styles/-/ckeditor5-basic-styles-16.0.0.tgz", diff --git a/package.json b/package.json index de0f7c58c..76959ca84 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@bundle-analyzer/webpack-plugin": "^0.5.1", + "@ckeditor/ckeditor5-alignment": "^16.0.0", "@ckeditor/ckeditor5-basic-styles": "^16.0.0", "@ckeditor/ckeditor5-block-quote": "^16.0.0", "@ckeditor/ckeditor5-build-balloon": "^16.0.0", diff --git a/src/components/TextEditor.vue b/src/components/TextEditor.vue index 1c24c900e..0616e513b 100644 --- a/src/components/TextEditor.vue +++ b/src/components/TextEditor.vue @@ -32,6 +32,7 @@ <script> import CKEditor from '@ckeditor/ckeditor5-vue' +import AlignmentPlugin from '@ckeditor/ckeditor5-alignment/src/alignment' import Editor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor' import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials' import BlockQuotePlugin from '@ckeditor/ckeditor5-block-quote/src/blockquote' @@ -73,18 +74,8 @@ export default { const toolbar = ['undo', 'redo'] if (this.html) { - plugins.push( - ...[ - EssentialsPlugin, - ParagraphPlugin, - BoldPlugin, - ItalicPlugin, - HeadingPlugin, - BlockQuotePlugin, - LinkPlugin, - ] - ) - toolbar.unshift(...['bold', 'italic', 'heading', 'blockquote', 'link']) + plugins.push(...[HeadingPlugin, AlignmentPlugin, BoldPlugin, ItalicPlugin, BlockQuotePlugin, LinkPlugin]) + toolbar.unshift(...['heading', 'alignment', 'bold', 'italic', 'blockquote', 'link']) } return { |