天天看点

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

版权所有 2009-2019 荆门泽优软件有限公司

保留所有权利

联系信箱:[email protected]

联系QQ:1085617561

产品交流群:

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

扫码加群:

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

1.1.集成到UEditor1.x

说明:

1.wordpaster以插件形式集成到ueditor中,不会对ueditor原有功能造成影响。当不需要wordpaster功能时可以直接卸载。

2.wordpaster使用的上传页面是一个单独的页面,和ueditor官方demo中的上传页面不是同一个页面。

3.wordpaster与ueditor版本无关,可支持多个版本。

4.wordpaster是基于插件技术实现的功能,使用前需要安装插件。

项目:

1.复制目录:WordPaster

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

2.复制文件:ueditor/themes/default/css/ueditor.css

demo已修改此样式文件,在这个样式文件中增加了wordpaster图标样式

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

增加的代码如下:

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

增加以下代码:这里使用单独的图片

.edui-for-wordpaster.edui-icon{width:16px;height:16px;background:url(“http://www.ncmem.com/images/w.png”)no-repeat 2px 2px !important;}

3.在工具栏中增加插件按钮

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.
edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

5.增加插件按钮事件响应代码

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

代码如下:

UE.commands[‘wordpaster’] = {

execCommand:function(){

pasterMgr.Paste();

}

};

UE.commands[‘netpaster’] = {

execCommand:function(){

pasterMgr.UploadNetImg();

}

};

如果使用ueditor.all.min.js则添加下列代码:

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

代码:

UE.commands.wordpaster={execCommand:function(){pasterMgr.Paste();}};

1.1.6.增加工具栏命令按钮

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

如果使用ueditor.all.min.js则添加下列代码:

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

1.1.7.添加到右键菜单

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.
edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

集成后的效果:

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

1.1.8.自定义Ctrl+V快捷键

edui 富文本编辑_百度ueditor新增的将word内容导入到富文本编辑框的功能.

页面:

1.在引用页面增加头文件和插件初始化代码

[/url]

这里写你的初始化内容

varpasterMgr =newWordPasterManager();//这里必须声明成全局变量。

pasterMgr.Config[“PostUrl”] =“http://localhost:1761/upload.aspx”

pasterMgr.Load();//加载控件

UE.getEditor(‘myEditor’,{onready:function(){

pasterMgr.SetEditor(this);

}});