[ 4 posts ]

Khoa Bui

  • Username: khoaminhbui
  • Joined: Tue Aug 09, 2011 6:11 am
  • Posts: 127
  • Location: Vietnam
  • Twitter: khoaminhbui
  • IRC: k_bui
  • Offline
  • Profile

YUI 2in3 Editor: detect actual content change.

Post Posted: Thu Jul 12, 2012 12:41 am
+0-
I want a signal for the actual change of editor content, including text change (modify the text), format change (change color, font, underline, bold..).
I cannot find that exact property or event from YUI 2in3 editor.

I may end up compare the original text with the current text, but before doing that, I prefer some support from Editor itself.

Anyone can help?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: YUI 2in3 Editor: detect actual content change.

Post Posted: Thu Jul 12, 2012 6:20 am
+0-
Listen for the afterNodeChange event, that is fired very often and usually means that something important has changed.

Khoa Bui

  • Username: khoaminhbui
  • Joined: Tue Aug 09, 2011 6:11 am
  • Posts: 127
  • Location: Vietnam
  • Twitter: khoaminhbui
  • IRC: k_bui
  • Offline
  • Profile

Re: YUI 2in3 Editor: detect actual content change.

Post Posted: Thu Jul 12, 2012 6:41 am
+0-
Unfortunately, the 'afterNodeChange' is fired so often, such as when clicking on the editor content, or a toolbar icon which does not affect the text content at all.

I see your example here: http://new.davglass.com/files/yui/editor7/. But it does not really help.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: YUI 2in3 Editor: detect actual content change.

Post Posted: Thu Jul 12, 2012 8:02 am
+0-
Yes, that's the point. Clicking into the editor and pasting with a mouse button is a change. Even tho the editor can't determine that they did that, it still fires an afterNodeChange event.

Like I said, you can listen on the afterNodeChange event then check the editorDirty flag. Or you can set your own flag to determine that you want to do something. It's totally up to you and your criteria.
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum