ice icon indicating copy to clipboard operation
ice copied to clipboard

track html editor events

Open alfred-c opened this issue 13 years ago • 3 comments

I'm trying to integrate 'ice' with an html editor, such as ckeditor or tinymce. I would like to track changes made through the editor, such as bold, underline, bullet list, etc.

I figure it should kinda be similar to the handlePaste method in the CopyPastePlugin, except that I need to setup an event listener rather than listen to keydown. Any tips on how to do that?

alfred-c avatar Nov 07 '12 22:11 alfred-c

Are you trying to track when these features are turned on? If so, you may need to catch an editor event, outside of ice.

If you want to build a plugin in ice, create a directory structure and formatted plugin file similar to the emdash plugin: https://github.com/NYTimes/ice/blob/master/src/plugins/IceEmdashPlugin/IceEmdashPlugin.js

The emdash plugin fills in a keydown event callback, but you can override any of the events listed in the IcePlugin.prototype: https://github.com/NYTimes/ice/blob/master/src/icePlugin.js

I'm not entirely sure what you are trying to do, so ping me back with more info and I'll try to help.

delambo avatar Nov 12 '12 02:11 delambo

@delambo i'm wanting to include editor format changes in the tracking. yes it will be an editor event, but 2 questions:

  1. how to raise that event through the plugin manager. it's not just a keydown nor a click (as ctrl-b or clicking the "bold" button would bold the selected text) so is there a way to define a custom event so as not to trigger the default actions or actions in other plugins?
  2. what method in ice do you call to tell it to tag the selected text?

alfred-c avatar Nov 20 '12 22:11 alfred-c

you done it ?

jeevani2it avatar May 20 '16 10:05 jeevani2it