HTML editor requirements for WIRIS editor

This article explains the requirements that an HTML editor should accomplish in order to be able to integrate WIRIS editor with it. You only need to check this requirements list if there is no WIRIS plugin for your HTML editor. Check the complete list at WIRIS plugins

For details of how to proceed with that integration visit WIRIS plugin for generic HTML editor.

Terminology

  • Web application. The collection of web pages that includes an HTML editor to generate new richly formatted content.
  • HTML editor. A Web component that allows editing rich HTML content. It usually substitutes a simple textarea with a more sophisticated user graphical interface that includes a toolbar and a frame where you can, for example, change font styling and insert images.
  • WIRIS editor/plugin. The WIRIS formula and equation editor and plugin.

There are two mandatory requirements

  1. Server side scripting. Allow executing server side scripting. WIRIS plugins already provide such scripts in Java, PHP, ASP.NET and ASP. This is more a Web application requirement than an HTML editor.
  2. Add a button. Allow inserting a new button in the toolbar of the HTML editor that executes a custom JavaScript code in the on click event. In addition is necessary to load a JavaScript file provided by WIRIS editor/plugin and to allow it to run some initialization code. The initialization method is the responsible to add the mouse events used to reedit a formula.

For features like LaTeX, storing “full MathML in the database” and WIRIS cas, two other requirements must be met:

  1. Post set HTML event. After the initial content is set in the HTML editor and before the user edition starts, a script of the WIRIS editor must called in order to transform the HTML.
  2. Pre get HTML event. Before the content is retrieved to be stored, a script of the WIRIS editor must be called in order to transform the HTML.

If the above requirements are not met, the Web application has still the change to do direct calls to the WIRIS editor/plugin.

Finally, two optional requirements help promote good practices and easy to maintain code:

  1. Auto-load of plugin JavaScripts. The HTML editor handles the load of the JavaScript required by WIRIS editor/plugin (it adds any necessary <script> tags by itself). If this requirement is not met, the Web application is the responsible to include the JavaScript file of the WIRIS editor/plugin whenever the editor is required.
  2. Initialization event. The HTML editor calls an initialization event of the WIRIS editor/plugin. If this requirement is not met, the Web application is the responsible to call the initialization method which might be tricky to achieve.