-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Paste images #137
Comments
You should view issue #122. They plan on adding 'drag-n-drop' features to Quill, but it was posted a while back on May 25, 2014. |
👍 super handy. Became addicted to pasting images from clipboard after using it in Slack, GitHub, StackOverflow. I can paste images from the same page, but not from the clipboard. I've listed other WYSIWYG editors that support pasting images in this comparison. |
Here is a demo of my plugin for image drag/drop and paste for Quill. If there is interest I can publish to npm or submit a pull request to add to Quill core. Also demoed there is a plugin for image resizing. |
@kensnyder would love it if the drag/drop and resize plugins were made available. thanks! |
These plugins are now available on npm: quill-image-resize-module and quill-image-drop-module. Contributions are welcome. |
@kensnyder any plans on making image pasting module as well? |
Here's what I'm using to add very basic support for pasting images from clipboard. It uses the Clipboard API. This will return an image element, which quill parses and inserts inline into the editor. It can be improved, but for my use case this works. Tested in Chrome and Firefox latest (but you should still keep an eye out for browser support as usual)
Source : https://gist.github.com/dusanmarsa/2ca9f1df36e14864328a2bb0b353332e |
@johnozbay, please attribute code if you pulled it from somewhere. Also, edit your post to include an important line you missed in your snippet: Thank you for getting this out here! |
@hardythomas at the time of posting this I copied the code from the project I was using it in. The lack of attribution was without any bad intention, but merely an oversight in a busy day. I apologize. |
No worries. I didn't think it was with bad will ;) just hoping people get credit where credit is due
Sent: Sunday, June 24, 2018 at 4:10 AM
From: "John Ozbay" <notifications@github.com>
To: quilljs/quill <quill@noreply.github.com>
Cc: hardythomas <hardy.thomas@mail.com>, Mention <mention@noreply.github.com>
Subject: Re: [quilljs/quill] Paste images (#137)
@hardythomas at the time of posting this I copied the code from the project I was using it in. The lack of attribution was without any bad intention, but merely an oversight in a busy day. I apologize.
Added the source & updated snippet with an edit now. Thanks for the heads up, and keeping me warned 🙏🏻
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@johnozbay this code produces double paste in most recent Firefox. Without the polyfill, pasting images directly into quill works. But Chrome still requires your polyfill. |
It would be nice if we could paste an image on the clipboard instead of having to save it to a file and upload from there.
The text was updated successfully, but these errors were encountered: