Fix the image button in the formatting toolbar.

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

maubin
Review Board
release-6.x
reviewboard

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
Make the image button in the formatting toolbar work.
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. Hold off on any reviews because I'll be updating this for the changes from /r/13212/.

  3. 
      
maubin
chipx86
  1. 
      
  2. 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: Closed (submitted)

Change Summary:

Pushed to release-6.x (9d080fc)
Loading...