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

Automatically upload images when paste #158

Open
hurui200320 opened this issue May 26, 2022 · 2 comments
Open

Automatically upload images when paste #158

hurui200320 opened this issue May 26, 2022 · 2 comments

Comments

@hurui200320
Copy link

hurui200320 commented May 26, 2022

Hi!

I'm using this project for a while, it's really brilliant in an elegant and powerful way. However, in some products like Google Docs and typora, you can copy and paste images, and it will automatically upload/save your image, which is missing in cowyo.

Although this is not a must-have feature, I can download or save the image/screenshot to a file and then upload it to my self-hosted cowyo, but it would be nice to have, and it will be a huge time saver.

Sadly I'm mainly working on Java (for the backend) and have very limited experience on the frontend. So I'm creating this issue and want to discuss if this feature is hard to implement.

@hurui200320
Copy link
Author

I found the following resources on paste images:

https://stackoverflow.com/questions/59769305/how-to-paste-files-into-an-input-using-ctrl-v-paste
https://webdevchallenges.com/how-to-paste-files-from-clipboard-using-javascript

However, I didn't find where I can integrate into cowyo yet...

@hurui200320
Copy link
Author

Seems like we can accept onPaste event here?

cowyo/templates/index.tmpl

Lines 155 to 159 in a58f4ca

<textarea
autofocus
placeholder="Use markdown to write your note! New: you can publish your note when you are done ({{ .Page }} -> Publish)."
id="userInput"
>{{ .RawPage }}</textarea>

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

No branches or pull requests

1 participant