Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70779

How to add a custom button with an action on CKEditor Ionic

$
0
0

@ionian wrote:

Hi, i am working on an Ionic project. I am using CKEditor. I am trying to add a custom item on the toolbar of the CKEditor. I would like to add an item ,that when clicked ,should change the color of the text inside the editor. My code is as follows:

const ClassicEditor = require('@ckeditor/ckeditor5-build-classic');
ClassicEditor.create( document.getElementById( 'editor1' ),{
toolbar: {
    items: [ 'bold', 'italic', 'undo' ],
    extraPlugins: [MyUploadAdapterPlugin]
}
)
.then( editor => {
    console.log( "editor= "+editor.textContent );
} )
.catch( error => {
    console.error( error );
} );

function MyUploadAdapterPlugin( editor ) {
  console.log("MyUploadAdapterPlugin");
}

Do i have to create a plugin and associate it somehow with the toolbar?
At the moment ,i do not see anything on my toolbar.
I was wondering ,if you could help me ,please?
Thank you in advance.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70779

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>