Opened 10 years ago

Closed 8 years ago

Last modified 5 years ago

#900 closed New Feature (wontfix)

onChange event

Reported by: kalanag@… Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: SF Confirmed Cc: Alfonso Martínez de Lizarrondo, rotty@…

Description (last modified by Martin Kou)

Is it possible to detect an onChange event of the FCKeditor?

In a TEXTAREA it is possible to place an onChange event; but after substituting to it the appropriate statements for FCKeditor

$oFCKeditor = new FCKeditor('...') ;

and so on it seems that there is no way to detect a change performed by editing. FCKeditor installs in HTML three stetements, two of them <INPUT HIDDEN ....> and one <IFRAME ...> but it seems that none of the three can be checked for change of rhe value.

Do you know any way to detect a change?

Moved from SF:

Change History (13)

comment:1 Changed 10 years ago by Martin Kou

Cc: Alfonso Martínez de Lizarrondo rotty@… added
Reporter: changed from Martin Kou to kalanag@…

You can use the IsDirty() function to check if the content has changed since last time was reset And you can try to use an event listener to OnSelectionChange but use it carefully as it can be fired quite often and the IsDirty checks the innerHTML of the frame so you might find problems if the content is too large (just depends on what you call large)

Moved from SF. Original poster: alfonsoml

This would be very helpful, as we often have many instances on a page which conprise the individual elements of an article.

We'd need to be able to detect events so that we can prompt for a "Save Changes".

Moved from SF. Original poster: rotty

comment:2 Changed 10 years ago by Martin Kou

Description: modified (diff)

comment:3 Changed 10 years ago by Martin Kou

Description: modified (diff)

comment:4 Changed 9 years ago by Artur Formella

Keywords: Confirmed added
Summary: is it possible to detect an onChange event of the FCKeditor?onChange event

comment:5 Changed 9 years ago by André Schild

Will this be included in a upcomming version of fckeditor ?

We need a way to detect changes in the content for the integration with echo3 framework.

Currently we just poll every 250ms for changes, but this is not the way it should be.

comment:6 Changed 8 years ago by Frederico Caldeira Knabben

Resolution: wontfix
Status: newclosed

We're not able to provide a single change event because it's very difficult to guanrantee that it will be fired for every single action. It is supposed to be a feature that "almost works" in this way.

My recommendation here is creating a plugin that doesn the job of watching for all ncessary events that generate changes, firing the change event in those cases.

comment:7 Changed 8 years ago by Frederico Caldeira Knabben

#4159 has been marked as DUP.

comment:8 Changed 8 years ago by Benedikt Rothe

I miss this feature also.

On "Many Events": A textarea-onchange or an inputfield-onchange ist thrown, when the user leaves the textarea/inputfield.

That would be enough. No need for events on every single action.

comment:9 Changed 5 years ago by Adam

This would be a very nice feature to have. Without it, integrating CKeditor into a more complex framework such as backbone or ember is a pain and a complete waste of time. It seems as though TinyMCE has a callback function for change events. Personally, I don't think "it's hard to guarantee the event will be fired" is a good excuse. Indeed, the fact that it's hard has not stopped other people from at least attempting some sort of implementation through plugins. That said, firing publicly accessible change events (among others) is a core feature of most great javascript libraries and I'm a bit amazed that CKEditor devs aren't even going to give it a shot.

comment:10 Changed 5 years ago by Jakub Ś

This is available in our Add-Ons forum as a plugin:

There has even been autosave plugin created based on the first plugin:

comment:11 Changed 5 years ago by Adam

That's great. Thank you for the links.

Is there any chance of that functionality being incorporated into the core?

comment:12 Changed 5 years ago by Jakub Ś

Perhaps in v4. I know nothing about implementing it in v3.

comment:13 Changed 5 years ago by Wiktor Walc

@astjohn This will be included in 4.1: #9794

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy