<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-314  評(píng)論-209  文章-0  trackbacks-0

    試用了一下FCKeditor,根據(jù)網(wǎng)上的文章小結(jié)一下:
    1.下載
    FCKeditor.java 2.3 (FCKeditot for java)
    FCKeditor 2.2 (FCKeditor基本文件)

    2.建立項(xiàng)目:tomcat/webapps/TestFCKeditor.

    3.將FCKeditor2.2解壓縮,將整個(gè)目錄FCKeditor復(fù)制到項(xiàng)目的根目錄下,
    目錄結(jié)構(gòu)為:tomcat/webapps/TestFCKeditor/FCKeditor
    然后將FCKeditor-2.3.zip(java)壓縮包中\(zhòng)web\WEB-INF\lib\目錄下的兩個(gè)jar文件拷到項(xiàng)目的\WEB-INF\lib\目錄下。把其中的src目錄下的FCKeditor.tld文件copy到TestFCKedit/FCKeitor/WEB-INF/下

    4.將FCKeditor-2.3.zip壓縮包中\(zhòng)web\WEB-INF\目錄下的web.xml文件合并到項(xiàng)目的\WEB-INF\目錄下的web.xml文件中。

    5. 修改合并后的web.xml文件,將名為SimpleUploader的Servlet的enabled參數(shù)值改為true,
    以允許上傳功能,Connector Servlet的baseDir參數(shù)值用于設(shè)置上傳文件存放的位置。
    添加標(biāo)簽定義:
    <taglib>
    <taglib-uri>/TestFCKeditor</taglib-uri>
    <taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
    </taglib>

    運(yùn)行圖:

    6. 上面文件中兩個(gè)servlet的映射分別為:/editor/filemanager/browser/default/connectors/jsp/connector
    和/editor/filemanager/upload/simpleuploader,需要在兩個(gè)映射前面加上/FCKeditor,
    即改為/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector和
    /FCKeditor/editor/filemanager/upload/simpleuploader。

    7.進(jìn)入skin文件夾,如果你想使用fckeditor默認(rèn)的這種奶黃色,
    那就把除了default文件夾外的另兩個(gè)文件夾直接刪除.

    8.刪除/FCKeditor/目錄下除fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml四個(gè)文件以外的所有文件
    刪除目錄/editor/_source,
    刪除/editor/filemanager/browser/default/connectors/下的所有文件
    刪除/editor/filemanager/upload/下的所有文件
    刪除/editor/lang/下的除了fcklanguagemanager.js, en.js, zh.js, zh-cn.js四個(gè)文件的所有文件

    9.打開(kāi)/FCKeditor/fckconfig.js
    修改 FCKConfig.DefaultLanguage = 'zh-cn' ;
    把FCKConfig.LinkBrowserURL等的值替換成以下內(nèi)容:
    FCKConfig.LinkBrowserURL
    = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ;

    FCKConfig.ImageBrowserURL
    = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" ;

    FCKConfig.FlashBrowserURL
    = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" ;


    FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=File' ;
    FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash' ;
    FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Image' ;

    10.其它
    fckconfig.js總配置文件,可用記錄本打開(kāi),修改后將文件存為utf-8 編碼格式。找到:

    FCKConfig.TabSpaces = 0 ; 改為FCKConfig.TabSpaces = 1 ; 即在編輯器域內(nèi)可以使用Tab鍵。

    如果你的編輯器還用在網(wǎng)站前臺(tái)的話,比如說(shuō)用于留言本或是日記回復(fù)時(shí),那就不得不考慮安全了,
    在前臺(tái)千萬(wàn)不要使用Default的toolbar,要么自定義一下功能,要么就用系統(tǒng)已經(jīng)定義好的Basic,
    也就是基本的toolbar,找到:
    FCKConfig.ToolbarSets["Basic"] = [
    ['Bold','Italic','-','OrderedList','UnorderedList','-',/*'Link',*/'Unlink','-','Style','FontSize','TextColor','BGColor','-',
    'Smiley','SpecialChar','Replace','Preview'] ] ;
    這是改過(guò)的Basic,把圖像功能去掉,把添加鏈接功能去掉,因?yàn)閳D像和鏈接和flash和圖像按鈕添加功能都能讓前臺(tái)
    頁(yè)直接訪問(wèn)和上傳文件, fckeditor還支持編輯域內(nèi)的鼠標(biāo)右鍵功能。

    FCKConfig.ContextMenu = ['Generic',/*'Link',*/'Anchor',/*'Image',*/'Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField',
    /*'ImageButton',*/'Button','BulletedList','NumberedList','TableCell','Table','Form'] ;

    這也是改過(guò)的把鼠標(biāo)右鍵的“鏈接、圖像,F(xiàn)LASH,圖像按鈕”功能都去掉。

      找到: FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
    加上幾種我們常用的字體
    FCKConfig.FontNames
    = '宋體;黑體;隸書(shū);楷體_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;

    7.添加文件 /TestFCKeditor/test.jsp:
    <%@ page language="java" import="com.fredck.FCKeditor.*" %>
    <%@ taglib uri="/TestFCKeditor" prefix="FCK" %>
    <script type="text/javascript" src="/TestFCKeditor/FCKeditor/fckeditor.js"></script>

    <%--
    三種方法調(diào)用FCKeditor
    1.FCKeditor自定義標(biāo)簽 (必須加頭文件 <%@ taglib uri="/TestFCKeditor" prefix="FCK" %> )
    2.script腳本語(yǔ)言調(diào)用 (必須引用 腳本文件 <script type="text/javascript" src="/TestFCKeditor/FCKeditor/fckeditor.js"></script> )
    3.FCKeditor API 調(diào)用 (必須加頭文件 <%@ page language="java" import="com.fredck.FCKeditor.*" %> )
    --%>

    <%--
    <form action="show.jsp" method="post" target="_blank">
    <FCK:editor id="content" basePath="/TestFCKeditor/FCKeditor/"
    width="700"
    height="500"
    skinPath="/TestFCKeditor/FCKeditor/editor/skins/silver/"
    toolbarSet = "Default"
    >
    input
    </FCK:editor>
    <input type="submit" value="Submit">
    </form>
    --%>

    <form action="show.jsp" method="post" target="_blank">
    <table border="0" width="700"><tr><td>
    <textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">input</textarea>
    <script type="text/javascript">
    var oFCKeditor = new FCKeditor('content') ;
    oFCKeditor.BasePath = "/TestFCKeditor/FCKeditor/" ;
    oFCKeditor.Height = 400;
    oFCKeditor.ToolbarSet = "Default" ;
    oFCKeditor.ReplaceTextarea();
    </script>
    <input type="submit" value="Submit">
    </td></tr></table>
    </form>

    <%--
    <form action="show.jsp" method="post" target="_blank">
    <%
    FCKeditor oFCKeditor ;
    oFCKeditor = new FCKeditor( request, "content" ) ;
    oFCKeditor.setBasePath( "/TestFCKeditor/FCKeditor/" ) ;
    oFCKeditor.setValue( "input" );
    out.println( oFCKeditor.create() ) ;
    %>
    <br>
    <input type="submit" value="Submit">
    </form>
    --%>

    添加文件/TestFCKeditor/show.jsp:
    <%
    String content = request.getParameter("content");
    out.print(content);
    %>

    8.瀏覽http://localhost:8080/TestFCKeditor/test.jsp
    ok!

    posted on 2006-10-11 17:19 xzc 閱讀(216) 評(píng)論(0)  編輯  收藏 所屬分類: Web
    主站蜘蛛池模板: 最新猫咪www免费人成| 1000部夫妻午夜免费| 精品免费国产一区二区| 男人天堂2018亚洲男人天堂| 免费观看国产网址你懂的| 亚洲国产精品综合久久久| 久久福利资源网站免费看| 亚洲一本之道高清乱码| 成年女人男人免费视频播放| 亚洲一区精彩视频| 拔擦拔擦8x华人免费久久| 国产成人综合亚洲一区| www国产亚洲精品久久久| eeuss草民免费| 亚洲国产精品va在线播放 | 亚洲成A人片在线观看WWW| 91在线视频免费观看| 亚洲高清在线观看| 美女内射毛片在线看免费人动物| 亚洲美女自拍视频| 在线观看视频免费国语| 暖暖免费中文在线日本| 国产亚洲精品精华液| 中国xxxxx高清免费看视频| 日本亚洲免费无线码| 亚洲国产精品狼友中文久久久 | 在线人成免费视频69国产| 亚洲视频免费在线看| 四色在线精品免费观看| 成在人线av无码免费高潮水| 91嫩草私人成人亚洲影院| 日本v片免费一区二区三区| 成人毛片100免费观看| 亚洲精品第五页中文字幕| 国产成人免费福利网站| 成人影片一区免费观看| 亚洲欧美日韩自偷自拍| 亚洲精品tv久久久久久久久| 一二三四影视在线看片免费 | 亚洲日本国产精华液| 国产成人啪精品视频免费网|