Answer the question
In order to leave comments, you need to log in
How to create and run custom plugins for CKEditor 5 if I load it in code from the official CDN?
Good day!
The admin area of a large non-NPM project is using CKEditor 5, which is downloaded from the official CDN , and I wanted to create some plugins for the input field:
class SmartTitleUploader extends Plugin{
init(){
const editor = this.editor;
editor.ui.componentFactory.add( 'smartTitleUploader', locale => {
const view = new ButtonView( locale );
...
view.on( 'execute', () => {} );
return view;
} );
}
}
class SaveNews extends Plugin{
init(){
const editor = this.editor;
editor.ui.componentFactory.add( 'saveNews', locale => {
const view = new ButtonView( locale );
....
view.on( 'execute', () => { } );
return view;
} );
}
}
toolbar: {
plugins: [ SmartTitleUploader, SaveNews ],
items: ['heading', 'bold', 'link', 'smartTitleUploader', 'saveNews']
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question