更换博易默认的编辑器

Posted by Spoony - 2008.8.19 at 10:6 AM

这篇文章转自幻想曲博客。
blogEngine哪一点都好,就后台编辑器太差,比如最明显的一点:
我想引用一个外部的图片地址,只能切换到代码视图,手工写html代码。
很怀念以前自己的blog后台的编辑器,那是一个经过改良的fckeditor,集成代码高亮等功能。
今天晚上有时间就给更换了,更换方法:
首先将Fckeditor的程序文件复制到blog根目录下,复制fckeditor.dll到bin中
打开admin/htmleditor.ascx,修改为以下代码:
 


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="htmlEditor.ascx.cs" Inherits="admin_htmlEditor" %>
<%@ Register Src="tinyMCE.ascx" TagName="tinyMCE" TagPrefix="uc1" %>
<%@ Import Namespace="BlogEngine.Core" %>
<%--<uc1:tinyMCE ID="TinyMCE1" runat="server" />--%>
<textarea ID="TinyMCE1" style="width:100%" rows="40" runat="server"></textarea>
<script src='../fckeditor/fckeditor.js' type='text/javascript'></script>
<script type= "text/javascript" defer="defer"
var oFCKeditor = new FCKeditor('<%=TinyMCE1.ClientID %>',null,null,"Default" );
oFCKeditor.BasePath = "../fckeditor/";
oFCKeditor.ReplaceTextarea();
</script>


转到htmleditor.ascx.cs,改成如下:

public partial class admin_htmlEditor : System.Web.UI.UserControl
{

  public string Text
  {
    get { return TinyMCE1.Value; }
      set { TinyMCE1.Value = value; }
  }

  public short TabIndex
  {
      //get { return TinyMCE1.TabIndex; }
      //set { TinyMCE1.TabIndex = value; }
      get { return 0; }
      set { }
  }

}

到此,更改结束。但在add_entry.aspx文件中有自动保存的js代码,注掉即可。

Comments

916x

写得好,我已经更换了,就是代码高亮没加上去.

Comment by 916x at 9/15/2008 4:14:55 PM | Reply

SpoonySonny

嗯。目前博易1.7已经集成了FCKEditor,升级即可,支持高亮!

Comment by SpoonySonny at 9/16/2008 10:08:11 AM | Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
微笑得意调皮害羞酷大笑惊讶发呆喜欢可怜尴尬闭嘴噘嘴皱眉伤心抓狂呕吐坏笑漫骂发怒
Loading




spoony

Categories

Shared Reading

Are you interested?

Recent comments

Comment RSS

Archives


耍宝