Append swagger-auth global functions to window and don't break backward
This commit is contained in:
4
dist/lib/swagger-oauth.js
vendored
4
dist/lib/swagger-oauth.js
vendored
@@ -202,7 +202,7 @@ function initOAuth(opts) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function processOAuthCode(data) {
|
window.processOAuthCode = function processOAuthCode(data) {
|
||||||
var params = {
|
var params = {
|
||||||
'client_id': clientId,
|
'client_id': clientId,
|
||||||
'code': data.code,
|
'code': data.code,
|
||||||
@@ -225,7 +225,7 @@ function processOAuthCode(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onOAuthComplete(token) {
|
window.onOAuthComplete = function onOAuthComplete(token) {
|
||||||
if(token) {
|
if(token) {
|
||||||
if(token.error) {
|
if(token.error) {
|
||||||
var checkbox = $('input[type=checkbox],.secured')
|
var checkbox = $('input[type=checkbox],.secured')
|
||||||
|
|||||||
3
dist/swagger-ui.js
vendored
3
dist/swagger-ui.js
vendored
@@ -201,7 +201,8 @@ window.SwaggerUi = Backbone.Router.extend({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.SwaggerUi.Views = {};
|
window.SwaggerUi.Views = {};
|
||||||
|
|
||||||
this["Handlebars"] = this["Handlebars"] || {};
|
this["Handlebars"] = this["Handlebars"] || {};
|
||||||
this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
|
this["Handlebars"]["templates"] = this["Handlebars"]["templates"] || {};
|
||||||
this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
this["Handlebars"]["templates"]["apikey_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ function initOAuth(opts) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function processOAuthCode(data) {
|
window.processOAuthCode = function processOAuthCode(data) {
|
||||||
var params = {
|
var params = {
|
||||||
'client_id': clientId,
|
'client_id': clientId,
|
||||||
'code': data.code,
|
'code': data.code,
|
||||||
@@ -225,7 +225,7 @@ function processOAuthCode(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onOAuthComplete(token) {
|
window.onOAuthComplete = function onOAuthComplete(token) {
|
||||||
if(token) {
|
if(token) {
|
||||||
if(token.error) {
|
if(token.error) {
|
||||||
var checkbox = $('input[type=checkbox],.secured')
|
var checkbox = $('input[type=checkbox],.secured')
|
||||||
|
|||||||
@@ -83,6 +83,13 @@
|
|||||||
console.log.apply(console, arguments);
|
console.log.apply(console, arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't break backward compatibility with previous versions
|
||||||
|
window.authorizations = {
|
||||||
|
add: swaggerUi.api.clientAuthorizations.add
|
||||||
|
};
|
||||||
|
window.ApiKeyAuthorization = SwaggerClient.ApiKeyAuthorization;
|
||||||
|
window.PasswordAuthorization = SwaggerClient.PasswordAuthorization;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -195,4 +195,4 @@ window.SwaggerUi = Backbone.Router.extend({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.SwaggerUi.Views = {};
|
window.SwaggerUi.Views = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user