I have a custom plug-in to add our custom links to FCKEditor, it works fine for text. However I am unable to figure out how can I get selected image when user wants to use it for link. How can I get all the selected contents of FCKEditor???
I tried this approach as wel, but as expected - this failed. Interestingly, first InsertHTML inserted complete tag instead of the partial one as code suggests -
FCKMyLinks.Add = function(link){
//FCK.InsertHtml("<a href='"+link+"'>"+text+"</a>") ;
var A= FCK.EditorWindow.getSelection();
var B = A;
A.collapseToStart();
FCK.InsertHtml("<a href='"+link+"'>");
B.collapseToEnd();
FCK.InsertHtml("</a>");
}
How can I get all selected contents of the FCKEditor???
TIA,
- Manish
I tried this approach as wel, but as expected - this failed. Interestingly, first InsertHTML inserted complete tag instead of the partial one as code suggests -
FCKMyLinks.Add = function(link){
//FCK.InsertHtml("<a href='"+link+"'>"+text+"</a>") ;
var A= FCK.EditorWindow.getSelection();
var B = A;
A.collapseToStart();
FCK.InsertHtml("<a href='"+link+"'>");
B.collapseToEnd();
FCK.InsertHtml("</a>");
}
How can I get all selected contents of the FCKEditor???
TIA,
- Manish