自定义CKEditor
我已经将 ckeditor 安装到我的 asp.mvc 项目中,现在我需要实现一些已实现的选项。我如何定义配置文件或者其中有什么问题?
<link href="../../ckeditor/contents.css" rel="stylesheet" type="text/css"></link>
<script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="../../../../ckeditor/config.js" type="text/javascript"></script>
<textarea class="ckeditor" cols="20" id="Article_Text" name="Article.Text" rows="2">
</textarea>
然而,这仍然以默认设置呈现。
和我的 ckeditor config.js
CKEditor1.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
config.language = 'cz';
config.uiColor = '#FFF';
};
CKEditor1.config.toolbar = new object[]
{
new object[] { "Source" },
new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" },
new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent" },
"/",
new object[] { "Styles", "Format", "Font", "FontSize", "TextColor", "BGColor", "-", "About" },
};
i have installed ckeditor into my asp.mvc project, now i need to implement just some of the options that are implemented. How do i define the config file or what i have wrong in it?
<link href="../../ckeditor/contents.css" rel="stylesheet" type="text/css"></link>
<script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="../../../../ckeditor/config.js" type="text/javascript"></script>
<textarea class="ckeditor" cols="20" id="Article_Text" name="Article.Text" rows="2">
</textarea>
how ever this still render with default settings.
and my ckeditor config.js
CKEditor1.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
config.language = 'cz';
config.uiColor = '#FFF';
};
CKEditor1.config.toolbar = new object[]
{
new object[] { "Source" },
new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" },
new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent" },
"/",
new object[] { "Styles", "Format", "Font", "FontSize", "TextColor", "BGColor", "-", "About" },
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经找到了基本的解决方案
i have found the basic solution
你好,应该是
而不是 CKEditor1.editorConfig。我认为那时它会起作用。
这是 ckeditor 配置的完整文档。
HI, it should be
instead of CKEditor1.editorConfig. I think it will work then.
here is the full documentation for ckeditor cofiguration.