diff --git a/dist/css/print.css b/dist/css/print.css index 9470571f..32bf0c86 100644 --- a/dist/css/print.css +++ b/dist/css/print.css @@ -184,6 +184,7 @@ .swagger-section .swagger-ui-wrap { line-height: 1; font-family: "Droid Sans", sans-serif; + min-width: 760px; max-width: 960px; margin-left: auto; margin-right: auto; @@ -1180,18 +1181,122 @@ } .swagger-section .oauth_submit { text-align: center; + display: inline-block; +} +.swagger-section .authorize-wrapper { + margin: 15px 0 10px; +} +.swagger-section .authorize-wrapper_operation { + float: right; +} +.swagger-section .authorize__btn:hover { + text-decoration: underline; + cursor: pointer; +} +.swagger-section .authorize__btn_operation:hover .authorize-scopes { + display: block; +} +.swagger-section .authorize-scopes { + position: absolute; + margin-top: 20px; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section .authorize-scopes .authorize__scope { + text-decoration: none; +} +.swagger-section .authorize__btn_operation { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons.png) no-repeat; +} +.swagger-section .authorize__btn_operation_login { + background-position: 0 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .authorize__btn_operation_logout { + background-position: -30px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section #auth_container { + color: #fff; + display: inline-block; + border: none; + padding: 5px; + width: 87px; + height: 13px; +} +.swagger-section #auth_container .authorize__btn { + color: #fff; +} +.swagger-section .auth_container { + padding: 0 0 10px; + margin-bottom: 5px; + border-bottom: solid 1px #CCC; + font-size: 0.9em; +} +.swagger-section .auth_container .auth__title { + color: #547f00; + font-size: 1.2em; +} +.swagger-section .auth_container .basic_auth__label { + display: inline-block; + width: 60px; +} +.swagger-section .auth_container .auth__description { + color: #999999; + margin-bottom: 5px; +} +.swagger-section .auth_container .auth__button { + margin-top: 10px; + height: 30px; +} +.swagger-section .auth_container .key_auth__field { + margin: 5px 0; +} +.swagger-section .auth_container .key_auth__label { + display: inline-block; + width: 60px; } .swagger-section .api-popup-dialog { - z-index: 10000; position: absolute; + display: none; +} +.swagger-section .api-popup-dialog-wrapper { + z-index: 1000; width: 500px; background: #FFF; padding: 20px; border: 1px solid #ccc; border-radius: 5px; - display: none; font-size: 13px; color: #777; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.swagger-section .api-popup-dialog-shadow { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0.2; + background-color: gray; + z-index: 900; } .swagger-section .api-popup-dialog .api-popup-title { font-size: 24px; @@ -1205,6 +1310,10 @@ padding-left: 5px; padding-bottom: 5px; } +.swagger-section .api-popup-dialog .api-popup-content { + max-height: 500px; + overflow-y: auto; +} .swagger-section .api-popup-dialog .api-popup-authbtn { height: 30px; } diff --git a/dist/css/screen.css b/dist/css/screen.css index 9fbd283b..90a93a2d 100644 --- a/dist/css/screen.css +++ b/dist/css/screen.css @@ -184,6 +184,7 @@ .swagger-section .swagger-ui-wrap { line-height: 1; font-family: "Droid Sans", sans-serif; + min-width: 760px; max-width: 960px; margin-left: auto; margin-right: auto; @@ -1180,18 +1181,122 @@ } .swagger-section .oauth_submit { text-align: center; + display: inline-block; +} +.swagger-section .authorize-wrapper { + margin: 15px 0 10px; +} +.swagger-section .authorize-wrapper_operation { + float: right; +} +.swagger-section .authorize__btn:hover { + text-decoration: underline; + cursor: pointer; +} +.swagger-section .authorize__btn_operation:hover .authorize-scopes { + display: block; +} +.swagger-section .authorize-scopes { + position: absolute; + margin-top: 20px; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section .authorize-scopes .authorize__scope { + text-decoration: none; +} +.swagger-section .authorize__btn_operation { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons.png) no-repeat; +} +.swagger-section .authorize__btn_operation_login { + background-position: 0 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .authorize__btn_operation_logout { + background-position: -30px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section #auth_container { + color: #fff; + display: inline-block; + border: none; + padding: 5px; + width: 87px; + height: 13px; +} +.swagger-section #auth_container .authorize__btn { + color: #fff; +} +.swagger-section .auth_container { + padding: 0 0 10px; + margin-bottom: 5px; + border-bottom: solid 1px #CCC; + font-size: 0.9em; +} +.swagger-section .auth_container .auth__title { + color: #547f00; + font-size: 1.2em; +} +.swagger-section .auth_container .basic_auth__label { + display: inline-block; + width: 60px; +} +.swagger-section .auth_container .auth__description { + color: #999999; + margin-bottom: 5px; +} +.swagger-section .auth_container .auth__button { + margin-top: 10px; + height: 30px; +} +.swagger-section .auth_container .key_auth__field { + margin: 5px 0; +} +.swagger-section .auth_container .key_auth__label { + display: inline-block; + width: 60px; } .swagger-section .api-popup-dialog { - z-index: 10000; position: absolute; + display: none; +} +.swagger-section .api-popup-dialog-wrapper { + z-index: 1000; width: 500px; background: #FFF; padding: 20px; border: 1px solid #ccc; border-radius: 5px; - display: none; font-size: 13px; color: #777; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.swagger-section .api-popup-dialog-shadow { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0.2; + background-color: gray; + z-index: 900; } .swagger-section .api-popup-dialog .api-popup-title { font-size: 24px; @@ -1205,6 +1310,10 @@ padding-left: 5px; padding-bottom: 5px; } +.swagger-section .api-popup-dialog .api-popup-content { + max-height: 500px; + overflow-y: auto; +} .swagger-section .api-popup-dialog .api-popup-authbtn { height: 30px; } @@ -1297,7 +1406,9 @@ } .swagger-section #header { background-color: #89bf04; - padding: 14px; + padding: 9px 14px 19px 14px; + height: 23px; + min-width: 775px; } .swagger-section #input_baseUrl { width: 400px; @@ -1308,9 +1419,8 @@ float: right; } .swagger-section #api_selector .input { - display: block; + display: inline-block; clear: none; - float: left; margin: 0 10px 0 0; } .swagger-section #api_selector input { @@ -1321,7 +1431,8 @@ .swagger-section #input_apiKey { width: 200px; } -.swagger-section #explore { +.swagger-section #explore, +.swagger-section #auth_container .authorize__btn { display: block; text-decoration: none; font-weight: bold; @@ -1336,17 +1447,25 @@ -khtml-border-radius: 4px; border-radius: 4px; } -.swagger-section #explore:hover { +.swagger-section #explore:hover, +.swagger-section #auth_container .authorize__btn:hover { background-color: #547f00; } .swagger-section #header #logo { font-size: 1.5em; font-weight: bold; text-decoration: none; - background: transparent url(../images/logo_small.png) no-repeat left center; - padding: 20px 0 20px 40px; color: white; } +.swagger-section #header #logo .logo__img { + display: block; + float: left; + margin-top: 2px; +} +.swagger-section #header #logo .logo__title { + display: inline-block; + padding: 5px 0 0 10px; +} .swagger-section #content_message { margin: 10px 15px; font-style: italic; @@ -1363,3 +1482,7 @@ .swagger-section .swagger-expand:before { content: "+"; } +.swagger-section .error { + outline-color: #cc0000; + background-color: #f2dede; +} diff --git a/dist/index.html b/dist/index.html index d95471a1..4bd82d5c 100644 --- a/dist/index.html +++ b/dist/index.html @@ -67,7 +67,7 @@ window.SwaggerTranslator.translate(); } - addApiKeyAuthorization(); +// addApiKeyAuthorization(); }, onFailure: function(data) { log("Unable to Load SwaggerUI"); @@ -79,16 +79,16 @@ showRequestHeaders: false }); - function addApiKeyAuthorization(){ - var key = encodeURIComponent($('#input_apiKey')[0].value); - if(key && key.trim() != "") { - var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query"); - window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth); - log("added key " + key); - } - } - - $('#input_apiKey').change(addApiKeyAuthorization); +// function addApiKeyAuthorization(){ +// var key = encodeURIComponent($('#input_apiKey')[0].value); +// if(key && key.trim() != "") { +// var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query"); +// window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth); +// log("added key " + key); +// } +// } +// +// $('#input_apiKey').change(addApiKeyAuthorization); // if you have an apiKey you would like to pre-populate on the page for demonstration purposes... /* @@ -110,11 +110,11 @@
diff --git a/dist/lib/swagger-oauth.js b/dist/lib/swagger-oauth.js index 576fcd33..2bb6be11 100644 --- a/dist/lib/swagger-oauth.js +++ b/dist/lib/swagger-oauth.js @@ -331,7 +331,8 @@ window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) { } } }); - window.swaggerUi.api.clientAuthorizations.add(OAuthSchemeKey, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header')); + window.swaggerUi.api.clientAuthorizations.add(window.OAuthSchemeKey, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header')); + window.swaggerUi.load(); } } } diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js index 92d06e19..726d5a15 100644 --- a/dist/swagger-ui.js +++ b/dist/swagger-ui.js @@ -6,15 +6,90 @@ */ (function(){this["Handlebars"] = this["Handlebars"] || {}; 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_auth"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "\n" + + escapeExpression(((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"description","hash":{},"data":data}) : helper))) + + "
\nScopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\n Learn how to use\n
\n" + + escapeExpression(((helper = (helper = helpers.appName || (depth0 != null ? depth0.appName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"appName","hash":{},"data":data}) : helper))) + + " API requires the following scopes. Select which ones you want to grant to Swagger UI.
\nAuthorization URL: " + + escapeExpression(((helper = (helper = helpers.authorizationUrl || (depth0 != null ? depth0.authorizationUrl : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"authorizationUrl","hash":{},"data":data}) : helper))) + + "
\nflow: " + + escapeExpression(((helper = (helper = helpers.flow || (depth0 != null ? depth0.flow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"flow","hash":{},"data":data}) : helper))) + + "
\n\n
Header | \nDescription | \nType | \nOther | \n
---|
Parameter | \nValue | \nDescription | \nParameter Type | \nData Type | \n
---|
HTTP Status Code | \nReason | \nResponse Model | \nHeaders | \n
---|
').text('no content');
pre = $('').append(code);
- // JSON
+ // JSON
} else if (contentType === 'application/json' || /\+json$/.test(contentType)) {
var json = null;
try {
@@ -19989,35 +20646,35 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
code = $('
').text(json);
pre = $('').append(code);
- // XML
+ // XML
} else if (contentType === 'application/xml' || /\+xml$/.test(contentType)) {
code = $('
').text(this.formatXml(content));
pre = $('').append(code);
- // HTML
+ // HTML
} else if (contentType === 'text/html') {
code = $('
').html(_.escape(content));
pre = $('').append(code);
- // Plain Text
+ // Plain Text
} else if (/text\/plain/.test(contentType)) {
code = $('
').text(content);
pre = $('').append(code);
- // Image
+ // Image
} else if (/^image\//.test(contentType)) {
pre = $('').attr('src', url);
- // Audio
+ // Audio
} else if (/^audio\//.test(contentType) && supportsAudioPlayback(contentType)) {
pre = $('