DEDECMS:DEDE整合(UEditor)百度编辑器以后,栏目内容、单页无法保存内容的bug处理方法

已经整合过百度编辑器的站长们或许会发现,在编辑单页文档和栏目内容的时候,百度编辑器不能够保存新增或已修改数据,经过排查后发现问题出现在catalog_edit.htm、catalog_add.htm这两个文件中,接下来我们就对这两个文件进行修改,使百度编辑器和织梦进行完美对接。

首先打开dede/templets/catalog_edit.htm(如果你有后台目录没有改名字的话就是dede),找到如下代码:

function checkSubmit()

{

   if(document.form1.typename.value==""){

          alert("栏目名称不能为空!");

          document.form1.typename.focus();

          return false;

     }

     return true;

}

替换为:

function checkSubmit()

{

   if(document.form1.typename.value==""){

          alert("栏目名称不能为空!");

          document.form1.typename.focus();

          return false;

     }
     document.form1.content.value = document.getElementById("ueditor_0").contentWindow.document.body.innerHTML;
     return true;

}

然后在同样的目录下打开catalog_add.htm,找到如下代码:

function checkSubmit()

{

   if(document.form1.typename.value==""){

          alert("栏目名称不能为空!");

          document.form1.typename.focus();

          return false;

     }

     return true;

}

  替换为:

function checkSubmit()

{

   if(document.form1.typename.value==""){

          alert("栏目名称不能为空!");

          document.form1.typename.focus();

          return false;

     }
     document.form1.content.value = document.getElementById("ueditor_0").contentWindow.document.body.innerHTML;
     return true;

}

保存文件即可使百度编辑器正常工作了。

posted @ 2020-08-31 17:15  白小白学IT  阅读(332)  评论(0)    收藏  举报