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

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

    • 1283.veb_dfb_00b_5ec0

      Problems

      == Inline Script Block
      Line: 11
      ----
      <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: 87
      ----
      <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

          [JENKINS-74032] [jobConfigHistory] Extract inline script blocks and event handlers in hudson/plugins/jobConfigHistory/ComputerConfigHistoryAction/showDiffFiles.jelly

          Basil Crow created issue -
          Basil Crow made changes -
          Summary Original: [jobConfigHistory] Extract inline script blocks and lsevent handlers in hudson/plugins/jobConfigHistory/ComputerConfigHistoryAction/showDiffFiles.jelly New: [jobConfigHistory] Extract inline script blocks and event handlers in hudson/plugins/jobConfigHistory/ComputerConfigHistoryAction/showDiffFiles.jelly
          Yaroslav Afenkin made changes -
          Assignee New: Yaroslav Afenkin [ yafenkin ]
          Yaroslav Afenkin made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Yaroslav Afenkin made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 11
          ----
          <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: 87
          ----
          <input id="showHideVersionDiffsJsButton" class="small-button" type="button" value="${%Hide Version Changes}" onClick="toggleShowHideVersionDiffsJs('${hideTextStr}', '${showTextStr}');"/>
          ----

          == Inline Script Block
          Line: 11
          ----
          <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: 87
          ----
          <input id="showHideVersionDiffsJsButton" class="small-button" type="button" value="${%Hide Version Changes}" onClick="toggleShowHideVersionDiffsJs('${hideTextStr}', '${showTextStr}');"/>
          ----
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          New: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 11
          ----
          <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: 87
          ----
          <input id="showHideVersionDiffsJsButton" class="small-button" type="button" value="${%Hide Version Changes}" onClick="toggleShowHideVersionDiffsJs('${hideTextStr}', '${showTextStr}');"/>
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          Yaroslav Afenkin made changes -
          Remote Link New: This issue links to "jenkinsci/job-config-history-plugin/pull/343 (Web Link)" [ 30103 ]
          Yaroslav Afenkin made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Basil Crow made changes -
          Released As New: 1283.veb_dfb_00b_5ec0
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Closed [ 6 ]

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

              Created:
              Updated:
              Resolved: