-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreview-release.html
132 lines (106 loc) · 3.06 KB
/
preview-release.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Preview Release</title>
<link crossorigin="anonymous" media="all" rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/markdowncss/air/css/air.min.css" />
<style>
* {
margin: 0;
padding: 0;
font-size: 16px;
text-align: left;
}
body {
margin: 8px 32px;
}
.info>div>span:nth-child(1) {
font-weight: bold;
font-size: 20px;
margin-right: 12px;
}
.info>div>span:nth-child(2) {
color: red;
}
.note {
margin-top: 32px;
padding-bottom: 32px;
border-bottom: 1px solid #ddd;
}
.note:first-of-type {
margin-top: 16px;
}
.note>span {
display: inline-block;
font-size: 16px;
font-weight: bold;
padding-bottom: 8px;
}
.release-note-area {
margin-top: 32px;
}
.release-note-area>span {
font-size: 20px;
font-weight: bold;
padding-bottom: 16px;
}
</style>
</head>
<body>
<div class="info">
<div>
<span>Version:</span><span id="version"></span>
</div>
<div>
<span>Allow Lowest Version:</span><span id="lowestVersion"></span>
</div>
<div>
<span>Force Update:</span><span id="forceUpdate"></span>
</div>
<div id="download">
<span>Download:</span>
</div>
</div>
<div class="release-note-area">
<span>Release Note:</span>
<div class="note">
<span>Simplified Chinese</span>
<div id="content_cn"></div>
</div>
<div class="note">
<span>Traditional Chinese</span>
<div id="content_tw"></div>
</div>
<div class="note">
<span>English</span>
<div id="content_en"></div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/marked@4.0.1/marked.min.js"></script>
<script>
fetch("./version_update_android.json").then(function (response) {
return response.text();
}).then(function (text) {
const json = JSON.parse(text);
const releaseNote = json["release_note_zh_hans"];
document.getElementById('version').innerHTML = json["version"];
document.getElementById('lowestVersion').innerHTML = json["allow_lowest_version"];
document.getElementById('forceUpdate').innerHTML = json["allow_lowest_version"] === 0 ? "true" : "false";
const aTag = document.createElement("a");
aTag.setAttribute("href", json["app_store_url_cn"]);
aTag.setAttribute("target", "_blank");
aTag.text = "app-release-" + json["version"] + ".apk"
document.getElementById('download').appendChild(aTag);
document.getElementById('content_cn').innerHTML =
marked.parse(json["release_note_zh_hans"]);
document.getElementById('content_tw').innerHTML =
marked.parse(json["release_note_zh_hant"]);
document.getElementById('content_en').innerHTML =
marked.parse(json["release_note_en_us"]);
})
</script>
</body>
</html>