KindEditor
编辑器初始化参数
¶
Contents
· 编辑器初始化参数
o width
o height
o minWidth
o minHeight
o items
o noDisableItems
o filterMode
o htmlTags
o wellFormatMode
o resizeType
o themeType
o langType
o designMode
o fullscreenMode
o basePath
o themesPath
o pluginsPath
o langPath
o minChangeSize
o urlType
o newlineTag
o pasteType
o dialogAlignType
o shadowMode
o useContextmenu
o syncType
o indentChar
o cssPath
o cssData
o bodyClass
o colorTable
o afterCreate
o afterChange
o afterTab
o afterFocus
o afterBlur
o afterUpload
o uploadJson
o fileManagerJson
o allowPreviewEmoticons
o allowImageUpload
o allowFlashUpload
o allowMediaUpload
o allowFileUpload
o allowFileManager
o fontSizeTable
o imageTabIndex
o formatUploadUrl
o fullscreenShortcut
o extraFileUploadParams
o filePostName
o fillDescAfterUploadImage
o afterSelectFile
o pagebreakHtml
width ¶
编辑器的宽度,可以设置 px 或 % ,比 textarea 输入框样式表宽度优先度高。
· 数据类型: String
· 默认值: textarea输入框的宽度
示例 :
K.create( '#id', {
width : '700px'
});
height ¶
编辑器的高度,只能设置 px ,比 textarea 输入框样式表高度优先度高。
· 数据类型: String
· 默认值: textarea输入框的高度
minWidth ¶
指定编辑器最小宽度,单位为 px 。
· 数据类型: Int
· 默认值: 650
minHeight ¶
指定编辑器最小高度,单位为 px 。
· 数据类型: Int
· 默认值: 100
items ¶
配置编辑器的工具栏,其中 ”/” 表示换行, ”|” 表示分隔符。
· 数据类型: Array
· 默认值:
[
'source', '|', 'undo', 'redo', '|', 'preview', 'print', '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', 'multiimage',
'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
'anchor', 'link', 'unlink', '|', 'about'
]
noDisableItems
¶
designMode 为false时,要保留的工具栏图标。
· 数据类型: Array
· 默认值: [‘source’, ‘fullscreen’]
filterMode ¶
true时根据 htmlTags 过滤HTML代码,false时允许输入任何代码。
· 数据类型: Boolean
· 默认值: true
Note
4.1.1 版本开始默认值为 true 。
htmlTags ¶
指定要保留的 HTML 标记和属性。 Object 的 key 为 HTML 标签名, value 为 HTML 属性数组, ”.” 开始的属性表示 style 属性。
· 数据类型: Object
· 默认值:
{
font : [ 'color', 'size', 'face', '.background-color'],
span : [
'.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
],
div : [
'align', '.border', '.margin', '.padding', '.text-align', '.color',
'.background-color', '.font-size', '.font-family', '.font-weight', '.background',
'.font-style', '.text-decoration', '.vertical-align', '.margin-left'
],
table : [
'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
'.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
'.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
'.width', '.height', '.border-collapse'
],
'td,th' : [
'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
],
a : [ 'href', 'target', 'name'],
embed : [ 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
img : [ 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
],
pre : [ 'class'],
hr : [ 'class', '.page-break-after'],
'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : []
}
wellFormatMode ¶
true 时美化 HTML 数据。
· 数据类型: Boolean
· 默认值: true
resizeType ¶
2 或 1 或 0 , 2 时可以拖动改变宽度和高度, 1 时只能改变高度, 0 时不能拖动。
· 数据类型: Int
· 默认值: 2
themeType ¶
指定主题风格,可设置 ”default” 、 ”simple” ,指定 simple 时需要引入 simple.css 。
· 数据类型: String
· 默认值: “default”
示例 :
<link rel= "stylesheet" href= "../themes/default/default.css" />
<link rel= "stylesheet" href= "../themes/simple/simple.css" />
<script charset= "utf-8" src= "../kindeditor.js" ></script>
<script charset= "utf-8" src= "../lang/zh_CN.js" ></script>
<script>
var editor;
KindEditor.ready( function(K) {
editor = K.create( '#editor_id', {
themeType : 'simple'
});
});
</script>
langType ¶
指定语言,可设置 ”en” 、 ”zh_CN” ,需要引入 lang/[langType].js 。
· 数据类型: String
· 默认值: “zh_CN”
示例 :
<link rel= "stylesheet" href= "../themes/default/default.css" />
<script charset= "utf-8" src= "../kindeditor.js" ></script>
<script charset= "utf-8" src= "../lang/en.js" ></script>
<script>
var editor;
KindEditor.ready( function(K) {
editor = K.create( '#editor_id', {
langType : 'en'
});
});
</script>
designMode ¶
可视化模式或代码模式
· 数据类型: Boolean
· 默认值: true
fullscreenMode ¶
true 时加载编辑器后变成全屏模式。
· 数据类型: Boolean
· 默认值: false
basePath ¶
指定编辑器的根目录路径。
· 数据类型: String
· 默认值: 根据kindeditor.js文件名自动获取
themesPath ¶
指定编辑器的 themes 目录路径。
· 数据类型: String
· 默认值: basePath + ‘themes/’
pluginsPath ¶
指定编辑器的 plugins 目录路径。
· 数据类型: String
· 默认值: basePath + ‘plugins/’
langPath ¶
指定编辑器的 lang 目录路径。
· 数据类型: String
· 默认值: basePath + ‘lang/’
minChangeSize ¶
undo/redo 文字输入最小变化长度,当输入的文字变化小于这个长度时不会添加到 undo 记录里。
· 数据类型: String
· 默认值: 5
urlType ¶
改变站内本地 URL ,可设置 ”“ 、 ”relative” 、 ”absolute” 、 ”domain” 。空为不修改 URL , relative 为相对路径, absolute 为绝对路径, domain 为带域名的绝对路径。
· 数据类型: String
· 默认值: “”
newlineTag ¶
设置回车换行标签,可设置 ”p” 、 ”br” 。
· 数据类型: String
· 默认值: “p”
pasteType ¶
设置粘贴类型, 0: 禁止粘贴 , 1: 纯文本粘贴 , 2:HTML 粘贴
· 数据类型: Int
· 默认值: 2
dialogAlignType ¶
设置弹出框 (dialog) 的对齐类型,可设置 ”“ 、 ”page” ,指定 page 时按当前页面居中,指定空时按编辑器居中。
· 数据类型: String
· 默认值: “page”
shadowMode ¶
true 时弹出层 (dialog) 显示阴影。
· 数据类型: Boolean
· 默认值: true
useContextmenu ¶
true 时使用右键菜单, false 时屏蔽右键菜单。
· 数据类型: Boolean
· 默认值: true
syncType ¶
同步数据的方式,可设置 ”“ 、 ”form” ,值为 form 时提交 form 时自动同步,空时不会自动同步。
· 数据类型: String
· 默认值: “form”
indentChar ¶
wellFormatMode 为true时,HTML代码缩进字符。
· 数据类型: String
· 默认值: “\t”
cssPath ¶
指定编辑器 iframe document 的 CSS 文件,用于设置可视化区域的样式。
· 数据类型: String或Array
· 默认值: 空
cssData ¶
指定编辑器 iframe document 的 CSS 数据,用于设置可视化区域的样式。
· 数据类型: String
· 默认值: 空
bodyClass ¶
指定编辑器 iframe document body 的 className 。
· 数据类型: String
· 默认值: “ke-content”
colorTable ¶
指定取色器里的颜色。
· 数据类型: Array
· 默认值:
[
[ '#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'],
[ '#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'],
[ '#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
[ '#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
]
afterCreate ¶
设置编辑器创建后执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterChange ¶
编辑器内容发生变化后执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterTab ¶
按下 TAB 键后执行的的回调函数。
· 数据类型: Function
· 默认值: 插入4个空格的函数
afterFocus ¶
编辑器聚焦 (focus) 时执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterBlur ¶
编辑器失去焦点 (blur) 时执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterUpload ¶
上传文件后执行的回调函数。
· 数据类型: Function
· 默认值: 无
KindEditor.ready( function(K) {
K.create( '#id', {
afterUpload : function(url) {
alert(url);
}
});
});
uploadJson ¶
指定上传文件的服务器端程序。
· 数据类型: String
· 默认值: basePath + ‘php/upload_json.php’
fileManagerJson ¶
指定浏览远程图片的服务器端程序。
· 数据类型: String
· 默认值: basePath + ‘php/file_manager_json.php’
allowPreviewEmoticons ¶
true 时鼠标放在表情上可以预览表情。
· 数据类型: Boolean
· 默认值: true
allowImageUpload ¶
true 时显示图片上传按钮。
· 数据类型: Boolean
· 默认值: true
allowFlashUpload ¶
true 时显示 Flash 上传按钮。
· 数据类型: Boolean
· 默认值: true
allowMediaUpload ¶
true 时显示视音频上传按钮。
· 数据类型: Boolean
· 默认值: true
allowFileUpload ¶
true 时显示文件上传按钮。
· 数据类型: Boolean
· 默认值: true
Note
4.0.6 版本开始支持。
allowFileManager ¶
true 时显示浏览远程服务器按钮。
· 数据类型: Boolean
· 默认值: false
fontSizeTable ¶
指定文字大小。
· 数据类型: Array
· 默认值:
[ '9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px']
imageTabIndex ¶
图片弹出层的默认显示标签索引。
· 数据类型: Int
· 默认值: 0
Note
4.0.6 版本开始支持。
formatUploadUrl ¶
false 时不会自动格式化上传后的 URL 。
· 数据类型: Boolean
· 默认值: true
Note
4.1 版本开始支持。
fullscreenShortcut ¶
false 时禁用 ESC 全屏快捷键。
· 数据类型: Boolean
· 默认值: false
Note
4.1 版本开始支持,从 4.1.2 版本开始默认值为 false 。
extraFileUploadParams ¶
上传图片、 Flash 、视音频、文件时,支持添加别的参数一并传到服务器。
· 数据类型: Array
· 默认值: {}
KindEditor.ready( function(K) {
K.create( '#id', {
extraFileUploadParams : {
item_id : 1000,
category_id : 1
}
});
});
Note
4.1.1 版本开始支持。
filePostName ¶
指定上传文件 form 名称。
· 数据类型: String
· 默认值: imgFile
Note
4.1.2 版本开始支持。
fillDescAfterUploadImage ¶
true 时图片上传成功后切换到图片编辑标签, false 时插入图片后关闭弹出框。
· 数据类型: Boolean
· 默认值: false
Note
4.1.2 版本开始支持。
afterSelectFile ¶
从图片空间选择文件后执行的回调函数。
· 数据类型: Function
· 默认值: 无
Note
4.1.2 版本开始支持。
pagebreakHtml ¶
可指定分页符 HTML 。
· 数据类型: String
· 默认值: <hr style=”page-break-after: always;” class=”ke-pagebreak” />
Note
4.1.3 版本开始支持。
Contents
· 编辑器初始化参数
o width
o height
o minWidth
o minHeight
o items
o noDisableItems
o filterMode
o htmlTags
o wellFormatMode
o resizeType
o themeType
o langType
o designMode
o fullscreenMode
o basePath
o themesPath
o pluginsPath
o langPath
o minChangeSize
o urlType
o newlineTag
o pasteType
o dialogAlignType
o shadowMode
o useContextmenu
o syncType
o indentChar
o cssPath
o cssData
o bodyClass
o colorTable
o afterCreate
o afterChange
o afterTab
o afterFocus
o afterBlur
o afterUpload
o uploadJson
o fileManagerJson
o allowPreviewEmoticons
o allowImageUpload
o allowFlashUpload
o allowMediaUpload
o allowFileUpload
o allowFileManager
o fontSizeTable
o imageTabIndex
o formatUploadUrl
o fullscreenShortcut
o extraFileUploadParams
o filePostName
o fillDescAfterUploadImage
o afterSelectFile
o pagebreakHtml
width ¶
编辑器的宽度,可以设置 px 或 % ,比 textarea 输入框样式表宽度优先度高。
· 数据类型: String
· 默认值: textarea输入框的宽度
示例 :
K.create( '#id', {
width : '700px'
});
height ¶
编辑器的高度,只能设置 px ,比 textarea 输入框样式表高度优先度高。
· 数据类型: String
· 默认值: textarea输入框的高度
minWidth ¶
指定编辑器最小宽度,单位为 px 。
· 数据类型: Int
· 默认值: 650
minHeight ¶
指定编辑器最小高度,单位为 px 。
· 数据类型: Int
· 默认值: 100
items ¶
配置编辑器的工具栏,其中 ”/” 表示换行, ”|” 表示分隔符。
· 数据类型: Array
· 默认值:
[
'source', '|', 'undo', 'redo', '|', 'preview', 'print', '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', 'multiimage',
'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
'anchor', 'link', 'unlink', '|', 'about'
]
source | HTML代码 |
preview | 预览 |
undo | 后退 |
redo | 前进 |
cut | 剪切 |
copy | 复制 |
paste | 粘贴 |
plainpaste | 粘贴为无格式文本 |
wordpaste | 从Word粘贴 |
selectall | 全选 |
justifyleft | 左对齐 |
justifycenter | 居中 |
justifyright | 右对齐 |
justifyfull | 两端对齐 |
insertorderedlist | 编号 |
insertunorderedlist | 项目符号 |
indent | 增加缩进 |
outdent | 减少缩进 |
subscript | 下标 |
superscript | 上标 |
formatblock | 段落 |
fontname | 字体 |
fontsize | 文字大小 |
forecolor | 文字颜色 |
hilitecolor | 文字背景 |
bold | 粗体 |
italic | 斜体 |
underline | 下划线 |
strikethrough | 删除线 |
removeformat | 删除格式 |
image | 图片 |
flash | Flash |
media | 视音频 |
table | 表格 |
hr | 插入横线 |
emoticons | 插入表情 |
link | 超级链接 |
unlink | 取消超级链接 |
fullscreen | 全屏显示 |
about | 关于 |
| 打印 |
code | 插入程序代码 |
map | Google地图 |
baidumap | 百度地图 |
lineheight | 行距 |
clearhtml | 清理HTML代码 |
pagebreak | 插入分页符 |
quickformat | 一键排版 |
insertfile | 插入文件 |
template | 插入模板 |
anchor | 插入锚点 |
designMode 为false时,要保留的工具栏图标。
· 数据类型: Array
· 默认值: [‘source’, ‘fullscreen’]
filterMode ¶
true时根据 htmlTags 过滤HTML代码,false时允许输入任何代码。
· 数据类型: Boolean
· 默认值: true
Note
4.1.1 版本开始默认值为 true 。
htmlTags ¶
指定要保留的 HTML 标记和属性。 Object 的 key 为 HTML 标签名, value 为 HTML 属性数组, ”.” 开始的属性表示 style 属性。
· 数据类型: Object
· 默认值:
{
font : [ 'color', 'size', 'face', '.background-color'],
span : [
'.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
],
div : [
'align', '.border', '.margin', '.padding', '.text-align', '.color',
'.background-color', '.font-size', '.font-family', '.font-weight', '.background',
'.font-style', '.text-decoration', '.vertical-align', '.margin-left'
],
table : [
'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
'.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
'.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
'.width', '.height', '.border-collapse'
],
'td,th' : [
'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
],
a : [ 'href', 'target', 'name'],
embed : [ 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
img : [ 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
],
pre : [ 'class'],
hr : [ 'class', '.page-break-after'],
'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : []
}
wellFormatMode ¶
true 时美化 HTML 数据。
· 数据类型: Boolean
· 默认值: true
resizeType ¶
2 或 1 或 0 , 2 时可以拖动改变宽度和高度, 1 时只能改变高度, 0 时不能拖动。
· 数据类型: Int
· 默认值: 2
themeType ¶
指定主题风格,可设置 ”default” 、 ”simple” ,指定 simple 时需要引入 simple.css 。
· 数据类型: String
· 默认值: “default”
示例 :
<link rel= "stylesheet" href= "../themes/default/default.css" />
<link rel= "stylesheet" href= "../themes/simple/simple.css" />
<script charset= "utf-8" src= "../kindeditor.js" ></script>
<script charset= "utf-8" src= "../lang/zh_CN.js" ></script>
<script>
var editor;
KindEditor.ready( function(K) {
editor = K.create( '#editor_id', {
themeType : 'simple'
});
});
</script>
langType ¶
指定语言,可设置 ”en” 、 ”zh_CN” ,需要引入 lang/[langType].js 。
· 数据类型: String
· 默认值: “zh_CN”
示例 :
<link rel= "stylesheet" href= "../themes/default/default.css" />
<script charset= "utf-8" src= "../kindeditor.js" ></script>
<script charset= "utf-8" src= "../lang/en.js" ></script>
<script>
var editor;
KindEditor.ready( function(K) {
editor = K.create( '#editor_id', {
langType : 'en'
});
});
</script>
designMode ¶
可视化模式或代码模式
· 数据类型: Boolean
· 默认值: true
fullscreenMode ¶
true 时加载编辑器后变成全屏模式。
· 数据类型: Boolean
· 默认值: false
basePath ¶
指定编辑器的根目录路径。
· 数据类型: String
· 默认值: 根据kindeditor.js文件名自动获取
themesPath ¶
指定编辑器的 themes 目录路径。
· 数据类型: String
· 默认值: basePath + ‘themes/’
pluginsPath ¶
指定编辑器的 plugins 目录路径。
· 数据类型: String
· 默认值: basePath + ‘plugins/’
langPath ¶
指定编辑器的 lang 目录路径。
· 数据类型: String
· 默认值: basePath + ‘lang/’
minChangeSize ¶
undo/redo 文字输入最小变化长度,当输入的文字变化小于这个长度时不会添加到 undo 记录里。
· 数据类型: String
· 默认值: 5
urlType ¶
改变站内本地 URL ,可设置 ”“ 、 ”relative” 、 ”absolute” 、 ”domain” 。空为不修改 URL , relative 为相对路径, absolute 为绝对路径, domain 为带域名的绝对路径。
· 数据类型: String
· 默认值: “”
newlineTag ¶
设置回车换行标签,可设置 ”p” 、 ”br” 。
· 数据类型: String
· 默认值: “p”
pasteType ¶
设置粘贴类型, 0: 禁止粘贴 , 1: 纯文本粘贴 , 2:HTML 粘贴
· 数据类型: Int
· 默认值: 2
dialogAlignType ¶
设置弹出框 (dialog) 的对齐类型,可设置 ”“ 、 ”page” ,指定 page 时按当前页面居中,指定空时按编辑器居中。
· 数据类型: String
· 默认值: “page”
shadowMode ¶
true 时弹出层 (dialog) 显示阴影。
· 数据类型: Boolean
· 默认值: true
useContextmenu ¶
true 时使用右键菜单, false 时屏蔽右键菜单。
· 数据类型: Boolean
· 默认值: true
syncType ¶
同步数据的方式,可设置 ”“ 、 ”form” ,值为 form 时提交 form 时自动同步,空时不会自动同步。
· 数据类型: String
· 默认值: “form”
indentChar ¶
wellFormatMode 为true时,HTML代码缩进字符。
· 数据类型: String
· 默认值: “\t”
cssPath ¶
指定编辑器 iframe document 的 CSS 文件,用于设置可视化区域的样式。
· 数据类型: String或Array
· 默认值: 空
cssData ¶
指定编辑器 iframe document 的 CSS 数据,用于设置可视化区域的样式。
· 数据类型: String
· 默认值: 空
bodyClass ¶
指定编辑器 iframe document body 的 className 。
· 数据类型: String
· 默认值: “ke-content”
colorTable ¶
指定取色器里的颜色。
· 数据类型: Array
· 默认值:
[
[ '#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'],
[ '#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'],
[ '#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
[ '#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
]
afterCreate ¶
设置编辑器创建后执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterChange ¶
编辑器内容发生变化后执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterTab ¶
按下 TAB 键后执行的的回调函数。
· 数据类型: Function
· 默认值: 插入4个空格的函数
afterFocus ¶
编辑器聚焦 (focus) 时执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterBlur ¶
编辑器失去焦点 (blur) 时执行的回调函数。
· 数据类型: Function
· 默认值: 无
afterUpload ¶
上传文件后执行的回调函数。
· 数据类型: Function
· 默认值: 无
KindEditor.ready( function(K) {
K.create( '#id', {
afterUpload : function(url) {
alert(url);
}
});
});
uploadJson ¶
指定上传文件的服务器端程序。
· 数据类型: String
· 默认值: basePath + ‘php/upload_json.php’
fileManagerJson ¶
指定浏览远程图片的服务器端程序。
· 数据类型: String
· 默认值: basePath + ‘php/file_manager_json.php’
allowPreviewEmoticons ¶
true 时鼠标放在表情上可以预览表情。
· 数据类型: Boolean
· 默认值: true
allowImageUpload ¶
true 时显示图片上传按钮。
· 数据类型: Boolean
· 默认值: true
allowFlashUpload ¶
true 时显示 Flash 上传按钮。
· 数据类型: Boolean
· 默认值: true
allowMediaUpload ¶
true 时显示视音频上传按钮。
· 数据类型: Boolean
· 默认值: true
allowFileUpload ¶
true 时显示文件上传按钮。
· 数据类型: Boolean
· 默认值: true
Note
4.0.6 版本开始支持。
allowFileManager ¶
true 时显示浏览远程服务器按钮。
· 数据类型: Boolean
· 默认值: false
fontSizeTable ¶
指定文字大小。
· 数据类型: Array
· 默认值:
[ '9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px']
imageTabIndex ¶
图片弹出层的默认显示标签索引。
· 数据类型: Int
· 默认值: 0
Note
4.0.6 版本开始支持。
formatUploadUrl ¶
false 时不会自动格式化上传后的 URL 。
· 数据类型: Boolean
· 默认值: true
Note
4.1 版本开始支持。
fullscreenShortcut ¶
false 时禁用 ESC 全屏快捷键。
· 数据类型: Boolean
· 默认值: false
Note
4.1 版本开始支持,从 4.1.2 版本开始默认值为 false 。
extraFileUploadParams ¶
上传图片、 Flash 、视音频、文件时,支持添加别的参数一并传到服务器。
· 数据类型: Array
· 默认值: {}
KindEditor.ready( function(K) {
K.create( '#id', {
extraFileUploadParams : {
item_id : 1000,
category_id : 1
}
});
});
Note
4.1.1 版本开始支持。
filePostName ¶
指定上传文件 form 名称。
· 数据类型: String
· 默认值: imgFile
Note
4.1.2 版本开始支持。
fillDescAfterUploadImage ¶
true 时图片上传成功后切换到图片编辑标签, false 时插入图片后关闭弹出框。
· 数据类型: Boolean
· 默认值: false
Note
4.1.2 版本开始支持。
afterSelectFile ¶
从图片空间选择文件后执行的回调函数。
· 数据类型: Function
· 默认值: 无
Note
4.1.2 版本开始支持。
pagebreakHtml ¶
可指定分页符 HTML 。
· 数据类型: String
· 默认值: <hr style=”page-break-after: always;” class=”ke-pagebreak” />
Note
4.1.3 版本开始支持。