From d6a6ad4f282db40def53d8c88f0185ab332f2d62 Mon Sep 17 00:00:00 2001 From: shlomomdahan <64103471+shlomomdahan@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:32:30 -0500 Subject: [PATCH 1/2] remove inline onClick handlers in PowershellBuildScript/config.jelly --- .../managedscripts/PowerShellBuildStep/config.jelly | 5 +++-- .../PowerShellBuildStep/powershell-build-step.js | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js diff --git a/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/config.jelly b/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/config.jelly index 114b7ab..13b8fe2 100644 --- a/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/config.jelly +++ b/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/config.jelly @@ -5,7 +5,8 @@ - view selected script + + @@ -13,7 +14,7 @@
- +
diff --git a/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js b/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js new file mode 100644 index 0000000..681fded --- /dev/null +++ b/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js @@ -0,0 +1,8 @@ +document.addEventListener("DOMContentLoaded", function () { + const scriptLink = document.querySelector(".powershell-script-window-link"); + + scriptLink.addEventListener("click", function (e) { + e.preventDefault(); + window.open(e.href, "window", "width=900,height=640,resizable,scrollbars,toolbar,menubar"); + }); +}); \ No newline at end of file From b58dd53058f4c1a81eb1706b794ea66b0a9678d5 Mon Sep 17 00:00:00 2001 From: Shlomo Dahan <64103471+shlomomdahan@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:50:00 -0500 Subject: [PATCH 2/2] Update powershell-build-step.js --- .../managedscripts/PowerShellBuildStep/powershell-build-step.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js b/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js index 681fded..ec22ac0 100644 --- a/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js +++ b/src/main/resources/org/jenkinsci/plugins/managedscripts/PowerShellBuildStep/powershell-build-step.js @@ -5,4 +5,4 @@ document.addEventListener("DOMContentLoaded", function () { e.preventDefault(); window.open(e.href, "window", "width=900,height=640,resizable,scrollbars,toolbar,menubar"); }); -}); \ No newline at end of file +});