每天学习一点点,每天进步一点点.
login

织梦5.7换编辑器 dedecms换ckeditor4

2021-04-05 11:32:09  |  分类: Other |  标签: 无 阅读(1612)    评论(0)

先到官网下个完整版的包

下载地址:https://ckeditor.com/ckeditor-4/download/

/include/ckeditor/config.js

  1. CKEDITOR.editorConfig = function( config ) {
  2. config.uiColor = '#EEEEEE';
  3. // 文件浏览
  4. config.filebrowserImageBrowseUrl = "../include/dialog/select_images.php";
  5. config.filebrowserFlashBrowseUrl = "../include/dialog/select_media.php";
  6. config.filebrowserImageUploadUrl = "../include/dialog/select_images_post.php?responseType=json";
  7. config.filebrowserFlashUploadUrl = "../include/dialog/select_media_post.php?responseType=json";
  8. config.filebrowserUploadUrl = "../include/dialog/select_templets_post.php?responseType=json";
  9. config.autoParagraph = false;
  10. config.enterMode = CKEDITOR.ENTER_BR;
  11. config.shiftEnterMode = CKEDITOR.ENTER_P;
  12. };

/include/dialog/select_images_post.php

  1. 110-112行修改为
  2. if (isset($_GET['responseType']) && $_GET['responseType'] == 'json') {
  3. $str = json_encode(['fileName'=>$filename,'uploaded'=>1,'url'=>$fileurl]);
  4. exit($str);
  5. }else{
  6. $str='<script type="text/javascript">window.parent.CKEDITOR.tools.callFunction('.$CKEditorFuncNum.', \''.$fileurl.'\', \''.$message.'\');</script>';
  7. exit($str);
  8. }

/include/image.class.php

  1. 23行的image方法移动到__construct方法下面

/include/inc/inc_fun_funAdmin.php

  1. 215行注释
  2. // $config['skin'] = 'kama';

这4个文件夹从旧版本移动到新版本

  1. /include/ckeditor/plugins/addon
  2. /include/ckeditor/plugins/dedepage
  3. /include/ckeditor/plugins/multipic
  4. /include/ckeditor/images
留言区域