如何配置CKEditor-4内联编辑器?

如何配置CKEditor-4内联编辑器?,ckeditor,Ckeditor,我有一个标准安装(如示例): 所以,我的问题是 如何在此上下文中执行customConfig 在没有在线配置工具的情况下,关于配置菜单(editor.config.toolbar)的“最佳完整文档”在哪里,我可以理解如何使用正确的名称放置和删除菜单项?没有关于如何在完整安装中修复“源代码”的错误的内容 是的 并使用上面的代码编辑samples/myinline.html 对于内联编辑器,标准的Source按钮是隐藏的,因为除了wysiwyg之外,不可能有其他模式。因此,为这些编辑器创建了新插件

我有一个标准安装(如示例):

所以,我的问题是

  • 如何在此上下文中执行
    customConfig
  • 在没有在线配置工具的情况下,关于配置菜单(
    editor.config.toolbar
    )的“最佳完整文档”在哪里,我可以理解如何使用正确的名称放置和删除菜单项?没有关于如何在完整安装中修复“源代码”的错误的内容

  • 是的

    并使用上面的代码编辑
    samples/myinline.html

  • 对于内联编辑器,标准的
    Source
    按钮是隐藏的,因为除了
    wysiwyg
    之外,不可能有其他模式。因此,为这些编辑器创建了新插件-,但默认情况下,它不包含在任何构建中。您可以使用或通过使用with
    all
    参数之一使用此插件构建编辑器。例如:
    /build.sh full all
    。还记得加载
    sourcedialog
    插件(使用
    config.extraPlugins='sourcedialog'

  • 若您想自由配置内联编辑器,那个么您应该看看示例。首先,您需要禁用可编辑元素上的自动编辑器初始化,然后对要成为编辑器的元素调用
    CKEDITOR.inline()

    // We need to turn off the automatic editor creation first.
    CKEDITOR.disableAutoInline = true;
    
    CKEDITOR.inline( 'editable1', {
        customConfig: 'editableConfig.js'
    } );
    CKEDITOR.inline( 'editable1', {
        toolbar: [ ... ]
    } );
    

  • 非常感谢,你是编辑!我正在进行测试,稍后会回来。
      <script>
       CKEDITOR.on( 'instanceCreated', function( event ) {
         var editor = event.editor, element = editor.element;
             if ( element.is( 'h1', 'h2', 'h3' ) ) {
            editor.on( 'configLoaded', function() {
                editor.config.toolbar = [
                    [ 'Source', '-', 'Bold', 'Italic' ]
                ];  // BUG: about "Source"?? NOT AT INTERFACE!
            }); 
             } else {
                // WHERE PUT THIS ITEM?
        customConfig: 'configType2.js';
             }
       });
      </script>
    
    git clone git://github.com/ckeditor/ckeditor-releases.git
    cd ckeditor-releases
    cp samples/inlineall.html samples/myinline.html 
    
    // We need to turn off the automatic editor creation first.
    CKEDITOR.disableAutoInline = true;
    
    CKEDITOR.inline( 'editable1', {
        customConfig: 'editableConfig.js'
    } );
    CKEDITOR.inline( 'editable1', {
        toolbar: [ ... ]
    } );