zoukankan      html  css  js  c++  java
  • 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

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

  • 相关阅读:
    MySQL(错误1064)
    如何判断是手机还是电脑访问网站
    Oracle表分区
    分离Date数据
    多对多
    一对多
    SQLalchemy基础
    paramiko上传下载
    paramiko
    automap
  • 原文地址:https://www.cnblogs.com/lexus/p/977292.html
Copyright © 2011-2022 走看看