一丶ueditor百度编辑器


1.官方文档,演示,下载地址:http://ueditor.baidu.com/website/index.html

2.百度编辑器的好:Editor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。

3.如果想定制你想要的编辑器功能:查看官方网站的下载页面即可。

4.编辑器展示:



5.百度编辑器配置。


1.载入js,css文件

<scriptsrc="ueditor/editor_config.js"type="text/javascript"></script><scriptsrc="ueditor/editor_all.js"type="text/javascript"></script><linkhref="ueditor/themes/default/ueditor.css"rel="stylesheet"type="text/css" />

2.页面配置

<divid="myEditor"></div>   //可以是aspx控件 只要id正确即可
<scripttype="text/javascript">varue= newbaidu.editor.ui.Editor();ue.render("myEditor");//这里填写要改变为编辑器的控件id
</script>

3.editor_config.js  文件中的路径配置

    var tmp = window.location.pathname;URL = window.UEDITOR_HOME_URL || "/SomePackage/Ueditor/ueditor/"; //这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径)

4.如果你要使用传图片功能,还需要修改net文件下的几个文件截图说明吧(这个路径可以直接删除的,试试。不行了自己再调整下)。

改为-->

同理将net文件下其它文件类似的错误更正后即可上传图片。

图片上传默认位置为:net文件夹下。上传一张打开即可发现一个upload文件夹。

5.ueditor 的很多默认配置都在 editor_config.js这个文件中,细心看的话,开启或关闭其中的配置是可以解决很多问题的。

6.我在使用过程中还遇到过编辑器内容影响整体页面的布局问题,这问题是在editor_all.js这个文件中修改的默认样式问题的。

 /*** 渲染编辑器的DOM到指定容器,必须且只能调用一次* @public* @function* @param {Element|String} container*/render:function ( container ) {var me = this, options = me.options;if ( container.constructor === String ) {container = document.getElementById( container );}if ( container ) {var useBodyAsViewport = ie && browser.version < 9,html = ( ie && browser.version < 9 ? '' : '<!DOCTYPE html>') +'<html xmlns=\'http://www.w3.org/1999/xhtml\'' + (!useBodyAsViewport ? ' class=\'view\'' : '') + '><head>' +( options.iframeCssUrl ? '<link rel=\'stylesheet\' type=\'text/css\' href=\'' + utils.unhtml( options.iframeCssUrl ) + '\'/>' : '' ) +'<style type=\'text/css\'>' +//这些默认属性不能够让用户改变//选中的td上的样式'.selectTdClass{background-color:#3399FF !important;}' +'table.noBorderTable td{border:1px dashed #ddd !important}' +//插入的表格的默认样式'table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;}' +//分页符的样式'.pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}' +//锚点的样式,注意这里背景图的路径'.anchorclass{background: url(\'' + me.options.UEDITOR_HOME_URL + 'themes/default/images/anchor.gif\') no-repeat scroll left center transparent;border: 1px dotted #0000FF;cursor: auto;display: inline-block;height: 16px;width: 15px;}' +//设置四周的留边'.view{padding:0;word-wrap:break-word;cursor:text;height:100%;}\n' +//设置默认字体和字号'body{margin:8px;font-family:\'宋体\';font-size:16px;}' +//针对li的处理'li{clear:both}' +//设置段落间距'p{margin:5px 0;}'+ ( options.initialStyle || '' ) +'</style></head><body' + (useBodyAsViewport ? ' class=\'view\'' : '') + '></body>';

最后对这个编辑器总结下:很好用的,代码很容易读懂,便于修改配置为自己喜欢的想要的。 


二丶CKEditor丶CKFinder 国外知名编辑器 


1.官方文档,演示,下载地址:http://ckeditor.com/download 丶 http://ckfinder.com/download

2.百度编辑器的好:是一个专门使用在网页上属于开放源代码的所见即所得文字编辑器。它志于轻量化,不需要太复杂的安装步骤即可使用。

3.编辑器展示:


 


4.配置步骤以及一些常用配置


1.引入<script src="ckeditor/ckeditor.js" type="text/javascript"></script>

2.页面代码

    <!--第一个---><textareaid="TextArea1"cols="20"rows="2"class="ckeditor"></textarea><!--第二个---><divid="editorSpace"></div>  <!--直接设置class好像也行的可以试试---><scripttype="text/javascript">CKEDITOR.appendTo('editorSpace');</script>

3.配置ckeditor的一些常用配置,在config.js这个文件中,所有的属性配置都可以查阅官方的API:http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html

4.列出一些常用的属性配置:

CKEDITOR.editorConfig = function( config )
{//Define changes to default configuration here. For example://config.language = 'fr';//config.uiColor = '#AADC6E';//config.width=700;//config.height=400;//config.skin='v2';   //自带皮肤种类有3种:Kama(默认) , Office 2003 , v2//config.font_names = '宋体;楷体 _GB2312;新宋体;黑体;隶书;幼圆;微软雅黑;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana';//如果上传图片或者flash则需要,下面配置ckfindervar ckfinderPath = "/SomePackage/FCKeditor/ckfinder";  //配置为绝对路径config.filebrowserBrowseUrl = ckfinderPath + "/ckfinder.html";config.filebrowserImageBrowseUrl = ckfinderPath + "/ckfinder.html?Type=Image";config.filebrowserFlashBrowseUrl = ckfinderPath + "/ckfinder.html?Type=Flash";config.filebrowserUploadUrl = ckfinderPath + "/core/connector/aspx/connector.aspx?command=QuickUpload&Type=Files";config.filebrowserImageUploadUrl = ckfinderPath + "/core/connector/aspx/connector.aspx?command=QuickUpload&Type=Images";config.filebrowserFlashUploadUrl = ckfinderPath + "/core/connector/aspx/connector.aspx?command=QuickUpload&Type=Flash";
};

5.如果上传图片则需在项目中添加ckfinder文件

6.第四步为配置上传图片的第一步

7.改变ckfinder文件夹下的config.ascx,内容如下:

public override bool CheckAuthentication(){//object str = session["username"];//if (str != null & Convert.ToBoolean(str) == true)//{//return true;//}return true;   //不建议直接返回true,最好做下用户验证判断在返回true(安全),上面为验证的一个实例}

8.这样就行了,由于ckfinder不是免费的,所以默认情况下会在上传页面中有红色的广告提示,虽然不影响使用,但总是觉得不爽。
          9.去除广告方法:找到ckfinder/core/js/ckfinder_ie.js及ckfinder_gecko.js,将其中的 en.call(window,qo);去掉

三、wysihtml5

1. get scripts

bower install wysihtml

or download the latest release  from Github.

2. include the scripts in your HTML

<!-- wysihtml core javascript with default toolbar functions -->
<script src="bower_components/wysihtml/dist/wysihtml-toolbar.min.js"></script><!-- rules defining tags, attributes and classes that are allowed -->
<script src="bower_components/wysihtml/parser_rules/advanced_and_extended.js"></script>

3. create the element to edit and toolbar

<!-- toolbar with suitable buttons and dialogues -->
<div id="toolbar"><a data-wysihtml5-command="bold">bold</a><a data-wysihtml5-command="italic">italic</a><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1">H1</a><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="p">P</a>
</div><!-- element to edit -->
<div id="editor" data-placeholder="Go on, start editing..."></div>

4. initialize editor

<script>
var editor = new wysihtml5.Editor('editor', {
toolbar: 'toolbar',
parserRules:  wysihtml5ParserRules
});
</script>

转载:Ueditor和CKeditor 两款编辑器的使用与配置

Ueditor和CKeditor wysihtml5 编辑器的使用与配置相关推荐

  1. Ueditor和CKeditor 两款编辑器的使用与配置

    一丶ueditor 百度编辑器 1.官方文档,演示,下载地址:http://ueditor.baidu.com/website/index.html 2.百度编辑器的好:Editor是由百度web前端 ...

  2. phpeditor编写php_在php中使用CKEDITOR在线编辑器

    一.官方Download 1.CKEditor:点击CKEditor.NET标题下的"Download zip"按钮 下载的文件:ckeditor_aspnet_3.6.2.zip ...

  3. Thinkphp下嵌套UEditor富文本WEB编辑器

    UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码... 本文实际操作于ThinkPHP框架下,现 ...

  4. UEditor 百度富文本编辑器 .Net实例

    转自 http://download.csdn.net/download/hdsslxl/6740605 1.UEditor 百度富文本编辑器完整版 .Net实例 已解决上传图片问题. 2.内附完整d ...

  5. 在php中使用CKEDITOR在线编辑器

    一.官方Download  1.CKEditor :点击CKEditor.NET标题下的"Download zip"按钮 下载的文件:ckeditor_aspnet_3.6.2.z ...

  6. 前端视角漫谈百度ueditor编辑器前后端分离配置

    此文旨在前后端分离的前提下,配置ueditor联通前后端接口,实现ueditor的文件上传(一般是图片上传)并在编辑器中反显 目录结构 百度的ueditor组件提供了各种主流的后端语言(Java,As ...

  7. CKEditor在线编辑器

    CKEditor在线编辑器 CKEditor是个专门使用在网上属于开放源码的文字编辑器,它用于轻量化,不需要太复杂的安装步骤即可使用,它可以和PHP,javascript,asp,java等不同的编程 ...

  8. ckeditor finder php,CKEDITOR CKFINDER的图片上传配置(C#/asp.net/php)

    CKEDITOR+CKFINDER的图片上传配置(C#/asp教程.net/php教程) php keditor的代码全部重写,但里面没有了上传功能,只是一个纯粹的文件在线编辑器,如果需要上传图片,还 ...

  9. 百度编辑器上传视频配置

    第一.IIS+php环境下解决方法 1.php.ini相关设置 打开php.ini,首先找到 file_uploads = on ;是否允许通过HTTP上传文件的开关.默认为ON即是开 upload_ ...

最新文章

  1. 解决VS2010复制代码中文乱码的问题
  2. 这个浮躁的年代,时刻提醒自己
  3. .NET Core 如何生成信用卡卡号
  4. Mybatis的mapper标签 namespace属性说明
  5. 利用bootstrap框架做了一个采摘节节日活动网页
  6. sql sum 结果集不为零_sql语句分类练习题
  7. 转:如何用EXCEL表运用FV函数
  8. 工作笔记-增加swap分区空间
  9. 可靠性测试设备技术含量_品牌手机厂商为何如此重视可靠性测试,海拓仪器一语道破玄机...
  10. php apache 404,如何从PHP显示默认的Apache 404
  11. flask post json_Flask 和 requests 搭建一个简单的API服务
  12. 浅谈协方差与协方差矩阵
  13. 七年为限 一觉梦已远——我与你的新贵族
  14. C/C++[ w1785]字符串连接
  15. C语言 - 直接插入排序、希尔排序、直接选择排序、堆排序、冒泡排序、快速排序、归并排序、基数排序。
  16. 小区物业收费管理系统
  17. 电大计算机原理及应用,电大《ERP原理与应用》试题及答案.doc
  18. 蓝桥杯赛后总结与反思
  19. c语言不报错但输不出正确结果,正则表达式,c++_C语言 正则表达式结果不对?,正则表达式,c++ - phpStudy...
  20. 1123: [POI2008]BLO

热门文章

  1. linux shell if命令参数说明
  2. redhat as4 上安装 MySQL5
  3. 伪随机算法c语言,伪随机算法实现各语言实现示例。
  4. 数据结构与算法笔记总结
  5. 541.反转字符串||
  6. 搭建大数据分析平台的必要性
  7. Javascript中的对象拷贝(对象复制/克隆)
  8. html鼠标拖尾效果,JS实现鼠标移动拖尾
  9. Android程序中回调的讲解和使用
  10. Python实现主成分分析(PCA)降维:原理及实例分析