Skip to content

Commit

Permalink
extract inline script in
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomomdahan committed Oct 31, 2024
1 parent 0ff593b commit b65fcf0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
document.addEventListener('DOMContentLoaded', function() {
const buildId = document.querySelector('.build-parameters-trigger-id').dataset.buildId;
jQuery('#build-parameters-trigger-' + buildId).tooltip({
bodyHandler: function() {
return jQuery('#build-parameters-' + buildId).html();
},
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<div class="pipeline-info">
<div class="revision rounded">
<div class="title">Pipeline ${buildGrid.get(0,0).getRevision()}</div>
<div class="title build-parameters-trigger-id" data-build-id="${buildGrid.get(0,0).getId()}" id="build-parameters-trigger-${buildGrid.get(0,0).getId()}">Pipeline ${buildGrid.get(0,0).getRevision()}</div>
<j:choose>
<j:when test="${buildGrid.get(0,0).getParameters().isEmpty()}">
<div class="description">No parameters</div>
Expand All @@ -18,16 +18,13 @@
<ul>
<j:forEach items="${it.getRowHeaders().getParameters(buildGrid.get(0,0).getCurrentBuild()).entrySet()}" var="buildParam" indexVar="buildParamCtr">
<li>${buildParam.getKey()}: ${buildParam.getValue()}</li>
<h1>TEST1</h1>
<h1>TEST2</h1>
<h1>TEST3</h1>
</j:forEach>
</ul>
</div>
<script>
jQuery('#build-parameters-trigger-${buildGrid.get(0,0).getId()}').tooltip({
bodyHandler: function() {
return jQuery('#build-parameters-${buildGrid.get(0,0).getId()}').html();
}
});
</script>
<st:adjunct includes="au.com.centrumsystems.hudson.plugin.buildpipeline.extension.AbstractNameValueHeader.build-parameters-tooltip"/>
</j:otherwise>
</j:choose>
</div>
Expand Down

0 comments on commit b65fcf0

Please sign in to comment.