merged
This commit is contained in:
13
dist/swagger-ui.js
vendored
13
dist/swagger-ui.js
vendored
File diff suppressed because one or more lines are too long
4
dist/swagger-ui.min.js
vendored
4
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -687,6 +687,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
|
|
||||||
var pre;
|
var pre;
|
||||||
var code;
|
var code;
|
||||||
|
var skipHighlight = false;
|
||||||
if (!content) {
|
if (!content) {
|
||||||
code = $('<code />').text('no content');
|
code = $('<code />').text('no content');
|
||||||
pre = $('<pre class="json" />').append(code);
|
pre = $('<pre class="json" />').append(code);
|
||||||
@@ -721,6 +722,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
var responseFilename = /filename=([^;]*);?/.exec(disposition);
|
var responseFilename = /filename=([^;]*);?/.exec(disposition);
|
||||||
if(responseFilename !== null && responseFilename.length > 1) {
|
if(responseFilename !== null && responseFilename.length > 1) {
|
||||||
download = responseFilename[1];
|
download = responseFilename[1];
|
||||||
|
fileName = download;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -729,6 +731,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
a.innerText = 'Download ' + fileName;
|
a.innerText = 'Download ' + fileName;
|
||||||
|
|
||||||
pre = $('<div/>').append(a);
|
pre = $('<div/>').append(a);
|
||||||
|
skipHighlight = true;
|
||||||
} else {
|
} else {
|
||||||
pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).');
|
pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).');
|
||||||
}
|
}
|
||||||
@@ -804,7 +807,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
|||||||
|
|
||||||
var response_body_el = $('.response_body', $(this.el))[0];
|
var response_body_el = $('.response_body', $(this.el))[0];
|
||||||
// only highlight the response if response is less than threshold, default state is highlight response
|
// only highlight the response if response is less than threshold, default state is highlight response
|
||||||
if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold) {
|
if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold || skipHighlight) {
|
||||||
return response_body_el;
|
return response_body_el;
|
||||||
} else {
|
} else {
|
||||||
return hljs.highlightBlock(response_body_el);
|
return hljs.highlightBlock(response_body_el);
|
||||||
|
|||||||
Reference in New Issue
Block a user