aces / cbrain

CBRAIN is a flexible Ruby on Rails framework for accessing and processing of large data on high-performance computing infrastructures.
GNU General Public License v3.0
71 stars 42 forks source link

Add a 'copy to clipboard' button in the API token page #1345

Open prioux opened 1 year ago

prioux commented 1 year ago

CBRAIN has a page that allows users to generate an API token.

When the token is generated, it is shown int he page and users are expected to write it down/copy it somewhere.

I suggest that just besides the token we had a nice 'copy to clipboard' button.

MontrealSergiy commented 1 year ago

a snippet for that https://www.w3schools.com/howto/howto_js_copy_clipboard.asp

MontrealSergiy commented 1 year ago

also there is a dedicated library, with an old backend https://clipboardjs.com/ with cool button and 'your text is copied' message

https://www.golinuxcloud.com/javascript-copy-to-clipboard/ recommends it as a polyfill/fall-back solution compatible with old browsers.