在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:iceEditor开源软件地址:https://gitee.com/iceui/iceEditor开源软件介绍:iceEditor富文本编辑器官方
介绍iceEditor是一款简约风格的富文本编辑器,体型十分娇小,无任何依赖,整个编辑器只有一个文件,功能却很不平凡!简约的唯美设计,简洁、极速、使用它的时候不需要引用jQuery、font、css……等文件,因为整个编辑器只是一个Js,支持上传图片、附件!支持添加音乐、视频!iceEditor官方群:324415936 优点
最新更新iceEditor v1.1.9
iceEditor v1.1.8
iceEditor v1.1.7
提示iceui 前端框架已经已集成该编辑器。 注意iceEditor.js的引用禁止放在head标签内,请尽量放在body中或body后面! 引入
使用<!-- 也可以直接使用textarea,放在form表单中可以直接提交 --><!-- <textarea id="editor" name="content"> 欢迎使用iceEditor富文本编辑器 </textarea> --><div id="editor"> 欢迎使用iceEditor富文本编辑器 </div><script type="text/javascript" src="https://cdn.jsdelivr.net/gh/iceuinet/iceEditor/src/iceEditor.min.js"></script> //第一步:创建实例化对象ice.editor('content',function(e){ //第二步:配置图片或附件上传提交表单的路径 //如果你的项目使用的php开发,可直接使用upload.php文件 //其它的编程语言需要你单独处理,后期我会放出.net java等语言代码 //具体与你平常处理multipart/form-data类型的表单一样 //唯一需要注意的就是:处理表单成功后要返回json格式字符串,不能包含其它多余的信息: //url:文件的地址 //name:文件的名称(包含后缀) //error:上传成功为0,其它为错误信息,将以弹窗形式提醒用户 //例如批量上传了两张图片: //[ // {url:'/upload/img/153444.jpg', name:'153444.jpg', error:0}, // {url:'/upload/img/153445.jpg', name:'153445.jpg', error:'禁止该文件类型上传'} //] e.uploadUrl="/iceEditor/src/upload.php"; //第三步:配置菜单(默认加载全部,无需配置) e.menu = [ 'backColor', //字体背景颜色 'fontSize', //字体大小 'foreColor', //字体颜色 'bold', //粗体 'italic', //斜体 'underline', //下划线 'strikeThrough', //删除线 'justifyLeft', //左对齐 'justifyCenter', //居中对齐 'justifyRight', //右对齐 'indent', //增加缩进 'outdent', //减少缩进 'insertOrderedList', //有序列表 'insertUnorderedList', //无序列表 'superscript', //上标 'subscript', //下标 'createLink', //创建连接 'unlink', //取消连接 'hr', //水平线 'table', //表格 'files', //附件 'music', //音乐 'video', //视频 'insertImage', //图片 'removeFormat', //格式化样式 'code', //源码 'line' //菜单分割线 ]; //第四步:创建,如果没有配置项,无需这一步 e.create();}); 设置编辑器尺寸ice.editor('content',function(e){ e.width='700px'; //宽度 e.height='300px'; //高度 e.create();}); 禁用编辑器//初始化过程中的禁用方式ice.editor('content',function(e){ e.disabled=true; e.create(); //通过方法禁用输入 e.inputDisabled(); //取消禁用,恢复输入状态 e.inputEnable();}); 获取内容ice.editor('content',function(e){ console.log(e.getHTML()); //获取HTML格式内容 console.log(e.getText()); //获取Text格式内容 console.log(e.getValue()); //同getHTML,只是为了好记}); 设置内容ice.editor('content',function(e){ e.setValue('hello world!');}); 追加内容ice.editor('content',function(e){ e.addValue('hello world!');}); 监听输入内容ice.editor('content',function(e){ //html:html格式 //text:纯文本格式 e.inputCallback(function(html,text){ //console.log(this.getHTML()) 方法内的this为e对象,html等价于this.getHTML() console.log(html); });}); 禁用截图粘贴功能ice.editor('content',function(e){ e.screenshot=false;}); 禁用截图粘贴直接上传功能//禁用后,将默认以base64格式显示图片ice.editor('content',function(e){ e.screenshotUpload=false;}); 网络图片自动下载到本地ice.editor('content',function(e){ e.imgAutoUpload=false;}); 网络图片自动下载到本地,域名白名单ice.editor('content',function(e){ //默认为false,自动过滤当前域名,如果该图保存到第三方存储平台,例如七牛,可添加该域名,这样避免重复下载 //配置其它域名 格式为数组,例如七牛 e.imgDomain=['www.qiniu.com'];}); 开启富文本粘贴,可粘贴Wordice.editor('content',function(e){ e.pasteText=false;}); 配置插入表情的表情列表ice.editor('content',function(e){ //type分两种,img和text,类型img为图片表情,content为图片的地址,类型text为文字表情,content为文字表情 //以下是简单示例,收集于网络,由某网友整理,仅供参考,如有版权侵犯,请您及时联系我,QQ:308018629,我将及时处理! //如果您有推荐的开源免费的表情,可联系我或者进入官方QQ群324415936,我将表情内置到编辑器中 e.face=[{ title: '新浪', type: 'img', list: [ {title:'嘻嘻',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/0b/tootha_thumb.gif'}, {title:'哈哈',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6a/laugh.gif'}, {title:'可爱',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/14/tza_thumb.gif'}, {title:'可怜',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/af/kl_thumb.gif'}, {title:'挖鼻屎',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/a0/kbsa_thumb.gif'}, {title:'吃惊',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/f4/cj_thumb.gif'}, {title:'害羞',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6e/shamea_thumb.gif'}, {title:'挤眼',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/c3/zy_thumb.gif'}, {title:'闭嘴',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/29/bz_thumb.gif'}, {title:'鄙视',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/71/bs2_thumb.gif'}, {title:'爱你',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6d/lovea_thumb.gif'}, {title:'泪',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/9d/sada_thumb.gif'}, {title:'偷笑',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/19/heia_thumb.gif'}, {title:'亲亲',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/8f/qq_thumb.gif'}, {title:'生病',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/b6/sb_thumb.gif'}, {title:'太开心',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/58/mb_thumb.gif'}, {title:'懒得理你',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/17/ldln_thumb.gif'}, {title:'右哼哼',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/98/yhh_thumb.gif'}, {title:'左哼哼',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6d/zhh_thumb.gif'}, {title:'嘘',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/a6/x_thumb.gif'}, {title:'衰',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/af/cry.gif'}, {title:'委屈',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/73/wq_thumb.gif'}, {title:'吐',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/9e/t_thumb.gif'}, {title:'打哈欠',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/f3/k_thumb.gif'}, {title:'抱抱',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/27/bba_thumb.gif'}, {title:'怒',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/7c/angrya_thumb.gif'}, {title:'疑问',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/5c/yw_thumb.gif'}, {title:'馋嘴',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/a5/cza_thumb.gif'}, {title:'拜拜',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/70/88_thumb.gif'}, {title:'思考',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/e9/sk_thumb.gif'}, {title:'汗',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/24/sweata_thumb.gif'}, {title:'困',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/7f/sleepya_thumb.gif'}, {title:'睡觉',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6b/sleepa_thumb.gif'}, {title:'钱',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/90/money_thumb.gif'}, {title:'失望',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/0c/sw_thumb.gif'}, {title:'酷',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/40/cool_thumb.gif'}, {title:'花心',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/8c/hsa_thumb.gif'}, {title:'哼',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/49/hatea_thumb.gif'}, {title:'鼓掌',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/36/gza_thumb.gif'}, {title:'晕',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/d9/dizzya_thumb.gif'}, {title:'悲伤',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/1a/bs_thumb.gif'}, {title:'抓狂',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/62/crazya_thumb.gif'}, {title:'黑线',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/91/h_thumb.gif'}, {title:'阴险',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6d/yx_thumb.gif'}, {title:'怒骂',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/89/nm_thumb.gif'}, {title:'心',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/40/hearta_thumb.gif'}, {title:'伤心',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/ea/unheart.gif'}, {title:'ok',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/d6/ok_thumb.gif'}, {title:'耶',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/d9/ye_thumb.gif'}, {title:'good',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/d8/good_thumb.gif'}, {title:'不要',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/c7/no_thumb.gif'}, {title:'赞',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/d0/z2_thumb.gif'}, {title:'来',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/40/come_thumb.gif'}, {title:'弱',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/d8/sad_thumb.gif'}, {title:'蜡烛',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/91/lazu_thumb.gif'}, {title:'蛋糕',content:'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6a/cake.gif'} ] }, { title: '文字', type: 'text', list: [ {title:'开心',content:'(^_^)'}, {title:'受不了',content:'(>_<)'}, {title:'鄙视',content:'(¬、¬)'}, {title:'难过',content:'(*>﹏<*)'}, {title:'可爱',content:'(。◕‿◕。)'}, {title:'无奈',content:'╮(╯_╰)╭'}, {title:'惊喜',content:'╰(*°▽°*)╯'}, {title:'听音乐',content:'♪(^∇^*)'}, {title:'害羞',content:'(✿◡‿◡)'}, {title:'睡啦',content:'(∪。∪)..zzZ'}, {title:'臭美',content:'(o≖◡≖)'}, {title:'流汗',content:'(ーー゛)'} ] }]; e.create();}); ajax回调ice.editor('content',function(e){ //ajax的xhr设置 e.ajax.xhr = function(xhr){}; //ajax的formData设置 e.ajax.formData = function(formData){}; //ajax超时回调 e.ajax.timeout = function(xhr){}; //ajax成功回调 e.ajax.success = function(res,xhr){}; //ajax失败回调 e.ajax.error = function(res,xhr){}; //ajax不管成功失败都调用 e.ajax.complete = function(res,xhr){};
全部评论
专题导读
上一篇:breadbot: 小面包(Breadbot)是一款功能强大,简单易部署的聊天AI ...发布时间:2022-03-25下一篇:zplayer: h5+css3+js精简音乐播放器,全部内容参数可控!实现播放列表播放/上下首/时 ...发布时间:2022-03-25热门推荐
热门话题
阅读排行榜
|
请发表评论