Link selection problem for fckeditor in Firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shrutid27
    New Member
    • Mar 2007
    • 1

    Link selection problem for fckeditor in Firefox

    Hi...
    I am just trying to use FCK Editor.
    I am having problem with link selection on double click for firefox.
    Means if I select the link by double clicking on it and then swith to source mode, the link is removed.
    I can only see the text inside the link. But the <a> tag is gone.
    But if I select the link without double click then everything is working fine.
    I am not getting what is going wrong.

    Following is the code I have written in fckeditorcode_g ecko.js:

    [CODE=javascript]if(FCK.EditMode ==FCK_EDITMODE_ WYSIWYG)
    {
    var oRangeAll = FCK.EditorWindo w.getSelection( );

    if (oRangeAll.rang eCount>0)
    {
    oRange=oRangeAl l.getRangeAt(0) ;
    var start = oRange.startOff set;
    var end = oRange.endOffse t;
    var selsize = end-start;
    var sContent = FCK.GetHTML();

    var selectstring = oRange.toString ();

    selectstring = selectstring.re place(/&/g, "&") ;
    selectstring = selectstring.re place(/"/g, """) ;
    selectstring = selectstring.re place(/</g, "<") ;
    selectstring = selectstring.re place(/>/g, ">") ;
    selectstring = selectstring.re place(/'/g, "’") ;

    if(sContent.ind exOf(selectstri ng)<0 || selectstring==" ")
    {
    oRange.collapse (true);
    }

    FCK.InsertHtml( '%SelStart%' + oRange + '%SelEnd%');

    }
    }[/CODE]

    Thanks in advance
    Last edited by acoder; Feb 12 '08, 10:06 AM.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    If you think this is a bug, ask the authors of the editor.

    Comment

    Working...