Skip to content

Commit

Permalink
Merge branch 'develop_2.0' into fix-1109
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Apr 15, 2015
2 parents e666485 + 3c6d4ff commit 3441403
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/main/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@
/*
var apiKey = "myApiKeyXXXX123456789";
$('#input_apiKey').val(apiKey);
addApiKeyAuthorization();
*/

window.swaggerUi.load();

// Add authorization if auth input is not empty
if ($('#input_apiKey').val().length) {
addApiKeyAuthorization();
}

function log() {
if ('console' in window) {
console.log.apply(console, arguments);
Expand Down
9 changes: 4 additions & 5 deletions src/main/javascript/view/OperationView.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
// Note: This is compiled code
// TODO: Refactor
handleFileUpload: function(map, form) {
var bodyParam, el, headerParams, l, len, len1, len2, len3, m, n, o, obj, p, param, params, ref1, ref2, ref3, ref4;
var bodyParam, el, headerParams, l, len, len1, len2, len3, m, n, o, p, param, params, ref1, ref2, ref3, ref4;
ref1 = form.serializeArray();
for (l = 0, len = ref1.length; l < len; l++) {
o = ref1[l];
Expand Down Expand Up @@ -363,7 +363,9 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), delete headerParams['Content-Type'], this.model.urlify(map, false)) : this.model.urlify(map, true);
$('.request_url', $(this.el)).html('<pre></pre>');
$('.request_url pre', $(this.el)).text(this.invocationUrl);
obj = {

// TODO: don't use jQuery. Use SwaggerJS for handling the call.
var obj = {
type: this.model.method,
url: this.invocationUrl,
headers: headerParams,
Expand All @@ -387,9 +389,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
};
})(this)
};
if (window.authorizations) {
window.authorizations.apply(obj);
}
jQuery.ajax(obj);
return false;
// end of file-upload nastiness
Expand Down

0 comments on commit 3441403

Please sign in to comment.