Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-74494

[mentor-questa-vrm] Extract inline script block and event handlers in com/mentor/questa/ucdb/jenkins/QuestaCoverageHistory/attribute-graph.jelly

XMLWordPrintable

      Problems

      == Inline Script Block
      Line: 93
      ----
      <script type="text/javascript">
                          function updateGraph(select) {
                          	var attrkey = select.value;
                          	var uniqueid = select.id;
              		for (var i=0; i&lt;select.options.length; i++) {
              			opt = select.options[i];
              			if (!opt.selected) {
                          			document.getElementById(uniqueid+"-"+opt.value+"-graph").style.display = "none";
              			}
              		}
                          	document.getElementById(uniqueid+"-graphTitle").innerHTML = select.options[select.selectedIndex].text;
                          	document.getElementById(uniqueid+"-"+attrkey+"-graph").style.display = "";
                          }
                      </script>
      ----
      
      == Inline Event Handler
      Line: 70
      ----
      <select id="${uniqueid}" onchange="updateGraph(this)">
      ----
      
      == Inline Event Handler
      Line: 85
      ----
      <a id="attribute-edit" href="${url}/edit-page" onclick="${h.isAutoRefresh(request) ? null : 'return replaceAttribute(&quot;'+url+'&quot;, &quot;'+uniqueid+'&quot;);'}">
      ----
      

      Solutions

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
      https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

            Unassigned Unassigned
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: