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

Paste images from clipboard #963

Merged
merged 4 commits into from Mar 7, 2024
Merged

Conversation

cmj2002
Copy link
Contributor

@cmj2002 cmj2002 commented Nov 25, 2023

Implement #572.

Specific behaviors:

  • When the clipboard contains an image and is pasted on the MessageBar, open the PublishDialog and attach the image in the clipboard as a local file.
  • Clear the attached local file when the PublishDialog is closed.
  • Pasting inside the PublishDialog is ineffective.(edit: feature added)
  • When the clipboard contains an image and is pasted on the the message section of PublishDialog, the attached file will be changed to the pasted image (no matter whether it already has a file or not)

For convenience in previewing, a new feature has also been added: clicking on the icon of the attached local file will create a blob URL using URL.createObjectURL and open it in a new tab. This feature is effective for all attached local files.

This feature has already been tested in Chrome and Firefox (on Windows). Testing on Safari is still needed (I don't have Apple devices). You can test this feature at https://ntfy-clipboard.fly.dev.

@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2525ef7) 65.82% compared to head (4b1468c) 65.82%.
Report is 4 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #963   +/-   ##
=======================================
  Coverage   65.82%   65.82%           
=======================================
  Files          53       53           
  Lines        7737     7737           
=======================================
  Hits         5093     5093           
  Misses       1799     1799           
  Partials      845      845           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wunter8
Copy link
Contributor

wunter8 commented Nov 25, 2023

Hey! Thanks for adding this! It's been on my list of things to do. Maybe remove the two console.logs that you have in there?

Also, I think it might be nice to be able to paste an image inside the PublishDialog, inside the message area. Was there a specific reason you decided not to do that?

(binwiederhier will have the final say, of course)

@cmj2002
Copy link
Contributor Author

cmj2002 commented Nov 25, 2023

Thanks for your advises.

Maybe remove the two console.logs that you have in there?

Sorry I forgot about this, this is what I use for debugging.

Was there a specific reason you decided not to do that?

There is no specific reason, I will try to implement it later since you asked.

@wunter8
Copy link
Contributor

wunter8 commented Nov 25, 2023

Looks great! Thanks again!

@binwiederhier binwiederhier merged commit 6c3aca4 into binwiederhier:main Mar 7, 2024
4 checks passed
@binwiederhier
Copy link
Owner

Thank you. Works amazingly.

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

4 participants