Fix the image button in the formatting toolbar.

Review Request #13211 — Created Aug. 14, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

The image button in the formatting toolbar would prompt for a file, but never
actually inserted it into the editor. This change fixes that.

  • Tested uploading images through the image button in empty and non-empty
    editors, and at various positions in the editor. Saw that this behaved in
    the same way as dragging and dropping images.
  • Tested using the other buttons in the editor.
Summary ID
Make the image button in the formatting toolbar work.
1a51e24bfec1e1f2033d2c044c926bdfe6583ece
Description From Last Updated

Hold off on any reviews because I'll be updating this for the changes from /r/13212/.

maubinmaubin

The custom _uploadImage callback on the interface is going to be too specific to this case, and it's not something …

chipx86chipx86
maubin
  1. 
      
  2. Show all issues

    Hold off on any reviews because I'll be updating this for the changes from /r/13212/.

  3. 
      
maubin
chipx86
  1. 
      
  2. Show all issues

    The custom _uploadImage callback on the interface is going to be too specific to this case, and it's not something that extensions could take advantage of.

    I think an approach worth exploring is just letting this button emit an event on the view, e.g. uploadImage. TextEditorView could then listen to this event and do the right thing. If something else were to use FormattingToolbarView (theoretically), it could implement its own logic there.

  3. 
      
maubin
chipx86
  1. Ship It!
  2. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (9d080fc)