Skip to content

Commit

Permalink
JENKINS-26556 fixing by not trying to overload @JavaScriptMethod methods
Browse files Browse the repository at this point in the history
anymore
  • Loading branch information
ghenzler committed Jan 24, 2015
1 parent 7bc6f8a commit 160d3c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Expand Up @@ -36,12 +36,12 @@ public String getContainerDivId() {
}

@JavaScriptMethod
public HttpResponse ajaxViaJenkins(String urlStr) {
public HttpResponse ajaxViaJenkinsWithoutAuth(String urlStr) {
return new ServerSideHttpCall(urlStr, null, null);
}

@JavaScriptMethod
public HttpResponse ajaxViaJenkins(String urlStr, String user, String pw) {
public HttpResponse ajaxViaJenkinsWithAuth(String urlStr, String user, String pw) {
return new ServerSideHttpCall(urlStr, user, pw);
}

Expand Down
Expand Up @@ -9,13 +9,21 @@

<script type="text/javascript">

new function(divId, rootUrl, ajaxViaJenkins) {
new function(divId, rootUrl, ajaxViaJenkinsWithoutAuth, ajaxViaJenkinsWithAuth) {
var ajaxViaJenkins = function() {
if(typeof arguments[1] === 'string') {
ajaxViaJenkinsWithAuth.apply(null, arguments);
} else {
ajaxViaJenkinsWithoutAuth.apply(null, arguments);
}
}

/// GENERIC JS CONTENT STARTS HERE

${it.javascript}

/// GENERIC JS CONTENT ENDS HERE
}("${it.containerDivId}", "${rootURL}", mashupPlugin_${it.id}.ajaxViaJenkins);
}("${it.containerDivId}", "${rootURL}", mashupPlugin_${it.id}.ajaxViaJenkinsWithoutAuth, mashupPlugin_${it.id}.ajaxViaJenkinsWithAuth);

</script>

Expand Down

0 comments on commit 160d3c7

Please sign in to comment.