-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-73944] Extract inline event handler from
POSTHyperlinkNote
(…
- Loading branch information
1 parent
f8d41ac
commit dc0c358
Showing
2 changed files
with
11 additions
and
1 deletion.
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
10 changes: 10 additions & 0 deletions
10
.../resources/org/jenkinsci/plugins/workflow/support/steps/input/POSTHyperlinkNote/script.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,10 @@ | ||
Behaviour.specify("A.post-hyperlink-note-button", "POSTHyperLinkNote", 0, function (element) { | ||
element.addEventListener("click", (event) => { | ||
event.preventDefault(); | ||
const url = decodeURIComponent(atob(element.dataset.encodedUrl)); | ||
fetch(url, { | ||
method: "post", | ||
headers: crumb.wrap({}), | ||
}); | ||
}); | ||
}); |