From 3e73a37988580cb0f3d1c1490e03557a1f9a560e Mon Sep 17 00:00:00 2001 From: Shlomo Dahan <64103471+shlomomdahan@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:45:35 -0500 Subject: [PATCH] [JENKINS-74098] Remove inline JS script and legacy onClick handler (#147) * remove inline JS script and legacy onClick handler * remove inline JS script and legacy onClick handler * remove inline JS script and legacy onClick handler --------- Co-authored-by: Mark Waite --- .../resources/hudson/plugins/plot/PlotReport/index.jelly | 8 ++------ .../hudson/plugins/plot/PlotReport/jump-to-plot.js | 6 ++++++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js diff --git a/src/main/resources/hudson/plugins/plot/PlotReport/index.jelly b/src/main/resources/hudson/plugins/plot/PlotReport/index.jelly index afbe59c..45a8752 100644 --- a/src/main/resources/hudson/plugins/plot/PlotReport/index.jelly +++ b/src/main/resources/hudson/plugins/plot/PlotReport/index.jelly @@ -70,12 +70,8 @@

${it.group}

- - ${%Jump to} diff --git a/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js b/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js new file mode 100644 index 0000000..25f13b1 --- /dev/null +++ b/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js @@ -0,0 +1,6 @@ +document.addEventListener('DOMContentLoaded', function() { + const plotSelector = document.querySelector('.plot-selector'); + plotSelector.addEventListener('change', function(e) { + window.location.hash = e.target.value; + }); +});