Hello
I am working on a multilanguage content editor which uses fckeditor. In the UI there is a tab for each language, and i dynamically set and get the contents of the editor with the GetData and SetData functions. This all works excellently!
Now when the tab is switched and the content in the Editor changes I need to reset the undohistory of the editor in my script.
I did some research and found the following code (context: this -> FCKUndo):
Now my problem might seem trivial to solve, but i couldn't manage to find the scope/object where FCKUndo is defined. When i use GetInstance, all i can see is the object Commands.LoadedCommands, and i would not like to use v3 or modify the FCK source myself (and add the resetUndo command to the available commands) but i would like to set the above vars directly.
thanks in advance for any advice where/how to find the objects i am looking for!
I am working on a multilanguage content editor which uses fckeditor. In the UI there is a tab for each language, and i dynamically set and get the contents of the editor with the GetData and SetData functions. This all works excellently!
Now when the tab is switched and the content in the Editor changes I need to reset the undohistory of the editor in my script.
I did some research and found the following code (context: this -> FCKUndo):
this.SavedData = new Array() ; this.CurrentIndex = -1 ; this.TypesCount = 0 ; this.Changed = false ; this.Typing = false ; this.SaveLocked = false ; FCK.Events.FireEvent( "OnSelectionChange" ) ; //update undo/redo toolbar btns
Now my problem might seem trivial to solve, but i couldn't manage to find the scope/object where FCKUndo is defined. When i use GetInstance, all i can see is the object Commands.LoadedCommands, and i would not like to use v3 or modify the FCK source myself (and add the resetUndo command to the available commands) but i would like to set the above vars directly.
thanks in advance for any advice where/how to find the objects i am looking for!
Re: Accessing FCK vars from outside the Editor with Javascript
I wonder how i can access the FKCUndo object in Javascript on the page where i have the FCKeditor iframe.
For example
I tried to trace the FCKUndo object but it doesn't seem to be available in the window (sub-)scope i am in (which is outside of the editor iframe).
Any help or pointing in the right direction to solve this problem is much appreciated.
Re: Accessing FCK vars from outside the Editor with Javascript
Look at this graph: http://alfonsoml.blogspot.com/2007/12/s ... ditor.html
You want to get the window 2, that's where FCKUndo lives, but there's no specific API call to get that. You'll need to get the iframe, then access the document (standard javascript DOM calls), or maybe it's easier to write a little plugin that exposes the FCKUndo as a property of the FCK instance.
Re: Accessing FCK vars from outside the Editor with Javascript