This commit is contained in:
Tony Tam
2015-07-22 18:14:18 -07:00
6 changed files with 12 additions and 8 deletions

1
dist/index.html vendored
View File

@@ -47,6 +47,7 @@
if(typeof initOAuth == "function") { if(typeof initOAuth == "function") {
initOAuth({ initOAuth({
clientId: "your-client-id", clientId: "your-client-id",
clientSecret: "your-client-secret",
realm: "your-realms", realm: "your-realms",
appName: "your-app-name" appName: "your-app-name"
}); });

View File

@@ -5,6 +5,7 @@ var clientId;
var realm; var realm;
var oauth2KeyName; var oauth2KeyName;
var redirect_uri; var redirect_uri;
var clientSecret;
function handleLogin() { function handleLogin() {
var scopes = []; var scopes = [];
@@ -185,6 +186,7 @@ function initOAuth(opts) {
popupMask = (o.popupMask||$('#api-common-mask')); popupMask = (o.popupMask||$('#api-common-mask'));
popupDialog = (o.popupDialog||$('.api-popup-dialog')); popupDialog = (o.popupDialog||$('.api-popup-dialog'));
clientId = (o.clientId||errors.push('missing client id')); clientId = (o.clientId||errors.push('missing client id'));
clientSecret = (o.clientSecret||errors.push('missing client secret'));
realm = (o.realm||errors.push('missing realm')); realm = (o.realm||errors.push('missing realm'));
if(errors.length > 0){ if(errors.length > 0){
@@ -207,6 +209,7 @@ function initOAuth(opts) {
window.processOAuthCode = function processOAuthCode(data) { window.processOAuthCode = function processOAuthCode(data) {
var params = { var params = {
'client_id': clientId, 'client_id': clientId,
'client_secret': clientSecret,
'code': data.code, 'code': data.code,
'grant_type': 'authorization_code', 'grant_type': 'authorization_code',
'redirect_uri': redirect_uri 'redirect_uri': redirect_uri

8
dist/swagger-ui.js vendored
View File

@@ -2,7 +2,7 @@
* swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API
* @version v2.1.0 * @version v2.1.0
* @link http://swagger.io * @link http://swagger.io
* @license Apache 2.0 * @license Apache-2.0
*/ */
(function(){this["Handlebars"] = this["Handlebars"] || {}; (function(){this["Handlebars"] = this["Handlebars"] || {};
this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {}; this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
@@ -533,7 +533,7 @@ this["Handlebars"]["templates"]["param_list"] = Handlebars.template({"1":functio
+ escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.valueId || (depth0 != null ? depth0.valueId : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"valueId","hash":{},"data":data}) : helper)))
+ "'>" + "'>"
+ escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper)))
+ "</labe></td>\n<td>\n <select "; + "</label></td>\n<td>\n <select ";
stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data})); stack1 = ((helpers.isArray || (depth0 && depth0.isArray) || helperMissing).call(depth0, depth0, {"name":"isArray","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}));
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
buffer += " class=\"parameter "; buffer += " class=\"parameter ";
@@ -30840,7 +30840,7 @@ window.SwaggerUi.Views = {};
}); });
} else if (typeof exports === 'object') { } else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but // Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports, // only CommonJS-like environments that support module.exports,
// like Node. // like Node.
module.exports = factory(require('b')); module.exports = factory(require('b'));
} else { } else {
@@ -31078,7 +31078,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
this.model.validatorUrl = null; this.model.validatorUrl = null;
} else { } else {
// Default validator // Default validator
if(window.location.protocol === 'https') { if(window.location.protocol === 'https:') {
this.model.validatorUrl = 'https://online.swagger.io/validator'; this.model.validatorUrl = 'https://online.swagger.io/validator';
} }
else { else {

File diff suppressed because one or more lines are too long

View File

@@ -257,7 +257,7 @@ window.SwaggerUi.Views = {};
}); });
} else if (typeof exports === 'object') { } else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but // Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports, // only CommonJS-like environments that support module.exports,
// like Node. // like Node.
module.exports = factory(require('b')); module.exports = factory(require('b'));
} else { } else {

View File

@@ -1,4 +1,4 @@
<td class='code{{#if required}} required{{/if}}'><label for='{{valueId}}'>{{name}}</labe></td> <td class='code{{#if required}} required{{/if}}'><label for='{{valueId}}'>{{name}}</label></td>
<td> <td>
<select {{#isArray this}} multiple="multiple"{{/isArray}} class="parameter {{#if required}} required {{/if}}" name="{{name}}" id="{{valueId}}"> <select {{#isArray this}} multiple="multiple"{{/isArray}} class="parameter {{#if required}} required {{/if}}" name="{{name}}" id="{{valueId}}">