-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-73969] [JENKINS-73970] Remove inline JavaScript to become CS…
…P compliant (#72)
- Loading branch information
1 parent
0c06a8e
commit 2c0a4dd
Showing
6 changed files
with
44 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/resources/hudson/views/RegExJobFilter/nameOptions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/)) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/resources/hudson/views/UserRelevanceFilter/showOptions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); |