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
Feature request: Add ability to edit images and embeds in rich text editor #2674
Comments
This is unlikely to happen for Hallo, but Draftail nearly has this in place. There are a few pieces missing:
|
Adding my feature request text from #4588: Issue SummaryAt the moment, images and embeds in rich text (Draftail) are not editable. They can be inserted, and removed, but there is no way to edit an existing image/embed reference like we can for links and documents. It would be nice if the Draftail image and embed blocks were enhanced to support editing – at the minimum, have an "Edit" button in the tooltip that opens the correct chooser pre-filled with current data, like for links and documents. Steps to Reproduce
We had already started work on this while replacing Hallo.js with Draftail, but decided to go without it to concentrate on replacing the existing. The two specific commits where the WIP editing was removed were 19a6189, and 9f17026. When implementing this, some more things to worry about:
|
For reference, here are examples of image / embed blocks that support editing: https://demo.draftail.org/storybook/?selectedKind=Docs&selectedStory=Entities, https://demo.draftail.org/storybook/?selectedKind=Examples&selectedStory=Custom%20formats. Source: https://github.com/springload/draftail/blob/master/examples/blocks/ImageBlock.js Within Wagtail, it would probably easier to start with embeds first since their chooser modal is much simpler. |
Thank you @maylonpedroso for making this happen, this is a pretty cool feature 🤘 This will be released in Wagtail 2.10. |
This is something we've implemented in the TinyMCE editor and would like to see in Hallo editor too. The current TinyMCE implementation relies on pull request #2672 to work properly - this adds the ability to push parameters to the chooser views.
To implement this for Hallo editor requires moving a line of JavaScript from the TinyMCE editor into Hallo to set a global
window.chooserUrls.imageChooserSelectFormat
value:https://github.com/isotoma/wagtailtinymce/blob/master/wagtailtinymce/wagtail_hooks.py#L89-94
Then follow the same general approach in image and embed plugins to detect and amend the current selection. I'm afraid this is beyond my Hallo JavaScript powers but someone else may wish to take up the challenge.
https://github.com/isotoma/wagtailtinymce/blob/master/wagtailtinymce/static/wagtailtinymce/js/tinymce-plugins/
The text was updated successfully, but these errors were encountered: