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
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
Comment