track html editor events
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?
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 i'm wanting to include editor format changes in the tracking. yes it will be an editor event, but 2 questions:
- 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?
- what method in ice do you call to tell it to tag the selected text?
you done it ?