ScottMaclure / dicey

Dice roller
https://dicey.maclure.info/
MIT License
0 stars 0 forks source link

Allow User to easily "copy" the result, to paste into another app #16

Closed ScottMaclure closed 8 years ago

ScottMaclure commented 10 years ago

Git branch: issue_16_copy_result

User Story: Roleplaying online using Telegram (or similar app). Task switch to Dicey, roll the dice, see the result. Copy the result to clipboard, switch to Telegram. Paste into Telegram in a standard format.

Links: http://www.htmlgoodies.com/html5/other/working-with-clipboard-apis-in-html5-web-apps.html http://stackoverflow.com/questions/10729570/html5-alternative-to-flash-based-zeroclipboard-for-safe-copying-of-data-to-clipb http://stackoverflow.com/questions/400212/how-to-copy-to-the-clipboard-in-javascript

ScottMaclure commented 10 years ago

Since Clipboard support is shite, and I don't want to use flash, the solution I'm thinking is this:

1) Display the ResultModal. Pass the log entry along as a prop. 2) Render an input field at the bottom, with the log entry text as its value 3) focus() and select() the element.

That way, the user can long-press the text and copy to clipboard.

Edit: This is how Evernote handles sharing links.

ScottMaclure commented 8 years ago

Currently, you can copy + paste the modal, not awesome, but it works.

ScottMaclure commented 8 years ago

Future plans means this one's not important anymore.