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

Support for pasting images into WYSIWYG fields #6145

Open
Piedone opened this issue May 9, 2020 · 5 comments
Open

Support for pasting images into WYSIWYG fields #6145

Piedone opened this issue May 9, 2020 · 5 comments
Milestone

Comments

@Piedone
Copy link
Member

Piedone commented May 9, 2020

In certain apps, like the comment boxes here on GitHub too, you can paste an image into the text from the clipboard. So if you've taken a screenshot for example, then you don't have to save it to a file and upload it but you can just directly paste it.

The suggestion is about having the same functionality for Orchard's WYSIWYG fields: Instead of having to browse for a Media file you'd get instant upload and insert.

This would require some cross-module functionality. It's a question how these images should be named and where they should be saved to. Possibly the name could be auto-generated as a random GUID or on paste you could specify it. If the latter then you could also browse to the folder where you want it saved.

@hishamco
Copy link
Member

hishamco commented May 9, 2020

This is a neat feature but it require some thinking as you mentioned before:

  • Image Name

For the name GUID may be suited

  • Image Location

For location we could create a temp folder in media, so temporary images could be stored there

Another option is to convert the image into base64, so name or location is required

@sebastienros
Copy link
Member

Done in O1, was not hard, there are libraries to do that.

@sebastienros sebastienros added this to the 1.0.x milestone May 21, 2020
@Piedone
Copy link
Member Author

Piedone commented May 21, 2020

Really, it's in O1? Didn't know and tried the latest dev, it doesn't seem to work with TinyMCE.

@agriffard
Copy link
Member

Trumbowyg already has a paste image plugin (included in OC) that generates a base64 img:
https://alex-d.github.io/Trumbowyg/demos/#plugins-pasteimage

@Piedone
Copy link
Member Author

Piedone commented Jun 21, 2020

That's great though I think uploading to flat files is better (as these can be served directly from a CDN).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants