Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Link Selection problem in FCKEditor for Firefox


shruti

Recommended Posts

Posted

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_gecko.js:

 

if(FCK.EditMode==FCK_EDITMODE_WYSIWYG)

{

var oRangeAll = FCK.EditorWindow.getSelection();

 

if (oRangeAll.rangeCount>0)

{

oRange=oRangeAll.getRangeAt(0);

var start = oRange.startOffset;

var end = oRange.endOffset;

var selsize = end-start;

var sContent = FCK.GetHTML();

 

var selectstring = oRange.toString();

 

selectstring = selectstring.replace(/&/g, "&") ;

selectstring = selectstring.replace(/"/g, """) ;

selectstring = selectstring.replace(/</g, "<") ;

selectstring = selectstring.replace(/>/g, ">") ;

selectstring = selectstring.replace(/'/g, "’") ;

 

if(sContent.indexOf(selectstring)<0 || selectstring=="")

{

oRange.collapse(true);

}

 

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

 

}

}

 

Thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...