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

[custom-job-icon] Extract inline script blocks in WEB-INF/classes/jenkins/plugins/jobicon/CustomIconProperty/global.jelly

      Problems

      == Inline Script Block
      Line: 31
      ----
      <script>
            document.getElementById("refresh-icons").addEventListener("click", function(e) {
                var div = document.getElementById("icons-table").parentNode;
                new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/globalIconsTable", {
                  onSuccess: function(rsp) {
                    var table = document.getElementById("icons-table");
                    div.removeChild(table);
                    div.innerHTML = rsp.responseText;
                  }
                });
              });
          </script>
      ----
      
      == Inline Script Block
      Line: 43
      ----
      <script>
            function deleteIcon(id) {
              var div = document.getElementById("icons-table").parentNode;
              if (confirm("${%Delete this icon?}")) {
                new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/deleteIcon?icon=" + id, {
                  onSuccess: function(rsp) {
                    var table = document.getElementById("icons-table");
                    div.removeChild(table);
                    div.innerHTML = rsp.responseText;
                  }
                });
              }
            }
          </script>
      ----
      

      Solution

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

          [JENKINS-74307] [custom-job-icon] Extract inline script blocks in WEB-INF/classes/jenkins/plugins/jobicon/CustomIconProperty/global.jelly

          Basil Crow created issue -
          Basil Crow made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 31
          ----
          <script>
                document.getElementById("refresh-icons").addEventListener("click", function(e) {
                    var div = document.getElementById("icons-table").parentNode;
                    new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/globalIconsTable", {
                      onSuccess: function(rsp) {
                        var table = document.getElementById("icons-table");
                        div.removeChild(table);
                        div.innerHTML = rsp.responseText;
                      }
                    });
                  });
              </script>
          ----

          == Inline Script Block
          Line: 43
          ----
          <script>
                function deleteIcon(id) {
                  var div = document.getElementById("icons-table").parentNode;
                  if (confirm("${%Delete this icon?}")) {
                    new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/deleteIcon?icon=" + id, {
                      onSuccess: function(rsp) {
                        var table = document.getElementById("icons-table");
                        div.removeChild(table);
                        div.innerHTML = rsp.responseText;
                      }
                    });
                  }
                }
              </script>
          ----

          == Inline Script Block
          Line: 31
          ----
          <script>
                document.getElementById("refresh-icons").addEventListener("click", function(e) {
                    var div = document.getElementById("icons-table").parentNode;
                    new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/globalIconsTable", {
                      onSuccess: function(rsp) {
                        var table = document.getElementById("icons-table");
                        div.removeChild(table);
                        div.innerHTML = rsp.responseText;
                      }
                    });
                  });
              </script>
          ----

          == Inline Script Block
          Line: 43
          ----
          <script>
                function deleteIcon(id) {
                  var div = document.getElementById("icons-table").parentNode;
                  if (confirm("${%Delete this icon?}")) {
                    new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/deleteIcon?icon=" + id, {
                      onSuccess: function(rsp) {
                        var table = document.getElementById("icons-table");
                        div.removeChild(table);
                        div.innerHTML = rsp.responseText;
                      }
                    });
                  }
                }
              </script>
          ----
          {noformat}

          h4. Solution

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

          {noformat}
          == Inline Script Block
          Line: 31
          ----
          <script>
                document.getElementById("refresh-icons").addEventListener("click", function(e) {
                    var div = document.getElementById("icons-table").parentNode;
                    new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/globalIconsTable", {
                      onSuccess: function(rsp) {
                        var table = document.getElementById("icons-table");
                        div.removeChild(table);
                        div.innerHTML = rsp.responseText;
                      }
                    });
                  });
              </script>
          ----

          == Inline Script Block
          Line: 43
          ----
          <script>
                function deleteIcon(id) {
                  var div = document.getElementById("icons-table").parentNode;
                  if (confirm("${%Delete this icon?}")) {
                    new Ajax.Request("/descriptor/jenkins.plugins.jobicon.CustomIconProperty/deleteIcon?icon=" + id, {
                      onSuccess: function(rsp) {
                        var table = document.getElementById("icons-table");
                        div.removeChild(table);
                        div.innerHTML = rsp.responseText;
                      }
                    });
                  }
                }
              </script>
          ----
          {noformat}

          h4. Solution

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

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

              Created:
              Updated: