[英]ckeditor 4 standard with text colour
我已经安装了 ckeditor 标准并且想要有文本颜色和背景颜色。 我使用以下代码安装了 colordialog 和 panelbutton 插件,有什么想法吗?
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbar = [
[ 'SpecialChar', 'Bold', 'Italic', 'Strike', 'Underline',{ name: 'colors', items: [ 'TextColor', 'BGColor' ] }]
];
config.removePlugins = 'elementspath';
config.resize_enabled = false;
config.extraPlugins = 'colordialog';
};
您需要colorbutton插件,而不是colordialog 。 实际上,您可以同时使用两者,因为颜色对话框扩展了颜色按钮。 颜色按钮为您提供设置前景色和背景色的按钮,颜色对话框在基本颜色选择器中添加了一个按钮,让您可以从更多颜色中进行选择。 请参阅设置文本和背景颜色示例以获取实时演示和要复制的代码。
我还建议使用online builder ,这样您就不必手动解析依赖项。 阅读有关安装插件的更多信息。
对于 CKEditor4 - 如果您使用的是完整包并且不尝试将颜色插件添加到基本或标准包,则工具栏名称为“TextColor”。 背景颜色是“BGColor”
config.toolbar = [['TextColor', 'BGColor']]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.