当前位置:网站首页>CKEditor富文本编辑器工具栏自定义笔记
CKEditor富文本编辑器工具栏自定义笔记
2022-08-11 05:25:00 【Three Big Stones】
1、页面引入js文件
<script src="~/Content/scripts/plugins/ckeditor/ckeditor.js"></script>
2、初始化富文本编辑器
CKEDITOR.replace("文本域id")
默认初始化的文本编辑器,工具栏如下所示:
默认配置代码:
config.toolbar = [ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Strike', '-', 'RemoveFormat' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, { name: 'styles', items: [ 'Styles', 'Format' ] }, { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] }, { name: 'tools', items: [ 'Maximize' ] }, { name: 'others', items: [ '-' ] } ];
3、自定义工具栏配置
CKEDITOR.replace("Remark", {
toolbar: [
{ name: 'basicstyles', groups: ['basicstyles', 'cleanup'], items: ['Bold', 'Italic', 'Strike', '-', 'RemoveFormat'] },
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
{ name: 'tools', items: ['Maximize'] }]
});
效果如下:
4、工具栏的所有配置项
config.toolbar = [ { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Scayt' ] }, '/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] }, '/', { name: 'styles', items: [ 'Styles', 'Format' ] }, { name: 'tools', items: [ 'Maximize' ] }, { name: 'others', items: [ '-' ] }, { name: 'about', items: [ 'About' ] } ];
边栏推荐
- 关于安全帽识别系统,你需要知道的选择要点
- Hard hat identification
- Maykle Studio - Second Training in HarmonyOS App Development
- vmware不可恢复错误vmui
- SCNet: Semantic Consistency Networks for 3D Object Detection
- Use regex to verify whether the file name is legal
- 梅科尔工作室-华为云ModelArts第二次培训
- 防盗链——防止其他页面通过url直接访问本站资源
- 360°大视野安全帽识别系统-深度学习智能视频分析
- 梅科尔工作室-华为云ModelArts第一次培训
猜你喜欢
随机推荐
mAPH - Waymo dataset
Generic kernel and userspace Makefiles
Maykel Studio - Django Web Application Framework + MySQL Database Second Training
CMT2380F32模块开发9-可编程计数阵列 PCA例程
LiDAR Snowfall Simulation for Robust 3D Object Detection
基于ijkplayer 0.8.8编译的完整so. libijkffmpeg.so等,支持ssl h265, rm, rmvb
Node-1.高性能服务器
CVPR2020: Seeing Through Fog Without Seeing Fog
mAPH——Waymo数据集
Diagnostic Log and Trace——DLT 离线日志存储
CMT2380F32模块开发4-UART例程
梅科尔工作室-华为云ModelArts第二次培训
数据库的基本语法(其一)
Pay “Attention” to Adverse Weather
CMT2380F32模块开发2-IDE软件配置
Hard hat identification
产品如何拟定优化方案?
Reconstruction and Synthesis of Lidar Point Clouds of Spray
Socket 网络协议 等
产品经理人物推荐