Skip to content

Create custom plugin #26

@jimenez-c

Description

@jimenez-c

Hello, thank you for this very good bundle!

I created a custom Froala plugin with the code from the documentation : Custom Popup

I added this custom plugin to the YML configuration using :

leapt_froala_editor:
  customJS: 'custom-plugin.js'
  pluginsEnabled: ['customPlugin']

But it seems that your bundle has a hardcoded list of available plugins, and any plugin that does not belong to this list is automatically removed.

So my question is : how do you register a custom Froala plugin with your bundle?

I managed to make it work by re-initializing all Froala instances in the custom JS with a code like this :

document.querySelectorAll('textarea').forEach(textarea => {
  new FroalaEditor(textarea, {
    pluginsEnabled: ['customPlugin'],
    toolbarButtons: ['myButton']
  })
});

but obviously it is very dirty and I have to copy/paste all YML configuration in the JS, which is not an acceptable solution.

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions