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

Copy sentence button #5

Open
mikavilpas opened this issue Dec 14, 2021 · 4 comments
Open

Copy sentence button #5

mikavilpas opened this issue Dec 14, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@mikavilpas
Copy link

Hi, absolutely love your work on this. I added it to my hobby dictionary project as an external search link ( https://github.com/sp3ctum/hare )

Any chance you could add a button to copy the sentence text to the clipboard? I make all of my cards on mobile and copying the text is a bit difficult due to Samsung having thought it's a great idea to have a curved screen.

Kinda silly but it would help me out a lot. Thanks for your consideration!

@mikavilpas
Copy link
Author

Alternatively, an option would be to enable the use of some API so l could (with your permission of course) fetch the results in my application.

Just tried it out though and at least the web ui doesn't allow it:
image

@mikavilpas
Copy link
Author

In case you're interested, l noticed you are also using react. Here is my implementation of the copy button:
https://github.com/sp3ctum/hare/blob/master/sakura/src/views/export/ExportView.js#L20

perhaps it can serve as inspiration or something :-)

@rsimmons
Copy link
Owner

Thanks for the suggestion. I will look into adding a copy button when I have more time (so I'll leave this issue open), but for now I have at least added the CORS header so that you can get search results in JSON. Just add &fmt=json to the search URL. For example:

image

@rsimmons rsimmons added the enhancement New feature or request label Dec 14, 2021
@mikavilpas
Copy link
Author

Awesome, thanks!
I'm pretty busy rn but will probably have time to implement something in my app early next year.

I guess this issue can stay open if you are still open about the copy sentence button idea. Otherwise I am very happy with a public api!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants