# kindeditor **Repository Path**: sparkinzy/kindeditor ## Basic Information - **Project Name**: kindeditor - **Description**: WYSIWYG HTML editor kindeditor图片上传修改版 - **Primary Language**: Unknown - **License**: LGPL-2.1 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-27 - **Last Updated**: 2023-02-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 私人订制版分支kindeditor 根据官方kindeditor 4.1.13 删除flash 组件,重新选用plupload作为上传组件[multiimage.js] ## 样式 ###主题样式 主题默认为`simple` 所有主题默认压缩 批量图片上传组件样式参考 `layui-btn` ### 功能菜单 默认精简模式,默认只展示最常用的功能 ## 使用方式 ### 默认使用 ```js var editor; KindEditor.ready(function(K) { editor = K.create('textarea[name="content"]', { uploadJson:'http://127.0.0.1:8000/php/upload_json.php', fileSizeLimit:"10MB",// 单张图片大小限制 fileUploadLimit:'30',// 一次上传的文件数量限制 }); }); ``` ### 异步加载渲染 ```js $(function() { $('input[name=load]').click(function() { $.getScript('../kindeditor-all-min.js', function() { KindEditor.basePath = '../'; KindEditor.create('textarea[name="content"]',{ allowFileManager : true, uploadJson:'http://127.0.0.1:8000/php/upload_json.php', fileSizeLimit:"10MB",// 单张图片大小限制 fileUploadLimit:'30',// 一次上传的文件数量限制 }); }); }); }); ``` ## 贴图上传 ```javascript KindEditor.ready(function(K) { editor = K.create('textarea[name="content"]', { allowFileManager : true, uploadJson:'http://127.0.0.1:8000/php/upload_json.php?dir=image', fileSizeLimit:"10MB",// 前端文件大小限制 fileUploadLimit:'30',// 全段一次上传的文件数量限制 afterUploaded:function(data) { // 格式化批量上传返回的数据, // 格式化截图上传返回的数据, // 上传成功返回数据格式: // data = { error:0 ,url:''} // 上传失败返回数据格式: // data= { error:10,message:''} var result = {}; if (data.code === 0){ result.error = 0; result.url = data.data.url; }else{ result.error = data.code; result.message = data.msg; } console.log('uploaded:' ,data); return result; } }); ``` ## 官网地址 http://kindeditor.org/ posite (https://github.com/composite) : Korean Translation