集成CKEDITOR.replace和Perch以使用两个编辑器

集成CKEDITOR.replace和Perch以使用两个编辑器,ckeditor,perch,Ckeditor,Perch,在CKEDITOR的文档中,建议在config.js文件中使用以下内容: CKEDITOR.editorConfig = function( config ) { config.toolbar_Full = [ { name: 'document', items : [ 'Source','-', 'Save','NewPage','DocProps','Preview', 'Print','-','Templates' ]

在CKEDITOR的文档中,建议在config.js文件中使用以下内容:

CKEDITOR.editorConfig = function( config ) {
    config.toolbar_Full = [
         { name: 'document', items : [ 'Source','-',
           'Save','NewPage','DocProps','Preview',
           'Print','-','Templates' ] }
    ];
    config.toolbar = 'Full';
 };
虽然这实际上不起作用。它只在没有parens的情况下工作:

 CKEDITOR.editorConfig = function( config ) {
    config.toolbar_Full = [
         [ 'Source','-','Save','NewPage','DocProps',
           'Preview','Print','-','Templates' ]
    ];
    config.toolbar = 'Full';
 };
现在,Perch还有一个小装备:CKEDITOR.replace,用于内联使用,但我想在config.js文件中使用它。如何重写对CKEDITOR.replace的调用,使其在config.js中工作

CKEDITOR.replace( 'editor1', {
    toolbar : 'Full'
});

CKEDITOR.replace( 'editor2', {
    toolbar : 'Basic'
});

只需使用自定义配置加载CKEditor:

CKEDITOR.replace( 'editor1', {
  toolbar: [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ]
});
或者定义自定义工具栏并将其加载:

CKEDITOR.replace( 'editor2', {
  toolbar_Custom: [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ],
  toolbar: 'Custom'
});

正如我在中所回答的,您一定使用的是旧版本的CKEditor,该工具栏语法是在CKEditor 3.6中引入的

实际上,第一个示例中的代码确实有效。在你试图改变事情之前,你可能应该试着让一个基本的设置工作起来。是否已检查位于ckeditor/\u samples文件夹中的文件是否正确加载?ckeditor/INSTALL.html文件建议您通过查看示例文件来验证安装是否正常工作。示例文件提供了如何修改工具栏设置的示例。