-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: mentor-questa-vrm-plugin
Problem
== Inline Script Block
Line: 68
----
<script type="text/javascript">
var linktitle= ["Show Actions", "Show Tests"]
var displayStyle= ["none", ""]
var linkIndex =1;
var failed = parseInt("${it.failedActionCount}")
var total = parseInt("${it.totalActionCount}")
document.addEventListener("DOMContentLoaded",function(){
onload();
flipTable();
});
function flipTable(){
//"use strict";
if(total == 0){
return;
}
var x = document.getElementById("vrmregr").rows
linkIndex = 1 - linkIndex;
document.getElementById("flipLink").innerHTML = linktitle[linkIndex];
document.getElementById("action-col").style.display=displayStyle[linkIndex]
for(var i=1; i< x.length; i++){
var className= x[i].className
if(className =="action-row"){
x[i].style.display= displayStyle[linkIndex]
}
x[i].firstElementChild.style.display= displayStyle[linkIndex]
}
if(failed > 0){
var x = document.getElementById("failed-table").rows
for(var i=1; i< x.length; i++){
var className= x[i].className
if(className =="action-row"){
x[i].style.display= displayStyle[linkIndex]
}
}
}
}
function flipView(){
if(total == 0){
return;
}
if(failed > 0){
var tempStyle=document.getElementById("failed-tests").style.display
document.getElementById("failed-tests").style.display = document.getElementById("failed-actions").style.display
document.getElementById("failed-actions").style.display = tempStyle
}
tempStyle=document.getElementById("all-tests").style.display
document.getElementById("all-tests").style.display = document.getElementById("all-actions").style.display
document.getElementById("all-actions").style.display = tempStyle
flipTable();
}
</script>
----
Solution
https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks