-
Notifications
You must be signed in to change notification settings - Fork 42
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
a button to copy api token to clipboard #1345 #1346
base: dev
Are you sure you want to change the base?
Conversation
I have multiple comments:
I think this can do the job: We have just generated a new API token for you (click to copy).
<p>
<div>
<button onclick="copy_text_to_clipboard()" id="api_token"><%= @new_token %></button>
</div>
<p> and: function copy_text_to_clipboard() {
navigator.clipboard.writeText($("#api_token").text().trim());
} It gave: Also you need to correct the date in the Copyright section. |
@natacha-beck do you actually observed the whitespace in copied string with your browser (safari I guess?), or trimming is 'just in case'?) |
I can adjust Copyrights, but fyi I think it is no longer part of cbrain development policies. Darcy had a discussion with Pierre regarding relevance of Copyright date updating, and I think he convinced everybody that copyright update is not necessary. |
So do not update it, it's fine. |
I use chrome and yes I observe it by copying it, then when debugging and print in the console I was able to confirm that it copy some beginning white space and the a |
While your token inside button suggestion has its charms, it might prevent typical 'clipboardless' copy-paste flow in unix-like OSs (selecting word with a double click and then copying it with wheel click, without need for any clipboard) |
You can discard my comment about the API button if you want, result is the same. Your 1st solution with the trimming is good, but you can consider to remove the |
Ok, done, please, check the changes. I can rebase if you like |
66c3b81
to
2602752
Compare
see #1345