当前位置:网站首页>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' ] }
];边栏推荐
- CMT2380F32模块开发10-高级定时器例程
- 360° large field of view helmet recognition system-deep learning intelligent video analysis
- Diagnostic Log and Trace——DLT 离线日志存储
- Mysql导入UTF8编码数据库命令总结
- 关于mmdetection框架实用小工具说明
- win10 配置tensorflow(GPU) anaconda3 cuda9.0 cudnn for 9.0
- 微信和抖音都到十亿级用户了,作为产品经理的你们觉得哪个产品更成功?
- 微文案也能提升用户体验
- AI智能图像识别的工作原理及行业应用
- Solutions to the 7th Jimei University Programming Contest (Individual Contest)
猜你喜欢

基于ijkplayer 0.8.8编译的完整so. libijkffmpeg.so等,支持ssl h265, rm, rmvb

SCNet: Semantic Consistency Networks for 3D Object Detection

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

动画(其二)

Solutions to the 7th Jimei University Programming Contest (Individual Contest)

TAMNet: A loss-balanced multi-task model for simultaneous detection and segmentation

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

咕咚vs悦跑圈的竞品分析

Pay “Attention” to Adverse Weather

CVPR2020: Seeing Through Fog Without Seeing Fog
随机推荐
梅科尔工作室-第四次PR培训笔记(字幕和标题动画,关键帧动画和声音处理)
数据库(其二)
从概念认识AI
TAMNet: A loss-balanced multi-task model for simultaneous detection and segmentation
Realize data exchange between kernel and userspace through character device virtual file system (passed based on kernel 5.8 test)
Robust 3D Object Detection in Cold Weather Conditions
CMT2380F32模块开发0-总览
安全帽识别系统
梅科尔工作室-HarmonyOS应用开发的第二次培训
用正则验证文件名是否合法
数据库的基本语法(其一)
yolov3+centerloss+replay buffer实现单人物跟踪
物联网基础知识学习
HTTP缓存机制详解
目标检测——LeNet
Mei cole studios - fifth training DjangoWeb application framework + MySQL database
CMT2380F32模块开发7-reset例程
自定义形状seekbar学习
10 个超好用的 DataGrip 快捷键,快加入收藏! | 实用技巧
Kotlin 增量编译的新方式 | 技术解析