当前位置:网站首页>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' ] }
];边栏推荐
- 动画(其一)
- 恶劣天气 3D 目标检测数据集收集
- Node-3.构建Web应用(二)
- 物联网基础知识学习
- 基于ijkplayer 0.8.8编译的完整so. libijkffmpeg.so等,支持ssl h265, rm, rmvb
- Maykel Studio - Django Web Application Framework + MySQL Database Third Training
- 微信和抖音都到十亿级用户了,作为产品经理的你们觉得哪个产品更成功?
- Zhejiang University School of Software 2020 Guarantee Research Computer Real Question Practice
- CVPR2022——Not All Points Are Equal : IA-SSD
- Waymo dataset usage introduction (waymo-open-dataset)
猜你喜欢

CMT2380F32模块开发2-IDE软件配置

AIDL 简介以及使用

关于安全帽识别系统,你需要知道的选择要点

360° large field of view helmet recognition system-deep learning intelligent video analysis

Maykle Studio - HarmonyOS Application Development Fourth Training

Maykle Studio - HarmonyOS Application Development First Training

咕咚vs悦跑圈的竞品分析

Joint 3D Instance Segmentation and Object Detection for Autonomous Driving

浙江大学软件学院2020年保研上机真题练习

解决jupyter中import torch出错问题
随机推荐
我心仪的数据集—目标检测为主
CMT2380F32模块开发0-总览
TAMNet:A loss-balanced multi-task model for simultaneous detection and segmentation
Pay “Attention” to Adverse Weather
梅科尔工作室-Pr第二次培训笔记(基本剪辑操作和导出)
The latest safety helmet wearing recognition system in 2022
Maykle Studio - HarmonyOS Application Development Third Training
通过字符设备虚拟文件系统实现kernel和userspace数据交换(基于kernel 5.8测试通过)
CMT2380F32模块开发9-可编程计数阵列 PCA例程
安全帽识别系统-解决监管难题
CNN-based Point Cloud De-Noising
电商机会:私域
恶劣天气 3D 目标检测数据集收集
物联网IOT 固件升级
SWOT分析法
【调试记录1】提高MC3172浮点运算能力,IQmath库的获取与导入使用教程
CVPR2022——A VERSATILE MULTI-VIEW FRAMEWORK
SCNet: Semantic Consistency Networks for 3D Object Detection
Robust 3D Object Detection in Cold Weather Conditions
Robust 3D Object Detection in Cold Weather Conditions