1.文本编辑器-->CKEditor+CKFinder使用与配置
| 一、CKEditor介绍 |
官网地址:http://ckeditor.com
CKEditor下载地址:http://ckeditor.com/download
CKFinder(免费版本)下载地址:http://cksource.com/ckfinder/download
CKEditorAPI:http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
| 二、安装使用 |
本文使用版本:CKEditor:4.4.2,CKFinder:2.4.1
1.将下载解压后的文件,放到同级目录下。需要注意的是CKFinder的_source文件夹下存放的是上传图片源码。两个文件夹有很多东西是不需要的,根据个人情况可做适当删除。
2.引用CKEditor核心JS文件<script src="~/Content/js/plugins/ckeditor/ckeditor.js"></script>
3.替换textarea标签。
CKEDITOR.replace( 'textarea_nameorid',
{
toolbar : 'Basic',
uiColor : '#9AB8F3'
});
options也可以直接写到config.js文件中
CKEDITOR.editorConfig = function( config )
{
config.toolbar= 'Basic';
config.uiColor = '#9AB8F3';
};
定制自己的config.js
CKEDITOR.replace( 'textarea_nameorid',
{
customConfig : '/custom/ckeditor_config.js'
});
4.新版CKEditor取消了自动同步内容功能,提交表单前手动同步内容
for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
5.新版CKEditor取消了上次本地图片功能。为了实现本地图片上传,需要配合使用CKFinder插件
1>添加bin目录下的dll项目引用。(注:代码是开源的,不懒的同志可以从_source目录下打开项目,编写适合自己的代码)
2>修改config.ascx文件
public override bool CheckAuthentication()
{
return true;
} BaseUrl = "/Upload/CKFinder/"
3>引用CKFinder核心JS文件<script src="~/Content/js/plugins/ckfinder/ckfinder.js"></script>
4>关联CKEditor和CKFinder这两个插件,打开CKEditor的config.js,贴入以下代码
var ckfinderPath = "/Content/js/plugins/ckfinder"; //ckfinder路径
config.filebrowserBrowseUrl = ckfinderPath + '/ckfinder.html';
config.filebrowserImageBrowseUrl = ckfinderPath + '/ckfinder.html?type=Images';
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';
1.文本编辑器-->CKEditor+CKFinder使用与配置的更多相关文章
- MVC5富文本编辑器CKEditor配置CKFinder
富文本编辑器CKEditor的使用 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: ...
- 富文本编辑器 CKeditor 配置使用+上传图片
参考文献: 富文本编辑器 CKeditor 配置使用 CKEditor与CKFinder的配置(ASP.NET环境),老版本可以参考 CKEditor+CKFinder ASP版在本地电脑中的配置 ...
- Django实现的博客系统中使用富文本编辑器ckeditor
操作系统为OS X 10.9.2,Django为1.6.5. 1.下载和安装 1.1 安装 ckeditor 下载地址 https://github.com/shaunsephton/django-c ...
- 富文本编辑器 CKeditor 配置使用 (带附件)
Ckeditor下载地址:http://ckeditor.com/download 1.CKeditor的基本配置 var textval=CKEDITOR.instances.TextArea1.g ...
- 富文本编辑器 CKeditor 配置使用
作者:Tyler Ning出处:http://www.cnblogs.com/tylerdonet/本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连 ...
- 富文本编辑器CKEDITOR的使用配置(问题注解)
CKEDITOR是一款非常轻便的富文本编辑器,如上图:参考网上的使用方法,我以.net为例,在aspx页面使用, 准备工作:首先要下载控件包,将解压后的整个文件夹添加到项目根目录. 第一步:引用js, ...
- 富文本编辑器CKeditor的配置和图片上传,看完不后悔
CKeditor是一款富文本编辑器,本文将用极为简单的方式介绍一下它的使用和困扰大家很久的图片上传问题,要有耐心. 第一步:如何使用 1.官网下载https://ckeditor.com/ckedit ...
- 富文本编辑器ckeditor继承
新建一个web项目ckfinder,导入lib包 加入java包,编码格式UTF-8 在WebRoot下添加ckedtior以及ckfinder两个文件夹,将config.xml拷入WEB-INF中 ...
- 文本编辑器 CKEditor 用法
最新文本编辑器,FCK升级版:CKEditor.NET CKEditor.NET.dll 版本:3.6.4.0 官方网址:http://ckeditor.com/ 效果图: 配置web.c ...
随机推荐
- tail()和head()
pandas 里的tail() 函数,读取后几行. head() dataframe.head():前五行 显示某一列的前五行,两种方法: 或者:
- 932. Beautiful Array
For some fixed N, an array A is beautiful if it is a permutation of the integers 1, 2, ..., N, such ...
- JavaScript高性能开发的十条建议
JavaScript高性能开发的十条建议 文/开发部 Dimmacro 编者按:javascript开发大部分程序员都做过,写出来的代码质量也千差万别,现在浏览器内嵌的解释器虽然效率已经很高了,但在客 ...
- Ionic2:创建App启动页滑动欢迎界面
来自:https://my.oschina.net/qinphil/blog/777787 著作权归原创作者所有,如有再转,请自觉标明原创出处,以示尊重! 摘要: 每个有逼格的App在第一次启动时都有 ...
- javascript 判断对象的内置类型
判断某个对象值属于哪种内置类型,最靠谱的做法就是通过Object.prototype.toString方法.在toString方法被调用时,会执行下面的操作步骤:1. 获取this对象的[[Class ...
- XMPP使用tls 和sasl登录
转自:http://ycool.com/post/xc98m5k 名词解释 TLS:安全传输层协议 TLS:Transport Layer Security 名词: 安全传输层协议(TLS)用于在两个 ...
- SyntaxError: Non-UTF-8 code starting with '\xb6' in file XX.py
导致出错的根源就是编码问题. 解决方案是: 在程序最上面加上: # coding=gbk
- Object类和包装类的一些方法
一.instanceof关键字的使用: a instanceof A:判断对象a是否是类A的实例.如果是,返回true:如果不是,返回false. 使用场景:为了避免在向下转型时出现ClassCast ...
- c++重载operator的示例 非原创
#include<iostream> #include<vector> using namespace std; class test{ public: int v; /*构造 ...
- java中如何把图片转换成二进制流的代码
在学习期间,把开发过程经常用到的一些代码段做个备份,下边代码内容是关于java中如何把图片转换成二进制流的代码,应该能对各朋友也有用处. public byte[] SetImageToByteArr ...