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

Create custom plugin #26

Open
jimenez-c opened this issue Oct 1, 2024 · 1 comment
Open

Create custom plugin #26

jimenez-c opened this issue Oct 1, 2024 · 1 comment

Comments

@jimenez-c
Copy link

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!

@jmsche
Copy link
Member

jmsche commented Oct 2, 2024

Hello,

I don't see a way right now, but feel free to open a pull request :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants