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

Implement copy/paste of images in the file/binary format #810

Merged
merged 12 commits into from
Apr 5, 2019

Conversation

SergioEstevao
Copy link
Contributor

@SergioEstevao SergioEstevao commented Apr 3, 2019

Fixes #730

Related Gutenberg PR: WordPress/gutenberg#14802

This PR implements the copy paste of images on the iOS side.
It works by intercepting the paste method on Aztec and passing a url path array to the JS side to import.

It also implements delegate methods to ask the native, host app to import them in any way it wants.
On the demo app we are just simulating an upload, but on the main WP app we should import the media to the site.

To test:

  • Open the demo app
  • Open the Photos app
  • Select one or more images
  • Tap on the copy button
  • Go back to the demo app
  • Select a text block, and tap paste
  • See that the images are inserted in the page.

@mzorz do you want to add the android implementation if needed? Can you do copy/paste of a binary image in Android?

@mzorz
Copy link
Contributor

mzorz commented Apr 4, 2019

@mzorz do you want to add the android implementation if needed? Can you do copy/paste of a binary image in Android?

Sure thing @SergioEstevao ! Thanks for the ping, will put this in my ToDo list and try start tomorrow 👍

@SergioEstevao
Copy link
Contributor Author

@pinarol do you mind test this on iOS too?

@pinarol
Copy link
Contributor

pinarol commented Apr 4, 2019

@SergioEstevao sure thing! I can test this later today or first thing tomorrow.

@pinarol
Copy link
Contributor

pinarol commented Apr 4, 2019

Hey @SergioEstevao 👋 I did some testing on this, I can paste multiple images pretty well but after that if I try to copy paste normal text it is not working. Also if the block is empty it is removed after the paste.

text-copy-paste

Other than this I think changes look pretty good.

@SergioEstevao
Copy link
Contributor Author

@pinarol excellent catch, just updated the code to fix the issue you found.

@pinarol
Copy link
Contributor

pinarol commented Apr 5, 2019

Hey @SergioEstevao 👋 Copy paste seems fixed but I just realized the keyboard down button is not working when caret is at the Image caption. This is not happening on develop.

image-caption-keyboard-close

@pinarol
Copy link
Contributor

pinarol commented Apr 5, 2019

Sorry wrong alarm with the right steps I could repro that in develop also

Copy link
Contributor

@pinarol pinarol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉 Tested with WPiOS

@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@SergioEstevao SergioEstevao merged commit 3bd518a into develop Apr 5, 2019
@SergioEstevao SergioEstevao deleted the issue/730_copy_paste branch April 5, 2019 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants