-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-60866] Advanced button, build health, confirmation link, URI…
… encoding monitor (#5515) Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
- Loading branch information
1 parent
c9926fe
commit 791447a
Showing
11 changed files
with
51 additions
and
48 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
core/src/main/resources/jenkins/diagnostics/URICheckEncodingMonitor/adjunct.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('#URICheckEncodingMonitor-message', 'URICheckEncodingMonitor', 0, function(element) { | ||
var url = element.getAttribute('data-url'); | ||
var params = {value : '\u57f7\u4e8b'}; | ||
var checkAjax = new Ajax.Updater( | ||
'URICheckEncodingMonitor-message', url, | ||
{ | ||
method: 'get', parameters: params | ||
} | ||
); | ||
}); |
13 changes: 2 additions & 11 deletions
13
core/src/main/resources/jenkins/diagnostics/URICheckEncodingMonitor/message.jelly
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 |
---|---|---|
@@ -1,16 +1,7 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> | ||
<j:if test="${it.checkEnabled}"> | ||
<script> | ||
var url="${rootURL}/${it.url}/checkURIEncoding"; | ||
var params = {value : '\u57f7\u4e8b'}; | ||
var checkAjax = new Ajax.Updater( | ||
'message', url, | ||
{ | ||
method: 'get', parameters: params | ||
} | ||
); | ||
</script> | ||
<span id="message"></span> | ||
<div id="URICheckEncodingMonitor-message" data-url="${rootURL}/${it.url}/checkURIEncoding"/> | ||
<st:adjunct includes="jenkins.diagnostics.URICheckEncodingMonitor.adjunct"/> | ||
</j:if> | ||
</j:jelly> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Behaviour.specify('.Behaviour-validateButton', 'Behaviour-validateButton', 0, function(element) { | ||
element.onclick = function() { safeValidateButton(this); }; | ||
}); |
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
18 changes: 18 additions & 0 deletions
18
core/src/main/resources/lib/layout/confirmationLink/adjunct.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,18 @@ | ||
Behaviour.specify("A.confirmation-link", 'confirmation-link', 0, function (element) { | ||
element.onclick = function(event) { | ||
var post = element.getAttribute('data-post'); | ||
var href = element.getAttribute('data-url'); | ||
var message = element.getAttribute('data-message'); | ||
if (confirm(message)) { | ||
var form = document.createElement('form'); | ||
form.setAttribute('method', (post === "true") ? 'POST' : 'GET'); | ||
form.setAttribute('action', href); | ||
if (post) { | ||
crumb.appendToForm(form); | ||
} | ||
document.body.appendChild(form); | ||
form.submit(); | ||
} | ||
return false; | ||
}; | ||
}); |
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