【免费】帝国CMS整合KindEditor编辑器(含附件管理)
插件 by ecms 2016-08-26 22:22:02 插件   帝国CMS   

aff4704f-abc7-4645-a09d-6cf4072c753c.png

同步附件管理:

QQ截图20160826234703.jpg

解压至 /e/extend/

替换编辑器字段内容:

XML/HTML Code复制内容到剪贴板
  1. <?php  
  2. $ziduan='newstext';//编辑器使用的字段名称  
  3. $ziduanzhi = $ecmsfirstpost==1?"":stripSlashes($r[$ziduan]);  
  4. ?>  
  5. <textarea id="<?=$ziduan?>" name="<?=$ziduan?>"><?=$ziduanzhi?></textarea>  
  6. <link rel="stylesheet" href="/e/extend/kindeditor/themes/simple/simple.css" />  
  7. <script>var classid='<?=$classid?>',infoid='<?=$id?>',filepass='<?=$filepass?>',ehash='<?=$ecms_hashur[ehref]?>',qiantai='<?=$qiantai?>';//把参数传给编辑器,增加支持7.2版本的金刚模式</script>  
  8. <script charset="utf-8" src="/e/extend/kindeditor/kindeditor.js"></script>  
  9. <script charset="utf-8" src="/e/extend/kindeditor/lang/zh_CN.js"></script>  
  10. <script>  
  11. KindEditor.ready(function(K) {  
  12.     window.editor = K.create('#<?=$ziduan?>',{  
  13.         cssPath: '/e/extend/kindeditor/plugins/code/prettify.css',  
  14.         filterMode:false,   //默认true,true时根据htmlTags过滤HTML代码,false时允许输入任何代码  
  15.         resizeType:2,       //默认2,可选:2、1、0 —— 2:可拖动改变宽度和高度,1:只能改变高度,0:不能拖动  
  16.         themeType:'simple', //默认default,如果是simple需要引入simple.css  
  17.         pagebreakHtml:'[ !--empirenews.page--]',   //设置分页  
  18.         uploadJson : '/e/extend/kindeditor/php/upload.php?id='+infoid+'&classid='+classid+'&qiantai='+qiantai+'&filepass='+filepass+ehash,  //上传文件  
  19.         width:'100%',  
  20.         minHeight:'500px',  
  21.         items:[  
  22.             'source', '|', 'clearhtml','unlink','quickformat' , '|','paste','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', '|', 'fontname','fontsize','forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage','flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', 'link', 'fullscreen','|'  
  23.         ]  
  24.     });  
  25. });  
  26. </script>  

 

 

 

 

 

 

 

 

代码高亮 在模板样式中添加:

XML/HTML Code复制内容到剪贴板
  1. <script src="/e/extend/kindeditor/plugins/code/prettify.js" type="text/javascript"></script>    
  2. <link href="/e/extend/kindeditor/plugins/code/prettify.css" rel="stylesheet" type="text/css" />   
  3. <script>  
  4. $(function(){ prettyPrint(); });  
  5. </script>  

 

 

工具栏:

source HTML代码
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 图片
flash Flash
media 视音频
table 表格
hr 插入横线
emoticons 插入表情
link 超级链接
unlink 取消超级链接
fullscreen 全屏显示
about 关于
print 打印
code 插入程序代码
map Google地图
baidumap 百度地图
lineheight 行距
clearhtml 清理HTML代码
pagebreak 插入分页符
quickformat 一键排版
insertfile 插入文件
template 插入模板
anchor 插入锚点

 

 

本文来自于:http://www.yoyo88.cn/note/extend/35.html

Powered by yoyo苏ICP备15045725号