Skip to content

Commit 8cf0893

Browse files
authored
Make dependency on YUI optional (#226)
1 parent 84c6455 commit 8cf0893

File tree

2 files changed

+23
-18
lines changed
  • src/main
    • resources/com/hcl/appscan/jenkins/plugin/builders/AppScanEnterpriseBuildStep
    • webapp/js

2 files changed

+23
-18
lines changed

src/main/resources/com/hcl/appscan/jenkins/plugin/builders/AppScanEnterpriseBuildStep/config.jelly

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<f:section title="${%label.job.properties}" field="loginTypeOptions">
2222
<f:entry title="${%label.template}" field="template">
2323
<f:textbox placeholder="${%template.placeholder}"
24+
data-maxsuggestions="99999"
2425
style="background: white url('${resURL}${%search.icon.url}') no-repeat 99% center;
2526
background-size: 16px;" />
2627
</f:entry>
@@ -30,15 +31,17 @@
3031
</f:entry>
3132

3233
<f:entry title="${%label.folder}" field="folder">
33-
<f:textbox placeholder="${%folder.placeholder}"
34+
<f:textbox placeholder="${%folder.placeholder}"
35+
data-maxsuggestions="99999"
3436
style="background: white url('${resURL}${%search.icon.url}') no-repeat 99% center;
3537
background-size: 16px;" />
3638
</f:entry>
3739

3840
<f:entry title="${%label.application}" field="application">
39-
<f:textbox placeholder="${%application.placeholder}"
40-
style="background: white url('${resURL}${%search.icon.url}') no-repeat 99% center;
41-
background-size: 16px;" />
41+
<f:textbox placeholder="${%application.placeholder}"
42+
data-maxsuggestions="99999"
43+
style="background: white url('${resURL}${%search.icon.url}') no-repeat 99% center;
44+
background-size: 16px;" />
4245
</f:entry>
4346

4447
<f:entry title="${%label.test.policy}" field="testPolicy">

src/main/webapp/js/util.js

+16-14
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,22 @@ function aseWaitClicked(e) {
8888
}
8989
}
9090

91-
/*
92-
* Overridable method called before autocomplete container is loaded with result data.
93-
* This method is overridden to dynamically change the autocomplete result list size
94-
* @param sQuery {String} Original request.
95-
* @param oResponse {Object} Response object.
96-
* @param oPayload {MIXED} (optional) Additional argument(s)
97-
* @return {Boolean} Return true to continue loading data, false to cancel.
98-
99-
*/
100-
YAHOO.widget.AutoComplete.prototype.doBeforeLoadData = function (sQuery, oResponse, oPayload) {
101-
if (oResponse.results.length != 0) {
102-
YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = oResponse.results.length;
103-
}
104-
return true;
91+
if (window.YAHOO) {
92+
/*
93+
* Fix for the YUI-based autocomplete field, not needed since Jenkins 2.473.
94+
* Overridable method called before autocomplete container is loaded with result data.
95+
* This method is overridden to dynamically change the autocomplete result list size
96+
* @param sQuery {String} Original request.
97+
* @param oResponse {Object} Response object.
98+
* @param oPayload {MIXED} (optional) Additional argument(s)
99+
* @return {Boolean} Return true to continue loading data, false to cancel.
100+
*/
101+
YAHOO.widget.AutoComplete.prototype.doBeforeLoadData = function (sQuery, oResponse, oPayload) {
102+
if (oResponse.results.length != 0) {
103+
YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = oResponse.results.length;
104+
}
105+
return true;
106+
}
105107
}
106108

107109
function resetFields(credentialElement) {

0 commit comments

Comments
 (0)