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

[deploy-dashboard] Extract inline script block in org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly

      Problem

      == Inline Script Block
      Line: 137
      ----
      <script language="javascript">
                      function toggle(id) {
                          var modal = document.getElementById('popup_' + id);
                          var span = modal.querySelector('.close');
                          modal.style.display = 'block';
      
                          function close() {
                              modal.style.display = 'none';
                              span.removeEventListener('click', close);
                              window.removeEventListener('click', windowClose);
                          }
      
                          function windowClose(event) {
                              if (event.target === modal) {
                                  close()
                              }
                          }
      
                          window.addEventListener('click', windowClose);
                          span.addEventListener('click', close);
                      }
                  </script>
      ----
      

      Solution

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

          [JENKINS-74429] [deploy-dashboard] Extract inline script block in org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly

          Basil Crow created issue -
          Basil Crow made changes -
          Assignee Original: Vitalii Sydorenko [ vetal2409 ]
          Basil Crow made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 137
          ----
          <script language="javascript">
                          function toggle(id) {
                              var modal = document.getElementById('popup_' + id);
                              var span = modal.querySelector('.close');
                              modal.style.display = 'block';

                              function close() {
                                  modal.style.display = 'none';
                                  span.removeEventListener('click', close);
                                  window.removeEventListener('click', windowClose);
                              }

                              function windowClose(event) {
                                  if (event.target === modal) {
                                      close()
                                  }
                              }

                              window.addEventListener('click', windowClose);
                              span.addEventListener('click', close);
                          }
                      </script>
          ----

          == Inline Script Block
          Line: 137
          ----
          <script language="javascript">
                          function toggle(id) {
                              var modal = document.getElementById('popup_' + id);
                              var span = modal.querySelector('.close');
                              modal.style.display = 'block';

                              function close() {
                                  modal.style.display = 'none';
                                  span.removeEventListener('click', close);
                                  window.removeEventListener('click', windowClose);
                              }

                              function windowClose(event) {
                                  if (event.target === modal) {
                                      close()
                                  }
                              }

                              window.addEventListener('click', windowClose);
                              span.addEventListener('click', close);
                          }
                      </script>
          ----
          {noformat}

          h4. Solution

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

          {noformat}
          == Inline Script Block
          Line: 137
          ----
          <script language="javascript">
                          function toggle(id) {
                              var modal = document.getElementById('popup_' + id);
                              var span = modal.querySelector('.close');
                              modal.style.display = 'block';

                              function close() {
                                  modal.style.display = 'none';
                                  span.removeEventListener('click', close);
                                  window.removeEventListener('click', windowClose);
                              }

                              function windowClose(event) {
                                  if (event.target === modal) {
                                      close()
                                  }
                              }

                              window.addEventListener('click', windowClose);
                              span.addEventListener('click', close);
                          }
                      </script>
          ----
          {noformat}

          h4. Solution

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          Summary Original: [deploy-dashboard] Extract inline script blocks in org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly New: [deploy-dashboard] Extract inline script block in org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly

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

              Created:
              Updated: