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

[mentor-questa-vrm] Extract inline script block and event handler in com/mentor/questa/vrm/jenkins/QuestaVrmTrendGraphsPortlet/table.jelly

XMLWordPrintable

      Problems

      == Inline Script Block
      Line: 132
      ----
      <script>document.addEventListener("DOMContentLoaded",function(){
      		onload();
      		var img = document.createElement("img");
      		img.src="${resURL}/plugin/mentor-questa-vrm/icons/mentorlogo.png"
      		img.height="14"
      		img.title="Mentor Graphics"
      		img.alt="[mentor logo]" 
      		document.getElementById("title-${it.id}").insertBefore( img, document.getElementById("title-${it.id}").childNodes[0]);
      		
      	});
      	
      	var imageResolverLock = 0;
      	
      	setTimeout(function(){
      		// This hack is used to modify the graphs hrefs of the images map after page load
      		// This function should be called once if the dashboard contains multiple portlets
      		if (imageResolverLock == 0) {
      			imageResolverLock = 1;
       			resolveImagesHref();
       		} 
      	}, 500);</script>
      ----
      
      == Inline Event Handler
      Line: 34
      ----
      <!-- onclick='showHideTrendGraphs(this)' -->
      ----
      

      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: