forked from jensoleg/swagger-ui
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
257 lines (221 loc) · 10.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32"/>
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16"/>
<link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--style type="text/css"></style-->
<link href="css/index.css" rel="stylesheet"/>
<link href='css/standalone.css' rel='stylesheet'/>
<link href='css/api-explorer.css' rel='stylesheet' type='text/css'/>
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
<script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
<script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
<script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
<script src='lib/js-yaml.min.js' type='text/javascript'></script>
<script src='lib/lodash.min.js' type='text/javascript'></script>
<!--<script src='lib/underscore-min.js' type='text/javascript'></script>-->
<script src='lib/backbone-min.js' type='text/javascript'></script>
<script src='swagger-ui.js' type='text/javascript'></script>
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
<script src='lib/jsoneditor.min.js' type='text/javascript'></script>
<script src='lib/marked.js' type='text/javascript'></script>
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
<script src='lib/bootstrap.min.js' type='text/javascript'></script>
<script type="text/javascript">
jQuery.browser = jQuery.browser || {};
(function () {
jQuery.browser.msie = jQuery.browser.msie || false;
jQuery.browser.version = jQuery.browser.version || 0;
if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
jQuery.browser.msie = true;
jQuery.browser.version = RegExp.$1;
}
})();
</script>
<script type="text/javascript">
$(function () {
var url = window.location.search.match(/url=([^&]+)/);
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
url = "http://petstore.swagger.io/v2/swagger.json";
}
// Pre load translate...
if (window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
window.swaggerUi = new SwaggerUi({
url: url,
dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
onComplete: function (swaggerApi, swaggerUi) {
if (typeof initOAuth == "function") {
initOAuth({
clientId: "ffe7748a-3a3f-4860-a02a-42ab08e4fde2",
realm: "realm",
appName: "Swagger"
});
}
if (window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
$('pre code').each(function (i, e) {
hljs.highlightBlock(e)
});
if (swaggerUi.options.url) {
$('#input_baseUrl').val(swaggerUi.options.url);
}
if (swaggerUi.options.apiKey) {
$('#input_apiKey').val(swaggerUi.options.apiKey);
}
$("[data-toggle='tooltip']").tooltip();
addApiKeyAuthorization();
},
onFailure: function (data) {
log("Unable to Load SwaggerUI");
},
docExpansion: "none",
//jsonEditor: false,
apisSorter: "alpha"//,
//defaultModelRendering: 'schema',
//showRequestHeaders: false
});
function addApiKeyAuthorization() {
var key = encodeURIComponent($('#input_apiKey')[0].value);
if (key && key.trim() != "") {
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("Authorization", "Bearer " + key, "header");
window.swaggerUi.api.clientAuthorizations.add("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...
/*
var apiKey = "myApiKeyXXXX123456789";
$('#input_apiKey').val(apiKey);
*/
window.swaggerUi.load();
function log() {
if ('console' in window) {
console.log.apply(console, arguments);
}
}
});
</script>
<script type="text/javascript">
$(function () {
$(window).scroll(function () {
var sticky = $(".sticky-nav");
if (!sticky || sticky.length === 0) {
return;
}
i(sticky);
r(sticky);
function n() {
return window.matchMedia("(min-width: 992px)").matches
}
function e() {
n() ? sticky.parents(".sticky-nav-placeholder").removeAttr("style") : sticky.parents(".sticky-nav-placeholder").css("min-height", sticky.outerHeight())
}
function i(n) {
n.hasClass("fixed") || (navOffset = n.offset().top);
e();
$(window).scrollTop() > navOffset ? $(".modal.in").length || n.addClass("fixed") : n.removeClass("fixed")
}
function r(e) {
function i() {
var i = $(window).scrollTop(), r = e.parents(".sticky-nav");
return r.hasClass("fixed") && !n() && (i = i + r.outerHeight() + 40), i
}
function r(e) {
var t = o.next("[data-endpoint]"), n = o.prev("[data-endpoint]");
return "next" === e ? t.length ? t : o.parent().next().find("[data-endpoint]").first() : "prev" === e ? n.length ? n : o.parent().prev().find("[data-endpoint]").last() : []
}
var nav = e.find("[data-navigator]");
if (nav.find("[data-endpoint][data-selected]").length) {
var o = nav.find("[data-endpoint][data-selected]"),
a = $("#" + o.attr("data-endpoint")),
s = a.offset().top,
l = (s + a.outerHeight(), r("next")),
u = r("prev");
if (l.length) {
{
var d = $("#" + l.attr("data-endpoint")), f = d.offset().top;
f + d.outerHeight()
}
i() >= f && c(l)
}
if (u.length) {
var p = $("#" + u.attr("data-endpoint")),
g = u.offset().top;
v = (g + p.outerHeight(), 100);
i() < s - v && c(u)
}
}
}
function s() {
var e = $(".sticky-nav [data-navigator]"),
n = e.find("[data-endpoint]").first();
n.attr("data-selected", "");
u.find("[data-selected-value]").html(n.text())
}
function c(e) {
{
var n = $(".sticky-nav [data-navigator]");
$("#" + e.attr("data-endpoint"))
}
if (!n.attr('data-scrolling')) {
n.find("[data-resource]").removeClass("active");
n.find("[data-selected]").removeAttr("data-selected");
e.closest("[data-resource]").addClass("active");
e.attr("data-selected", "");
sticky.find("[data-selected-value]").html(e.text());
}
}
});
});
</script>
<script type="text/javascript">
$(function () {
$("[data-toggle='tooltip']").tooltip();
});
</script>
</head>
<body class="page-docs" style="zoom: 1;">
<header class="site-header">
<nav role="navigation" class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#navbar-collapse" class="navbar-toggle"><span
class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span
class="icon-bar"></span><span class="icon-bar"></span></button>
<h1 class="navbar-brand"><a href="http://swagger.io"><span>swagger explorer</span></a></h1>
</div>
<div id="navbar-collapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-left">
<li class="li-why"><a href="http://swagger.io" style="font-size: 25px; padding-left: 0px">Swagger
explorer</a></li>
</ul>
</div>
</div>
</nav>
</header>
<section class="content">
<div id="api2-explorer">
<div class="swagger-section page-docs" style="zoom: 1">
<div class="main-section">
<div id="swagger-ui-container" class="swagger-ui-wrap">
</div>
</div>
</div>
</div>
</section>
</body>
</html>