账号通
    

账号  

密码  

6523

查看

16

回复
主题:再次提供整合eWebeditor编辑器方法 [收藏主题] 本贴被认定为精华 转到:  
gxda112 当前离线

194

主题

1

广播

2

粉丝
添加关注
级别:一年级

用户积分:4384 分
登录次数:295 次
注册时间:2007/7/30
最后登录:2016/12/15
gxda112 发表于:2007/12/19 11:30:00   | 只看该作者 查看该作者主题 楼主 
科汛在线考试系统(NET)

4.5刚发布我就提供了一次,当时只是简单整合,不过那帖子已经不见了,为了给需要的朋友方便,再次提供出来,这回已经整合了科讯自带的上传系统。

修改办法:

1、amin/ks.model.asp,第767行左右。加入红色部分。

.Write "    <tr class='tdbg'>"
  .Write "      <td class='clefttitle'><div align=""right""><strong>编辑器类型:</strong><br><font color=red>选择您习惯使用的编辑器。</font></div></td>"
  .Write "      <td height=""30""> <input type=""radio"" name=""EditorType"" value=""0"" "
  If EditorType = 0 Then .Write (" checked")
  .Write ">"
  .Write "        KesionCMS自带编辑器"


.Write "          <input type=""radio"" name=""EditorType"" value=""2"" "
  If EditorType = 2 Then .Write (" checked")
  .Write "> eWebeditor"
  .Write "          <input type=""radio"" name=""EditorType"" value=""1"" "
  If EditorType = 1 Then .Write (" checked")
  .Write ">"
  .Write "          FCKEditor        </td>"
  .Write "    </tr>"

2、admin/KS.Article.asp ;1464行左右,加入红色部分,作用:把上传附件插入到编辑器中。

function insertHTMLToEditor(codeStr)
   {
    oEditor=FCKeditorAPI.GetInstance("content");
    if(oEditor   &&   oEditor.EditorWindow){
     oEditor.InsertHtml(codeStr);
    }


   }


function insertHTMLToEditor1(codeStr)
   {



    eWebEditor1.appendHTML(codeStr);//在内容最后插入
    //eWebEditor1.insertHTML(codeStr);//在光标处插入,但不成功,待高手再完善吧。

   }
   function InsertFileFromUp(FileList,InstallDir)
   {
    Files=FileList.split("|");
    for(var i=0;i<Files.length-1;i++)
    {     var ext=getFilePic(Files[i]);
       var files=Files[i].split('/');
       var file=files[files.length-1];
       var br='';
       if (i!=Files.length-1) br='<br />';
       var str="<img border=0 src="+InstallDir+"KS_Editor/images/FileIcon/"+ext+"> <a href="+Files[i]+"  target=_blank>[点击浏览该文件:"+file+"]</a>"+br;
       insertHTMLToEditor(str);
     }
   }


function InsertFileFromUp1(FileList,InstallDir)
   {
    Files=FileList.split("|");
    for(var i=0;i<Files.length-1;i++)
    {     var ext=getFilePic(Files[i]);
       var files=Files[i].split('/');
       var file=files[files.length-1];
       var br='';
       if (i!=Files.length-1) br='<br />';
       var str="<img border=0 src="+InstallDir+"KS_Editor/images/FileIcon/"+ext+"> <a href="+Files[i]+"  target=_blank>[点击浏览该文件:"+file+"]</a>"+br;
       insertHTMLToEditor1(str);



     }
   }

3、1641行,作用:不填内容时不给提交

<%If F_B_Arr(4)=1 and F_B_Arr(9)=1 Then%>
       <%if KS.C_S(ChannelID,34)=0 Then%>
     if (($("Changes").checked==false)&&($F("Content")==""))
       { 
        frames["ArticleContent"].KS_EditArea.focus();
      alert("<%=KS.C_S(ChannelID,3)%>内容不能留空!");
      return false;
       }
     <%elseif KS.C_S(ChannelID,34)=1 then%>
       if (($("Changes").checked==false)&&(FCKeditorAPI.GetInstance('content').GetXHTML(true)==""))
      {
       alert("<%=KS.C_S(ChannelID,3)%>内容不能留空!");
       return false;
      }
      <%else   '用ewebeditor编辑器%>
      var sHTML = eWebEditor1.getHTML();
                     if (sHTML =="")
        {
         alert("<%=KS.C_S(ChannelID,3)%>内容不能留空!");
      return false;}

     <%end if%>
    <%end if%>

4、1957行,作用:加入新编辑器,注意,要修改蓝色的eWebEditor1,必须同时修改上面的相关地方。

If KS.C_S(ChannelID,34)=0 Then
   .Write "      <input type='hidden'  ID='Content' name='Content' value=""" & Server.HTMLEncode(ArticleContent) & """>"

   .Write "<iframe id='ArticleContent' name='ArticleContent' src='KS.Editor.asp?ID=Content&style="&channelid&"&ChannelID=" & channelid & "' frameborder=0 scrolling=no width='700' height='350'></iframe>"


elseif KS.C_S(ChannelID,34)=2 Then
   .Write "      <input type='hidden'  ID='Content' name='Content' value=""" & Server.HTMLEncode(ArticleContent) & """>"
   .Write "<iframe id='eWebEditor1' name='eWebEditor1' src='../eWebEditor/ewebeditor.asp?id=Content&style=s_coolblue' frameborder=0 scrolling=no width='700' height='350'></iframe>"
   Else
     Dim oFCKeditor
     Set oFCKeditor = New FCKeditor
     oFCKeditor.BasePath = "../KS_Editor/FCKeditor/"
     oFCKeditor.ToolbarSet = "NewsTool"
     oFCKeditor.Width = "695"
     oFCKeditor.Height = "480"
     oFCKeditor.Value = ArticleContent
     oFCKeditor.Create "content"
            End If

5、admin/include/upfilesave.asp    175行,作用:触发新的事件InsertFileFromUp1

if UpType="File" Then   '上传附件
           If KS.C_S(ChannelID,34)=0 Then
        Response.Write("parent.ArticleContent.InsertFileFromUp('" & TempFileStr &"','" & KS.Setting(3) & "');")
        ElseIf KS.C_S(ChannelID,34)=1 Then
        Response.Write("parent.InsertFileFromUp('" & TempFileStr &"','" & KS.Setting(3) & "');")


else
        Response.Write("parent.InsertFileFromUp1('" & TempFileStr &"','" & KS.Setting(3) & "');")
        End If
        Response.Write("document.write('&nbsp;&nbsp;&nbsp;&nbsp;<font size=2>附件上传成功!</font>');")
      Else

6、eWebeditor部分(我用的是2.8)

eWebEditor/Dialog/img.htm  75行

// 图片来源单选点击事件
function RadioClick(what){
if (what=="url"){
  d_checkfromfile.checked=false;
  d_fromurl.disabled=false;


Button.disabled=false;
  d_checkfromurl.checked=true;
  d_file.myform.uploadfile.disabled=true;
}else{
  d_checkfromurl.checked=false;
  d_file.myform.uploadfile.disabled=false;
  d_checkfromfile.checked=true;
  d_fromurl.disabled=true;


Button.disabled=true;
}
}

同文件272行

<tr>
  <td width=7></td>
  <td width=54 align=right onClick="RadioClick('url')"><input type=radio id="d_checkfromurl" value="1" onClick="RadioClick('url')">网络:</td>
  <td width=5></td>
  <td colspan=5><input type=text id="d_fromurl" style="width:186" size=30 value=""><input type="button" name="Button" value="选择图片" onClick="var TempReturnValue=OpenWindow('http://127.0.0.1/admin/include/SelectPic.asp?ChannelID=1&CurrPath=/',500,290,window);if (TempReturnValue!='') d_fromurl.value=TempReturnValue;" class=Anbutc> </td>
  <td width=7></td>
</tr>

<script language="JavaScript" src="../../KS_Inc/Common.js"></script>


[此贴子已经被作者于2007-12-19 11:40:58编辑过]

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
gxda112 当前离线

194

主题

1

广播

2

粉丝
添加关注
级别:一年级

用户积分:4384 分
登录次数:295 次
注册时间:2007/7/30
最后登录:2016/12/15
gxda112 发表于:2007/12/21 11:29:00   | 只看该作者 查看该作者主题 沙发 
怎么做?去http://www.ewebeditor.net/download.asp下载一个了。
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
csp6353963 当前离线

428

主题

0

广播

1

粉丝
添加关注
级别:四年级

用户积分:4446 分
登录次数:529 次
注册时间:2007/9/6
最后登录:2018/5/21
csp6353963 发表于:2007/12/21 11:39:00   | 只看该作者 查看该作者主题 藤椅 
科汛在线商城系统(NET)
我已经整合好了,看了看,还是没多大用处.觉得风讯那个编辑还好,请问楼主,有没有哪个编辑器是可以调整文本的行高的?
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
csp6353963 当前离线

428

主题

0

广播

1

粉丝
添加关注
级别:四年级

用户积分:4446 分
登录次数:529 次
注册时间:2007/9/6
最后登录:2018/5/21
csp6353963 发表于:2007/12/21 10:30:00   | 只看该作者 查看该作者主题 板凳 
楼主,我的是4.5的.怎么找不到这个文件?eWebEditor/Dialog/img.htm
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
gxda112 当前离线

194

主题

1

广播

2

粉丝
添加关注
级别:一年级

用户积分:4384 分
登录次数:295 次
注册时间:2007/7/30
最后登录:2016/12/15
gxda112 发表于:2008/2/18 10:46:00   | 只看该作者 查看该作者主题 报纸 
科汛在线商城系统(NET)

有什么好的编辑器,如果不会整合,我可以帮整合…………

eWebEditor4_4带后台(商业版下载)

http://class.ontian.com/showdown.asp?soft_id=78

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
gxda112 当前离线

194

主题

1

广播

2

粉丝
添加关注
级别:一年级

用户积分:4384 分
登录次数:295 次
注册时间:2007/7/30
最后登录:2016/12/15
gxda112 发表于:2007/12/21 10:42:00   | 只看该作者 查看该作者主题 地板 
科汛在线考试系统(NET)

狂汗………………

有的话还用整合么?我用的是eWebeditor 2.8,其他版本修改类似。

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
csp6353963 当前离线

428

主题

0

广播

1

粉丝
添加关注
级别:四年级

用户积分:4446 分
登录次数:529 次
注册时间:2007/9/6
最后登录:2018/5/21
csp6353963 发表于:2007/12/21 10:51:00   | 只看该作者 查看该作者主题 7楼 
做在线知识付费 选科汛云开店
那具体要怎么做,请指教
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
陈晶 当前离线

219

主题

0

广播

0

粉丝
添加关注
级别:二年级

用户积分:970 分
登录次数:20 次
注册时间:2007/11/24
最后登录:2008/1/21
陈晶 发表于:2007/12/19 19:56:00   | 只看该作者 查看该作者主题 8楼 
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
zhenfengdz 当前离线

3821

主题

0

广播

1

粉丝
添加关注
级别:大三

用户积分:21733 分
登录次数:436 次
注册时间:2007/1/9
最后登录:2013/4/24
zhenfengdz 发表于:2007/12/19 19:23:00   | 只看该作者 查看该作者主题 9楼 
不好意思,看见了是2.8版本,成功了。
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
xjin 当前离线

247

主题

0

广播

0

粉丝
添加关注
级别:二年级

用户积分:2356 分
登录次数:197 次
注册时间:2007/4/4
最后登录:2010/4/21
xjin 发表于:2007/12/19 17:48:00   | 只看该作者 查看该作者主题 10楼 
科汛在线网校系统
4.5不是已经加进去了。?
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.23486秒 powered by KesionCMS 9.0