最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

比較不錯(cuò)的修改FCKEditor的修改方法

 更新時(shí)間:2007年11月04日 12:50:56   作者:  

修改后的代碼下載http://www.cnblogs.com/Files/Truly/FCKeditor_Truly.rar
本地下載地址
由于項(xiàng)目需要,近期仔細(xì)研究了FCKEditor。發(fā)現(xiàn)一下bug,以及缺少的一些東西。

一、防止連續(xù)文本導(dǎo)致出現(xiàn)滾動(dòng)條
        FCKEditor編輯器使用Iframe來(lái)處理編輯器內(nèi)容,可惜不支持文本換行,假如你連續(xù)輸入一段英文或數(shù)字等,將會(huì)出現(xiàn)滾動(dòng)條,這時(shí)我們需要給其增加word-wrap樣式為break-word;

添加方式有很多,我選擇最便捷的修改方式:具體做法是修改fckeditor.html文件,給<iframe id="eEditorArea" 增加事件 onload="window.frames['eEditorArea'].document.body.style.wordWrap='break-word'"

二、增加Media以及Realplay按鈕
      此項(xiàng)工作相對(duì)龐大,要修改很多js文件,以及一些圖片和樣式文件。
      a.準(zhǔn)備圖片:FCKeditor\editor\css\images下面,添加fck_medialogo.gif和fck_realplaylogo.gif,大小隨意,作為背景居中顯示的。
FCKeditor\editor\skins\default\toolbar\增加media.gif和realplay.gif,其他皮膚類(lèi)推。
      b.修改css:給FCKeditor\editor\css\fck_internal.css增加

.FCK__Media
{
 border: darkgray 1px solid;
 background-position: center center;
 background-image: url(images/fck_medialogo.gif);
 background-repeat: no-repeat;
 width: 80px ;
 height: 80px ;
}

.FCK__Realplay
{
 border: darkgray 1px solid;
 background-position: center center;
 background-image: url(images/fck_realplaylogo.JPG);
 background-repeat: no-repeat;
 width: 80px ;
 height: 80px ;
}
c。修改js,主要以realplay做示例
FCKeditor\editor\js\fckeditorcode_ie_1.js,在FCKDocumentProcessors.addItem(FCKFlashProcessor);后面增加
// Realplay begin
var FCKRealplayProcessor=new Object();
FCKRealplayProcessor.ProcessDocument=function(A){
    var B=A.getElementsByTagName('EMBED');
    var C;
    var i=B.length-1;

while (i>=0&&(C=B[i--])){
if (C.src.endsWith('.rm',true) || C.src.endsWith('.ram',true) || C.src.endsWith('.ra',true))
{var D=FCKDocumentProcessors_CreateFakeImage('FCK__Realplay',C.cloneNode(true));
D.setAttribute('_fckRealplay','true',0);
FCKRealplayProcessor.RefreshView(D,C);
C.parentNode.insertBefore(D,C);
C.parentNode.removeChild(C);
};
};
};

FCKRealplayProcessor.RefreshView=function(A,B){
    if (B.width>0) A.style.width=FCKTools.ConvertHtmlSizeToStyle(B.width);
    if (B.height>0) A.style.height=FCKTools.ConvertHtmlSizeToStyle(B.height);
};
FCKDocumentProcessors.addItem(FCKRealplayProcessor);
// Realplay end
var FCKMediaProcessor=new Object();
FCKMediaProcessor.ProcessDocument=function(A)
{
    var B=A.getElementsByTagName('EMBED');
    var C;
    var i=B.length-1;
    while (i>=0&&(C=B[i--]))
    {
        if (C.src.endsWith('.avi',true) || C.src.endsWith('.mpg',true) || C.src.endsWith('.mpeg',true))
        {
            var D=FCKDocumentProcessors_CreateFakeImage('FCK__Media',C.cloneNode(true));
            D.setAttribute('_fckmedia','true',0);FCKMediaProcessor.RefreshView(D,C);
            C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);
        };
    };
};
FCKMediaProcessor.RefreshView=function(A,B)
{
    if (B.width>0) A.style.width=FCKTools.ConvertHtmlSizeToStyle(B.width);
    if (B.height>0) A.style.height=FCKTools.ConvertHtmlSizeToStyle(B.height);
};
FCKDocumentProcessors.addItem(FCKMediaProcessor);

然后修改FCK.GetRealElement方法為下面代碼,該方法為處理編輯器中width和height的調(diào)整
FCK.GetRealElement=function(A){
var e=FCKTempBin.Elements[A.getAttribute('_fckrealelement')];

if (A.getAttribute('_fckflash')|| A.getAttribute('_fckrealplay') || A.getAttribute('_fckmedia')){
    if (A.style.width.length>0) e.width=FCKTools.ConvertStyleSizeToHtml(A.style.width);
    if (A.style.height.length>0) e.height=FCKTools.ConvertStyleSizeToHtml(A.style.height);
};
return e;};

----------
FCKeditor\editor\js\fckeditorcode_ie_2.js
FCKCommands.GetCommand方法增加
case 'Media':B=new FCKDialogCommand('Media',FCKLang.DlgMediaTitle,'dialog/fck_Media.html',450,400);
break;
case 'Realplay':B=new FCKDialogCommand('Realplay',FCKLang.DlgMediaTitle,'dialog/fck_Realplay.html',450,400);
break;

FCKToolbarItems.GetItem方法增加

case 'Media':B=new FCKToolbarButton('Media',FCKLang.InsertMediaLbl,FCKLang.InsertMedia);
break;
case 'Realplay':B=new FCKToolbarButton('Realplay',FCKLang.InsertRealplayLbl,FCKLang.InsertRealplay);
break;
FCKContextMenu._GetGroup方法增加
case 'Media':return new FCKContextMenuGroup(true,this,'Media',FCKLang.MediaProperties,true);
case 'Realplay':return new FCKContextMenuGroup(true,this,'Realplay',FCKLang.RealplayProperties,true);   // truly

FCKContextMenu.RefreshState方法增加
if (this.Groups['Media'])   this.Groups['Media'].SetVisible(B=='IMG'&&A.getAttribute('_fckmedia'));
if (this.Groups['Realplay'])  this.Groups['Realplay'].SetVisible(B=='IMG'&&A.getAttribute('_fckrealplay'));


然后要增加'dialog/fck_Media.html'和'dialog/fck_Realplay.html'頁(yè)面,具體我懶得再寫(xiě)了,自己到我的源碼下載里看,我是在2。1的基礎(chǔ)上改的,2.2要做一些調(diào)整!

fckconfig.js也有較多調(diào)整,但是這個(gè)文件非常簡(jiǎn)單,自己去看我的源碼吧。
然后就是lang目錄中對(duì)常量的定義,搜索一下就很容易得到,沒(méi)什么可講。

在然后就可以了,:)。



三、添加刪除按鈕列,類(lèi)似sina的blog中的編輯控件

四、修改上傳路徑
        默認(rèn)是根目錄/UserFiles,有多種方式進(jìn)行修改,先看一下它的源碼:
protected string UserFilesPath
{
 get
 {
  if ( sUserFilesPath == null )
  {
   // Try to get from the "Application".
   sUserFilesPath = (string)Application["FCKeditor:UserFilesPath"] ;

   // Try to get from the "Session".
   if ( sUserFilesPath == null || sUserFilesPath.Length == 0 )
   {
    sUserFilesPath = (string)Session["FCKeditor:UserFilesPath"] ;

    // Try to get from the Web.config file.
    if ( sUserFilesPath == null || sUserFilesPath.Length == 0 )
    {
     sUserFilesPath = System.Configuration.ConfigurationSettings.AppSettings["FCKeditor:UserFilesPath"] ;

     // Otherwise use the default value.
     if ( sUserFilesPath == null || sUserFilesPath.Length == 0 )
      sUserFilesPath = DEFAULT_USER_FILES_PATH ;

     // Try to get from the URL.
     if ( sUserFilesPath == null || sUserFilesPath.Length == 0 )
     {
      sUserFilesPath = Request.QueryString["ServerPath"] ;
     }
    }
   }

   // Check that the user path ends with slash ("/")
   if ( ! sUserFilesPath.EndsWith("/") )
    sUserFilesPath += "/" ;
  }
  return sUserFilesPath ;
 }
}

由此,可以在Global里或者程序任意位置(加載fckeditor前可以運(yùn)行到的位置)設(shè)置Application["FCKeditor:UserFilesPath"] ,或者Session,或者Webconfig,或者action中的請(qǐng)求參數(shù)等。


to be continued...


附:js版FCKEditor下載:http://prdownloads.sourceforge.net/fckeditor/FCKeditor_2.2.zip
.net版
http://prdownloads.sourceforge.net/fckeditor/FCKeditor.Net_2.2.zip
所有版本列表
http://prdownloads.sourceforge.net/fckeditor

相關(guān)文章

  • 將CKfinder 整合進(jìn) CKEditor3.0的方法

    將CKfinder 整合進(jìn) CKEditor3.0的方法

    CKFinder是一款基于AJAX的文件瀏覽器,這是ASP.NET專(zhuān)用版,它可以在線瀏覽文件、管理文件、上傳文件,以樹(shù)形Tree的方式展開(kāi)目錄,自動(dòng)檢測(cè)圖片并生成縮略圖,它是由Fckeditor公司出品,同時(shí)也可配合FckEditor來(lái)使用,可達(dá)到意想不到的效果。
    2010-01-01
  • FCKeditor 和 SyntaxHighlighter 代碼高亮插件的整合

    FCKeditor 和 SyntaxHighlighter 代碼高亮插件的整合

    FCKeditor 和 SyntaxHighlighter 代碼高亮插件的整合方法,里面有下載,可以根據(jù)需要結(jié)合自己的fckeditor版本。
    2010-04-04
  • 解決SyntaxHighlighter 代碼高亮不換行問(wèn)題的解決方法

    解決SyntaxHighlighter 代碼高亮不換行問(wèn)題的解決方法

    用SyntaxHighlighter 語(yǔ)法高亮插件的朋友可能都遇到過(guò)代碼顯示不換行的問(wèn)題,這個(gè)問(wèn)題在網(wǎng)上也找不到什么解決辦法,一直困擾了我很久,今天算是把它解決了,辦法其實(shí)簡(jiǎn)單,下面說(shuō)下如何解決
    2014-11-11
  • ckeditor插件開(kāi)發(fā)簡(jiǎn)單實(shí)例

    ckeditor插件開(kāi)發(fā)簡(jiǎn)單實(shí)例

    我需要在編輯文本的時(shí)候,選擇一段文字,點(diǎn)擊自定義的按鈕,就能夠在這段文字后面增加一個(gè)圖標(biāo),圖標(biāo)超鏈接去一個(gè)地址,以選中的文字作為參數(shù)
    2013-07-07
  • 在asp.net中KindEditor編輯器的使用方法小結(jié)

    在asp.net中KindEditor編輯器的使用方法小結(jié)

    由于國(guó)外的服務(wù)器好象對(duì)一些要引用dll編輯器由于安全問(wèn)題,鎖定了web.config中的一些權(quán)限,在先試了FreeTexbox不行,FCKEditor也不行,因?yàn)槎际且胐ll文件,最后同事介紹一款 純js的kindeditor編輯器,
    2010-12-12
  • javascript fckeditor編輯器取值與賦值實(shí)現(xiàn)代碼

    javascript fckeditor編輯器取值與賦值實(shí)現(xiàn)代碼

    這篇文章對(duì)于使用fckeditor編輯器的朋友是個(gè)不錯(cuò)應(yīng)用,主要介紹的是js對(duì)fckeditor的取值與賦值操作,fckeditor是個(gè)不錯(cuò)的比較方便的擴(kuò)展功能的編輯器。
    2010-05-05
  • 自動(dòng)刷新從BrowserSync開(kāi)始

    自動(dòng)刷新從BrowserSync開(kāi)始

    Browsersync能讓瀏覽器實(shí)時(shí)、快速響應(yīng)您的文件更改(html、js、css、sass、less等)并自動(dòng)刷新頁(yè)面。下面小編來(lái)帶大家了解下如何使用
    2019-05-05
  • 讓谷歌瀏覽器Google Chrome支持eWebEditor的方法

    讓谷歌瀏覽器Google Chrome支持eWebEditor的方法

    這篇文章主要介紹了讓谷歌瀏覽器Google Chrome支持eWebEditor的方法,默認(rèn)情況是不顯示的, 還需要安裝組件
    2016-01-01
  • FCKEditor網(wǎng)頁(yè)編輯器 幾點(diǎn)使用心得

    FCKEditor網(wǎng)頁(yè)編輯器 幾點(diǎn)使用心得

    FCKEditor網(wǎng)頁(yè)編輯器 幾點(diǎn)使用心得,需要的朋友可以參考下。
    2009-10-10
  • nicedit 輕量級(jí)編輯器 使用心得

    nicedit 輕量級(jí)編輯器 使用心得

    NicEdit是一個(gè)輕量級(jí),跨平臺(tái),內(nèi)置內(nèi)容編輯器,允許在瀏覽器中輕松地編輯網(wǎng)站上的內(nèi)容。
    2009-06-06

最新評(píng)論

五莲县| 鄂尔多斯市| 大荔县| 绥化市| 广汉市| 多伦县| 云梦县| 哈尔滨市| 鄱阳县| 醴陵市| 泉州市| 彰武县| 巴彦淖尔市| 柘城县| 于田县| 田阳县| 金山区| 亚东县| 丹江口市| 隆尧县| 上思县| 温州市| 本溪市| 柳江县| 安泽县| 楚雄市| 佳木斯市| 盐津县| 澄江县| 泰和县| 田东县| 钟山县| 扎囊县| 新疆| 绥化市| 德惠市| 郑州市| 江门市| 民勤县| 无锡市| 湖州市|