diff --git a/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/handle-prototype.js b/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/handle-prototype.js index 79e7d5569..533aef6e0 100644 --- a/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/handle-prototype.js +++ b/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/handle-prototype.js @@ -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'); + copybutton.setAttribute("text", responseText); + copybutton.classList.remove('jenkins-hidden'); }); } }) diff --git a/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly b/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly index 1394a5458..eeb02d9bd 100644 --- a/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly +++ b/plugin/src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly @@ -73,6 +73,7 @@ THE SOFTWARE. data-url="${rootURL}/${it.GENERATE_URL}" data-crumb="${h.getCrumb(request)}"/> +