首页 > 运营 > 软件工具 > 正文

kindSoft在线网页编辑器简单的配置参数介绍

2020-10-06 22:54:23
字体:
来源:转载
供稿:网友
对于网页编辑器对做项目的时候是非常的又用的一个编辑器,大大的减轻了开发人员的负担,感觉KindSoft是一个不错的选择,因此也在不断的使用。

下面对一些简单的配置进行归纳一下
首先是将下载的KindSoft文件导入到项目的目录下;
复制代码 代码如下:

<script src="../Content/kindeditor-4.1.4/kindeditor-all.js" type="text/javascript"></script>
<script src="../Content/kindeditor-4.1.4/lang/zh_CN.js" type="text/javascript"></script>

这两个引用在xx.aspx文件的Head部分
然后插入下面的一段代码
复制代码 代码如下:

<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('#tbContent');
});
</script>

tbContent是要嵌入的Input标签的id值,呵呵嘿嘿、、惊喜就出现了;如下图所示:
 
但是如果要进行图片、flash或者视频的上传的话,你就会很郁闷了,很多时候都会因为上传路径不对而出错,因此你需要设置你的图片、flash或者视频文件的路径;只需将上面一段代码改为如下部分则可以满足基本的需求了:
复制代码 代码如下:

<script language="javascript" type="text/javascript">
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图片
flashFlash
media视音频
table表格
hr插入横线
emoticons插入表情
link超级链接
unlink取消超级链接
fullscreen全屏显示
about关于
print打印
code插入程序代码
mapGoogle地图
baidumap百度地图
lineheight行距
clearhtml清理HTML代码
pagebreak插入分页符
quickformat一键排版
insertfile插入文件
template插入模板
anchor插入锚点
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表