문제

Does TinyMCE's API support a method for finding whether or not a plugin is active, or better, whether a given command is registered? Specifically, I am creating a plugin that would like to call the mceAutoResize command at periods, but in order to do so I would prefer to detect whether the command exists or not. I know I can do this by searching the plugins parameter, but I wanted to know specifically if there is an API-supported way (to limit the chances that this plugin will break on a TinyMCE update).

도움이 되었습니까?

해결책

To see if a plugin or command is active there seems to be no real API functionality. What you can do to see if a plugin is loaded use

var plugin_is_usable = tinymce.get(editor_id).plugins.pluginname;

To check if a given command (in this case mceAutoResize) is available you may use

var mceAutoResize_is_usable = tinymce.get(editor_id).execCommands.mceAutoResize;

It is not likely that this will ever change in tinymce.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top