当前位置:网站首页>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' ] }
];边栏推荐
- Maykel Studio - Django Web Application Framework + MySQL Database Fourth Training
- CMT2380F32模块开发4-UART例程
- Pay “Attention” to Adverse Weather
- Waymo dataset usage introduction (waymo-open-dataset)
- The kernel communicates with user space through character devices
- 目标检测思维导图
- 珍爱网App竞品分析报告
- Diagnostic Log and Trace——开发人员如何使用 DLT
- Node-2.垃圾回收机制
- 物联网IOT 固件升级
猜你喜欢

梅科尔工作室-DjangoWeb 应用框架+MySQL数据库第三次培训

CVPR2022——Not All Points Are Equal : IA-SSD

Maykel Studio - Django Web Application Framework + MySQL Database Fourth Training

Reconstruction and Synthesis of Lidar Point Clouds of Spray

梅科尔工作室-深度学习第二讲 BP神经网络

Node-2.垃圾回收机制

从概念认识AI

Safety helmet identification system - escort for safe production

Safety helmet recognition system

梅科尔工作室-HarmonyOS应用开发的第二次培训
随机推荐
CVPR2022——Not All Points Are Equal : IA-SSD
珍爱网App竞品分析报告
Safety helmet identification system - escort for safe production
目标检测学习目录(持续更新)
360° large field of view helmet recognition system-deep learning intelligent video analysis
Waymo数据集使用介绍(waymo-open-dataset)
360°大视野安全帽识别系统-深度学习智能视频分析
梅科尔工作室-Pr第一次培训笔记(安装及项目创建)
Zhejiang University School of Software 2020 Guarantee Research Computer Real Question Practice
Maykel Studio - Django Web Application Framework + MySQL Database Fourth Training
CMT2380F32模块开发7-reset例程
安全帽识别
Joint 3D Instance Segmentation and Object Detection for Autonomous Driving
数据库(其二)
Diagnostic Log and Trace——开发人员如何使用 DLT
安全帽识别系统-为安全生产保驾护航
CMT2380F32模块开发2-IDE软件配置
Use regex to verify whether the file name is legal
关于安全帽识别系统,你需要知道的选择要点
mAPH——Waymo数据集