Hi,
Newb to fckEditor, and the lack of any documentation on the API is a bit frustrating.
Writing a plugin that has a link creator as one part. No problem inserting the link into the html in the first place. When I want to edit the link and the cursor is within the link text, I can grab the href and other values and populate my plugin box. However upon editing, it just inserts another link where the cursor was. If I have the entire link selected, it works and replaces.
I had gotten this from another thread:
var eSelected = FCK.Selection.MoveToAncestorNode( 'A' )
//if ( eSelected )
//FCK.Selection.MoveToNode( eSelected ) ;
However, I am not finding a function called moveToNode when I run the page. I think this would do what I want.
Any ideas? Thanks.
oj
Newb to fckEditor, and the lack of any documentation on the API is a bit frustrating.
Writing a plugin that has a link creator as one part. No problem inserting the link into the html in the first place. When I want to edit the link and the cursor is within the link text, I can grab the href and other values and populate my plugin box. However upon editing, it just inserts another link where the cursor was. If I have the entire link selected, it works and replaces.
I had gotten this from another thread:
var eSelected = FCK.Selection.MoveToAncestorNode( 'A' )
//if ( eSelected )
//FCK.Selection.MoveToNode( eSelected ) ;
However, I am not finding a function called moveToNode when I run the page. I think this would do what I want.
Any ideas? Thanks.
oj
RE: Selecting/replacing an element
FCK.Selection.MoveToNode=function(node){
FCK.EditorDocument.selection.empty();
var oRange=FCK.EditorDocument.selection.createRange();
oRange.moveToElementText(node);
oRange.select();
}
Now it works.