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

[custom-folder-icon] Extract inline script block and event handlers in jenkins/plugins/foldericon/CustomFolderIcon/config.jelly

XMLWordPrintable

    • 2.15

      Problems

      == Inline Script Block
      Line: 57
      ----
      <script>
              // init the preview
              window.addEventListener("DOMContentLoaded", initCustomIcon());
          </script>
      ----
      
      == Inline Event Handler
      Line: 36
      ----
      <f:file id="custom-icon-upload" accept="image/*" onchange="setCustomIconFile(this.files[0])"
                          clazz="custom-icon jenkins-file-upload" />
      ----
      
      == Inline Event Handler
      Line: 39
      ----
      <input type="button" value="${%Apply}"
                         onclick="doUploadCustomIcon('${it.getUrl()}', '${%UploadSuccess}', '${%UploadFailed}')" />
      ----
      
      == Inline Event Handler
      Line: 47
      ----
      <img class="custom-icon-selection" src="${rootURL}/userContent/customFolderIcons/${icon}"
                               onclick="setCustomIcon(this.src)" />
      ----
      

      Solutions

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

            strangelookingnerd Daniel Krämer
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: