Ticket #900 (closed New Feature: wontfix)

Opened 7 years ago

Last modified 21 months ago

onChange event

Reported by: kalanag@… Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: SF Confirmed Cc: alfonsoml, rotty@…

Description (last modified by martinkou) (diff)

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:
http://sourceforge.net/tracker/index.php?func=detail&aid=1497731&group_id=75348&atid=543656

Change History

comment:1 Changed 7 years ago by martinkou

  • Cc alfonsoml, rotty@… added
  • Reporter changed from martinkou to kalanag@…

You can use the IsDirty() function to check if the content has changed since last time was reset http://wiki.fckeditor.net/Developer%27s_Guide/Javascript_API 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 7 years ago by martinkou

  • Description modified (diff)

comment:3 Changed 7 years ago by martinkou

  • Description modified (diff)

comment:4 Changed 6 years ago by arczi

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

comment:5 Changed 6 years ago by aschild

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.

http://echo.nextapp.com/site/node/5532#comment-14553

comment:6 Changed 5 years ago by fredck

  • Status changed from new to closed
  • Resolution set to wontfix

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 5 years ago by fredck

#4159 has been marked as DUP.

comment:8 Changed 5 years ago by BenediktRothe

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 2 years ago by astjohn

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 2 years ago by j.swiderski

This is available in our Add-Ons forum as a plugin: http://cksource.com/forums/viewtopic.php?f=18&t=23605

There has even been autosave plugin created based on the first plugin: http://cksource.com/forums/viewtopic.php?f=18&t=24128

comment:11 Changed 2 years ago by astjohn

That's great. Thank you for the links.

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

comment:12 Changed 2 years ago by j.swiderski

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

comment:13 Changed 21 months ago by wwalc

@astjohn This will be included in 4.1: #9794

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