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

[dropdown-viewstabbar-plugin] Extract inline script blocks and event handler in hudson/views/tabbar/DropDownViewsTabBar/viewTabs.jelly

XMLWordPrintable

      Problems

      == Inline Script Block
      Line: 27
      ----
      <script type="text/javascript">
          function selectViewOnChange()
          {
            var selectViewCurrentView = document.getElementById('selectView');
            if (selectViewCurrentView != null)
            {
              /* selectViewCurrentView.value == ${v.viewUrl} */
              var selectViewCurrentViewName = selectViewCurrentView.value;
              if (selectViewCurrentViewName != null )
              {
                if (selectViewCurrentViewName.length > 0)
                {
                  window.location.href = '${rootURL}/' + selectViewCurrentViewName;
                }
              }
            }
          }
        </script>
      ----
      
      == Inline Script Block
      Line: 74
      ----
      <script type="text/javascript">
            /* be nice and put focus on current view */
            var elementId = '${currentView.viewName}';
            var selectViewCurrentView = document.getElementById(elementId);
            if (selectViewCurrentView != null) { selectViewCurrentView.selected = true; }
          </script>
      ----
      
      == Inline Event Handler
      Line: 47
      ----
      <select id="selectView" onChange="javascript:selectViewOnChange();">
      ----
      

      Solutions

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

            Unassigned Unassigned
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: