From f968532e31a7af547498f3ef6b13f71069e03ee1 Mon Sep 17 00:00:00 2001 From: shlomomdahan <64103471+shlomomdahan@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:17:37 -0500 Subject: [PATCH 1/3] remove inline JS script and legacy onClick handler --- .../resources/hudson/plugins/plot/PlotReport/index.jelly | 8 ++------ .../hudson/plugins/plot/PlotReport/jump-to-plot.js | 8 ++++++++ 2 files changed, 10 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..586fe6e --- /dev/null +++ b/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js @@ -0,0 +1,8 @@ +document.addEventListener('DOMContentLoaded', function () { + const plotSelector = document.querySelector('.plot-selector'); + if (plotSelector) { + plotSelector.addEventListener('change', function () { + window.location.hash = this.value; + }); + } +}); From b7637da0a5510f7a13d707c711369b60badfa347 Mon Sep 17 00:00:00 2001 From: shlomomdahan <64103471+shlomomdahan@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:49:47 -0500 Subject: [PATCH 2/3] remove inline JS script and legacy onClick handler --- .../hudson/plugins/plot/PlotReport/jump-to-plot.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 index 586fe6e..2f137f1 100644 --- a/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js +++ b/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js @@ -1,8 +1,6 @@ -document.addEventListener('DOMContentLoaded', function () { +document.addEventListener('DOMContentLoaded', function() { const plotSelector = document.querySelector('.plot-selector'); - if (plotSelector) { - plotSelector.addEventListener('change', function () { - window.location.hash = this.value; - }); - } -}); + plotSelector.addEventListener('change', function(e) { + window.location.hash = e.target.value; + }); +}); \ No newline at end of file From 0f6c63e62530ac6897a138e457856c8a31ece710 Mon Sep 17 00:00:00 2001 From: shlomomdahan <64103471+shlomomdahan@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:50:23 -0500 Subject: [PATCH 3/3] remove inline JS script and legacy onClick handler --- .../resources/hudson/plugins/plot/PlotReport/jump-to-plot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 2f137f1..25f13b1 100644 --- a/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js +++ b/src/main/resources/hudson/plugins/plot/PlotReport/jump-to-plot.js @@ -3,4 +3,4 @@ document.addEventListener('DOMContentLoaded', function() { plotSelector.addEventListener('change', function(e) { window.location.hash = e.target.value; }); -}); \ No newline at end of file +});