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

[test-results-analyzer] Extract inline script blocks and event handler in org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly

      Note

      While testing this plugin, evaluate whether the third-party libraries in src/main/webapp/js/libs are compatible with CSP in restrictive mode. The libraries may call eval, which is not allowed in restrictive mode.

      Problems

      == Inline Script Block
      Line: 19
      ----
      <script>
      
      var $j = jQuery.noConflict();
      </script>
      ----
      
      == Inline Script Block
      Line: 128
      ----
      <script>
      	var runtimeLowThreshold = "${it.runTimeLowThreshold}";
      	var runtimeHighThreshold = "${it.runTimeHighThreshold}";
          var customStatuses = {
              'PASSED':'PASSED',
              'SKIPPED':'SKIPPED',
              'FAILED':'FAILED',
              'N/A':'N/A'
          }
      	function generateCharts() {
      		var chartType = {
      			type: jQuery("#chartDataType").val(),
      			line: jQuery('#linegraph').is(':checked'),
      			bar: jQuery('#bargraph').is(':checked'),
      			pie: jQuery('#piegraph').is(':checked')
      		}
      		generateChart(chartType);
      
      		//fixes Jenkins issue where page content is not correctly placed until the window is resized
      		window.dispatchEvent(new Event('resize'));
      	}
      
      	jQuery(document).ready(function () {
      		jQuery("#allnoofbuilds")[0].checked = ${it.showAllBuilds};
      		jQuery("#show-build-durations")[0].checked = ${it.showBuildTime};
      		jQuery("#hide-config-methods")[0].checked = ${it.hideConfigurationMethods};
      		jQuery("#linegraph")[0].checked = ${it.showLineGraph};
      		jQuery("#bargraph")[0].checked = ${it.showBarGraph};
      		jQuery("#piegraph")[0].checked = ${it.showPieGraph};
      		jQuery("#noofbuilds").attr('disabled', ${it.showAllBuilds});
      
      		if ("${it.chartDataType}" === "runtime") {
      			jQuery("#chartDataType").val("runtime");
      			jQuery("#bargraph").attr('disabled', true);
      		} else {
      			jQuery("#chartDataType").val("passfail");
      		}
      		setCustomStatuses();
      		populateTemplate();
      	});
      
      	jQuery("#settingsmenubutton").click(function () {
      		jQuery("#settingsmenu").slideToggle(400, function () {
      			//fixes Jenkins issue where page content is not correctly placed until the window is resized
      			window.dispatchEvent(new Event('resize'));
      		});
      
      		//fixes Jenkins issue where page content is not correctly placed until the window is resized
      		window.dispatchEvent(new Event('resize'));
      	});
      
      	jQuery("#allnoofbuilds").change(function () {
      		jQuery("#noofbuilds").attr('disabled', this.checked);
      	});
      
      	jQuery("#chartDataType").change(function (e) {
      		jQuery("#bargraph").attr('disabled', e.target.value == "runtime");
      	});
      
      	jQuery("#downloadCSV").click(function () {
      	    var noOfBuilds = "-1";
      
              if (!jQuery("#allnoofbuilds").is(":checked")) {
                  noOfBuilds = jQuery("#noofbuilds").val();
              }
              remoteAction.getExportCSV(displayValues, noOfBuilds, function(t) {
                  download("Test Results.csv", t.responseObject());
              })
          });
      
      	jQuery("#getbuildreport").click(function () {
      		populateTemplate();
      	});
      	
      	jQuery("#expandall").click(function () {
      		expandAll();
      	});
      	
      	jQuery("#collapseall").click(function () {
      		collapseAll();
      	});
      
          function setCustomStatuses(){
              customStatuses['PASSED'] = "${it.passedRepresentation}";
              customStatuses['SKIPPED'] = "${it.skippedRepresentation}";
              customStatuses['FAILED'] = "${it.failedRepresentation}";
              customStatuses['N/A'] = "${it.naRepresentation}";
          }
      
      	function download(filename, text) {
      		var element = document.createElement('a');
      		element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
      		element.setAttribute('download', filename);
      		element.style.display = 'none';
      		document.body.appendChild(element);
      		element.click();	
      		document.body.removeChild(element);
      	}
      </script>
      ----
      
      == Inline Event Handler
      Line: 84
      ----
      <input id="filter" class="table-filter" type="text" placeholder="Test/Class/Package" onkeyup="searchTests()"/>
      ----
      

      Solutions

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

          [JENKINS-74074] [test-results-analyzer] Extract inline script blocks and event handler in org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly

          Basil Crow created issue -
          Basil Crow made changes -
          Summary Original: [test-results-analyzer] Extract inline script blocks and lsevent handlers in org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly New: [test-results-analyzer] Extract inline script blocks and event handlers in org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly
          Basil Crow made changes -
          Assignee Original: Varun Menon [ menonvarun ]
          Basil Crow made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 19
          ----
          <script>

          var $j = jQuery.noConflict();
          </script>
          ----

          == Inline Script Block
          Line: 128
          ----
          <script>
          var runtimeLowThreshold = "${it.runTimeLowThreshold}";
          var runtimeHighThreshold = "${it.runTimeHighThreshold}";
              var customStatuses = {
                  'PASSED':'PASSED',
                  'SKIPPED':'SKIPPED',
                  'FAILED':'FAILED',
                  'N/A':'N/A'
              }
          function generateCharts() {
          var chartType = {
          type: jQuery("#chartDataType").val(),
          line: jQuery('#linegraph').is(':checked'),
          bar: jQuery('#bargraph').is(':checked'),
          pie: jQuery('#piegraph').is(':checked')
          }
          generateChart(chartType);

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          }

          jQuery(document).ready(function () {
          jQuery("#allnoofbuilds")[0].checked = ${it.showAllBuilds};
          jQuery("#show-build-durations")[0].checked = ${it.showBuildTime};
          jQuery("#hide-config-methods")[0].checked = ${it.hideConfigurationMethods};
          jQuery("#linegraph")[0].checked = ${it.showLineGraph};
          jQuery("#bargraph")[0].checked = ${it.showBarGraph};
          jQuery("#piegraph")[0].checked = ${it.showPieGraph};
          jQuery("#noofbuilds").attr('disabled', ${it.showAllBuilds});

          if ("${it.chartDataType}" === "runtime") {
          jQuery("#chartDataType").val("runtime");
          jQuery("#bargraph").attr('disabled', true);
          } else {
          jQuery("#chartDataType").val("passfail");
          }
          setCustomStatuses();
          populateTemplate();
          });

          jQuery("#settingsmenubutton").click(function () {
          jQuery("#settingsmenu").slideToggle(400, function () {
          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          jQuery("#allnoofbuilds").change(function () {
          jQuery("#noofbuilds").attr('disabled', this.checked);
          });

          jQuery("#chartDataType").change(function (e) {
          jQuery("#bargraph").attr('disabled', e.target.value == "runtime");
          });

          jQuery("#downloadCSV").click(function () {
          var noOfBuilds = "-1";

                  if (!jQuery("#allnoofbuilds").is(":checked")) {
                      noOfBuilds = jQuery("#noofbuilds").val();
                  }
                  remoteAction.getExportCSV(displayValues, noOfBuilds, function(t) {
                      download("Test Results.csv", t.responseObject());
                  })
              });

          jQuery("#getbuildreport").click(function () {
          populateTemplate();
          });

          jQuery("#expandall").click(function () {
          expandAll();
          });

          jQuery("#collapseall").click(function () {
          collapseAll();
          });

              function setCustomStatuses(){
                  customStatuses['PASSED'] = "${it.passedRepresentation}";
                  customStatuses['SKIPPED'] = "${it.skippedRepresentation}";
                  customStatuses['FAILED'] = "${it.failedRepresentation}";
                  customStatuses['N/A'] = "${it.naRepresentation}";
              }

          function download(filename, text) {
          var element = document.createElement('a');
          element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
          element.setAttribute('download', filename);
          element.style.display = 'none';
          document.body.appendChild(element);
          element.click();
          document.body.removeChild(element);
          }
          </script>
          ----

          == Inline Event Handler
          Line: 84
          ----
          <input id="filter" class="table-filter" type="text" placeholder="Test/Class/Package" onkeyup="searchTests()"/>
          ----

          == Inline Script Block
          Line: 19
          ----
          <script>

          var $j = jQuery.noConflict();
          </script>
          ----

          == Inline Script Block
          Line: 128
          ----
          <script>
          var runtimeLowThreshold = "${it.runTimeLowThreshold}";
          var runtimeHighThreshold = "${it.runTimeHighThreshold}";
              var customStatuses = {
                  'PASSED':'PASSED',
                  'SKIPPED':'SKIPPED',
                  'FAILED':'FAILED',
                  'N/A':'N/A'
              }
          function generateCharts() {
          var chartType = {
          type: jQuery("#chartDataType").val(),
          line: jQuery('#linegraph').is(':checked'),
          bar: jQuery('#bargraph').is(':checked'),
          pie: jQuery('#piegraph').is(':checked')
          }
          generateChart(chartType);

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          }

          jQuery(document).ready(function () {
          jQuery("#allnoofbuilds")[0].checked = ${it.showAllBuilds};
          jQuery("#show-build-durations")[0].checked = ${it.showBuildTime};
          jQuery("#hide-config-methods")[0].checked = ${it.hideConfigurationMethods};
          jQuery("#linegraph")[0].checked = ${it.showLineGraph};
          jQuery("#bargraph")[0].checked = ${it.showBarGraph};
          jQuery("#piegraph")[0].checked = ${it.showPieGraph};
          jQuery("#noofbuilds").attr('disabled', ${it.showAllBuilds});

          if ("${it.chartDataType}" === "runtime") {
          jQuery("#chartDataType").val("runtime");
          jQuery("#bargraph").attr('disabled', true);
          } else {
          jQuery("#chartDataType").val("passfail");
          }
          setCustomStatuses();
          populateTemplate();
          });

          jQuery("#settingsmenubutton").click(function () {
          jQuery("#settingsmenu").slideToggle(400, function () {
          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          jQuery("#allnoofbuilds").change(function () {
          jQuery("#noofbuilds").attr('disabled', this.checked);
          });

          jQuery("#chartDataType").change(function (e) {
          jQuery("#bargraph").attr('disabled', e.target.value == "runtime");
          });

          jQuery("#downloadCSV").click(function () {
          var noOfBuilds = "-1";

                  if (!jQuery("#allnoofbuilds").is(":checked")) {
                      noOfBuilds = jQuery("#noofbuilds").val();
                  }
                  remoteAction.getExportCSV(displayValues, noOfBuilds, function(t) {
                      download("Test Results.csv", t.responseObject());
                  })
              });

          jQuery("#getbuildreport").click(function () {
          populateTemplate();
          });

          jQuery("#expandall").click(function () {
          expandAll();
          });

          jQuery("#collapseall").click(function () {
          collapseAll();
          });

              function setCustomStatuses(){
                  customStatuses['PASSED'] = "${it.passedRepresentation}";
                  customStatuses['SKIPPED'] = "${it.skippedRepresentation}";
                  customStatuses['FAILED'] = "${it.failedRepresentation}";
                  customStatuses['N/A'] = "${it.naRepresentation}";
              }

          function download(filename, text) {
          var element = document.createElement('a');
          element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
          element.setAttribute('download', filename);
          element.style.display = 'none';
          document.body.appendChild(element);
          element.click();
          document.body.removeChild(element);
          }
          </script>
          ----

          == Inline Event Handler
          Line: 84
          ----
          <input id="filter" class="table-filter" type="text" placeholder="Test/Class/Package" onkeyup="searchTests()"/>
          ----
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          New: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 19
          ----
          <script>

          var $j = jQuery.noConflict();
          </script>
          ----

          == Inline Script Block
          Line: 128
          ----
          <script>
          var runtimeLowThreshold = "${it.runTimeLowThreshold}";
          var runtimeHighThreshold = "${it.runTimeHighThreshold}";
              var customStatuses = {
                  'PASSED':'PASSED',
                  'SKIPPED':'SKIPPED',
                  'FAILED':'FAILED',
                  'N/A':'N/A'
              }
          function generateCharts() {
          var chartType = {
          type: jQuery("#chartDataType").val(),
          line: jQuery('#linegraph').is(':checked'),
          bar: jQuery('#bargraph').is(':checked'),
          pie: jQuery('#piegraph').is(':checked')
          }
          generateChart(chartType);

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          }

          jQuery(document).ready(function () {
          jQuery("#allnoofbuilds")[0].checked = ${it.showAllBuilds};
          jQuery("#show-build-durations")[0].checked = ${it.showBuildTime};
          jQuery("#hide-config-methods")[0].checked = ${it.hideConfigurationMethods};
          jQuery("#linegraph")[0].checked = ${it.showLineGraph};
          jQuery("#bargraph")[0].checked = ${it.showBarGraph};
          jQuery("#piegraph")[0].checked = ${it.showPieGraph};
          jQuery("#noofbuilds").attr('disabled', ${it.showAllBuilds});

          if ("${it.chartDataType}" === "runtime") {
          jQuery("#chartDataType").val("runtime");
          jQuery("#bargraph").attr('disabled', true);
          } else {
          jQuery("#chartDataType").val("passfail");
          }
          setCustomStatuses();
          populateTemplate();
          });

          jQuery("#settingsmenubutton").click(function () {
          jQuery("#settingsmenu").slideToggle(400, function () {
          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          jQuery("#allnoofbuilds").change(function () {
          jQuery("#noofbuilds").attr('disabled', this.checked);
          });

          jQuery("#chartDataType").change(function (e) {
          jQuery("#bargraph").attr('disabled', e.target.value == "runtime");
          });

          jQuery("#downloadCSV").click(function () {
          var noOfBuilds = "-1";

                  if (!jQuery("#allnoofbuilds").is(":checked")) {
                      noOfBuilds = jQuery("#noofbuilds").val();
                  }
                  remoteAction.getExportCSV(displayValues, noOfBuilds, function(t) {
                      download("Test Results.csv", t.responseObject());
                  })
              });

          jQuery("#getbuildreport").click(function () {
          populateTemplate();
          });

          jQuery("#expandall").click(function () {
          expandAll();
          });

          jQuery("#collapseall").click(function () {
          collapseAll();
          });

              function setCustomStatuses(){
                  customStatuses['PASSED'] = "${it.passedRepresentation}";
                  customStatuses['SKIPPED'] = "${it.skippedRepresentation}";
                  customStatuses['FAILED'] = "${it.failedRepresentation}";
                  customStatuses['N/A'] = "${it.naRepresentation}";
              }

          function download(filename, text) {
          var element = document.createElement('a');
          element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
          element.setAttribute('download', filename);
          element.style.display = 'none';
          document.body.appendChild(element);
          element.click();
          document.body.removeChild(element);
          }
          </script>
          ----

          == Inline Event Handler
          Line: 84
          ----
          <input id="filter" class="table-filter" type="text" placeholder="Test/Class/Package" onkeyup="searchTests()"/>
          ----
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          Summary Original: [test-results-analyzer] Extract inline script blocks and event handlers in org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly New: [test-results-analyzer] Extract inline script blocks and event handler in org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly
          Basil Crow made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 19
          ----
          <script>

          var $j = jQuery.noConflict();
          </script>
          ----

          == Inline Script Block
          Line: 128
          ----
          <script>
          var runtimeLowThreshold = "${it.runTimeLowThreshold}";
          var runtimeHighThreshold = "${it.runTimeHighThreshold}";
              var customStatuses = {
                  'PASSED':'PASSED',
                  'SKIPPED':'SKIPPED',
                  'FAILED':'FAILED',
                  'N/A':'N/A'
              }
          function generateCharts() {
          var chartType = {
          type: jQuery("#chartDataType").val(),
          line: jQuery('#linegraph').is(':checked'),
          bar: jQuery('#bargraph').is(':checked'),
          pie: jQuery('#piegraph').is(':checked')
          }
          generateChart(chartType);

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          }

          jQuery(document).ready(function () {
          jQuery("#allnoofbuilds")[0].checked = ${it.showAllBuilds};
          jQuery("#show-build-durations")[0].checked = ${it.showBuildTime};
          jQuery("#hide-config-methods")[0].checked = ${it.hideConfigurationMethods};
          jQuery("#linegraph")[0].checked = ${it.showLineGraph};
          jQuery("#bargraph")[0].checked = ${it.showBarGraph};
          jQuery("#piegraph")[0].checked = ${it.showPieGraph};
          jQuery("#noofbuilds").attr('disabled', ${it.showAllBuilds});

          if ("${it.chartDataType}" === "runtime") {
          jQuery("#chartDataType").val("runtime");
          jQuery("#bargraph").attr('disabled', true);
          } else {
          jQuery("#chartDataType").val("passfail");
          }
          setCustomStatuses();
          populateTemplate();
          });

          jQuery("#settingsmenubutton").click(function () {
          jQuery("#settingsmenu").slideToggle(400, function () {
          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          jQuery("#allnoofbuilds").change(function () {
          jQuery("#noofbuilds").attr('disabled', this.checked);
          });

          jQuery("#chartDataType").change(function (e) {
          jQuery("#bargraph").attr('disabled', e.target.value == "runtime");
          });

          jQuery("#downloadCSV").click(function () {
          var noOfBuilds = "-1";

                  if (!jQuery("#allnoofbuilds").is(":checked")) {
                      noOfBuilds = jQuery("#noofbuilds").val();
                  }
                  remoteAction.getExportCSV(displayValues, noOfBuilds, function(t) {
                      download("Test Results.csv", t.responseObject());
                  })
              });

          jQuery("#getbuildreport").click(function () {
          populateTemplate();
          });

          jQuery("#expandall").click(function () {
          expandAll();
          });

          jQuery("#collapseall").click(function () {
          collapseAll();
          });

              function setCustomStatuses(){
                  customStatuses['PASSED'] = "${it.passedRepresentation}";
                  customStatuses['SKIPPED'] = "${it.skippedRepresentation}";
                  customStatuses['FAILED'] = "${it.failedRepresentation}";
                  customStatuses['N/A'] = "${it.naRepresentation}";
              }

          function download(filename, text) {
          var element = document.createElement('a');
          element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
          element.setAttribute('download', filename);
          element.style.display = 'none';
          document.body.appendChild(element);
          element.click();
          document.body.removeChild(element);
          }
          </script>
          ----

          == Inline Event Handler
          Line: 84
          ----
          <input id="filter" class="table-filter" type="text" placeholder="Test/Class/Package" onkeyup="searchTests()"/>
          ----
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          New: h1. Note

          *While testing this plugin, evaluate whether the third-party libraries in {{src/main/webapp/js/libs}} are compatible with CSP in restrictive mode. The libraries may call {{{}eval{}}}, which is not allowed in restrictive mode.*

          h4. Problems

          {noformat}
          == Inline Script Block
          Line: 19
          ----
          <script>

          var $j = jQuery.noConflict();
          </script>
          ----

          == Inline Script Block
          Line: 128
          ----
          <script>
          var runtimeLowThreshold = "${it.runTimeLowThreshold}";
          var runtimeHighThreshold = "${it.runTimeHighThreshold}";
              var customStatuses = {
                  'PASSED':'PASSED',
                  'SKIPPED':'SKIPPED',
                  'FAILED':'FAILED',
                  'N/A':'N/A'
              }
          function generateCharts() {
          var chartType = {
          type: jQuery("#chartDataType").val(),
          line: jQuery('#linegraph').is(':checked'),
          bar: jQuery('#bargraph').is(':checked'),
          pie: jQuery('#piegraph').is(':checked')
          }
          generateChart(chartType);

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          }

          jQuery(document).ready(function () {
          jQuery("#allnoofbuilds")[0].checked = ${it.showAllBuilds};
          jQuery("#show-build-durations")[0].checked = ${it.showBuildTime};
          jQuery("#hide-config-methods")[0].checked = ${it.hideConfigurationMethods};
          jQuery("#linegraph")[0].checked = ${it.showLineGraph};
          jQuery("#bargraph")[0].checked = ${it.showBarGraph};
          jQuery("#piegraph")[0].checked = ${it.showPieGraph};
          jQuery("#noofbuilds").attr('disabled', ${it.showAllBuilds});

          if ("${it.chartDataType}" === "runtime") {
          jQuery("#chartDataType").val("runtime");
          jQuery("#bargraph").attr('disabled', true);
          } else {
          jQuery("#chartDataType").val("passfail");
          }
          setCustomStatuses();
          populateTemplate();
          });

          jQuery("#settingsmenubutton").click(function () {
          jQuery("#settingsmenu").slideToggle(400, function () {
          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          //fixes Jenkins issue where page content is not correctly placed until the window is resized
          window.dispatchEvent(new Event('resize'));
          });

          jQuery("#allnoofbuilds").change(function () {
          jQuery("#noofbuilds").attr('disabled', this.checked);
          });

          jQuery("#chartDataType").change(function (e) {
          jQuery("#bargraph").attr('disabled', e.target.value == "runtime");
          });

          jQuery("#downloadCSV").click(function () {
          var noOfBuilds = "-1";

                  if (!jQuery("#allnoofbuilds").is(":checked")) {
                      noOfBuilds = jQuery("#noofbuilds").val();
                  }
                  remoteAction.getExportCSV(displayValues, noOfBuilds, function(t) {
                      download("Test Results.csv", t.responseObject());
                  })
              });

          jQuery("#getbuildreport").click(function () {
          populateTemplate();
          });

          jQuery("#expandall").click(function () {
          expandAll();
          });

          jQuery("#collapseall").click(function () {
          collapseAll();
          });

              function setCustomStatuses(){
                  customStatuses['PASSED'] = "${it.passedRepresentation}";
                  customStatuses['SKIPPED'] = "${it.skippedRepresentation}";
                  customStatuses['FAILED'] = "${it.failedRepresentation}";
                  customStatuses['N/A'] = "${it.naRepresentation}";
              }

          function download(filename, text) {
          var element = document.createElement('a');
          element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
          element.setAttribute('download', filename);
          element.style.display = 'none';
          document.body.appendChild(element);
          element.click();
          document.body.removeChild(element);
          }
          </script>
          ----

          == Inline Event Handler
          Line: 84
          ----
          <input id="filter" class="table-filter" type="text" placeholder="Test/Class/Package" onkeyup="searchTests()"/>
          ----
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          Yaroslav Afenkin made changes -
          Assignee New: Yaroslav Afenkin [ yafenkin ]
          Yaroslav Afenkin made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Yaroslav Afenkin made changes -
          Remote Link New: This issue links to "jenkinsci/test-results-analyzer-plugin/pull/122 (Web Link)" [ 30453 ]
          Yaroslav Afenkin made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

            yafenkin Yaroslav Afenkin
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: