ckeditor 3.3.1配置

本文介绍CKEditor 3.3.1版本的精简步骤及配置方法,并演示了如何在.NET环境中应用CKEditor,同时提供了集成CKFinder的示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一.ckeditor 3.3.1精简
  1、删除_samples和_source文件夹,分别为示例文件和未压缩源程序
  2、删除lang文件夹下除zh-cn.js,en.js下的所有语言文件.根据需要删除
  3、删除根目录下的changes.html(更新列表),install.html(安装指向),license.html(使用许可).
  4、删除skins目录下不需要的皮肤.我一般用V2(简单.朴素)  //如果只保留V2则必须在config.js中指定皮肤
  5、删除根目录下的ckeditor.asp、ckeditor.php、ckeditor_php4.php、ckeditor_php5.php(asp和php版的文件).

二.ckeditor 3.3.1相关文件配置路径
  1、/ckeditor.js   核心文件,调用需加载
  2、/config.js     配置文件,参数配置均在此完成

三.ckeditor应用(.net环境)
   1、引用js脚本
   <script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
   2、添加TextBox控件,class设置为ckeditor
   <asp:TextBox id="txtContent" class="ckeditor" TextMode="MultiLine"  Text='' runat="server" />

 四.ckeditor配置(config.js配置文件)
详细api参数见: http://docs.cksource.com/ckeditor_api/,我的默认配置:

CKEDITOR.editorConfig = function( config )
{
  // Define changes to default configuration here. For example:
  // config.language = 'fr';
    // config.uiColor = '#AADC6E';

    // Define changes to default configuration here. For example:   
    config.language = 'zh-cn'; //配置语言
    //config.uiColor = '#AADC6E'; //背景颜色   
    //config.width = 650; //宽度   
    config.height = 400; //高度
    config.skin = 'v2'; //编辑器样式(kama、office2003、v2)

    // 取消 “拖拽以改变尺寸”功能
    config.resize_enabled = true;

    // 基础工具栏
    //config.toolbar = "Basic";

    // 全能工具栏
    //config.toolbar = "Full";

    //自定义工具栏
    config.toolbar =
        [
        ['Source', '-', 'Preview'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'ShowBlocks'], '/',
        ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], ['Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar'], '/',
        ['Styles', 'Format', 'Font', 'FontSize'], ['TextColor', 'BGColor'], ['Maximize',]
        ];

};

 

ckfinder安装

一.ckfinder精简
   1、删除_samples和_source文件夹,分别为示例文件和未压缩源程序
   2、删除根目录下changelog.txt,install.txt,license.txt文件
   3、1.x版的删除core/lang目录下除en.js,zh-cn.js的所有语言文件(根据条件删除),2.0的删除lang和core/connector/aspx/lang目录下除en.js,zh-cn.js的所有语言文件;help目录除en外的其他目录

二.ckfinder配置
   1、复制/bin目录下的ckfinder.dll文件至站点bin目录
   2、复制ckfinder目录至站点根目录下(可另选择路径)

三.ckfinder应用
  1、与ckeditor集成,详情见官方文档,官方文档是加载修改,我用的方法是全局修改.

  具体操作方法如下:修改ckeditor目录下的config.js文件,添加::

  //在 CKEditor 中集成 CKFinder,注意 ckfinder 的路径选择要正确。
  var ckfinderPath = ""; //ckfinder路径
  config.filebrowserBrowseUrl = ckfinderPath + '/ckfinder/ckfinder.html';
  config.filebrowserImageBrowseUrl = ckfinderPath + '/ckfinder/ckfinder.html?type=Images';
  config.filebrowserFlashBrowseUrl = ckfinderPath + '/ckfinder/ckfinder.html?type=Flash';
  config.filebrowserUploadUrl = ckfinderPath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';
  config.filebrowserImageUploadUrl = ckfinderPath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images'; 
  config.filebrowserFlashUploadUrl = ckfinderPath + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'; 

  以上URL值需要根据你ckfinder路径的不同而不同,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值