Hi.
i have been trying to update from very old version FCK to 2.6.3.. And i've got some problem.
Autoresizeing editor window:
function FCK.AutoHeight = function() {
FCK.EditorDocument.getElementsByTagName('html')[0].style.overflow = FCK.EditorDocument.body.style.overflow = "hidden";
(...)
}
FCK.Events.AttachEvent("OnKeyDown", FCK.AutoHeight) ;
Firefox throw me error "FCK.EditorDocument is undefined.. There is another way to access 'EditorDocument' from plugin? I searched code fck and cannot find it.
thanks.
Thu, 11/13/2008 - 17:58
#1
Re: access to FCK.EditorDocument from plugin..
Re: access to FCK.EditorDocument from plugin..
I remembered it myself
here you go:
Re: access to FCK.EditorDocument from plugin..
Hey, thanks for the code. I am having the same problem with my plugin. However, when I try to apply your code, I get:
Error: window.parent.InnerDialogLoaded is not a function
Any ideas? I am a complete beginner when it comes to FCK. Thanks in advance!
Oh, and I totally intend to contribute my plugin as GPL when I get done with it... It's going to allow default text color to be set as the user types. Searching the forums reveals a lot of people want that functionality, so I am happy to contribute... If I can get it working!
Re: access to FCK.EditorDocument from plugin..
Do you have a dialog showing for your plugin already? If not, start with http://docs.fckeditor.net/FCKeditor_2.x ... n/Plug-ins.
I made a modification to the code above, so make sure to get this 'latest version'.
Re: access to FCK.EditorDocument from plugin..
You see - i don't use dialog window in this plugin.
autoheight, this plugin + code:
FCK.Events.AttachEvent("OnSelectionChange", FCK.AutoHeight);
FCK.Events.AttachEvent("OnKeyDown", FCK.AutoHeight) ;
i want autosize height in process writing/pasting something. So i dont need any dialog to do this.
Do you have any idea for resolve this?
Re: access to FCK.EditorDocument from plugin..
Ah hmm sorry now I had a look at your code again and believe that it is a scoping problem: 'FCK' is not known in the event scope, i.e. in the function called OnKeyDown. You can solve this by 'scoping it in', (see http://www.howtocreate.co.uk/referencedvariables.html for a good article on it), but it is easier when you know that the editorInstance is passed to every event callback set by editorInstance.Events.AttachEvent (see http://docs.fckeditor.net/FCKeditor_2.x ... API#Events). So just catching it in your function should do the trick:
Re: access to FCK.EditorDocument from plugin..