当前位置:网站首页>Customize the toolbars of the kindeditor editor. Items removes unnecessary toolbars or retains some toolbars
Customize the toolbars of the kindeditor editor. Items removes unnecessary toolbars or retains some toolbars
2022-06-24 10:24:00 【Wandering in memory of Yu Fei】
Customize kindeditor Editor toolbar ,items That is, remove unnecessary toolbars or keep some toolbars
kindeditor Introduction to editor toolbar

kindeditor The toolbar of the editor mainly refers to the menu above the input box of the editor , By default, the editor gives all the toolbars . For different users , Different projects , Different environments , You may need to keep some of the toolbars . So how should we customize the toolbar we want ? How to edit toolbars ? We will elaborate in several cases : The first one is : Modify the original file kindeditor.js Adjust the toolbar uniformly kindeditor There is a kindeditor.js perhaps kindeditor-min.js file , This file mainly contains the whole basic configuration of the editor and some basic functions and good methods . By finding the location kindeditor Basic configuration properties of the editor options, Then you can see that there is a items term : items: [“source”, “|”, “undo”, “redo”, “|”, “preview”, “print”,…
kindeditor The toolbar of the editor mainly refers to the menu above the input box of the editor , By default, the editor gives all the toolbars . For different users , Different projects , Different environments , You may need to keep some of the toolbars . So how should we customize the toolbar we want ? How to edit toolbars ? We will elaborate in several cases :
The first one is : Modify the original file kindeditor.js Adjust the toolbar uniformly
kindeditor There is a kindeditor.js perhaps kindeditor-min.js file , This file mainly contains the whole basic configuration of the editor and some basic functions and good methods . By finding the location kindeditor Basic configuration properties of the editor options, Then you can see that there is a items term :
items : [
'source', '|', 'undo', 'redo', '|', 'preview', 'template', 'code', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
'media', 'table', 'hr', 'emoticons', 'baidumap',
'link', 'unlink', '|'
],
This items What is configured is kindeditor Editor all toolbar menu items . We can modify and keep several menus we want . And this is for every menu code A description of the meaning of :
source: Indicates that you can switch the editing mode of the editor to enter the source code HTML View mode ;
undo: Back off , That is what we often use CTRL+Z Shortcut key function ;
redo: To move forward , That is what we often use CTRL+Y Shortcut key function ;
preview: Indicates preview , Click to preview the effect of the content in the editor in advance .
print: Indicates the contents in the print editor .
template: Represents a template form that can be inserted into the editor ;
code: Indicates that code snippets can be inserted ;
cut: It means cutting ;
copy: Represents replication , Like CTRL+C;
paste: It means paste , Like CTRL+V;
plainpaste: Means paste as unformatted text , It is mainly used, for example, to assign other values HTML Format plain text into the editor , You can do it here first HTML Filtering of tags ;
wordpaste: From WORD Inner paste ;
justifyleft: Indicates that the selected text is left ;
justifycenter: Indicates that the selected text is centered ;
justifyright: Indicates that the selected text is on the right ;
justifyfull: Indicates that both ends are aligned ;
insertorderedlist: Indicates the number (1、2、3);
insertunorderedlist: Indicates a bullet ;
indent: Means to increase the indent ;
outdent: Means to reduce indent ;
subscript: Indicates subscript ; Like :X2
superscript: Means superscript ; Like :X2
clearhtml: Said clear HTML label ;
quickformat: Express quick typesetting ;
selectall: Select all ;
fullscreen: Indicates full screen ;
formatblock: A paragraph ;
fontname: Represents the font ;
fontsize: Indicates the text size ;
forecolor: Indicates the text color ;
hilitecolor: Indicates the background color of the text ;
bold: Indicates bold text ;
italic: Indicates that the text is italicized ;
underline: Means to underline text ;
strikethrough: Indicates adding a strikethrough to the text ;
lineheight: Indicates to adjust the line spacing ;
removeformat: Indicates to delete the format of the selected segment ;
image: Indicates a single uploaded picture ;
multiimage: Indicates uploading pictures in batch ;
flash: Indicates insertion flash;
media: Indicates inserting an audio / video file ;
insertfile: Means to insert a file ;
table: Means insert table ;
hr: Indicates inserting a horizontal line ;
emoticons: Means to insert an expression ;
baidumap: Means insert map ;
pagebreak: Indicates inserting a page break ;
anchor: Indicates the insertion anchor ;
link: Indicates inserting a hyperlink ;
unlink: Means to unlink ; In general, and link Co occurrence ;
about: About kindeditor Editor information ;
The second kind : In the use of kindeditor Configure the toolbar menu in the page of the editor
If we want to use kindeditor Editors will write a KindEditor.ready Methods
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
});
});
If in create Method has not been applied to it items Make any designations , Then it will inherit by default kindeditor.js Internal items Configuration of , That is, all the menus . When we're in create Method specifies items Property will display the toolbar menu configured here , Such as :
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
items:["image", "multiimage"] // To configure kindeditor Editor toolbar menu item
});
});
Here's the picture : Just keep , Menu items for uploading pictures and batch uploading pictures , The Avatar was uploaded before 
边栏推荐
- leetCode-1089: 复写零
- numpy.logical_and()
- Uniapp implementation forbids video drag fast forward
- 静态链接库和动态链接库的区别
- Why is JSX syntax so popular?
- Status of the thread pool
- Safety and food security for teachers and students of the trapped Yingxi middle school
- 学习使用php实现无限极评论和无限极转二级评论解决方案
- 卷妹带你学jdbc---2天冲刺Day1
- Three ways to use applicationcontextinitializer
猜你喜欢

Uniapp develops wechat official account, and the drop-down box selects the first one in the list by default

p5.js实现的炫酷交互式动画js特效

6.套餐管理业务开发

p5.js千纸鹤动画背景js特效

Go language development environment setup +goland configuration under the latest Windows

SQL Sever中的窗口函数row_number()rank()dense_rank()

leetCode-1823: 找出游戏的获胜者

使用swiper左右轮播切换时,Swiper Animate的动画失效,怎么解决?

百度网盘下载一直请求中问题解决

大中型企业如何构建自己的监控体系
随机推荐
Engine localization adaptation & Reconstruction notes
小程序 rich-text中图片点击放大与自适应大小问题
numpy. logical_ or
leetCode-面试题 16.06: 最小差
Record the range of data that MySQL update will lock
顺丰科技智慧物流校园技术挑战赛(2022/06/19)【AK】
【资源分享】2022年第五届土木,建筑与环境工程国际会议(ICCAEE 2022)
SQL Server AVG function rounding
分布式系统你必须了解的点-CAP
5. dish management business development
希尔排序图文详解+代码实现
6.套餐管理业务开发
leetCode-1051: 高度检查器
自定义kindeditor编辑器的工具栏,items即去除不必要的工具栏或者保留部分工具栏
canvas管道动画js特效
uniapp开发微信小程序,显示地图功能,且点击后打开高德或腾讯地图。
上升的气泡canvas破碎动画js特效
Role of message queuing
抓包工具charles实践分享
卷妹带你学jdbc---2天冲刺Day1