-
Notifications
You must be signed in to change notification settings - Fork 196
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
[JENKINS-70695] add copy to clipboard button for snippet generator #666
Conversation
this change adds a copy to clipboard button below the field with the generated code.
affects #599 |
1e8a130
to
e47101f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable though IIUC it is tricky to test locally since only https
-protocol pages will actually let you copy. https://github.com/jglick/jenkins-demo-reverse-proxy might help.
As |
@@ -21,6 +21,9 @@ function handlePrototype(url, crumb) { | |||
if (response.ok) { | |||
response.text().then((responseText) => { | |||
document.getElementById('prototypeText').value = responseText; | |||
copybutton = document.querySelector('.jenkins-copy-button'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could wrap that also in a check of isSecureContext to avoid showing the copy button when it will not work anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not relevant for production uses.
Ah TIL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I normally run with the wildcardDNS
Maven property set which I guess deactivates the copy button. With that profile disabled I am able to test locally.
@@ -21,6 +21,9 @@ function handlePrototype(url, crumb) { | |||
if (response.ok) { | |||
response.text().then((responseText) => { | |||
document.getElementById('prototypeText').value = responseText; | |||
copybutton = document.querySelector('.jenkins-copy-button'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not relevant for production uses.
this change adds a copy to clipboard button below the field with the generated code
See JENKINS-70695