diff --git a/src/app/simple-cdn-usage/simple-cdn-usage.component.html b/src/app/simple-cdn-usage/simple-cdn-usage.component.html index 0cdd84d..7273204 100644 --- a/src/app/simple-cdn-usage/simple-cdn-usage.component.html +++ b/src/app/simple-cdn-usage/simple-cdn-usage.component.html @@ -13,6 +13,7 @@
Getting used to an entirely different culture can be challenging.
@@ -28,11 +29,107 @@ You learn to appreciate each and every single one of the differences while you b
loadCKEditorCloud( {
version: '43.0.0'
} )
- .then( cloud => {
- this.Editor = createCdnEditor( {
- cloud
- } );
- } );
+ .then( this._setupEditor.bind( this ) );
+ }
+
+ private _setupEditor( cloud: CKEditorCloudResult ) {
+ const {
+ ClassicEditor,
+ Essentials,
+ CKFinderUploadAdapter,
+ Autoformat,
+ Bold,
+ Italic,
+ BlockQuote,
+ CKBox,
+ CKFinder,
+ CloudServices,
+ EasyImage,
+ Heading,
+ Image,
+ ImageCaption,
+ ImageStyle,
+ ImageToolbar,
+ ImageUpload,
+ Indent,
+ Link,
+ List,
+ MediaEmbed,
+ Paragraph,
+ PasteFromOffice,
+ PictureEditing,
+ Table,
+ TableToolbar,
+ TextTransformation
+ } = cloud.CKEditor;
+
+ this.Editor = ClassicEditor;
+ this.config = {
+ plugins: [
+ Essentials,
+ CKFinderUploadAdapter,
+ Autoformat,
+ Bold,
+ Italic,
+ BlockQuote,
+ CKBox,
+ CKFinder,
+ CloudServices,
+ EasyImage,
+ Heading,
+ Image,
+ ImageCaption,
+ ImageStyle,
+ ImageToolbar,
+ ImageUpload,
+ Indent,
+ Link,
+ List,
+ MediaEmbed,
+ Paragraph,
+ PasteFromOffice,
+ PictureEditing,
+ Table,
+ TableToolbar,
+ TextTransformation
+ ],
+ toolbar: {
+ items: [
+ 'undo',
+ 'redo',
+ '|',
+ 'heading',
+ '|',
+ 'bold',
+ 'italic',
+ '|',
+ 'link',
+ 'uploadImage',
+ 'insertTable',
+ 'blockQuote',
+ 'mediaEmbed',
+ '|',
+ 'bulletedList',
+ 'numberedList',
+ 'outdent',
+ 'indent'
+ ]
+ },
+ image: {
+ toolbar: [
+ 'imageStyle:inline',
+ 'imageStyle:block',
+ 'imageStyle:side',
+ '|',
+ 'toggleImageCaption',
+ 'imageTextAlternative'
+ ]
+ },
+ table: {
+ contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
+ },
+ language: 'en'
+ };
}
public onReady(): void {
diff --git a/src/editor/create-cdn-editor.ts b/src/editor/create-cdn-editor.ts
deleted file mode 100644
index 36267d7..0000000
--- a/src/editor/create-cdn-editor.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-import type { CKEditorCloudResult } from '@ckeditor/ckeditor5-integrations-common';
-import type { ClassicEditor, Plugin } from 'https://cdn.ckeditor.com/typings/ckeditor5.d.ts';
-
-type ClassicEditorCreatorConfig = {
- cloud: CKEditorCloudResult;
- additionalPlugins?: Array