leighmcculloch / looks.wtf

A collection of looks. (▰˘◡˘▰) (-‸ლ) 눈_눈 (◔_◔) (-■_■) ...
https://looks.wtf
104 stars 23 forks source link

Copy to clipboard on click #3

Closed aemylt closed 7 years ago

aemylt commented 8 years ago

Fixes #2

Implemented using clipboard.js, so no Flash is used.

I've also added a brief sentence pointing out the feature. I haven't mentioned browser support right now, so let me know if you want that added. The list of browsers which support clipboard.js is available here.

You can also do more advanced things like displaying tooltips when copying has/hasn't been successful, but I just wanted to show off the basic functionality in this PR.

aemylt commented 8 years ago

Both of these comments have now been addressed.

aemylt commented 8 years ago

I think you still need to merge the PR yourself if you want these changes added, instead of simply approving it. Unless someone else has write access to this repo.

leighmcculloch commented 7 years ago

Merged! This is great. Sorry it took me a while, have a relatively new 👶. I had a quick look at adding tooltips but I couldn't see the option. Is it built in?

aemylt commented 7 years ago

That's fine; kids are definitely more important than this PR. =)

Tooltips aren't built in to the library, but clipboard.js supports success and error events: https://clipboardjs.com/#events

Their recommendation for browser support is to provide a "Copied!" message on a success event and "Press Ctrl+C to copy" on an error event.