Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build CKEditor5 #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

build CKEditor5 #57

wants to merge 1 commit into from

Conversation

WebberMao
Copy link

Hello, I build CKEditor5 in this RP.

The user can use ckeditor4 or ckeditor5 by choosing different CKEditor class
app = CKEditor4(app) #for ckeditor4
app = CKEditor5(app) #for ckeditor5

and change the editor_type (support CKEditor5 only) by setting config
`CKEDITOR_EDITOR_TYPE = 'classic' #and all of the following

  • classic for Classic Editor
  • inline for Inline Editor
  • balloon for Balloon Editor
  • balloon-block for Balloon Block Editor
  • decoupled-document for Decoupled Editor

hope you will like it!


file_uploader = kwargs.get('file_uploader', current_app.config['CKEDITOR_FILE_UPLOADER'])

if file_uploader != '':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not something like if not file_uploader instead of if file_uploader != '' ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, nice work, @WebberMao

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I following the coding style of the previous version ( as you can see in line 80 ), and if file_uploder is more correct.
Thanks!

@greyli greyli added this to the 0.5.0 milestone Jan 14, 2022
@malikpiara
Copy link

Hi @WebberMao! Super excited to learn CKEditor5 might be available soon! Any news on the merge? Also: Does it make sense to add GitHub sponsors to this project?

@WebberMao WebberMao closed this Jan 28, 2022
@WebberMao WebberMao reopened this Jan 28, 2022
Comment on lines -17 to -18
c = kwargs.pop('class', '') or kwargs.pop('class_', '')
kwargs['class'] = u'%s %s' % ('ckeditor', c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove these lines? It supports adding the user-defined class to the textarea element.

c = kwargs.pop('class', '') or kwargs.pop('class_', '')
kwargs['class'] = u'%s %s' % ('ckeditor', c)
return super(CKEditor, self).__call__(field, **kwargs)
ckeditor=field.name+'_'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ckeditor=field.name+'_'
ckeditor = field.name + '_'

.catch( error => {
console.error( error );
});
document.querySelector( '#submit' ).addEventListener( 'click', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the user uses a different id for the submit button?

@greyli
Copy link
Member

greyli commented Mar 5, 2023

Hi, thanks for working on this. I think this PR is still incomplete:

  • We shouldn't introduce a breaking change directly. The CKEditor class should be kept with a deprecated warning.
  • The CKEditor5 support for some configurations is not implemented (e.g. CKEDITOR_SERVE_LOCAL, CKEDITOR_LANGUAGE, etc.)
  • The example application, tests, docs, and changelog should be updated.

@greyli greyli modified the milestones: 0.5.0, 1.0.0 Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants