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

XMLWordPrintable

      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

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

              Created:
              Updated: