Skip to content

Commit

Permalink
[JENKINS-69658] Move internal script block in "failed-test.jelly" t…
Browse files Browse the repository at this point in the history
…o external file (#439)

Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
  • Loading branch information
Jagrutiti and timja authored Oct 3, 2022
1 parent 085131f commit 5c28483
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
23 changes: 1 addition & 22 deletions src/main/resources/lib/hudson/test/failed-test.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,7 @@ THE SOFTWARE.
</st:attribute>
</st:documentation>
<st:once>
<script type="text/javascript">
<!-- TODO make sure load doesn't happen every time -->
function showFailureSummary(id,query) {
var element = document.getElementById(id)
element.style.display = "";
document.getElementById(id + "-showlink").style.display = "none";
document.getElementById(id + "-hidelink").style.display = "";

if (typeof query !== 'undefined') {
var rqo = new XMLHttpRequest();
rqo.open('GET', query, true);
rqo.onreadystatechange = function() { element.innerHTML = rqo.responseText; }
rqo.send(null);
}
}

function hideFailureSummary(id) {
document.getElementById(id).style.display = "none";
document.getElementById(id + "-showlink").style.display = "";
document.getElementById(id + "-hidelink").style.display = "none";
}
</script>
<st:adjunct includes="lib.hudson.test.js.failureSummary" />
<style type="text/css">
.failure-summary {
margin-left: 2em;
Expand Down
20 changes: 20 additions & 0 deletions src/main/resources/lib/hudson/test/js/failureSummary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

function showFailureSummary(id,query) {
var element = document.getElementById(id)
element.style.display = "";
document.getElementById(id + "-showlink").style.display = "none";
document.getElementById(id + "-hidelink").style.display = "";

if (typeof query !== 'undefined') {
var rqo = new XMLHttpRequest();
rqo.open('GET', query, true);
rqo.onreadystatechange = function() { element.innerHTML = rqo.responseText; }
rqo.send(null);
}
}

function hideFailureSummary(id) {
document.getElementById(id).style.display = "none";
document.getElementById(id + "-showlink").style.display = "";
document.getElementById(id + "-hidelink").style.display = "none";
}

0 comments on commit 5c28483

Please sign in to comment.