我已经将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" },
};
答案 0 :(得分:1)
我找到了基本的解决方案
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="../../ckeditor/adapters/jquery.js" type="text/javascript"></script>
<script src="../../ckeditor/config.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var config =
{
height: 180,
width: 515,
linkShowAdvancedTab: false,
scayt_autoStartup: true,
enterMode: Number(2),
toolbar_Full: [['Styles', 'Bold', 'Italic', 'Underline', 'SpellChecker', 'Scayt', '-', 'NumberedList', 'BulletedList'],
['Link', 'Unlink'], ['Undo', 'Redo', '-', 'SelectAll']]
};
$('#editor').ckeditor(config);
});
</script>
<textarea name="myTextArea" id="editor">
To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
</textarea>
答案 1 :(得分:0)