一:介绍
ueditor已经停止维护,可以使用ueditor plus
1 | 常用的富文本编辑器有百度符文本ueditor,kingeditor等,只能实现简单的功能, |
二:最终目的
- ueditor原关于图片,视频等的功能实现自定义上传到文件服务
- 集成135编辑器插件
- 实现135编辑器的外部地址自动上传到自己的文件服务器
三:前端调整
3.1 后台自定义server
1 | 需要实现原本ueditor demo中的jsp的接口,下面是入口的地址,详情代码联系作者。 |
3.2 修改ueditor.config.js
1 | 1.修改SERVER_URL为自己新写的server后台地址 |
3.3 修改编辑器index.html
下载插件
1
2
3
4将插件的文件下载到项目ueditor对应的目录里,并将135editor.js加载到自己的网页里(放在ueditor.all.min.js之后)
下载地址:
- http://www.135editor.com/js/ueditor/plugins/135editor.js
- https://static.tohours.com/jren/2024/1106/135editor.js修改配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31在ueditor.config.js中toolbars项里增加一个135editor菜单项
{
"toolbars":[
[
"bold",
"italic",
"underline",
"fontborder",
"strikethrough",
"135editor",
"rowspacingtop",
"rowspacingbottom",
"lineheight",
"removeformat",
"formatmatch",
"autotypeset",
"blockquote",
"pasteplain",
"|",
"forecolor",
"backcolor",
"insertorderedlist",
"insertunorderedlist",
"selectall",
"cleardoc",
"|",
"superscript",
"subscript"
]
]
}增加CSS代码
1
2
3
4
5
6
7
8
9
10在自己的项目调用编辑器的网页里中增加一段CSS
<style>
.edui-button.edui-for-135editor .edui-button-wrap .edui-button-body .edui-icon{
background-image: url("https://static.135editor.com/img/icons/editor-135-icon.png") !important;
background-size: 85%;
background-position: center;
background-repeat: no-repeat;
}
</style>
图片地址也可以换成:https://static.tohours.com/jren/2024/1106/editor-135-icon.png
四:后端调整
1 | 1.实现自定义server |
五:演示效果
*************感谢您的阅读*************