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