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

[jobConfigHistory] Extract inline script blocks and event handlers in hudson/plugins/jobConfigHistory/JobConfigHistoryProjectAction/showDiffFiles.jelly

XMLWordPrintable

    • 1283.veb_dfb_00b_5ec0

      Problems

      == Inline Script Block
      Line: 12
      ----
      <script>hljs.initHighlightingOnLoad();</script>
      ----
      
      == Inline Script Block
      Line: 65
      ----
      <script>
                      var showVersionDiffsJs = true;
      
                      function toggleShowHideVersionDiffsJs(hideText, showText) {
                        showVersionDiffsJs = !showVersionDiffsJs;
                        if (showVersionDiffsJs === true) {
                          document.getElementById("tbody_versionDiffsShown").style.display = '';
                          document.getElementById("tbody_versionDiffsHidden").style.display = 'none';
      
                          document.getElementById("showHideVersionDiffsJsButton").value = hideText;
      
                        } else {
                          document.getElementById("tbody_versionDiffsShown").style.display = 'none';
                          document.getElementById("tbody_versionDiffsHidden").style.display = '';
      
                          document.getElementById("showHideVersionDiffsJsButton").value = showText;
                        }
                      }
                    </script>
      ----
      
      == Inline Event Handler
      Line: 88
      ----
      <input id="showHideVersionDiffsJsButton" class="small-button" type="button" value="${%Hide Version Changes}" onClick="toggleShowHideVersionDiffsJs('${hideTextStr}', '${showTextStr}');"/>
      

      Solutions

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

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

              Created:
              Updated:
              Resolved: