Skip to content
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

Upload polish #109

Merged
merged 3 commits into from
Aug 19, 2019
Merged

Upload polish #109

merged 3 commits into from
Aug 19, 2019

Conversation

jfly
Copy link

@jfly jfly commented Jul 29, 2019

This fixes two issues I found while playing around with the awesome new file upload support:

  • The button to upload files from your computer would not use options.imageUploadFunction if specified.
  • Copy pasting or dragging 0 images would cause the status bar to permanently update to "Uploading image ..."

jfly added 2 commits July 29, 2019 02:49
…tion` if specified.

I think this part just got missed in
Ionaru#106.

I'm not sure if I should be doing anything with the `onSuccess` and
`onError` callbacks here.
Without this change, if you either:
  - Click and drag some text into the markdown editor, or
  - Copy paste some text into the markdown editor

The status bar will get updated to say "Uploading image ...", and will
never stop.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 29, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint.

This is part of thewca#4309.

NOTE: We should not merge this up until
Ionaru/easy-markdown-editor#109 is merged and
released. Then we should update this diff to pull in latest version of
EasyMDE with these fixes.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 29, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint.

This is part of thewca#4309.

NOTE: We should not merge this up until
Ionaru/easy-markdown-editor#109 is merged and
released. Then we should update this diff to pull in latest version of
EasyMDE with these fixes.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 29, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint.

This is part of thewca#4309.

NOTE: We should not merge this up until
Ionaru/easy-markdown-editor#109 is merged and
released. Then we should update this diff to pull in latest version of
EasyMDE with these fixes.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 29, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint.

This is part of thewca#4309.

NOTE: We should not merge this up until
Ionaru/easy-markdown-editor#109 is merged and
released. Then we should update this diff to pull in latest version of
EasyMDE with these fixes.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 30, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint.

This is part of thewca#4309.

NOTE: We should not merge this up until
Ionaru/easy-markdown-editor#109 is merged and
released. Then we should update this diff to pull in latest version of
EasyMDE with these fixes.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 30, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint. Unfortunately, I couldn't find a good way to add validations
to this new endpoint. Since we only allow fairly trusted users to access
this endpoint, I think that's acceptable for now, but eventually it
would be nice to validate file size/format/etc. See
thewca#4380 for more
information.

This is part of thewca#4309.

NOTE: We should not merge this up until
Ionaru/easy-markdown-editor#109 is merged and
released. Then we should update this diff to pull in latest version of
EasyMDE with these fixes.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 31, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint. Unfortunately, I couldn't find a good way to add validations
to this new endpoint. Since we only allow fairly trusted users to access
this endpoint, I think that's acceptable for now, but eventually it
would be nice to validate file size/format/etc. See
thewca#4380 for more
information.

This is part of thewca#4309.

NOTE: We should not merge this up until
Ionaru/easy-markdown-editor#109 is merged and
released. Then we should update this diff to pull in latest version of
EasyMDE with these fixes.
jfly added a commit to jfly/worldcubeassociation.org that referenced this pull request Jul 31, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint. Unfortunately, I couldn't find a good way to add validations
to this new endpoint. Since we only allow fairly trusted users to access
this endpoint, I think that's acceptable for now, but eventually it
would be nice to validate file size/format/etc. See
thewca#4380 for more
information.

This is part of thewca#4309.

I found a problem with EasyMDE's image upload button: it doesn't seem to
use the custom image upload function if you've specified one. It was
fairly easy to work around this issue, but I have filed
Ionaru/easy-markdown-editor#109 upstream to fix
the bug in the right place.
jfly added a commit to thewca/worldcubeassociation.org that referenced this pull request Jul 31, 2019
Support for uploading images was very recently added to EasyMDE.
I followed
https://medium.com/weareevermore/manual-uploads-using-activestorage-47808dab1b65
to build a new endpoint just for uploading images, and then wrote a
little bit of javascript to actually connect EasyMDE to this new
endpoint. Unfortunately, I couldn't find a good way to add validations
to this new endpoint. Since we only allow fairly trusted users to access
this endpoint, I think that's acceptable for now, but eventually it
would be nice to validate file size/format/etc. See
#4380 for more
information.

This is part of #4309.

I found a problem with EasyMDE's image upload button: it doesn't seem to
use the custom image upload function if you've specified one. It was
fairly easy to work around this issue, but I have filed
Ionaru/easy-markdown-editor#109 upstream to fix
the bug in the right place.
@Ionaru
Copy link
Owner

Ionaru commented Aug 19, 2019

I apologise for the extremely late reaction.

Your change looks good, I'll update the changelog and merge it into master.

@Ionaru Ionaru merged commit d114dab into Ionaru:master Aug 19, 2019
@jfly jfly deleted the upload-polish branch August 19, 2019 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants