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
Extend editors API #23224
Extend editors API #23224
Conversation
Dimitris my hero! Personally I don’t think it’s a BC Break as nothing is breaking but changing for the better in the way it’s always been assumed it should work....
…On 3 Dec 2018, 19:21 +0000, dGrammatiko ***@***.***>, wrote:
Pull Request for Issue #17665 .
Summary of Changes
This PR introduces one more method to our Joomla.Editors API:
getSelection() { /* return the current selection */ }
Why?
Well it's a missing piece of the puzzle but mainly because it allows DEVs to do more advanced stuff instead of always replacing some selected text.
As this is a PR for the issue linked above, the menu button is the only place where this API is used at the moment. Also this part (in media/com_menus/js/admin-items-modal.js might be removed depending on the decision about B/C break, check the notes bellow)
Testing Instructions
Apply patch select some text in the editor and then through the menu button (xtd_button) try to insert a link! The link will have as text the selected text in the editor instead of the default menu name.
Repeat the process for all three core editors: none, tinyMCE and codemirror
Expected result
When you link to menu items etc, if you highlight text and link it the selected text gets replaced.
Actual result
When you link to menu items etc, if you highlight text and link it the selected text becomes the link text.
Preview
Documentation Changes Required
This PR is not breaking any API but it changes the behaviour. Eg
• old behaviour: either some text is selected or nothing then the link will have the default menu text and the selected text gets replaced
• new behaviour: if some text is selected then that will become the text of the menu item. If nothing is selected the link will have the default menu text.
@mbabker @wilsonge please make up your mind on the B/C here
@tonypartridge this one is for you 😉
You can view, comment on, or merge this pull request online at:
#23224
Commit Summary
• extend editors API
File Changes
• M media/com_menus/js/admin-items-modal.js (6)
• M media/com_menus/js/admin-items-modal.min.js (2)
• M media/editors/none/js/none.js (24)
• M media/editors/none/js/none.min.js (2)
• M media/editors/tinymce/js/tinymce.js (1)
• M media/editors/tinymce/js/tinymce.min.js (2)
Patch Links:
• https://github.com/joomla/joomla-cms/pull/23224.patch
• https://github.com/joomla/joomla-cms/pull/23224.diff
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm happy with this new proposed behaviour. Is there a reason we don't have an implementation for codemirror? |
Yes! Basically the Joomla's API for the editors is a one to one match for |
Cool. One test here and I'm happy |
I have tested this item ✅ successfully on 939cfa6 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23224. |
Pull Request for Issue #17665 .
Summary of Changes
This PR introduces one more method to our Joomla.Editors API:
Why?
Well it's a missing piece of the puzzle but mainly because it allows DEVs to do more advanced stuff instead of always replacing some selected text.
As this is a PR for the issue linked above, the menu button is the only place where this API is used at the moment. Also this part (in media/com_menus/js/admin-items-modal.js might be removed depending on the decision about B/C break, check the notes bellow)
Testing Instructions
Apply patch select some text in the editor and then through the menu button (xtd_button) try to insert a link! The link will have as text the selected text in the editor instead of the default menu name.
Repeat the process for all three core editors: none, tinyMCE and codemirror
Expected result
When you link to menu items etc, if you highlight text and link it the selected text gets replaced.
Actual result
When you link to menu items etc, if you highlight text and link it the selected text becomes the link text.
Preview
Documentation Changes Required
This PR is not breaking any API but it changes the behaviour. Eg
@mbabker @wilsonge please make up your mind on the B/C here
@tonypartridge this one is for you 😉