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

[xpath-config-viewer] Extract inline script block in WEB-INF/classes/org/jenkinsci/plugins/viewer/XPathConfigViewerPlugin/index.jelly

XMLWordPrintable

      Problem

      == Inline Script Block
      Line: 28
      ----
      <script type="text/javascript">
              function toggleAll(action) {
                  var xmlBlocks = [];
                  <j:forEach var="provider" items="${it.providers}">
                      <j:forEach var="conf" items="${provider.allConfigs}">
                          <util:replace value="${conf.id}" var="classId" old="." new="_" />
                  xmlBlocks.push("${classId}"); 
                      </j:forEach>
                  </j:forEach>
                  
                  if(action == "hide") {
                      for(var i = 0; i &lt; xmlBlocks.length; i++) {
                          $$("." + xmlBlocks[i]).each(Element.hide);
                          $$("." + xmlBlocks[i] + "a").each(Element.show);
                      }
                  } else {
                      for(var i = 0; i &lt; xmlBlocks.length; i++) {
                          $$("." + xmlBlocks[i] + "a").each(Element.hide);
                          $$("." + xmlBlocks[i]).each(Element.show);
                      }
                  }                        
              }
              
              
          </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: