Hello,
I'm currently working on a plugin. Unfortunately, I'm having troubles in getting the current FCKeditor instance. I hope that somebody can help me please.
This is what I have, but it doesn't work:
....
FCKPluginName.prototype.Execute = function() {
Plugin_click(FCK, null)
}
function Plugin_click(editor) {
oEditor = FCKeditorAPI.GetInstance(editor.Name);
oEditor.contentWindow.focus();
}
How do I have to get the editor object in order to make this work:
oEditor.contentWindow.focus();
Thank you in advance for your help
I'm currently working on a plugin. Unfortunately, I'm having troubles in getting the current FCKeditor instance. I hope that somebody can help me please.
This is what I have, but it doesn't work:
....
FCKPluginName.prototype.Execute = function() {
Plugin_click(FCK, null)
}
function Plugin_click(editor) {
oEditor = FCKeditorAPI.GetInstance(editor.Name);
oEditor.contentWindow.focus();
}
How do I have to get the editor object in order to make this work:
oEditor.contentWindow.focus();
Thank you in advance for your help
RE: problems with getting editor instance
ib.oEditor = document.getElementById('eEditorArea');
could anybody please confirm that this is o.k. or is there a better way?
thank you
RE: problems with getting editor instance
RE: problems with getting editor instance
There is also an option within the fckconfig.js file to specify whether the editor should get the focus on startup (FCKConfig.StartupFocus) just in case that's of use....
RE: problems with getting editor instance
thank you for getting back to me - I appreciate that I finally got some help.
I tried the FCKeditorAPI.GetInstance() function, but it didn't work while this worked: document.getElementById('eEditorArea');
no my question, how could I get the same value (the corresponding value) by using FCKeditorAPI.GetInstance() ?
Thank you again
RE: problems with getting editor instance
Anyway, I'm still struggling getting the editor instance properly! Although, I'm able to put the image into the editor, sometimes it gets just inserted above the FCK toolbar which is not really what I want.
Therefore, I would very much appreciate if somebody would be able to help me a little with this.
Thank you
RE: problems with getting editor instance
It seems that you want to insert some code into the editorArea. Why don't you use the built-in method FCK.InsertHtml( yourCode )?
If this is not your solution, perhaps this topic may help:
http://sourceforge.net/forum/message.php?msg_id=3063199
Or what about looping manualy over the instances array?
RE: problems with getting editor instance
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
RE: problems with getting editor instance
I thought this would do it but I could be wrong :
var oEditorArea = FCKeditorAPI.GetInstance('name').EditorWindow;
'EditorWindow' is initialised to point to the 'eEditorArea' element within the editor code.
If I've misunderstood you, sorry I couldn't be more help!
RE: problems with getting editor instance
ib.oEditor = document.getElementById('eEditorArea');
RE: problems with getting editor instance
RE: problems with getting editor instance
RE: problems with getting editor instance
You could always try venkman (sp?), the javascript debugger for mozilla browsers. I think it has a DOM inspector and such. If not, those are around. I think you could use those to find where the instance is residing, but I really don't know and haven't really done it, or know what those tools are for really. Besides telling me X happend on line Y.
But they look (debugger, dom inspector) like they got a lot of stuff to do stuff with.
Good Luck, I know it's possible, somehow...
XD
RE: problems with getting editor instance
dude, you have to check out the dom inspector built in to firefox - especially if you're coding stuff to manipulate documents on the fly.
here's some ramble...i was recently doing some javascript coding and was wishing that i could get a visual reperentation of what was happening in a document to help figure out what elements, relationships, and whatever i needed to be targeting to get the job done. then i remembered your post - so i did a google for "dom inspector" (or something like that) and right at the top of the list was the dom inspector built into firefox. nice. i already had it. it's a really powerful and intuitive way to dig into a doc and figure stuff out. i'm using it all the time now. granted, i'm relatively new at intensive dom coding, so a visual reference is helping me out alot, but i can see how this can be a really valuable tool for anybody manipulating the dom.
check it out, you might like it:
tools-->dom inspector
later.
RE: problems with getting editor instance
In Mozilla something like
oFCKeditor.Value = window.opener.FCK.EditorDocument.body.innerHTML;
works, but unfortunatly not in IE