当前位置:网站首页>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 
边栏推荐
猜你喜欢

How to customize sharing links in wechat for H5 web pages

机器学习——主成分分析(PCA)

Juul, the American e-cigarette giant, suffered a disaster, and all products were forced off the shelves

Uniapp develops a wechat applet to display the map function, and click it to open Gaode or Tencent map.

Six states of threads

canvas掉落的小球重力js特效动画

2022年智能机器人与系统国际研讨会(ISoIRS 2022)

uniapp 开发微信公众号,下拉框默认选中列表第一个

Cookie encryption 4 RPC method determines cookie encryption

SVG+js拖拽滑块圆形进度条
随机推荐
植物生长h5动画js特效
机器学习——主成分分析(PCA)
tf. errors
leetCode-929: 独特的电子邮件地址
JMeter接口测试工具基础— 使用Badboy录制JMeter脚本
学习使用KindEditor富文本编辑器,点击上传图片遮罩太大或白屏解决方案
uniapp实现点击拨打电话功能
【IEEE出版】2022年工业自动化,机器人与控制工程国际会议(IARCE 2022)
记录一下MySql update会锁定哪些范围的数据
百度网盘下载一直请求中问题解决
tf. contrib. layers. batch_ norm
Floating point notation (summarized from cs61c and CMU CSAPP)
numpy.logical_and()
上升的气泡canvas破碎动画js特效
2022全网最全最细的jmeter接口测试教程以及接口测试流程详解— JMeter测试计划元件(线程<用户>)
Recursive traversal of 414 binary tree
Leetcode-498: diagonal traversal
Why is JSX syntax so popular?
Internet of things? Come and see Arduino on the cloud
Leetcode interview question 01.05: primary editing