Skip to content

Commit

Permalink
Merge pull request #257 from NeetigyaPod/feat/remove-inline-handlers-…
Browse files Browse the repository at this point in the history
…validate

feat:remove-inline onclick handlers for validate button
  • Loading branch information
jtnord authored Oct 25, 2023
2 parents 87184d4 + cfd6552 commit bd1a491
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@
<div style="float:right" class="ldap-validate-section">
<span class="yui-button">
<span>
<button id="${uid}" type="button" name="${name}" class="ldap-validate-button"
onclick="ldapValidateButton('${descriptor.descriptorFullUrl}/${method}','${attrs.filter}',this,'${uid}'); return false;">
<span class="ldap-validate-button-reference-holder" data-id="${uid}" data-fullurl="${descriptor.descriptorFullUrl}/${method}" data-attributes="${attrs.filter}"/>
<button id="${uid}" type="button" name="${name}" class="ldap-validate-button">
${title}
</button>
<st:adjunct includes="jenkins.security.plugins.ldap.validation.validateButton"/>
</span>
</span>
<div id="${uid}_div" style="display:none;" class="ldap-validate-form">
Expand All @@ -68,7 +69,9 @@
<div id="${uid}_dialog">
<d:invokeBody/>
<f:entry>
<input type="submit" name="Validate" value="${attrs.submit}" class="ldap-validate submit-button primary" onclick="return false;"/>
<span class="ldap-validate-input-button-reference-holder"/>
<input id="ldap-validate-input" type="submit" name="Validate" value="${attrs.submit}" class="ldap-validate submit-button primary"/>
<st:adjunct includes="jenkins.security.plugins.ldap.validation.validateButtonOnClick"/>
</f:entry>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Behaviour.specify(".ldap-validate-button-reference-holder", 'ldap-validate', 0, function (e) {
var url = e.getAttribute('data-fullurl');
var attr = e.getAttribute('data-attributes')
var id = e.getAttribute('data-id');
var button = document.getElementById(id);
button.onclick = function(el) {
ldapValidateButton(url,attr,this,id);
return false;
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

Behaviour.specify(".ldap-validate-input-button-reference-holder", 'ldap-validate', 0, function (e) {
var validateinp = document.getElementById("ldap-validate-input");
validateinp.onclick = function(el) {
return false;
}
});

0 comments on commit bd1a491

Please sign in to comment.