From 7de1e3a6be2a5838eef5add48c23a910916eff12 Mon Sep 17 00:00:00 2001 From: Yaroslav Afenkin <91559310+yaroslavafenkin@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:40:19 +0200 Subject: [PATCH] [JENKINS-74111][JENKINS-74112][JENKINS-74113][JENKINS-74114] Make plugin CSP compatible --- .../rayh/DeveloperProfileLoader/config.jelly | 15 +++------------ .../au/com/rayh/ExportIpa/config.jelly | 18 +++++------------- .../com/rayh/KeychainUnlockStep/config.jelly | 15 +++------------ .../au/com/rayh/XCodeBuilder/config.jelly | 18 +++++------------- .../au/com/rayh/show-hide-attr-input.js | 15 +++++++++++++++ 5 files changed, 31 insertions(+), 50 deletions(-) create mode 100644 src/main/resources/au/com/rayh/show-hide-attr-input.js diff --git a/src/main/resources/au/com/rayh/DeveloperProfileLoader/config.jelly b/src/main/resources/au/com/rayh/DeveloperProfileLoader/config.jelly index c0d93401..c6ff4d77 100644 --- a/src/main/resources/au/com/rayh/DeveloperProfileLoader/config.jelly +++ b/src/main/resources/au/com/rayh/DeveloperProfileLoader/config.jelly @@ -23,17 +23,7 @@ ~ THE SOFTWARE. --> - - - - ]]> + @@ -59,7 +49,8 @@ - ${%none} (${%specify one below}) diff --git a/src/main/resources/au/com/rayh/ExportIpa/config.jelly b/src/main/resources/au/com/rayh/ExportIpa/config.jelly index d1d55704..7caa1758 100644 --- a/src/main/resources/au/com/rayh/ExportIpa/config.jelly +++ b/src/main/resources/au/com/rayh/ExportIpa/config.jelly @@ -23,17 +23,7 @@ ~ THE SOFTWARE. --> - - - - ]]> + @@ -41,7 +31,8 @@ - ${%none} (${%specify one below}) @@ -208,7 +199,8 @@ - ${%none} (${%specify one below}) diff --git a/src/main/resources/au/com/rayh/KeychainUnlockStep/config.jelly b/src/main/resources/au/com/rayh/KeychainUnlockStep/config.jelly index efaa8665..a57c527b 100644 --- a/src/main/resources/au/com/rayh/KeychainUnlockStep/config.jelly +++ b/src/main/resources/au/com/rayh/KeychainUnlockStep/config.jelly @@ -23,17 +23,7 @@ ~ THE SOFTWARE. --> - - - - ]]> + @@ -46,7 +36,8 @@ - ${%none} (${%specify one below}) diff --git a/src/main/resources/au/com/rayh/XCodeBuilder/config.jelly b/src/main/resources/au/com/rayh/XCodeBuilder/config.jelly index b96a5125..7e1fb616 100644 --- a/src/main/resources/au/com/rayh/XCodeBuilder/config.jelly +++ b/src/main/resources/au/com/rayh/XCodeBuilder/config.jelly @@ -23,17 +23,7 @@ ~ THE SOFTWARE. --> - - - - ]]> + @@ -41,7 +31,8 @@ - ${%none} (${%specify one below}) @@ -280,7 +271,8 @@ - ${%none} (${%specify one below}) diff --git a/src/main/resources/au/com/rayh/show-hide-attr-input.js b/src/main/resources/au/com/rayh/show-hide-attr-input.js new file mode 100644 index 00000000..a161a2a7 --- /dev/null +++ b/src/main/resources/au/com/rayh/show-hide-attr-input.js @@ -0,0 +1,15 @@ +if (window["showOrHideAttributeInput"] === undefined) { + window.showOrHideAttributeInput = (prefix, uuid) => { + const defaultChosen = (document.getElementById(prefix + uuid).selectedIndex == 0); + + document.getElementById("" + uuid).style.display = defaultChosen ? "block" : "none"; + }; +} + +Behaviour.specify("SELECT.xcode-show-hide-attr-input", "xcode-show-hide-attr-input", 0, (element) => { + element.addEventListener("change", (event) => { + const { prefix, uuid } = event.target.dataset; + + showOrHideAttributeInput(prefix, uuid); + }); +});