/**
* 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.2
* @link http://swagger.io
* @license Apache-2.0
*/
(function(){'use strict';
window.SwaggerUi = Backbone.Router.extend({
dom_id: 'swagger_ui',
// Attributes
options: null,
api: null,
headerView: null,
mainView: null,
// SwaggerUi accepts all the same options as SwaggerApi
initialize: function(options) {
options = options || {};
if(!options.highlightSizeThreshold) {
options.highlightSizeThreshold = 100000;
}
// Allow dom_id to be overridden
if (options.dom_id) {
this.dom_id = options.dom_id;
delete options.dom_id;
}
if (!options.supportedSubmitMethods){
options.supportedSubmitMethods = [
'get',
'put',
'post',
'delete',
'head',
'options',
'patch'
];
}
if (typeof options.oauth2RedirectUrl === 'string') {
window.oAuthRedirectUrl = options.oauth2RedirectUrl;
}
// Create an empty div which contains the dom_id
if (! $('#' + this.dom_id).length){
$('body').append('<div id="' + this.dom_id + '"></div>') ;
}
this.options = options;
// set marked options
marked.setOptions({gfm: true});
// Set the callbacks
var that = this;
this.options.success = function() { return that.render(); };
this.options.progress = function(d) { return that.showMessage(d); };
this.options.failure = function(d) { return that.onLoadFailure(d); };
// Create view to handle the header inputs
this.headerView = new SwaggerUi.Views.HeaderView({el: $('#header')});
// Event handler for when the baseUrl/apiKey is entered by user
this.headerView.on('update-swagger-ui', function(data) {
return that.updateSwaggerUi(data);
});
},
// Set an option after initializing
setOption: function(option, value) {
this.options[option] = value;
},
// Get the value of a previously set option
getOption: function(option) {
return this.options[option];
},
// Event handler for when url/key is received from user
updateSwaggerUi: function(data){
this.options.url = data.url;
this.load();
},
// Create an api and render
load: function(){
// Initialize the API object
if (this.mainView) {
this.mainView.clear();
}
var url = this.options.url;
if (url && url.indexOf('http') !== 0) {
url = this.buildUrl(window.location.href.toString(), url);
}
if(this.api) {
this.options.authorizations = this.api.clientAuthorizations.authz;
}
this.options.url = url;
this.headerView.update(url);
this.api = new SwaggerClient(this.options);
},
// collapse all sections
collapseAll: function(){
Docs.collapseEndpointListForResource('');
},
// list operations for all sections
listAll: function(){
Docs.collapseOperationsForResource('');
},
// expand operations for all sections
expandAll: function(){
Docs.expandOperationsForResource('');
},
// This is bound to success handler for SwaggerApi
// so it gets called when SwaggerApi completes loading
render: function(){
this.showMessage('Finished Loading Resource Information. Rendering Swagger UI...');
this.mainView = new SwaggerUi.Views.MainView({
model: this.api,
el: $('#' + this.dom_id),
swaggerOptions: this.options,
router: this
}).render();
this.showMessage();
switch (this.options.docExpansion) {
case 'full':
this.expandAll(); break;
case 'list':
this.listAll(); break;
default:
break;
}
this.renderGFM();
if (this.options.onComplete){
this.options.onComplete(this.api, this);
}
setTimeout(Docs.shebang.bind(this), 100);
},
buildUrl: function(base, url){
if (url.indexOf('/') === 0) {
var parts = base.split('/');
base = parts[0] + '//' + parts[2];
return base + url;
} else {
var endOfPath = base.length;
if (base.indexOf('?') > -1){
endOfPath = Math.min(endOfPath, base.indexOf('?'));
}
if (base.indexOf('#') > -1){
endOfPath = Math.min(endOfPath, base.indexOf('#'));
}
base = base.substring(0, endOfPath);
if (base.indexOf('/', base.length - 1 ) !== -1){
return base + url;
}
return base + '/' + url;
}
},
// Shows message on topbar of the ui
showMessage: function(data){
if (data === undefined) {
data = '';
}
var $msgbar = $('#message-bar');
$msgbar.removeClass('message-fail');
$msgbar.addClass('message-success');
$msgbar.html(data);
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate($msgbar);
}
},
// shows message in red
onLoadFailure: function(data){
if (data === undefined) {
data = '';
}
$('#message-bar').removeClass('message-success');
$('#message-bar').addClass('message-fail');
var val = $('#message-bar').text(data);
if (this.options.onFailure) {
this.options.onFailure(data);
}
return val;
},
// Renders GFM for elements with 'markdown' class
renderGFM: function(){
$('.markdown').each(function(){
$(this).html(marked($(this).html()));
});
$('.propDesc', '.model-signature .description').each(function () {
$(this).html(marked($(this).html())).addClass('markdown');
});
}
});
window.SwaggerUi.Views = {};
// don't break backward compatibility with previous versions and warn users to upgrade their code
(function(){
window.authorizations = {
add: function() {
warn('Using window.authorizations is deprecated. Please use SwaggerUi.api.clientAuthorizations.add().');
if (typeof window.swaggerUi === 'undefined') {
throw new TypeError('window.swaggerUi is not defined');
}
if (window.swaggerUi instanceof SwaggerUi) {
window.swaggerUi.api.clientAuthorizations.add.apply(window.swaggerUi.api.clientAuthorizations, arguments);
}
}
};
window.ApiKeyAuthorization = function() {
warn('window.ApiKeyAuthorization is deprecated. Please use SwaggerClient.ApiKeyAuthorization.');
SwaggerClient.ApiKeyAuthorization.apply(window, arguments);
};
window.PasswordAuthorization = function() {
warn('window.PasswordAuthorization is deprecated. Please use SwaggerClient.PasswordAuthorization.');
SwaggerClient.PasswordAuthorization.apply(window, arguments);
};
function warn(message) {
if ('console' in window && typeof window.console.warn === 'function') {
console.warn(message);
}
}
})();
// UMD
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['b'], function (b) {
return (root.SwaggerUi = factory(b));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('b'));
} else {
// Browser globals
root.SwaggerUi = factory(root.b);
}
}(this, function () {
return SwaggerUi;
}));
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) {
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_c
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
酒店系统管理(前端vue.js框架+后端springboot+mybaits) (22964个子文件)
sshpk-conv.1 4KB
he.1 3KB
jsesc.1 3KB
jsesc.1 3KB
sshpk-sign.1 2KB
sshpk-verify.1 2KB
cssesc.1 2KB
_mocha 13KB
_mocha 12KB
_mocha 303B
_mocha-nightwatch 325B
configure.ac 6KB
acorn 2KB
acorn 2KB
acorn 2KB
acorn 301B
acorn 301B
acorn 301B
address 692B
license.after 4B
ansi-html 2KB
ansi-html 317B
LICENSE.APACHE2 586B
SocketPool.as 22KB
Test.as 3KB
SocketEvent.as 830B
PooledSocket.as 338B
AUTHORS 10KB
AUTHORS 4KB
AUTHORS 4KB
AUTHORS 986B
AUTHORS 961B
AUTHORS 876B
AUTHORS 851B
AUTHORS 609B
AUTHORS 310B
AUTHORS 227B
AUTHORS 217B
AUTHORS 217B
AUTHORS 169B
AUTHORS 163B
AUTHORS 152B
AUTHORS 81B
.babelrc 236B
.babelrc 81B
.babelrc 30B
.babelrc 29B
.babelrc 28B
babylon 315B
README.md.bak 7KB
base64_utf8 7KB
gradlew.bat 2KB
license.before 4B
benchmark 692B
.bithoundrc 254B
.bithoundrc 254B
range.bnf 629B
range.bnf 629B
browserslist 309B
browserslist 309B
browserslist 309B
browserslist 309B
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
build-setup 1002B
_ssl.c 54KB
mod_fsp.c 13KB
benchmark-native.c 613B
Cakefile 2KB
Cakefile 1KB
CakeFile 1KB
CakeFile 1KB
Cakefile 658B
calendar 998B
card 2KB
node.cert 1KB
haproxy.cfg 1KB
ChangeLog 8KB
Changelog 7KB
ChangeLog 7KB
CHANGELOG 2KB
CHANGELOG 896B
CHANGELOG 465B
CHANGES 272KB
CHANGES 27KB
CHANGES 2KB
CHANGES 2KB
CHANGES 1KB
CHANGES 1KB
CHANGES 1KB
CHANGES 851B
CHANGES 440B
chromedriver 329B
共 22964 条
- 1
- 2
- 3
- 4
- 5
- 6
- 230
资源评论
- wuchao01232020-10-10还可以,学习使用
- 小史8972021-04-23这是Javaweb,不是web前端。
- wahahaheiheiasd2021-04-26小白都不知道咋打开 给个五星 能送个文档嘛
- mbcqss2019-03-12还可吧,可以用
- gaoyuan371062019-03-20很好,支持下载
淡泊明志宁静致远
- 粉丝: 13
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功