Merge branch 'bodnia-issue-1745-changes'
This commit is contained in:
125
dist/swagger-ui.js
vendored
125
dist/swagger-ui.js
vendored
File diff suppressed because one or more lines are too long
18
dist/swagger-ui.min.js
vendored
18
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -14,7 +14,6 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
this.router = opts.router;
|
||||
|
||||
document.addEventListener('click', this.onLinkClick, true);
|
||||
// Sort APIs
|
||||
if (opts.swaggerOptions.apisSorter) {
|
||||
sorterOption = opts.swaggerOptions.apisSorter;
|
||||
@@ -84,6 +83,12 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
render: function () {
|
||||
$(this.el).html(Handlebars.templates.main(this.model));
|
||||
this.info = this.$('.info')[0];
|
||||
|
||||
if (this.info) {
|
||||
this.info.addEventListener('click', this.onLinkClick, true);
|
||||
}
|
||||
|
||||
this.model.securityDefinitions = this.model.securityDefinitions || {};
|
||||
|
||||
// Render each resource
|
||||
@@ -136,11 +141,10 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
onLinkClick: function (e) {
|
||||
var el = e.target;
|
||||
if (el.tagName === 'A' && el.href) {
|
||||
if (location.hostname !== el.hostname || location.port !== el.port) {
|
||||
|
||||
if (el.tagName === 'A' && el.href && !el.target) {
|
||||
e.preventDefault();
|
||||
window.open(el.href, '_blank');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<p>{{externalDocs.description}}</p>
|
||||
<a href="{{externalDocs.url}}" target="_blank">{{externalDocs.url}}</a>
|
||||
{{/if}}
|
||||
{{#if info.termsOfServiceUrl}}<div class="info_tos"><a href="{{info.termsOfServiceUrl}}" data-sw-translate>Terms of service</a></div>{{/if}}
|
||||
{{#if info.termsOfServiceUrl}}<div class="info_tos"><a target="_blank" href="{{info.termsOfServiceUrl}}" data-sw-translate>Terms of service</a></div>{{/if}}
|
||||
{{#if info.contact.name}}<div class='info_name' data-sw-translate>Created by {{info.contact.name}}</div>{{/if}}
|
||||
{{#if info.contact.url}}<div class='info_url' data-sw-translate>See more at <a href="{{info.contact.url}}">{{info.contact.url}}</a></div>{{/if}}
|
||||
{{#if info.contact.email}}<div class='info_email'><a target="_parent" href="mailto:{{info.contact.email}}?subject={{info.title}}" data-sw-translate>Contact the developer</a></div>{{/if}}
|
||||
{{#if info.license}}<div class='info_license'><a href='{{info.license.url}}'>{{info.license.name}}</a></div>{{/if}}
|
||||
{{#if info.license}}<div class='info_license'><a target="_blank" href='{{info.license.url}}'>{{info.license.name}}</a></div>{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class='container' id='resources_container'>
|
||||
@@ -24,7 +24,7 @@
|
||||
, <span style="font-variant: small-caps" data-sw-translate>api version</span>: {{info.version}}
|
||||
{{/if}}]
|
||||
{{#if validatorUrl}}
|
||||
<span style="float:right"><a href="{{validatorUrl}}/debug?url={{url}}"><img id="validator" src="{{validatorUrl}}?url={{url}}"></a>
|
||||
<span style="float:right"><a target="_blank" href="{{validatorUrl}}/debug?url={{url}}"><img id="validator" src="{{validatorUrl}}?url={{url}}"></a>
|
||||
</span>
|
||||
{{/if}}
|
||||
</h4>
|
||||
|
||||
Reference in New Issue
Block a user