FckEditor自定义按钮

目录

FckEditor自定义按钮    1

目录    2

修订历史纪录    3

1 FckEditor简介    4

2 使用FckEditor    4

3 添加自定义按钮    4

1 FckEditor简介

一款比较好的网页文本编辑器

2 使用FckEditor

1.将FCKeditor编辑器的文件夹复制到网站根目录下

2. 请设置文件夹的user用户的访问权限

3. 在web.config中添加

<appSettings>

<add key="FCKeditor:BasePath" value="~/FckEditorv2/"/>

</appSettings>

4.添加对FredCK.FCKeditorV2.dll的引用

5. 在要使用此编辑器的页面的最上方添加

<%@Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

6. 在需要使用编辑器的地方添加

    <fckeditorv2:fckeditor id="txtContent" runat="server" Height="100%">

</fckeditorv2:fckeditor>

3 添加自定义按钮

以添加上传附件按钮为例:

1.在fckconfig.js中添的FCKConfig.ToolbarSets["Default"]添加'InsertFile',这是在Default模式下的工具栏显示的按钮。如需要可添加到其他模式下。

2.在editor/lang/zh-cn.js文件最后添加InsertFile : "附件"

3.在editor/js/fckeditorcode_ie.js文件中查找InsertHorizontalRule,在|后添加InsertFile

4.还在此文件中查找default:if (FCKRegexLib,在其前边添加case 'InsertFile':B=new FCKDialogCommand

('InsertFile',FCKLang.InsertFile,'dialog/InsertFile/InsertFile.aspx',510,450);break;

第3个参数为打开窗口的相对路径

5.还在此文件中查找default:alert(FCKLang.UnknownToolbarItem 在其前面添加

case 'InsertFile':B = new FCKToolbarButton('InsertFile',FCKLang.InsertFile,FCKLang.InsertFile,FCK_TOOLBARITEM_ICONTEXT,false,true,4);break;

FCK_TOOLBARITEM_ICONTEXT参数使此按钮为文字和图片同时显示,最后一个参数为使用第几个图片图片,图片的路径为editor\skins\default\fck_strip.gif

这样工具栏上就多了一个添加附件的按钮

posted on 2007-11-29 18:35  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2007/11/29/977292.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值