亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

比較不錯(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,其他皮膚類推。
      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)什么可講。

在然后就可以了,:)。



三、添加刪除按鈕列,類似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)文章

  • eWebEditor 輯器按鈕失效 IE8下eWebEditor編輯器無(wú)法使用的解決方法

    eWebEditor 輯器按鈕失效 IE8下eWebEditor編輯器無(wú)法使用的解決方法

    最近我把IE瀏覽器更新到了IE8.0,在用eWebEditor在線HTML文本編輯器的時(shí)候點(diǎn)擊eWebEditor上的所有編輯按鈕都沒(méi)用,只看到瀏覽器狀態(tài)欄左下角顯示網(wǎng)頁(yè)上有錯(cuò)誤,于是上網(wǎng)查了一下。終于找到解決的方法,測(cè)試后正常。
    2009-06-06
  • 解決FCKEditor在IE10、IE11下的不兼容問(wèn)題

    解決FCKEditor在IE10、IE11下的不兼容問(wèn)題

    今天有編輯反映網(wǎng)站后臺(tái)的網(wǎng)頁(yè)編輯器無(wú)法顯示了,原來(lái)是編輯自己的電腦升級(jí)了ie到IE10或IE11版本,這里特總結(jié)下多種解決方法,需要的朋友可以參考下
    2014-10-10
  • FCKEidtor 自動(dòng)統(tǒng)計(jì)輸入字符個(gè)數(shù)(IE)

    FCKEidtor 自動(dòng)統(tǒng)計(jì)輸入字符個(gè)數(shù)(IE)

    由于項(xiàng)目需要,需要做字?jǐn)?shù)統(tǒng)計(jì),于是寫(xiě)了一個(gè)JS計(jì)算字符個(gè)數(shù),如果輸入的字符數(shù)大于100個(gè)字符,就彈出提示,點(diǎn)擊【確定】后,自動(dòng)截取為100個(gè)字符。
    2009-05-05
  • IE8 Fckedit2.6.X不兼容

    IE8 Fckedit2.6.X不兼容

    經(jīng)過(guò)測(cè)試IE8和FCKEditer出現(xiàn)不兼容的情況,表現(xiàn)在提交數(shù)據(jù)時(shí)Fckediter對(duì)象里面的數(shù)據(jù)為空
    2009-04-04
  • fckeditor php上傳文件重命名的設(shè)置

    fckeditor php上傳文件重命名的設(shè)置

    我使用的fckeditor版本是fckeditor2.6.4. fckeditor默認(rèn)上傳文件不沒(méi)有重命名的,這樣的話就很麻煩,有時(shí)上傳中文的文件或者名稱重復(fù)的文件就很惱火。
    2009-04-04
  • CKEDITOR二次開(kāi)發(fā)之插件開(kāi)發(fā)方法

    CKEDITOR二次開(kāi)發(fā)之插件開(kāi)發(fā)方法

    CKEditor固有的一些文件被組織到_source目錄里. 核心的功能,諸如DOM元素操作,事件處理,初始化腳本和一些環(huán)境設(shè)置被包含在_source\core文件夾內(nèi). 而其它的一些功能, 比如格式化,拷貝和粘貼, 圖片和鏈接, 都被實(shí)現(xiàn)為插件形式放在_source\plugins文件夾內(nèi)
    2017-03-03
  • CKEditor 附插入代碼的插件

    CKEditor 附插入代碼的插件

    從官網(wǎng)下載ckeditor,我下載的是ckeditor_3.0.2。CKEditor與原來(lái)的FCKeditor有太大的不同了,作為開(kāi)發(fā)人員,在做自己的博客的時(shí)候總是需要貼代碼的,只好給它先做一個(gè)插入代碼的插件了。
    2010-03-03
  • FCKEditor+jQuery+PHP實(shí)現(xiàn)分頁(yè)代碼

    FCKEditor+jQuery+PHP實(shí)現(xiàn)分頁(yè)代碼

    根據(jù)一下步驟,即可實(shí)現(xiàn)使用FCKEditor+jQuery+PHP實(shí)現(xiàn)無(wú)刷新頁(yè)面分頁(yè)。
    2010-07-07
  • 網(wǎng)頁(yè)資源阻塞瀏覽器加載的原理示例解析

    網(wǎng)頁(yè)資源阻塞瀏覽器加載的原理示例解析

    這篇文章主要為大家介紹了網(wǎng)頁(yè)資源阻塞瀏覽器加載的原理示例解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-03-03
  • Fckeditor XML Request error:internal server error (500) 解決方法小結(jié)

    Fckeditor XML Request error:internal server error (500) 解決方法

    本文章收藏了關(guān)于FCKEditor XML Request Error:Internal Server Error(500)各種問(wèn)題的解決辦法
    2012-09-09

最新評(píng)論