CKEditor 3.0 配置
来源:互联网 发布:name域名注册商 编辑:程序博客网 时间:2024/05/15 05:12
CKEditor 3.0 配置
CKEditor 3.0安装配置,感觉比较简单,但本次没有涉及上传文件的配置,下篇文章将写一下如何将CKEditor的兄弟产品:ckfinder 功能强大的上传文件管理器整合进 CKEditor3.0
下载CKEditor 3.0,地址:http://ckeditor.com/
首先,下载下来解压后,把文件夹ckeditor放到你的站点。
其次,在你的网页里面加入下面脚本:
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
注意红色部分,这里根据你自己的编辑器路径修改,请务必配置正确。
再次,在需要引用CKEditor编辑器的地方加入下面代码:
<textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10">
这里是内容
</textarea>
如果你是ASP.NET开发人员 可以写成:
<textarea class="ckeditor" id="txtContent" runat="server" name="txtContent"></textarea>
或者:
<textarea cols="80" id="editor1" name="editor1" rows="10">
这里是内容
</textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1' );
</script>
这样,一个编辑器就基本可以使用了。
--------------------------------------------------
配置属于自己的编辑器,配置Config.js文件(官方给出配置的几种方法,详见参考官方文档)如下:
http://docs.fckeditor.net/ckeditor_api/symbols/CKEDITOR.config.html#.autoUpdateElement
用记事本打开config.js文件,可看到下面代码:
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
config.language = 'zh-cn'; //配置语言
//config.uiColor = '#FFF'; //背景颜色
//config.width = 500; //宽度
config.height = 400; //高度
config.skin='v2';
//工具栏
config.toolbar =
[
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','Source','-','Undo','Redo']
];
};
为了减少编辑器的大小,可以删除一些不必要的文件,如把_samples、_source、_tests三个文件夹删除,进入lang文件目录,保留en.js、zh.js、zh-cn.js三个文件,其余的语言文件如果你用不到,可以删除。
- CKEditor 3.0 配置
- CKEditor 3.0安装配置使用
- CKeditor 配置
- CKEditor配置
- 配置CKEditor
- CKEDITOR配置
- ckeditor配置
- ckeditor 配置
- 配置 CKEditor
- ckeditor 配置
- CKEditor配置
- CKeditor配置
- 配置ckeditor
- CKEditor 3.0的简单安装配置使用
- ckeditor配置设置
- CKeditor配置使用(转)
- CKEDITOR config.js配置
- CKeditor配置大全
- 喜欢上了习惯
- 关于编译器的内存分配有感小记
- Java的辉煌 还能延续多久?
- 汉字过滤器
- 为人民服务
- CKEditor 3.0 配置
- 最牛三枪男电话调戏客服 转载土豆
- GI中一些基本概念
- POJO与VO
- SQLServer数据库——触发器
- 目前纠结于算法问题是个杯具
- FlexReport笔记
- 对称加密算法
- Thoughtworks-一个社会试验?