0

I have a very basic text editor that uses CKEditor. The default CKEditor toolbar is hidden because for editing I need only image upload (which is completely custom) and Equation Editor plugin for formulas.

My goal is to use a custom button for the Equation Editor and call the plugin on click. So, somewhere in the UI of the editor, I would have this:

<a href="#" class="custom-formula-button">Insert formula</a>

Clicking on the button should open the Equation Editor.

How do I achieve this?

Note: I have multiple CKEditor instances on the page.

lesssugar
  • 15,486
  • 18
  • 65
  • 115
  • Please see ["Should questions include “tags” in their titles?"](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles), where the consensus is "no, they should not"! –  Apr 13 '15 at 11:12

1 Answers1

1

You should use CKEDITOR.editor.execCommand() like this

CKEDITOR.instances.myEditorInstance.execCommand( 'mathjax' )

And this is where you'll find how to do this.

You can list available commands of the CKEditor instance by browsing CKEDITOR.instances.myEditorInstance.commands object.

Community
  • 1
  • 1
oleq
  • 15,697
  • 1
  • 38
  • 65