我试图添加 justify 插件以使文本能够向右、向左或居中对齐。但是按照文档中的说明(http://apostrophecms.org/docs/tutorials/howtos/ckeditor.html),我想知道插件是否应该位于特定文件夹中(我的位于 public/modules/apostrophe- area/js/ckeditorPlugins/justify/),因为它会在网站加载时消失,但是如果我将它包含在其他一些文件夹中,例如 public/plugins/justify 仍然不起作用。
这是我的代码以防万一:(位于 lib/modules/apostrophe-areas/public/js/user.js)
apos.define('apostrophe-areas', {
construct: function(self, options) {
// Use the super pattern - don't forget to call the original method
var superEnableCkeditor = self.enableCkeditor;
self.enableCkeditor = function() {
superEnableCkeditor();
// Now do as we please
CKEDITOR.plugins.addExternal('justify', '/modules/apostrophe-areas/js/ckeditorPlugins/justify/', 'plugin.js');
};
}
});
此外,很高兴知道应该如何在可编辑小部件的工具栏设置中调用插件。谢谢!