-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-73951][JENKINS-73952] Improve CSP compatibility (#321)
* [JENKINS-73952] Extract inline event handler from SubversionTagAction/tagForm.jelly * [JENKINS-73951] Extract event handler from SubversionSCM/DescriptorImpl/credentialOK.jelly * Fix adjunct name * Address review feedback
- Loading branch information
1 parent
2eba787
commit b8220b2
Showing
4 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
src/main/resources/hudson/scm/SubversionSCM/DescriptorImpl/credential-ok.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,5 @@ | ||
window.addEventListener("DOMContentLoaded", () => { | ||
document.querySelector(".svn-credential-ok-close").addEventListener("click", () => { | ||
window.close(); | ||
}); | ||
}); |
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
14 changes: 14 additions & 0 deletions
14
src/main/resources/hudson/scm/SubversionTagAction/svn-tagform-update-row.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,14 @@ | ||
// update the visual feedback depending on the checkbox state | ||
function updateRow(changeEvent) { | ||
const checkbox = changeEvent.target; | ||
checkbox.parentNode.parentNode.style.color = checkbox.checked ? "inherit" : "grey"; | ||
|
||
const index = checkbox.getAttribute("data-index"); | ||
document.querySelector(`input[name="name${index}"]`).disabled = !checkbox.checked; | ||
} | ||
|
||
window.addEventListener("DOMContentLoaded", () => { | ||
document.querySelectorAll(".svn-tagform-tag-checkbox").forEach((checkbox) => { | ||
checkbox.addEventListener("change", updateRow); | ||
}); | ||
}); |
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