rsimmons/massif

Copy sentence button

Opened this issue · 4 comments

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!

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

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 :-)

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

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!