TinyMCE editor upgrade

Still need help?

The Atlassian Community is here for you.

Ask the community

We’ve upgraded TinyMCE editor from version 4.6.4 to 5.8.0 (latest release). Below we’ve included information about editor API deprecations.

TinyMCE 5 editor deprecations

See TinyMCE’s guide for migrating from TinyMCE 4 to TinyMCE 5.

Event handling

Event handling is based on the new way of binding events introduced in TinyMCE 4.0. See Event handling and Handling Editor events for more details. You can skip event handling if you've already migrated your code to TinyMCE 4.0.

Below is an example for listening to mouse click event. You should apply the new method for other events as well.

Deprecated method

New method

Docs for new API

editor.onClick.add(callbackFunction)

editor.on("Click", callbackFunction)

API reference

editor.onClick.addToTop(callbackFunction)

editor.on("Click", callbackFunction, true)

API reference

editor.onClick.dispatch()

editor.fire("Click")

API reference

editor.onClick.remove(callbackFunction)

editor.off("Click", callbackFunction)

API reference

Changed UI API method namespace

The API methods for registering UI components have moved. They are now part of TinyMCE 5 Ui registration API.

Deprecated method

New method

Doc for new API

editor.addButton(identifier, configuration)

editor.ui.registry.addButton(identifier, configuration)

API reference

Translation i18n

Deprecated method

New method

Docs for new API

tinymce.addI18n(key, data)

Parameters

  • key (String) - combination of language code and prefix

  • data (Object) - Name/value object with translations

Sample

tinymce.addI18n('en_AU.dialog', {'title': 'My dialog'}) 

tinymce.addI18n(languageCode, data)

tinymce.util.i18n.add(languageCode, data)

Parameters

  • languageCode (String) - language code

  • data (Object) - Name/value object with translations

Sample

tinymce.addI18n('en_AU', {'dialog.title': 'My dialog'}) 

API reference 

editor.getLang(key, defaultValue)

editor.translate(key)

tinymce.util.i18n.translate(key)

API reference

editor = tinymce.activeEditor (editor is the active editor)

Last modified on Jul 29, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.