-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make applyStyle and removeStyle hookable #3306
Comments
Fortunately, these methods don't return anything, so probably canceling them shouldn't cause side effects. Yeah, I think that additional events instead of dedicated methods will be much easier to implement (single place) with the same profit. Just don't forget about passing style object into an event, otherwise, it will be useless.
|
You can look into |
After some testing (@jacekbogdanski 👍) we decided to go with commands (but in simplified version). Since few plugins overuse So the idea is to provide commands which will be wrapping current code which applies styles for a given plugin (so it's kind of implementation/refactor per plugin basis). We do not want to try with any generic solution since it will require huge amount of work. Each style should have own command, for example the The command data object should contain applied style (if style is removed, it should be Let's start with covering:
Depending on how it goes we may think of supporting |
Type of report
Feature request
Provide description of the new feature
Some of the features use
commands
(e.g. bold, italics, alignment, etc) which makes it easy to hook into withbeforeCommandExec
andafterCommandExec
.However, others use
applyStyle
andremoveStyle
(e.g. font, stylescombo, colorbutton, colordialog) which makes it impossible to hook into as there are no events or any other forms of intercepting the flow (apart from hacky methods proxying). This makes it quite difficult to integrate with other features.So the idea is to make
applyStyle
andremoveStyle
methods hookable. We were thinking about refactoring using commands however it requires quite significant amount of work and may be problematic. So we decided to go with events which will be fired before/after styles applying/removing.I'm just wondering if one event will be enough - something like
beforeApplyStyle
/removeApplyStyle
(which will also allow canceling styles applying) or we could also addafterApplyStyle
/afterApplyStyle
? cc @jacekbogdanskiThe text was updated successfully, but these errors were encountered: