插件不适用于 CKEditor 4.4

plugins don't work with CKEditor 4.4

我正在尝试向 CKeditor 添加一个插件,所以我遵循了这个 tutorial which show you an example of a timestamp plugin which you can add to your ckeditor. this plugin example is available for download here

我下载了它,它在这个配置下工作得很好:

CKEDITOR.editorConfig = function(config) {

    config.extraPlugins = 'timestamp';
}

html 页数:

<p id="editable-text" contenteditable="true"> 
    this is a text which should be edited by ckeditor
</p>

 <p id="another-editable" contenteditable="true"> 
    this is a text which should be edited by ckeditor
 </p

<script>
  CKEDITOR.disableAutoInline = true;
  CKEDITOR.inline( 'editable-text');
  CKEDITOR.inline( 'another-editable');
</script>

但过了一段时间,我一直在寻找一种解决方案,在所有可编辑段落之间共享工具栏,并将工具栏的位置固定在页面顶部。幸运的是,我找到了一个名为 sharedspace 的插件,它正是这样做的,我下载了它并将它放在插件文件夹中,然后我在我的配置文件中添加了一些行以使其工作。

CKEDITOR.editorConfig = function(config) {

    config.extraPlugins = 'timestamp';

    config.extraPlugins = 'sharedspace';
    config.removePlugins = 'floatingspace,resize';

    config.sharedSpaces = {
      top: 'toolbarLocation',
    }
}

现在 timestamp 插件不再工作。当我删除添加的几行时,'timestamp' 插件重新工作(我可以在工具栏中看到计时器按钮)。

没有其他插件似乎可以使用上面的代码行。

有办法解决吗?谢谢!

这是不正确的:

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

    config.extraPlugins = 'sharedspace';
};

您首先将 extraPlugins 设置为 'timestamp',然后立即将其设置为 'sharedspace'。您需要设置一次,两个值:

CKEDITOR.editorConfig = function(config) {
    config.extraPlugins = 'timestamp,sharedspace';
};