Ticket #5707 (assigned defect)
Improved Editor Plugin Architecture
| Reported by: | ptwobrussell | Owned by: | alex |
|---|---|---|---|
| Priority: | high | Milestone: | 1.2 |
| Component: | Editor | Version: | 1.0 |
| Severity: | normal | Keywords: | |
| Cc: | liucougar, alex, peller |
Description
I don't think this is news to anyone, but wanted to start a ticket to discuss the Editor's plugin architecture. Basically, I am hoping that at some point, plugins will be more standalone in that plugin code from _editor/plugins won't have dependencies on Editor.js, which appears to be the case right now.
While trying to write about plugins, I quickly ran out of creative ideas for how to tell someone to write their own custom plugin without suggesting that they hack on Editor.js (which currently has a bunch of case statements that handle some of this stuff.) Am I wrong, and there is there is a fairly simple and elegant way to create custom plugins w/o doing that?
Also, it might be worth talking about how you should and shouldn't pass in values to plugins. For example, on the EnterKeyHandlingPlugin?, I don't see a better way of specifying blockNodeForEnter than adding a call to
dojo.extend(dijit._editor.plugins.EnterKeyHandling, {
blockNodeForEnter : "div"
});
sometime before the editor is parsed. Is there a better way of doing this? Should there be? (All sincere questions.)