Skip to content

Commit

Permalink
feat:Remove inline javascript code from BuoldTriggerStep
Browse files Browse the repository at this point in the history
  • Loading branch information
NeetigyaPod committed Oct 9, 2023
1 parent 2239584 commit 4bf9d68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,7 @@ THE SOFTWARE.
<f:entry field="parameters" title="Parameters">
<div id="params"/>
<script>
function loadParams() {
var div = document.getElementById('params');
fetch('${descriptor.descriptorUrl}/parameters?job=' + encodeURIComponent(document.getElementById('${jobFieldId}').value) + '&amp;context=${descriptor.contextEncoded}').then((rsp) => {
rsp.text().then((responseText) => {
if (rsp.ok) {
div.innerHTML = responseText;
Behaviour.applySubtree(div);
} else {
div.innerHTML = "<b>ERROR</b>: Failed to load parameter definitions: " + rsp.statusText;
}
});
});
}
<st:adjunct includes="org.jenkinsci.plugins.workflow.support.steps.build.BuildTriggerStep.config"/>
</script>
</f:entry>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function loadParams() {
var div = document.getElementById('params');
fetch('${descriptor.descriptorUrl}/parameters?job=' + encodeURIComponent(document.getElementById('${jobFieldId}').value) + '&amp;context=${descriptor.contextEncoded}').then((rsp) => {
rsp.text().then((responseText) => {
if (rsp.ok) {
div.innerHTML = responseText;
Behaviour.applySubtree(div);
} else {
div.innerHTML = "<b>ERROR</b>: Failed to load parameter definitions: " + rsp.statusText;
}
});
});
}

0 comments on commit 4bf9d68

Please sign in to comment.