ZK框架中使用的CKEditor如何添加Emoji插件?

How to add Emoji plugin to CKEditor used in ZK framework?

我有一个要求,我的 ZK 所见即所得工具栏 需要提供添加表情符号的选项。

我检查发现 CKEditor 已经附带了一个表情符号插件,但我无法在 ZK 编辑器上启用它。

我已经尝试将以下内容添加到配置文件中,但它不起作用。

config.toolbar_EmojiOnly = [
    ['emoji']
];

有人可以帮忙吗?

请注意 - 我不想使用 Smiley 插件。我想使用表情符号插件。

为 ZK 应用程序添加插件 CKEditor 需要做三件事。 1:下载所有插件文件,包括您要安装的插件的依赖项。 对于表情符号插件,您至少需要以下插件:

- ajax
- autocomplete
- emoji
- floatpanel
- panelbutton
- textmatch
- textwatcher
- xml

您可以从 CKEditor 官方网站下载这些

2:将插件部署到正确的文件夹中 ZK 的 CKEditor 插件位于 [classpath]/web/js/ckez/ext/CKeditor/plugins 下 标准部署位于 [application root]/src/main/resources/web/js/ckez/ext/CKeditor/plugins 您的部署应如下所示:

- [root]/src/main/resources/web/js/ckez/ext/CKeditor/plugins/ajax/plugin.js
- [root]/src/main/resources/web/js/ckez/ext/CKeditor/plugins/emoji/plugin.js
- [root]/src/main/resources/web/js/ckez/ext/CKeditor/plugins/emoji/assets/...
etc.

3:实际将插件添加到您的 ckeditor 实例中。 标准方法是使用自定义配置文件,例如:

CKEDITOR.editorConfig = function(config) {
    config.extraPlugins = 'emoji';
};

并且您将声明您的配置,例如:

<ckeditor customConfigurationsPath="/path/to/config.js"/>