Skip to content

Commit e94f592

Browse files
update swagger
1 parent 52767d0 commit e94f592

11 files changed

+60
-212
lines changed

Diff for: 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+
}

Diff for: index.html

+8-29
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,24 @@
1-
<!-- HTML for static distribution bundle build -->
1+
<!-- HTML for static distribution bundle build -->
22
<!DOCTYPE html>
33
<html lang="en">
44
<head>
55
<meta charset="UTF-8">
66
<title>Swagger UI</title>
7-
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600,700|Titillium+Web:400,600,700" rel="stylesheet">
8-
9-
<link rel="stylesheet" type="text/css" href="./swagger-ui.css">
10-
<link rel="stylesheet" type="text/css" href="./emby-custom.css">
7+
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
8+
<link rel="stylesheet" type="text/css" href="index.css" />
119
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
1210
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
13-
<style>
14-
html {
15-
box-sizing: border-box;
16-
overflow: -moz-scrollbars-vertical;
17-
overflow-y: scroll;
18-
}
19-
20-
*,
21-
*:before,
22-
*:after {
23-
box-sizing: inherit;
24-
}
25-
26-
body {
27-
margin: 0;
28-
background: #fafafa;
29-
}
30-
</style>
3111
</head>
3212

3313
<body>
3414
<div id="swagger-ui"></div>
35-
36-
<script src="./swagger-ui-bundle.js"></script>
37-
<script src="./swagger-ui-standalone-preset.js"></script>
15+
<script src="./swagger-ui-bundle.js" charset="UTF-8"></script>
16+
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"></script>
3817
<script src="./emby-custom.js"></script>
3918
<script src="./emby-auth.js"></script>
4019

4120
<script>
42-
window.onload = function() {
21+
window.onload = function () {
4322

4423
function getWindowLocationSearch(win) {
4524
'use strict';
@@ -81,7 +60,7 @@
8160

8261
const schema = specJson().getIn([...definitionBase, key]);
8362

84-
if(!schema) {
63+
if (!schema) {
8564
return null;
8665
}
8766

@@ -119,7 +98,7 @@
11998
renderAuths
12099
],
121100
layout: 'StandaloneLayout',
122-
onComplete: function() {
101+
onComplete: function () {
123102
if (apikey && apikey.trim() !== '') {
124103
preauthorizeApiKey(ui, 'apikeyauth', apikey);
125104
}

Diff for: oauth2-redirect.html

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!doctype html>
22
<html lang="en-US">
3-
<title>Swagger UI: OAuth2 Redirect</title>
4-
<body onload="run()">
5-
</body>
6-
</html>
3+
<head>
4+
<title>Swagger UI: OAuth2 Redirect</title>
5+
</head>
6+
<body>
77
<script>
88
'use strict';
99
function run () {
@@ -13,31 +13,32 @@
1313
var isValid, qp, arr;
1414

1515
if (/code|token|error/.test(window.location.hash)) {
16-
qp = window.location.hash.substring(1);
16+
qp = window.location.hash.substring(1).replace('?', '&');
1717
} else {
1818
qp = location.search.substring(1);
1919
}
2020

21-
arr = qp.split("&")
22-
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('=', '":"') + '"';});
2323
qp = qp ? JSON.parse('{' + arr.join() + '}',
2424
function (key, value) {
25-
return key === "" ? value : decodeURIComponent(value)
25+
return key === "" ? value : decodeURIComponent(value);
2626
}
27-
) : {}
27+
) : {};
2828

29-
isValid = qp.state === sentState
29+
isValid = qp.state === sentState;
3030

3131
if ((
32-
oauth2.auth.schema.get("flow") === "accessCode"||
33-
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"
3435
) && !oauth2.auth.code) {
3536
if (!isValid) {
3637
oauth2.errCb({
3738
authId: oauth2.auth.name,
3839
source: "auth",
3940
level: "warning",
40-
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."
4142
});
4243
}
4344

@@ -46,7 +47,7 @@
4647
oauth2.auth.code = qp.code;
4748
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
4849
} else {
49-
let oauthErrorMsg
50+
let oauthErrorMsg;
5051
if (qp.error) {
5152
oauthErrorMsg = "["+qp.error+"]: " +
5253
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
@@ -57,12 +58,22 @@
5758
authId: oauth2.auth.name,
5859
source: "auth",
5960
level: "error",
60-
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
61+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
6162
});
6263
}
6364
} else {
6465
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
6566
}
6667
window.close();
6768
}
69+
70+
if (document.readyState !== 'loading') {
71+
run();
72+
} else {
73+
document.addEventListener('DOMContentLoaded', function () {
74+
run();
75+
});
76+
}
6877
</script>
78+
</body>
79+
</html>

Diff for: swagger-ui-bundle.js

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

Diff for: 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.

Diff for: swagger-ui-standalone-preset.js

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

Diff for: 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.

Diff for: swagger-ui.css

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

Diff for: swagger-ui.css.map

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

Diff for: swagger-ui.js

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

Diff for: 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)