From 66867ef3796692e2f6fd3315c3be5abcae4d37ad Mon Sep 17 00:00:00 2001 From: Shlomo Dahan <64103471+shlomomdahan@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:16:31 -0500 Subject: [PATCH 1/2] [JENKINS-74057] Extract inline script block in `BuildCardExtension/buildCardHelpers.jelly` (#146) --- .../build-card-script-helpers.js | 7 +++++++ .../BuildCardExtension/buildCardHelpers.jelly | 14 +------------- 2 files changed, 8 insertions(+), 13 deletions(-) create mode 100644 src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-script-helpers.js diff --git a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-script-helpers.js b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-script-helpers.js new file mode 100644 index 00000000..22ca1121 --- /dev/null +++ b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-script-helpers.js @@ -0,0 +1,7 @@ +Handlebars.registerHelper('startScript', function() { + return new Handlebars.SafeString(""); +}); diff --git a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardHelpers.jelly b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardHelpers.jelly index 2bf013e3..6e20ffe1 100644 --- a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardHelpers.jelly +++ b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardHelpers.jelly @@ -7,17 +7,5 @@ By default we just include helpers to append script tags to your build card --> - - Handlebars.registerHelper('startScript', function() { - return new Handlebars.SafeString(""); - }); - - Handlebars.registerHelper('endScript', function() { - return new Handlebars.SafeString(""); - }); - - - ]]> + \ No newline at end of file From f2ceaf66e49670a8cf34b14a84b7be9b2a4f2054 Mon Sep 17 00:00:00 2001 From: Shlomo Dahan <64103471+shlomomdahan@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:21:10 -0500 Subject: [PATCH 2/2] [JENKINS-74055] Extract inline script block in `BuildPipelineView/main_dashboard.jelly` (#149) --- .../BuildPipelineView/main_dashboard.jelly | 13 +------------ .../BuildPipelineView/toggle-build-details.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/toggle-build-details.js diff --git a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/main_dashboard.jelly b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/main_dashboard.jelly index 32108a49..f0c0b8e7 100755 --- a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/main_dashboard.jelly +++ b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/main_dashboard.jelly @@ -2,16 +2,5 @@ - + diff --git a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/toggle-build-details.js b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/toggle-build-details.js new file mode 100644 index 00000000..52da9aa0 --- /dev/null +++ b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/toggle-build-details.js @@ -0,0 +1,10 @@ +// show/hide build details +jQuery(document).ready(function() { + jQuery(".header").click(function() { + var parent = jQuery(this).parent(); + var ba = parent.find(".build-actions"); + var bb = parent.find(".build-body"); + + ba.add(bb).toggle('slow'); + }); +});