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)

API のリファレンス

editor.onClick.addToTop(callbackFunction)

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

API のリファレンス

editor.onClick.dispatch()

editor.fire("Click")

API のリファレンス

editor.onClick.remove(callbackFunction)

editor.off("Click", callbackFunction)

API のリファレンス

変更された 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)

API のリファレンス

翻訳 i18n

廃止予定のメソッド

新しいメソッド

新しい API のドキュメント

tinymce.addI18n(key, data)

パラメーター

  • key (文字列) - 言語コードとプレフィックスの組み合わせ

  • data (オブジェクト) - 翻訳を持つ名前 / 値オブジェクト

サンプル

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

tinymce.addI18n(languageCode, data)

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

パラメーター

  • languageCode (文字列) - 言語コード

  • data (オブジェクト) - 翻訳を持つ名前 / 値オブジェクト

サンプル

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

API のリファレンス 

editor.getLang(key, defaultValue)

editor.translate(key)

tinymce.util.i18n.translate(key)

API のリファレンス

editor = tinymce.activeEditor (エディターはアクティブ エディター)

最終更新日 2021 年 7 月 29 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.