forked from 0111/Kindle_WeatherCN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.html
156 lines (147 loc) · 5.41 KB
/
config.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
<!DOCTYPE html>
<html lang="zh_CN">
<head>
<meta charset="UTF-8">
<title>Kindle WeatherCN 参数设置</title>
<style>
h1 {
text-align: center;
}
body {
margin: 10px;
}
form div {
margin: 10px 0;
}
input[name=city] {
width: 90%;
padding: 10px;
}
input[name=lat],
input[name=lon] {
width: 100px;
}
</style>
</head>
<body>
<h1>Kindle WeatherCN 参数设置</h1>
<form action="index.html">
<div>
<label>输入城市: <br /><input type="text" name="city" id="city" value="Nanjing" /></label>
</div>
<div>或者 输入GPS坐标:</div>
<div>
<label>Lat (e.g. 50.123): <input type="text" name="lat" id="lat" /></label>
<label>Lon (e.g. 14.4): <input type="text" name="lon" id="lon" /></label>
</div>
<div>
<label>设置UTC时区<br />
<select name="utcOffset" id="utcOffset">
<option value="+08:00">+8 h</option>
<option value="+01:00">+1 h</option>
<option value="-01:00">-1 h</option>
<option value="+02:00">+2 h</option>
<option value="-02:00">-2 h</option>
<option value="+03:00">+3 h</option>
<option value="-03:00">-3 h</option>
<option value="+04:00">+4 h</option>
<option value="-04:00">-4 h</option>
<option value="+05:00">+5 h</option>
<option value="-05:00">-5 h</option>
<option value="+06:00">+6 h</option>
<option value="-06:00">-6 h</option>
<option value="+07:00">+7 h</option>
<option value="-07:00">-7 h</option>
<option value="+08:00">+8 h</option>
<option value="-08:00">-8 h</option>
<option value="+09:00">+9 h</option>
<option value="-09:00">-9 h</option>
<option value="+10:00">+10 h</option>
<option value="-10:00">-10 h</option>
<option value="+11:00">+11 h</option>
<option value="-11:00">-11 h</option>
<option value="+12:00">+12 h</option>
<option value="-12:00">-12 h</option>
</select>
</label>
</div>
<div>
<label>设置显示语言: <br />
<select name="lang" id="lang">
<option value="zh_cn">中文</option>
<option value="en">English</option>
</select>
</label>
</div>
<div>
<label>设置屏幕方向: <br />
<select name="rotation" id="rotation">
<option value="none">竖屏显示</option>
<option value="ll">向左横屏</option>
<option value="lr">向右横屏</option>
<option value="up">竖屏倒置</option>
</select>
</label>
</div>
<div>
<label>设置温度单位: <br />
<select name="units" id="units">
<option value="metric">摄氏度 - °C</option>
<option value="imperial">华氏度 - °F</option>
</select>
</label>
</div>
<div>
<label>设置夜间模式: <br />
<select name="night" id="night">
<option value="off">设置白天模式</option>
<option value="auto">自动切换模式</option>
<option value="on">设置夜间模式</option>
<option value="">default</option>
</select>
</label>
</div>
<div>
<label>设置自定义 APIKey: <br /><input type="text" name="appId" id="appId" /></label>
</div>
<div>
<input type="submit" value="保存当前设置" />
</div>
</form>
<script type="application/javascript">
var params = {};
window.location.search
.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (str, key, value) {
params[key] = decodeURIComponent(value);
}
);
if (params["city"]) {
document.getElementById("city").value = params["city"];
}
if (params["lat"]) {
document.getElementById("lat").value = params["lat"];
}
if (params["lon"]) {
document.getElementById("lon").value = params["lon"];
}
if (params["lang"]) {
document.getElementById("lang").value = params["lang"];
}
if (params["rotation"]) {
document.getElementById("rotation").value = params["rotation"];
}
if (params["units"]) {
document.getElementById("units").value = params["units"];
}
if (params["night"]) {
document.getElementById("night").value = params["night"];
}
if (params["appId"]) {
document.getElementById("appId").value = params["appId"];
}
if (params["utcOffset"]) {
document.getElementById("utcOffset").value = params["utcOffset"];
}
</script>
</body>
</html>