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

[deployer-framework] Extract inline script block and event handler in com/cloudbees/plugins/deployer/DeployNowRunAction/configure.jelly

XMLWordPrintable

      Problems

      == Inline Script Block
      Line: 83
      ----
      <script type="text/javascript">
                      x = 60;
                      function countdown() {
                        if (x > 1) {
                          x--;
                          document.getElementById("autoDeploy").innerHTML = x;
                          r = setTimeout("countdown()", 1000);
                        }
                        else {
                          clearTimeout(r);
                          document.getElementById("autoDeploy").innerHTML = 0;
                          if (document.forms["deploy"].onsubmit &amp;&amp; !document.forms["deploy"].onsubmit()) {
                            return;
                          }
                          document.forms["deploy"].submit();
                        }
                      }
      
                      r = setTimeout("countdown()", 1000);
                    </script>
      ----
      
      == Inline Event Handler
      Line: 78
      ----
      <a href="#"
                         onclick="clearTimeout(r); document.getElementById('autoDeployContainer').innerHTML=''; return false;">
      ----
      

      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: