-
Notifications
You must be signed in to change notification settings - Fork 0
/
perDay.api.html
199 lines (180 loc) · 9.62 KB
/
perDay.api.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
<!--
Program name: Class Schedule
Version: In Readme file and index.html
Author: Xuyang1638
-->
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link href="./css/index.css" rel="stylesheet">
<link href="./assets/mdui/css/mdui.min.css" rel="stylesheet">
<script src="./assets/mdui/js/mdui.min.js"></script>
<title>Class Schedule - By Xuyang1638</title>
</head>
<body class="mdui-theme-primary-pink">
<!-- Toolbar Material -->
<div class="mdui-toolbar mdui-color-theme" id='toolbar'>
<a href="javascript:;" class="mdui-btn mdui-btn-icon" mdui-drawer="{target: '#left-drawer'}"><i class="mdui-icon material-icons">menu</i></a>
<span class="mdui-typo-title">课程表</span>
<div class="mdui-toolbar-spacer"></div>
<a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">search</i></a>
<a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">refresh</i></a>
<a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">more_vert</i></a>
</div>
<!-- Drawer Material -->
<div class="mdui-drawer mdui-drawer-close" id="left-drawer">
<ul class="mdui-list" style="padding-top: 0%">
<li class="image">
<img class="image" src="https://mdui-aliyun.cdn.w3cbus.com/docs/assets/docs/img/card.jpg">
</li>
<li class="mdui-list-item mdui-ripple" onclick="window.open('https://github.com/xuyang1638');">
<div class="mdui-list-item-avatar"><img src="./assets/author-avatar.png" /></div>
<div class="mdui-list-item-content">
<div class="mdui-list-item-title">
Author: <a href="https://github.com/xuyang1638" style="color: black;">Xuyang1638</a>
</div>
<div class="mdui-list-item-text mdui-list-item-one-line">
A Middle School Student in China.
</div>
</div>
</li>
<li class="mdui-list-item mdui-ripple" onclick="window.open('https://github.com/xuyang1638/class-schedule');">
<div class="mdui-list-item-avatar"><img src="./assets/github-avatar.png" /></div>
<div class="mdui-list-item-content">
<div class="mdui-list-item-title">
Github: <a href="https://github.com/xuyang1638/class-schedule" style="color: black;">Class-schedule</a>
</div>
<div class="mdui-list-item-text mdui-list-item-one-line">
Open Source in Github
</div>
</div>
</li>
<li class="mdui-list-item mdui-ripple">Send mail</li>
</ul>
<br />
<button class="mdui-btn mdui-color-theme mdui-ripple mdui-btn-block" mdui-drawer-close style="text-align: center; position: relative; bottom: 0;">
close
</button>
</div>
<div class="mdui-container">
<div id="body" style="text-align: center">
<h2> </h2>
<div class="mdui-panel" mdui-panel>
<div class="mdui-panel-item mdui-panel-item-open">
<div class="mdui-panel-item-header">
<div class="mdui-panel-item-title">Classes</div>
<i class="mdui-panel-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
</div>
<div class="mdui-panel-item-body">
<h2 class="black" id="title">Monday | 星期一</h2>
<ul class="mdui-list container">
<li class="mdui-list-item mdui-ripple mdui-color-pink">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-1">语文</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-pink">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-2">英语</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-pink">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-3">英语</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-pink">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-4">信息</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-blue">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title"> 午休 </div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-pink">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-5">美术</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-pink">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-6">数学</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-pink">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-7">班会</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
<li class="mdui-list-item mdui-ripple mdui-color-indigo">
<div class="mdui-list-item-content">
<div class="mdui-list-item-title" id="class-night">班会</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
</li>
<p></p>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Javascript Programs Here -->
<script src="js/main.js"></script>
<script>
//Solve URL Arguments
var toolbar = getQueryString('toolbarStatus')
var day = getQueryString("day");
if(toolbar == 'false') document.querySelector('body').removeChild(document.querySelector('#toolbar'))
//Catch Excepation
if (day == '1' || day == '2' || day == '3' || day == '4' || day == '5' || day == '6' || day == '7') {} else {
mdui.alert('你输入了错误的天数,重新试一下吧!', 'Exceptions');
console.log('你输入了错误的天数,重新试一下吧!');
}
if(day == '6' || day == '7') day = '1'
//Get data from Javascript JSON
var content = getContent(day);
//Change Return
for (var i = 0; i < 7; i++) {
document.getElementById('class-' + (i+1).toString()).innerText = content[i]; // Change content
}
const nightClassEl = document.querySelector('#class-night')
if(content[7] === "N/A"){
nightClassEl.innerText = '历史'
}
nightClassEl.innerText = content[7]
//Change Title
var x = document.getElementById('title');
x.innerText = getTitle(day);
mdui.snackbar({
message: "软件开发:武宁二中初一(19)班 徐阳",
});
if (window.console) {
console.groupCollapsed('%c课程表 by Xuyang1638', 'color:#009a61; font-size: 28px; font-weight: 300');
console.log('%chttps://github.com/xuyang1638\n-------------\n欢迎在Github上发Issue和Pull Request!',
'color:#009a61');
console.groupEnd();
}
</script>
</body>
</html>