From 166ccc22d73d8c8105bbb7824303391aaf44c4ad Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sat, 13 May 2023 00:11:01 +0200 Subject: [PATCH] Adapt build button to core changes --- .../dashboard/core/JobsPortlet/portlet.jelly | 50 ++++++++++--------- .../core/JobsPortlet/portlet.properties | 5 ++ .../core/JobsPortlet/portlet_ja.properties | 26 ++-------- .../core/UnstableJobsPortlet/portlet.jelly | 50 ++++++++++--------- .../UnstableJobsPortlet/portlet.properties | 5 ++ .../UnstableJobsPortlet/portlet_ja.properties | 28 ++--------- .../view/dashboard/core/buildbutton.js | 21 ++++++++ 7 files changed, 92 insertions(+), 93 deletions(-) create mode 100644 src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.properties create mode 100644 src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.properties create mode 100644 src/main/resources/hudson/plugins/view/dashboard/core/buildbutton.js diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly index afb239ab..a5e87a19 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly @@ -1,5 +1,11 @@ + - @@ -7,29 +13,27 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.properties b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.properties new file mode 100644 index 00000000..2b99208b --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.properties @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: \u00A9 2023 TobiX +# SPDX-License-Identifier: MIT +Task_scheduled={0} scheduled +Schedule_a_task=Schedule a {1} for {0} +Schedule_a_task_with_parameters=Schedule a {1} with parameters for {0} diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet_ja.properties b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet_ja.properties index 725bba7c..12b92cb5 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet_ja.properties +++ b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet_ja.properties @@ -1,23 +1,3 @@ -# The MIT License -# -# Copyright (c) 2012, Seiji Sogabe -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Schedule\ a\ build=\u30d3\u30eb\u30c9\u5b9f\u884c +# SPDX-FileCopyrightText: \u00A9 2012 Seiji Sogabe +# SPDX-License-Identifier: MIT +Schedule_a_task=\u30D3\u30EB\u30C9\u5B9F\u884C diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly index 1f8c9169..e38cd006 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly @@ -1,5 +1,11 @@ + - @@ -17,29 +23,27 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.properties b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.properties new file mode 100644 index 00000000..2b99208b --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.properties @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: \u00A9 2023 TobiX +# SPDX-License-Identifier: MIT +Task_scheduled={0} scheduled +Schedule_a_task=Schedule a {1} for {0} +Schedule_a_task_with_parameters=Schedule a {1} with parameters for {0} diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet_ja.properties b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet_ja.properties index 91c2c663..df2f47b8 100755 --- a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet_ja.properties +++ b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet_ja.properties @@ -1,24 +1,4 @@ -# The MIT License -# -# Copyright (c) 2004-2010, Sun Microsystems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -No\ unstable\ jobs=\u4e0d\u5b89\u5b9a\u30d3\u30eb\u30c9\u306a\u3057 -Schedule\ a\ build=\u30d3\u30eb\u30c9\u5b9f\u884c +# SPDX-FileCopyrightText: \u00A9 2012 Seiji Sogabe +# SPDX-License-Identifier: MIT +No\ unstable\ jobs=\u4E0D\u5B89\u5B9A\u30D3\u30EB\u30C9\u306A\u3057 +Schedule_a_task=\u30D3\u30EB\u30C9\u5B9F\u884C diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/buildbutton.js b/src/main/resources/hudson/plugins/view/dashboard/core/buildbutton.js new file mode 100644 index 00000000..a954f499 --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/core/buildbutton.js @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: © 2023 TobiX +// SPDX-License-Identifier: MIT + +Behaviour.specify( + ".dashboard-view-job-portlet-build-button", + "build-button", + 0, + function (e) { + var url = e.getAttribute("href"); + var message = e.getAttribute("data-notification"); + + e.onclick = function () { + fetch(url, { + method: "post", + headers: crumb.wrap({}), + }); + hoverNotification(message, this, -100); + return false; + }; + } +);