Merge remote-tracking branch 'upstream/develop_2.0' into JSONEditor
Conflicts: dist/swagger-ui.js dist/swagger-ui.min.js
This commit is contained in:
@@ -13,7 +13,7 @@ SwaggerUi.Views.HeaderView = Backbone.View.extend({
|
||||
|
||||
showPetStore: function(){
|
||||
this.trigger('update-swagger-ui', {
|
||||
url:'http://petstore.swagger.wordnik.com/api/api-docs'
|
||||
url:'http://petstore.swagger.io/v2/swagger.json'
|
||||
});
|
||||
},
|
||||
|
||||
@@ -52,4 +52,4 @@ SwaggerUi.Views.HeaderView = Backbone.View.extend({
|
||||
this.trigger('update-swagger-ui', {url:url});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
} else {
|
||||
|
||||
// Default validator
|
||||
this.model.validatorUrl = 'http://online.swagger.io/validator';
|
||||
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -352,7 +352,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];
|
||||
@@ -390,7 +390,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,
|
||||
@@ -414,9 +416,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
|
||||
@@ -621,6 +620,12 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
code = $('<code />').html(_.escape(content));
|
||||
pre = $('<pre class="xml" />').append(code);
|
||||
|
||||
// Plain Text
|
||||
} else if (/text\/plain/.test(contentType)) {
|
||||
code = $('<code />').text(content);
|
||||
pre = $('<pre class="plain" />').append(code);
|
||||
|
||||
|
||||
// Image
|
||||
} else if (/^image\//.test(contentType)) {
|
||||
pre = $('<img>').attr('src', url);
|
||||
|
||||
Reference in New Issue
Block a user