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

[delivery-pipeline-plugin] Extract inline script block in se/diabol/jenkins/workflow/WorkflowPipelineView/main.jelly

XMLWordPrintable

      Problem

      == Inline Script Block
      Line: 66
      ----
      <script type="text/javascript">
                      function pipeline${it.id == null ? 0 : it.id}(pipelineid, viewUrl) {
      
                      var pipelineContainers = [];
                      var jsplumb = jsPlumb.getInstance();
                      jsPlumbUtilityVariable.push(jsplumb);
      
                      <j:forEach begin="1" end="${it.noOfColumns}" indexVar="i">
                          pipelineContainers.push('pipelines-${i}-' + pipelineid);
                      </j:forEach>
      
                      var view = { "viewUrl" : viewUrl };
      
                      var pipelineutils = new pipelineUtils();
      
                      pipelineutils.updatePipelines(pipelineContainers, "pipelineerror-" + pipelineid, view, ${fullscreen}, ${page}, ${component}, ${it.isShowChanges()},
      
                      <j:choose>
                          <j:when test="it.getAggregatedChangesGroupingPattern()">
                              /${it.getAggregatedChangesGroupingPattern()}/g
                          </j:when>
                          <j:otherwise>null</j:otherwise>
                      </j:choose>,
                      ${it.updateInterval * 1000}, ${it.id == null ? 0 : it.id}, jsplumb);
      
                      Q(window).resize(function () {
                          jsplumb.repaintEverything();
                      });
                      }
                      var jsPlumbUtilityVariable;
                      Q(document).ready(function() {
                          if ( undefined === jsPlumbUtilityVariable ) {
                              jsPlumbUtilityVariable = [];
                          }
                          var itpipeline${it.id == null ? 0 : it.id} = new
                          pipeline${it.id == null ? 0 : it.id}('${it.id == null ? 0 : it.id}', '${it.getViewUrl()}');
                      });
                  </script>
      ----
      

      Solution

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

            yafenkin Yaroslav Afenkin
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: