`

ckeditor4.2的配置使用与问题解决

阅读更多
一、CKeditor的使用
首先从CKEditor的官方网站(http://ckeditor.com/download) 下载开发包并解压。
将解压后文件夹里面的ckeditor文件夹放到项目webroot下面。
CKEditor 的基本使用
1、页面引入js文件
<script type="text/javascript"src="js/ckeditor/ckeditor.js"></script>
2、使用<textarea id="editor1" class="ckeditor">待输入内容</textarea>
3、配置样式及宽高<script type="text/javascript">$(function () {
               CKEDITOR.replace( 'editor1', {
height: '200px',
width: '350px',
  });}) </script>

4.关于取出textarea中输入内容的问题
取值:CKEDITOR.instances.editor1.getData();
设置值:CKEDITOR.instances.editor1.setData();
5.关于在IE下出现不兼容的问题:

在html标签上方添加:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


二、ckeditor的配置

在ckeditor的文件夹中找到config.js,根据自己需要选择功能
CKEDITOR.editorConfig = function( config ) {
  config.toolbarGroups = [
//{ name: 'clipboard'//,groups: [ 'clipboard', 'undo' ] },
    //  { name: 'editing'   //groups: [ 'find', 'selection', 'spellchecker' ]},
{ name: 'links' },
{ name: 'insert' },
//{ name: 'forms' },
//{ name: 'tools' },
//{ name: 'document'   //,    groups: [ 'mode', 'document', 'doctools' ]},
//{ name: 'others' },
'/',
{ name: 'basicstyles' //, groups: [ 'basicstyles', 'cleanup' ]
},
{ name: 'paragraph' ,   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ]
},
{ name: 'styles' },
{ name: 'colors' }

];
//config.removeButtons = 'Underline,Subscript,Superscript';
//config.format_tags = 'p;h1;h2;h3;pre';
//config.removeDialogTabs = 'image:advanced;link:advanced';
};

三、ckeditor的精简

    在部署到Web服务器上时,下列文件夹和文件都可以删除:

    /_samples :示例文件夹;

    /_source :未压缩源程序;

    /lang文件夹下除 zh-cn.js、en.js 以外的文件(也可以根据需要保留其他语言文件);

    根目录下的 changes.html(更新列表),install.html(安装指向),license.html(使用许可);
0
0
分享到:
评论

相关推荐

    ckeditor4.2 整合ckfinder_2.4 for PHP

    《ckeditor4.2整合ckfinder_2.4 for PHP:构建强大的富文本编辑器与文件管理器》 在Web开发中,富文本编辑器(WYSIWYG Editor)是不可或缺的一部分,它允许用户以类似Word的方式创建和编辑内容。CKEditor 4.2.2是一...

    最新版本ckeditor+ckfinder,集成上传功能

    同时,`安装说明.txt`提供了详细的步骤指导,包括如何配置ckfinder与ckeditor的连接,以及可能遇到的问题和解决方案。 `upfiles`文件夹通常是用来存储用户上传的文件和图片的,ckfinder会读取并管理这个目录中的...

    ckeditor_4.11.2_standard

    CKEditor 4.11.2 Standard版,作为一款功能强大的富文本控件,为开发者提供了高效、灵活且易于集成的解决方案,使得在线编辑和文件上传变得更加便捷。 CKEditor,全称为“CKEditor 4”,是一款开源的JavaScript富...

    ckedtior与ckfinder集成 图片上传浏览 不同用户 不同上传文件夹

    本篇将详细讲解如何将CKEditor与CKFinder集成,实现图片上传浏览功能,并针对不同用户创建独立的上传文件夹,以解决中文乱码问题。 首先,让我们从CKEditor说起。CKEditor 4.2 是一个功能丰富的JavaScript富文本...

    Cheditor 4.2

    "Cheditor 4.2"是一款专为Web开发者设计的高效、全面的在线Word文档编辑器,它提供了丰富的功能,使用户...此外,根据"使用更新说明.txt"的指导,开发者还可以了解如何更新到最新版本,以及如何解决可能遇到的问题。

    Fckeditor下载

    Fckeditor是一款功能强大的在线文本编辑器,...在安装和使用过程中,如果遇到问题,可以参考官方文档或社区资源,通常能找到解决方案。总的来说,Fckeditor是一个强大且灵活的在线编辑工具,值得广大开发者尝试和使用。

Global site tag (gtag.js) - Google Analytics