merged
This commit is contained in:
30
dist/css/screen.css
vendored
30
dist/css/screen.css
vendored
@@ -1155,8 +1155,16 @@
|
||||
.swagger-section .auth {
|
||||
float: right;
|
||||
}
|
||||
.swagger-section #api_information_panel {
|
||||
position: absolute;
|
||||
.swagger-section .api-ic {
|
||||
height: 18px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
background: url(../images/explorer_icons.png) no-repeat;
|
||||
}
|
||||
.swagger-section .api-ic .api_information_panel {
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
margin-left: -5px;
|
||||
background: #FFF;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
@@ -1167,34 +1175,32 @@
|
||||
color: black;
|
||||
padding: 5px;
|
||||
}
|
||||
.swagger-section #api_information_panel p .api-msg-enabled {
|
||||
.swagger-section .api-ic .api_information_panel p .api-msg-enabled {
|
||||
color: green;
|
||||
}
|
||||
.swagger-section #api_information_panel p .api-msg-disabled {
|
||||
.swagger-section .api-ic .api_information_panel p .api-msg-disabled {
|
||||
color: red;
|
||||
}
|
||||
.swagger-section .api-ic {
|
||||
height: 18px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
background: url(../images/explorer_icons.png) no-repeat;
|
||||
.swagger-section .api-ic:hover .api_information_panel {
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
.swagger-section .ic-info {
|
||||
background-position: 0 0;
|
||||
width: 18px;
|
||||
margin-top: -7px;
|
||||
margin-top: -6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.swagger-section .ic-warning {
|
||||
background-position: -60px 0;
|
||||
width: 18px;
|
||||
margin-top: -7px;
|
||||
margin-top: -6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.swagger-section .ic-error {
|
||||
background-position: -30px 0;
|
||||
width: 18px;
|
||||
margin-top: -7px;
|
||||
margin-top: -6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.swagger-section .ic-off {
|
||||
|
||||
7
dist/lib/swagger-oauth.js
vendored
7
dist/lib/swagger-oauth.js
vendored
@@ -40,6 +40,7 @@ function handleLogin() {
|
||||
appName = window.swaggerUi.api.info.title;
|
||||
}
|
||||
|
||||
$('.api-popup-dialog').remove();
|
||||
popupDialog = $(
|
||||
[
|
||||
'<div class="api-popup-dialog">',
|
||||
@@ -240,7 +241,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
|
||||
if(b){
|
||||
// if all roles are satisfied
|
||||
var o = null;
|
||||
$.each($('.auth #api_information_panel'), function(k, v) {
|
||||
$.each($('.auth .api-ic .api_information_panel'), function(k, v) {
|
||||
var children = v;
|
||||
if(children && children.childNodes) {
|
||||
var requiredScopes = [];
|
||||
@@ -257,7 +258,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
|
||||
}
|
||||
}
|
||||
if(diff.length > 0){
|
||||
o = v.parentNode;
|
||||
o = v.parentNode.parentNode;
|
||||
$(o.parentNode).find('.api-ic.ic-on').addClass('ic-off');
|
||||
$(o.parentNode).find('.api-ic.ic-on').removeClass('ic-on');
|
||||
|
||||
@@ -266,7 +267,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
|
||||
$(o).find('.api-ic').removeClass('ic-error');
|
||||
}
|
||||
else {
|
||||
o = v.parentNode;
|
||||
o = v.parentNode.parentNode;
|
||||
$(o.parentNode).find('.api-ic.ic-off').addClass('ic-on');
|
||||
$(o.parentNode).find('.api-ic.ic-off').removeClass('ic-off');
|
||||
|
||||
|
||||
63
dist/swagger-ui.js
vendored
63
dist/swagger-ui.js
vendored
@@ -8,9 +8,9 @@
|
||||
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) {
|
||||
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
||||
return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'>"
|
||||
return "<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'><label for='input_apiKey_entry'>"
|
||||
+ escapeExpression(((helper = (helper = helpers.keyName || (depth0 != null ? depth0.keyName : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"keyName","hash":{},"data":data}) : helper)))
|
||||
+ "</div>\n <input placeholder=\"api_key\" class=\"auth_input\" id=\"input_apiKey_entry\" name=\"apiKey\" type=\"text\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_api_key\" href=\"#\" data-sw-translate>apply</a></div>\n </div>\n</div>\n\n";
|
||||
+ "</label></div>\n <input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>\n <div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#' data-sw-translate>apply</a></div>\n </div>\n</div>\n";
|
||||
},"useData":true});
|
||||
this["Handlebars"]["templates"]["basic_auth_button_view"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
|
||||
return "<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>\n<div class='auth_container' id='basic_auth_container'>\n <div class='key_input_container'>\n <div class=\"auth_label\"><label for=\"input_username\" data-sw-translate>Username</label></div>\n <input placeholder=\"username\" class=\"auth_input\" id=\"input_username\" name=\"username\" type=\"text\"/>\n <div class=\"auth_label\"><label for=\"password\" data-sw-translate>Password</label></div>\n <input placeholder=\"password\" class=\"auth_input\" id=\"input_password\" name=\"password\" type=\"password\"/>\n <div class='auth_submit'><a class='auth_submit_button' id=\"apply_basic_auth\" href=\"#\">apply</a></div>\n </div>\n</div>\n\n";
|
||||
@@ -253,6 +253,14 @@ Handlebars.registerHelper('renderTextParam', function(param) {
|
||||
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple;
|
||||
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
|
||||
|
||||
var dataVendorExtensions = Object.keys(param).filter(function(property) {
|
||||
// filter X-data- properties
|
||||
return property.match(/^X-data-/i) !== null;
|
||||
}).reduce(function(result, property) {
|
||||
// remove X- from property name, so it results in html attributes like data-foo='bar'
|
||||
return result += ' ' + property.substring(2, property.length) + '=\'' + param[property] + '\'';
|
||||
}, '');
|
||||
|
||||
if (typeof defaultValue === 'undefined') {
|
||||
defaultValue = '';
|
||||
}
|
||||
@@ -266,7 +274,7 @@ Handlebars.registerHelper('renderTextParam', function(param) {
|
||||
}
|
||||
|
||||
if(isArray) {
|
||||
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt;
|
||||
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;
|
||||
result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
|
||||
result += defaultValue + '</textarea>';
|
||||
} else {
|
||||
@@ -275,7 +283,7 @@ Handlebars.registerHelper('renderTextParam', function(param) {
|
||||
parameterClass += ' required';
|
||||
}
|
||||
result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
|
||||
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt;
|
||||
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions;
|
||||
result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
|
||||
}
|
||||
return new Handlebars.SafeString(result);
|
||||
@@ -386,9 +394,9 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
|
||||
if (stack1 != null) { buffer += stack1; }
|
||||
return buffer + "</div>\n";
|
||||
},"7":function(depth0,helpers,partials,data) {
|
||||
return " <div class=\"auth\">\n <span class=\"api-ic ic-error\"></span>";
|
||||
return " <div class=\"auth\">\n <span class=\"api-ic ic-error\">";
|
||||
},"9":function(depth0,helpers,partials,data) {
|
||||
var stack1, buffer = " <div id=\"api_information_panel\" style=\"top: 526px; left: 776px; display: none;\">\n";
|
||||
var stack1, buffer = " <div class=\"api_information_panel\">\n";
|
||||
stack1 = helpers.each.call(depth0, depth0, {"name":"each","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data});
|
||||
if (stack1 != null) { buffer += stack1; }
|
||||
return buffer + " </div>\n";
|
||||
@@ -400,7 +408,7 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
|
||||
+ escapeExpression(lambda((depth0 != null ? depth0.scope : depth0), depth0))
|
||||
+ "</div>\n";
|
||||
},"12":function(depth0,helpers,partials,data) {
|
||||
return "</div>";
|
||||
return "</span></div>";
|
||||
},"14":function(depth0,helpers,partials,data) {
|
||||
return " <div class='access'>\n <span class=\"api-ic ic-off\" title=\"click to authenticate\"></span>\n </div>\n";
|
||||
},"16":function(depth0,helpers,partials,data) {
|
||||
@@ -31155,7 +31163,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
'click .response_hider' : 'hideResponse',
|
||||
'click .toggleOperation' : 'toggleOperationContent',
|
||||
'mouseenter .api-ic' : 'mouseEnter',
|
||||
'mouseout .api-ic' : 'mouseExit',
|
||||
'dblclick .curl' : 'selectText',
|
||||
},
|
||||
|
||||
@@ -31179,7 +31186,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
range.moveToElementText(text);
|
||||
range.select();
|
||||
} else if (window.getSelection) {
|
||||
selection = window.getSelection();
|
||||
selection = window.getSelection();
|
||||
range = document.createRange();
|
||||
range.selectNodeContents(text);
|
||||
selection.removeAllRanges();
|
||||
@@ -31218,11 +31225,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
pos.top = y;
|
||||
pos.left = x;
|
||||
elem.css(pos);
|
||||
$(e.currentTarget.parentNode).find('#api_information_panel').show();
|
||||
},
|
||||
|
||||
mouseExit: function(e) {
|
||||
$(e.currentTarget.parentNode).find('#api_information_panel').hide();
|
||||
},
|
||||
|
||||
// Note: copied from CoffeeScript compiled file
|
||||
@@ -31241,22 +31243,23 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
for (l = 0, len = modelAuths.length; l < len; l++) {
|
||||
auths = modelAuths[l];
|
||||
for (key in auths) {
|
||||
auth = auths[key];
|
||||
for (a in this.auths) {
|
||||
auth = this.auths[a];
|
||||
if (auth.type === 'oauth2') {
|
||||
this.model.oauth = {};
|
||||
this.model.oauth.scopes = [];
|
||||
ref1 = auth.value.scopes;
|
||||
for (k in ref1) {
|
||||
v = ref1[k];
|
||||
scopeIndex = auths[key].indexOf(k);
|
||||
if (scopeIndex >= 0) {
|
||||
o = {
|
||||
scope: k,
|
||||
description: v
|
||||
};
|
||||
this.model.oauth.scopes.push(o);
|
||||
if (key === auth.name) {
|
||||
if (auth.type === 'oauth2') {
|
||||
this.model.oauth = {};
|
||||
this.model.oauth.scopes = [];
|
||||
ref1 = auth.value.scopes;
|
||||
for (k in ref1) {
|
||||
v = ref1[k];
|
||||
scopeIndex = auths[key].indexOf(k);
|
||||
if (scopeIndex >= 0) {
|
||||
o = {
|
||||
scope: k,
|
||||
description: v
|
||||
};
|
||||
this.model.oauth.scopes.push(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32122,7 +32125,9 @@ SwaggerUi.Views.SignatureView = Backbone.View.extend({
|
||||
if (e) { e.preventDefault(); }
|
||||
|
||||
var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
|
||||
if ($.trim(textArea.val()) === '') {
|
||||
|
||||
// Fix for bug in IE 10/11 which causes placeholder text to be copied to "value"
|
||||
if ($.trim(textArea.val()) === '' || textArea.prop('placeholder') === textArea.val()) {
|
||||
textArea.val(this.model.sampleJSON);
|
||||
}
|
||||
}
|
||||
|
||||
26
dist/swagger-ui.min.js
vendored
26
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user