User tests: Successful: Unsuccessful:
The patch improve Editor and Buttons plugins.
Now they can use a real events.
It similar to #39657 but for Editors and Buttons.
This is fully backward compatible.
How this work.
Here I added a new event onEditorSetup and an Interface for EditorProviderInterface class.
And similar for buttons onEditorButtonsSetup and a Button class with Interface ButtonInterface.
On onEditorSetup an editor plugin should register own EditorProvider in EditorsRegistry.
On onEditorButtonsSetup a button plugin should register own Button(s) in ButtonsRegistry.
The system will retrieve a requested Editor from that registry and call required methods, that defined by EditorProviderInterface.
Example registering an Editor:
joomla-cms/plugins/editors/codemirror/src/Extension/Codemirror.php
Lines 50 to 55 in 059d2b4
Example registering an editor Button:
joomla-cms/plugins/editors-xtd/article/src/Extension/Article.php
Lines 58 to 73 in 059d2b4
Apply patch.
Set default editor to Codemirror and make sure it works.
Testing B/C:
Enable TinyMCE editor and make sure it works.
Works
Works
Please select:
| Category | ⇒ | Layout Libraries Front End Plugins |
| Status | New | ⇒ | Pending |
| Labels |
Added:
?
PR-4.3-dev
|
||
I have "transformed" Codemirror and Article button, rest working in "legacy mode", can test b/c on them.
I will update rest later, when will know whether it suits us.
| Labels |
Added:
PR-4.4-dev
Removed: PR-4.3-dev |
||
I guess it is better to rebase this pr to the 5.0-dev branch, as it will get more attention for new features. Thanks for understanding.
TODO: Button layout should load any asset for a buton when available.
TODO: Move buttons, asset, author from Ediitor $attributes to $params
joomla-cms/libraries/src/Editor/Editor.php
Lines 206 to 215 in c2997e1
$event->getSubject()
| Labels |
Added:
PR-5.0-dev
Removed: PR-4.4-dev |
||
| Labels |
Added:
?
b/c break
|
||
| Title |
|
||||||
| Labels |
Added:
Feature
Removed: ? |
||
| Title |
|
||||||
| Status | Pending | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-08-21 06:42:00 |
| Closed_By | ⇒ | HLeithner |
Can you please create a manual entry for migration, not only that it changes, also what needs to be done to convert a button to use event triggers please.
I'm merging this for now to have more test coverage in alpha.
I like it but didn't had time to look at it in deep