helloflask / flask-ckeditor

CKEditor integration for Flask, including image upload, code syntax highlight, and more.
https://flask-ckeditor.readthedocs.io
MIT License
200 stars 67 forks source link

How to add custom button?? #25

Closed highwindmx closed 3 years ago

highwindmx commented 4 years ago

I am trying to implement html5video but I find some diffculty in custom its button

ref : https://github.com/bahriddin/ckeditor-html5-video/issues/4

How can I code such as :

editor.ui.addButton && editor.ui.addButton( 'html5video', {
    label   : 'Video',
    command : 'html5video'
});

Thanks

greyli commented 3 years ago

Hi, sorry for the late response. This usage is currently not supported in Flask-CKEditor. The editor variable is the object returned by CKEDITOR.replace. However, to support multiple CKEditor on one page, I can't simply set it to a hard-coded variable.

In my opinion, this feature is out of the scope this project is focused on. There are some other ways to add a custom button, for example, update config.js or plugin.js file (this post may be helpful).