作者: 字体:[增加 减小] 类型:转载
对于网页编辑器对做项目的时候是非常的又用的一个编辑器,大大的减轻了开发人员的负担,感觉KindSoft是一个不错的选择,因此也在不断的使用接下来介绍参数配置,需要的朋友可以了解下
对于网页编辑器对做项目的时候是非常的又用的一个编辑器,大大的减轻了开发人员的负担,感觉KindSoft是一个不错的选择,因此也在不断的使用,
kindSoft在线网页编辑器简单的配置参数介绍
。下面对一些简单的配置进行归纳一下:
首先是将下载的KindSoft文件导入到项目的目录下;
代码如下:
这两个引用在xx.aspx文件的Head部分
然后插入下面的一段代码:
代码如下:
tbContent是要嵌入的Input标签的id值,呵呵嘿嘿、、惊喜就出现了;如下图所示:
但是如果要进行图片、flash或者视频的上传的话,你就会很郁闷了,很多时候都会因为上传路径不对而出错,因此你需要设置你的图片、flash或者视频文件的路径;只需将上面一段代码改为如下部分则可以满足基本的需求了:
代码如下:
KindEditor.ready(function (K) {
K.create(‘#tbContent‘, {
uploadJson: ‘../Content/kindeditor-4.1.4/asp.net/upload_json.ashx‘,
fileManagerJson: ‘../Content/kindeditor-4.1.4/asp.net/file_manager_json.ashx‘,
allowFileManager: true
});
});
上面标记颜色的部分应该根据自己的文件路径选择合适的路径;
最后就是有关编辑器中的控件并不是自己所需要的,所以你需要在如下的路径进行配置:
展开kindeditor-4.1.4,找到kindeditor.js文件,双击就去,然后找到在246页左右,就有一个Items,在之后又如下的配置参数:
代码如下:
[
‘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‘
]
参数的解释如下:
sourceHTML代码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图片flashFlashmedia视音频table表格hr插入横线emoticons插入表情link超级链接unlink取消超级链接fullscreen全屏显示about关于print打印code插入程序代码mapGoogle地图baidumap百度地图lineheight行距clearhtml清理HTML代码pagebreak插入分页符quickformat一键排版insertfile插入文件template插入模板anchor插入锚点