TinyMCE エディターのアップグレード
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 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.
以下は、マウス クリックのイベント リスナーの例です。ほかのイベントにも新しいメソッドを適用する必要があります。
廃止予定のメソッド | 新しいメソッド | 新しい API のドキュメント |
---|---|---|
editor.onClick.add(callbackFunction) | editor.on("Click", callbackFunction) | |
editor.onClick.addToTop(callbackFunction) | editor.on("Click", callbackFunction, true) | |
editor.onClick.dispatch() | editor.fire("Click") | |
editor.onClick.remove(callbackFunction) | editor.off("Click", callbackFunction) |
変更された UI API メソッド名前空間
The API methods for registering UI components have moved. They are now part of TinyMCE 5 Ui registration API.
廃止予定のメソッド | 新しいメソッド | 新しい API のドキュメント |
---|---|---|
editor.addButton(identifier, configuration) | editor.ui.registry.addButton(identifier, configuration) |
翻訳 i18n
廃止予定のメソッド | 新しいメソッド | 新しい API のドキュメント |
---|---|---|
tinymce.addI18n(key, data) パラメーター
サンプル
| tinymce.addI18n(languageCode, data) tinymce.util.i18n.add(languageCode, data) パラメーター
サンプル
| |
editor.getLang(key, defaultValue) | editor.translate(key) tinymce.util.i18n.translate(key) |
editor = tinymce.activeEditor (エディターはアクティブ エディター)