forked from AndreasFischer1985/tagesschau-api
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
42 lines (38 loc) · 1.32 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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.51.1/swagger-ui.min.css">
<title>Tagesschau API - OpenAPI Documentation</title>
<body>
<div><small><a href="index.html">[DE]</a><a id="en" href="#">/[EN]</a></small></div>
<div id="openapi">
<script src="//cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.51.1/swagger-ui-bundle.min.js"></script>
<script>
var xhr = new XMLHttpRequest();
xhr.open('HEAD', "openapi_en.yaml", true);
xhr.onreadystatechange = function(){
if (xhr.readyState === 4){
if (xhr.status === 404) {
document.getElementById('en').remove();
}
}
};
xhr.send();
if (document.getElementById('en') !== null)
document.getElementById('en').onclick = function() {
const ui = SwaggerUIBundle({
url: "openapi_en.yaml",
dom_id: "#openapi"
})
};
window.onload = function () {
const ui = SwaggerUIBundle({
url: "openapi.yaml",
dom_id: "#openapi"
})
}
</script>
</body>
</html>