question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update documentation to include custom plugin example

See original GitHub issue

Overview

I am working on a react application and am using this wrapper to integrate tinymce as an editor. I have written a simple plugin that I would like to add to the editor. The tinymce documentation shows how to include a custom plugin using the PluginManager.add function.

How do I add my custom plugin using this wrapper?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonFccommented, Apr 23, 2019

@vctormb When TinyMCE(not the editor) is loaded a global object called tinymce is created. That is the object that’s being refered to in this example. If you make sure that tinymce.PluginManager.add('customPlugin', (editor) => { /* Do stuff here */ }); is being run before the editor is being set up, that is before this part -

<Editor
      init={{
        plugins: ['customPlugin']
      }}
    />

the editor instance will load the plugin(run the code) previously added to the global tinymce object. Doing it this way with the PluginManager ensures that everything in the editor instance is being set up in the right order.

1reaction
vctormbcommented, Apr 23, 2019

That’s how I’m creating a custom plugin.

<Editor
      init={{
        plugins: ['customPlugin'],
        toolbar: 'customPlugin',
        setup: editor => {
          customPlugin(editor); // I'm importing this plugin from a js file
        }
      }}
    />

I don’t even know if this is a correct way to do it. That’s the only way that I’ve found that works good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developing Custom Gradle Plugins
In our examples, we are going to use Java as the implementation language for standalone plugin project and Groovy or Kotlin in the...
Read more >
Creating a Basic Plugin - CKEditor 4 Documentation
Learn how to install, integrate and configure CKEditor 4. More complex aspects, like creating plugins, widgets and skins are explained here, too.
Read more >
Create a plugin for TinyMCE | Docs
A short introduction to creating plugins for TinyMCE along with an example ... If a custom plugin includes any custom UI created using...
Read more >
How to Create a Custom WordPress Plugin From Scratch
In this guide, I'll show you how to create a custom WordPress plugin. Also, you'll learn how to use best practices in WordPress...
Read more >
Custom plugins - Budibase Docs
You can import a plugin by pressing the. Add plugin button. This will display a dialog box from which you choose a Source....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found