merged with master
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- '0.10'
|
- '4.2'
|
||||||
- '0.12'
|
|
||||||
install:
|
install:
|
||||||
- export DISPLAY=:99.0
|
- export DISPLAY=:99.0
|
||||||
- sh -e /etc/init.d/xvfb start
|
- sh -e /etc/init.d/xvfb start
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ This will start Swagger UI at `http://localhost:8080`.
|
|||||||
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.io/v2/swagger.json) service and show its APIs. You can enter your own server url and click explore to view the API.
|
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.io/v2/swagger.json) service and show its APIs. You can enter your own server url and click explore to view the API.
|
||||||
|
|
||||||
### Customize
|
### Customize
|
||||||
You may choose to customize Swagger UI for your organization. Here is an overview of whats in its various directories:
|
You may choose to customize Swagger UI for your organization. Here is an overview of what's in its various directories:
|
||||||
|
|
||||||
- dist: Contains a distribution which you can deploy on a server or load from your local machine.
|
- dist: Contains a distribution which you can deploy on a server or load from your local machine.
|
||||||
- dist/lang: The swagger localization
|
- dist/lang: The swagger localization
|
||||||
|
|||||||
10
dist/swagger-ui.js
vendored
10
dist/swagger-ui.js
vendored
@@ -250,7 +250,8 @@ Handlebars.registerHelper('sanitize', function(html) {
|
|||||||
|
|
||||||
Handlebars.registerHelper('renderTextParam', function(param) {
|
Handlebars.registerHelper('renderTextParam', function(param) {
|
||||||
var result, type = 'text', idAtt = '';
|
var result, type = 'text', idAtt = '';
|
||||||
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple;
|
var paramType = param.type || param.schema.type || '';
|
||||||
|
var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple;
|
||||||
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
|
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
|
||||||
|
|
||||||
var dataVendorExtensions = Object.keys(param).filter(function(property) {
|
var dataVendorExtensions = Object.keys(param).filter(function(property) {
|
||||||
@@ -24888,9 +24889,10 @@ SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({
|
|||||||
'click #apply_basic_auth' : 'applyPassword'
|
'click #apply_basic_auth' : 'applyPassword'
|
||||||
},
|
},
|
||||||
|
|
||||||
applyPassword: function(){
|
applyPassword: function(event){
|
||||||
var username = $('.input_username').val();
|
event.preventDefault();
|
||||||
var password = $('.input_password').val();
|
var username = $('#input_username').val();
|
||||||
|
var password = $('#input_password').val();
|
||||||
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
|
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
|
||||||
this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
|
this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
|
||||||
this.router.load();
|
this.router.load();
|
||||||
|
|||||||
16
dist/swagger-ui.min.js
vendored
16
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
2
index.js
2
index.js
@@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var pack = require('./package');
|
var pack = require('./package');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ Handlebars.registerHelper('sanitize', function(html) {
|
|||||||
|
|
||||||
Handlebars.registerHelper('renderTextParam', function(param) {
|
Handlebars.registerHelper('renderTextParam', function(param) {
|
||||||
var result, type = 'text', idAtt = '';
|
var result, type = 'text', idAtt = '';
|
||||||
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple;
|
var paramType = param.type || param.schema.type || '';
|
||||||
|
var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple;
|
||||||
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
|
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
|
||||||
|
|
||||||
var dataVendorExtensions = Object.keys(param).filter(function(property) {
|
var dataVendorExtensions = Object.keys(param).filter(function(property) {
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({
|
|||||||
'click #apply_basic_auth' : 'applyPassword'
|
'click #apply_basic_auth' : 'applyPassword'
|
||||||
},
|
},
|
||||||
|
|
||||||
applyPassword: function(){
|
applyPassword: function(event){
|
||||||
var username = $('.input_username').val();
|
event.preventDefault();
|
||||||
var password = $('.input_password').val();
|
var username = $('#input_username').val();
|
||||||
|
var password = $('#input_password').val();
|
||||||
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
|
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
|
||||||
this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
|
this.router.api.clientAuthorizations.add(this.model.type, basicAuth);
|
||||||
this.router.load();
|
this.router.load();
|
||||||
|
|||||||
Reference in New Issue
Block a user