我正在尝试将 CKEditor 添加到我当前正在开发的页面,但在获取我的自定义配置文件时遇到问题?我在 Visual Studio.NET 2008 中使用 CKEditor。我需要自定义显示的工具栏,因为 Basic 太少了,而 Full 会给用户提供大量按钮。
我在 aspx 页面中声明编辑器如下:
<script type="text/javascript">
CKEDITOR.replace(document.getElementById("<%= txtTourItinerary.ClientID %>"),
{ customConfig: 'myconfig.js' }
);
</script>
myconfig.js 文件本身位于 ckeditor 目录的根目录中(config.js 所在的位置)。
但是,尽管渲染了 CKEditor 本身,它似乎完全忽略了我的自定义配置文件。我想知道是否有人有任何建议?
谢谢!
自定义配置文件的内容如下:
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
config.language = 'en';
config.defaultLanguage = 'en';
config.uiColor = '#000000';
};
CKEDITOR.config.toolbar_Full = [['Save', '-', 'Preview', '-' 'Print'],
['Undo', 'Redo'], ['Cut', 'Copy', 'Paste', 'PasteFromWord', 'SelectAll'],
['Find', 'Replace'],
'/',
['Bold', 'Italic', 'Unnderline', 'Strike', '-', 'Subscript', 'Superscript']];
最佳答案
我想发布一个解决方案。路径在:
CKEDITOR.replace(document.getElementById("<%= txtTourItinerary.ClientID %>"),
{ customConfig: 'myconfig.js' }
来自网站的根目录,与 CKEditor 中的目录无关。
所以我的声明应该如下
<script type="text/javascript">
CKEDITOR.replace(document.getElementById("<%= txtTourItinerary.ClientID %>"),
{ customConfig: '/ckeditor/myconfig.js' }
);
</script>
希望我可以帮助其他类似的人,因为 CKEditor 上的文档有点薄弱。
关于asp.net - 为 CKEditor 指定自定义配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1754798/