KindEditor编辑器 用法

来源:互联网 发布:长虹led32538数据 编辑:程序博客网 时间:2024/05/16 07:29


先去官网下载相关文件

<link rel="stylesheet" href="kindeditor/themes/default/default.css" />

<link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script>
<script>
KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name="consult.content"]', {
cssPath : 'kindeditor/plugins/code/prettify.css',
uploadJson : 'kindeditor/jsp/upload_json.jsp',
fileManagerJson : 'kindeditor/jsp/file_manager_json.jsp',

allowFileManager : true,

/************************以下是简单模式*****************************************************************/

resizeMode : 2, 
allowPreviewEmoticons : false,

allowUpload : true, 

//启用的功能

items : [ 'source','|','fontname', 'fontsize', '|', 
'textcolor', 'bgcolor', 'bold', 'italic', 'underline', 'removeformat', '|',
'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 

'emoticons', 'image', 'link'],

/*****************************************************************************************/

afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
document.forms['example'].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
document.forms['example'].submit();
});
}
});
prettyPrint();
});
   </script>
原创粉丝点击