Skip to content

Commit 75b3c49

Browse files
updates swagger to latest 5.11.7 (#101)
Here's what I did: * downloaded latest swagger from https://swagger.io/tools/swagger-ui/download/ * unzipped the dist directory into the gh-pages branch * changed swagger-initializer-js to point to our api file * that's it Signed-off-by: Adrian Cole <[email protected]>
1 parent 3543244 commit 75b3c49

16 files changed

+72
-74
lines changed

index.css

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
html {
2+
box-sizing: border-box;
3+
overflow: -moz-scrollbars-vertical;
4+
overflow-y: scroll;
5+
}
6+
7+
*,
8+
*:before,
9+
*:after {
10+
box-sizing: inherit;
11+
}
12+
13+
body {
14+
margin: 0;
15+
background: #fafafa;
16+
}

index.html

+3-44
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,16 @@
44
<head>
55
<meta charset="UTF-8">
66
<title>Swagger UI</title>
7-
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
7+
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
8+
<link rel="stylesheet" type="text/css" href="index.css" />
89
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
910
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
10-
<style>
11-
html
12-
{
13-
box-sizing: border-box;
14-
overflow: -moz-scrollbars-vertical;
15-
overflow-y: scroll;
16-
}
17-
18-
*,
19-
*:before,
20-
*:after
21-
{
22-
box-sizing: inherit;
23-
}
24-
25-
body
26-
{
27-
margin:0;
28-
background: #fafafa;
29-
}
30-
</style>
3111
</head>
3212

3313
<body>
3414
<div id="swagger-ui"></div>
35-
3615
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
3716
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
38-
<script>
39-
window.onload = function() {
40-
// Begin Swagger UI call region
41-
const ui = SwaggerUIBundle({
42-
url: "https://zipkin.io/zipkin-api/zipkin2-api.yaml",
43-
dom_id: '#swagger-ui',
44-
deepLinking: true,
45-
presets: [
46-
SwaggerUIBundle.presets.apis,
47-
SwaggerUIStandalonePreset
48-
],
49-
plugins: [
50-
SwaggerUIBundle.plugins.DownloadUrl
51-
],
52-
layout: "StandaloneLayout"
53-
})
54-
// End Swagger UI call region
55-
56-
window.ui = ui
57-
}
58-
</script>
17+
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
5918
</body>
6019
</html>

oauth2-redirect.html

+21-16
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<title>Swagger UI: OAuth2 Redirect</title>
55
</head>
66
<body>
7-
</body>
8-
</html>
97
<script>
108
'use strict';
119
function run () {
@@ -15,31 +13,32 @@
1513
var isValid, qp, arr;
1614

1715
if (/code|token|error/.test(window.location.hash)) {
18-
qp = window.location.hash.substring(1);
16+
qp = window.location.hash.substring(1).replace('?', '&');
1917
} else {
2018
qp = location.search.substring(1);
2119
}
2220

23-
arr = qp.split("&")
24-
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
21+
arr = qp.split("&");
22+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
2523
qp = qp ? JSON.parse('{' + arr.join() + '}',
2624
function (key, value) {
27-
return key === "" ? value : decodeURIComponent(value)
25+
return key === "" ? value : decodeURIComponent(value);
2826
}
29-
) : {}
27+
) : {};
3028

31-
isValid = qp.state === sentState
29+
isValid = qp.state === sentState;
3230

3331
if ((
34-
oauth2.auth.schema.get("flow") === "accessCode"||
35-
oauth2.auth.schema.get("flow") === "authorizationCode"
32+
oauth2.auth.schema.get("flow") === "accessCode" ||
33+
oauth2.auth.schema.get("flow") === "authorizationCode" ||
34+
oauth2.auth.schema.get("flow") === "authorization_code"
3635
) && !oauth2.auth.code) {
3736
if (!isValid) {
3837
oauth2.errCb({
3938
authId: oauth2.auth.name,
4039
source: "auth",
4140
level: "warning",
42-
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
41+
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
4342
});
4443
}
4544

@@ -48,7 +47,7 @@
4847
oauth2.auth.code = qp.code;
4948
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
5049
} else {
51-
let oauthErrorMsg
50+
let oauthErrorMsg;
5251
if (qp.error) {
5352
oauthErrorMsg = "["+qp.error+"]: " +
5453
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
@@ -59,7 +58,7 @@
5958
authId: oauth2.auth.name,
6059
source: "auth",
6160
level: "error",
62-
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
61+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
6362
});
6463
}
6564
} else {
@@ -68,7 +67,13 @@
6867
window.close();
6968
}
7069

71-
window.addEventListener('DOMContentLoaded', function () {
72-
run();
73-
});
70+
if (document.readyState !== 'loading') {
71+
run();
72+
} else {
73+
document.addEventListener('DOMContentLoaded', function () {
74+
run();
75+
});
76+
}
7477
</script>
78+
</body>
79+
</html>

swagger-initializer.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
window.onload = function() {
2+
//<editor-fold desc="Changeable Configuration Block">
3+
4+
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
5+
window.ui = SwaggerUIBundle({
6+
url: "https://zipkin.io/zipkin-api/zipkin2-api.yaml",
7+
dom_id: '#swagger-ui',
8+
deepLinking: true,
9+
presets: [
10+
SwaggerUIBundle.presets.apis,
11+
SwaggerUIStandalonePreset
12+
],
13+
plugins: [
14+
SwaggerUIBundle.plugins.DownloadUrl
15+
],
16+
layout: "StandaloneLayout"
17+
});
18+
19+
//</editor-fold>
20+
};

swagger-ui-bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-bundle.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle-core.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle-core.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-standalone-preset.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-standalone-preset.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.css

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.js

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)