diff --git a/src/main/resources/hudson/views/OtherViewsFilter/config.jelly b/src/main/resources/hudson/views/OtherViewsFilter/config.jelly index a45257e..d1aebca 100644 --- a/src/main/resources/hudson/views/OtherViewsFilter/config.jelly +++ b/src/main/resources/hudson/views/OtherViewsFilter/config.jelly @@ -6,7 +6,10 @@ - + + + + \ No newline at end of file diff --git a/src/main/resources/hudson/views/RegExJobFilter/config.jelly b/src/main/resources/hudson/views/RegExJobFilter/config.jelly index 0a0c723..38f9757 100644 --- a/src/main/resources/hudson/views/RegExJobFilter/config.jelly +++ b/src/main/resources/hudson/views/RegExJobFilter/config.jelly @@ -3,12 +3,12 @@ xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project"> - +
- ${%Job name} ${%Job folder name} ${%Job description} @@ -19,7 +19,7 @@ ${%Node label expression}
-
+
@@ -36,4 +36,5 @@
+ \ No newline at end of file diff --git a/src/main/resources/hudson/views/RegExJobFilter/nameOptions.js b/src/main/resources/hudson/views/RegExJobFilter/nameOptions.js new file mode 100644 index 0000000..d1bf4b6 --- /dev/null +++ b/src/main/resources/hudson/views/RegExJobFilter/nameOptions.js @@ -0,0 +1,6 @@ +Behaviour.specify(".vjf-regex-select", "vjf-regex-select", 0, function (e) { + e.addEventListener("change", function () { + const nameOptions = e.closest(".valueType").querySelector(".nameOptions"); + nameOptions.classList.toggle("jenkins-hidden", !e.options[e.selectedIndex].value.match(/NAME/)) + }); +}); diff --git a/src/main/resources/hudson/views/UnclassifiedJobsFilter/config.jelly b/src/main/resources/hudson/views/UnclassifiedJobsFilter/config.jelly index 803beb3..80259fa 100644 --- a/src/main/resources/hudson/views/UnclassifiedJobsFilter/config.jelly +++ b/src/main/resources/hudson/views/UnclassifiedJobsFilter/config.jelly @@ -5,9 +5,12 @@ + + +
- +
diff --git a/src/main/resources/hudson/views/UserRelevanceFilter/config.jelly b/src/main/resources/hudson/views/UserRelevanceFilter/config.jelly index 907eeff..a2dcab0 100644 --- a/src/main/resources/hudson/views/UserRelevanceFilter/config.jelly +++ b/src/main/resources/hudson/views/UserRelevanceFilter/config.jelly @@ -29,31 +29,11 @@
+ class="showOrHideBuildOptions"/>
-
-
- + class="showOrHideBuildOptions"/>
@@ -66,7 +46,5 @@
- + \ No newline at end of file diff --git a/src/main/resources/hudson/views/UserRelevanceFilter/showOptions.js b/src/main/resources/hudson/views/UserRelevanceFilter/showOptions.js new file mode 100644 index 0000000..58a6f4c --- /dev/null +++ b/src/main/resources/hudson/views/UserRelevanceFilter/showOptions.js @@ -0,0 +1,23 @@ +function showOrHideBuildOptions(elem) { + var jobFilter = elem.closest('[name="jobFilters"]'); + var matchBuilder = jobFilter.querySelector('[name="matchBuilder"]'); + var matchScmChanges = jobFilter.querySelector('[name="matchScmChanges"]'); + + var tr2 = jobFilter.querySelector('[name="buildCountTypeString"]').parentElement.parentElement.parentElement; + var tr3 = jobFilter.querySelector('[name="amountTypeString"]').parentElement.parentElement.parentElement; + + if (matchBuilder.checked || matchScmChanges.checked) { + tr2.classList.remove("jenkins-hidden"); + tr3.classList.remove("jenkins-hidden"); + } else { + tr2.classList.add("jenkins-hidden"); + tr3.classList.add("jenkins-hidden"); + } +} + +Behaviour.specify(".showOrHideBuildOptions", "showOrHideBuildOptions", 0, function (element) { + element.addEventListener("click", function () { + showOrHideBuildOptions(element); + }); + showOrHideBuildOptions(element); +});