Insert placeholder text in post while uploading

upload

(Erlend Sogge Heggen) #1

GitHub’s upload dialog has a handy placeholder in the editor while your upload is being processed:

In Discourse I tend to take my fingers off the keyboard as long as I’m downloading something, because the download link will be inserted wherever my cursor is at the time.


(Jeff Atwood) #2

Sure, not a bad idea, up to @zogstrip. If it is hard may need to wait for a future release.


(Régis Hanol) #3

Just pushed the upload placeholder :bird:

https://github.com/discourse/discourse/commit/38cb72b3294230caee2ab7f11b8f90c43b68969d


(Jeff Atwood) #4

Works! Looks like this:

Very nice improvement, excellent suggestion @erlend_sh


(Erlend Sogge Heggen) #5

Fantastic!

Funnily enough I think your server was running an update of sorts just now, because my first test pic uploaded perfectly, but then the updates were constantly stalling, both here and on Try (page loads were also slow, so I’m pretty sure it was server). Perfectly fine and snappy again now.

Because I happened to experience a longer than usual loading time, I did notice a few minor quirks, but both might be quite hard to do anything about:

  • Cancelling the upload doesn’t remove the inserted upload placeholder text. I can see why this might be tricky.
  • GitHub doesn’t even offer a cancel option…
  • If the upload is finished in the background while the smiley selector is open, my smiley will be inserted into the image link, breaking it.
  • Interestingly, following those same steps in GitHub ends with no smiley being inserted. Maybe they encountered this too, and solved it.

(Erlend Sogge Heggen) #6

Kind of edge case, but I noticed that if you’re typing something above the placeholder, your typing position will be forced to the end of the placeholder when it finishes. Like:

I'm typing something above this image and sudd
<img src="//discourse-meta.s3-us-west-1.amazonaws.com/original/3X/8/8/889493f5d072349533b284ba007ec0384f0cc2a2.jpg" width="690" height="215"> enly it's continued here.

(Régis Hanol) #7

That’s now fixed with

https://github.com/discourse/discourse/commit/e65ddc6c253fb89ce992a3610f60ccf6a30b02a5


(Régis Hanol) #8

This is now fixed :strawberry:


(Jeff Atwood) #9