-
Task
-
Resolution: Unresolved
-
Minor
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
[JENKINS-74327] [dropdown-viewstabbar-plugin] Extract inline script blocks and event handler in hudson/views/tabbar/DropDownViewsTabBar/viewTabs.jelly
Description |
Original:
h4. Problems {noformat} == Inline Event Handler Line: 47 ---- <select id="selectView" onChange="javascript:selectViewOnChange();"> ---- == 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();"> ---- == 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> ---- {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: 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();"> ---- {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] |
Summary | Original: [dropdown-viewstabbar-plugin] Extract inline script blocks and event handlers in hudson/views/tabbar/DropDownViewsTabBar/viewTabs.jelly | New: [dropdown-viewstabbar-plugin] Extract inline script blocks and event handler in hudson/views/tabbar/DropDownViewsTabBar/viewTabs.jelly |