-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSettings-1_10.html
274 lines (252 loc) · 9.01 KB
/
Settings-1_10.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html>
<html>
<head>
<title>ForeCal Settings</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.setting { margin: 10px 5px 0px 5px; }
.footnote { font-size: small; }
input, select { font-size: larger; }
input[type=checkbox] {
-webkit-transform: scale(2,2);
}
</style>
<script type="text/javascript" language="Javascript">
function querySt(Key) {
var url = window.location.href;
KeysValues = url.split(/[\?&]+/);
for (i = 0; i < KeysValues.length; i++) {
KeyValue = KeysValues[i].split('=');
if (KeyValue[0].toUpperCase() == Key.toUpperCase()) {
return decodeURIComponent(KeyValue[1]);
}
}
return '';
}
function getSettings() {
var colorScheme = document.getElementById('ColorScheme');
var showBT = document.getElementById('ShowBT');
var btVibes = document.getElementById('BTVibes');
var showBatt = document.getElementById('ShowBatt');
var forecastHour = document.getElementById('ForecastHour');
var forecastMin = document.getElementById('ForecastMin');
var useGPS = document.getElementById('UseGPS');
var weatherLoc = document.getElementById('WeatherLoc');
var tempUnit = document.getElementById('TempUnit');
var updateInterval = document.getElementById('UpdateInterval');
var firstDay = document.getElementById('FirstDay');
var calOffset = document.getElementById('CalOffset');
var qsColorScheme = querySt('ColorScheme');
var qsShowBT = querySt('ShowBT');
var qsBTVibes = querySt('BTVibes');
var qsShowBatt = querySt('ShowBatt');
var qsForecastHour = querySt('ForecastHour');
var qsForecastMin = querySt('ForecastMin');
var qsUseGPS = querySt('UseGPS');
var qsWeatherLoc = querySt('WeatherLoc');
var qsTempUnit = querySt('TempUnit');
var qsUpdateInterval = querySt('UpdateInterval');
var qsFirstDay = querySt('FirstDay');
var qsCalOffset = querySt('CalOffset');
if (qsColorScheme != '') {
colorScheme.value = qsColorScheme;
}
if (qsShowBT != '') {
showBT.checked = (qsShowBT == 'true');
}
if (qsBTVibes != '') {
btVibes.checked = (qsBTVibes == 'true');
}
if (qsShowBatt != '') {
showBatt.checked = (qsShowBatt == 'true');
}
if (qsForecastHour != '') {
forecastHour.value = qsForecastHour;
}
if (qsForecastMin != '') {
forecastMin.value = qsForecastMin;
}
if (qsUseGPS != '') {
useGPS.checked = (qsUseGPS == 'true');
}
if (qsWeatherLoc.trim() != '') {
useGPS.checked = false;
weatherLoc.value = qsWeatherLoc.trim();
}
if (qsTempUnit != '') {
tempUnit.value = qsTempUnit;
}
if (qsUpdateInterval != '') {
updateInterval.value = qsUpdateInterval;
}
if (qsFirstDay != '') {
firstDay.value = qsFirstDay;
}
if (qsCalOffset != '') {
calOffset.value = qsCalOffset;
}
}
function validateInput() {
var useGPS = document.getElementById('UseGPS');
var weatherLoc = document.getElementById('WeatherLoc');
if (!useGPS.checked && weatherLoc.value == '') {
weatherLoc.focus();
return false;
}
return true;
}
function updateGPS() {
var useGPS = document.getElementById('UseGPS');
var weatherLoc = document.getElementById('WeatherLoc');
if (useGPS.checked)
weatherLoc.value = '';
}
function updateWeatherLoc() {
var useGPS = document.getElementById('UseGPS');
var weatherLoc = document.getElementById('WeatherLoc');
useGPS.checked = (weatherLoc.value.trim() == '');
}
function applySettings() {
if (validateInput()) {
var colorScheme = document.getElementById('ColorScheme');
var showBT = document.getElementById('ShowBT');
var btVibes = document.getElementById('BTVibes');
var showBatt = document.getElementById('ShowBatt');
var forecastHour = document.getElementById('ForecastHour');
var forecastMin = document.getElementById('ForecastMin');
var useGPS = document.getElementById('UseGPS');
var weatherLoc = document.getElementById('WeatherLoc');
var tempUnit = document.getElementById('TempUnit');
var updateInterval = document.getElementById('UpdateInterval');
var firstDay = document.getElementById('FirstDay');
var calOffset = document.getElementById('CalOffset');
var settings = JSON.stringify({
'ColorScheme': colorScheme.value,
'ShowBT': showBT.checked,
'BTVibes': btVibes.checked,
'ShowBatt': showBatt.checked,
'ForecastHour': parseInt(forecastHour.value),
'ForecastMin': parseInt(forecastMin.value),
'UseGPS': useGPS.checked,
'WeatherLoc': weatherLoc.value.trim(),
'TempUnit': tempUnit.value,
'UpdateInterval': parseInt(updateInterval.value),
'FirstDay': parseInt(firstDay.value),
'CalOffset': parseInt(calOffset.value)
});
var qsReturnTo = querySt('return_to');
if (qsReturnTo == '') qsReturnTo = 'pebblejs://close#';
document.location = qsReturnTo + encodeURIComponent(settings);
}
}
</script>
</head>
<body style="font-family: sans-serif;" onload="getSettings();">
<div style="clear: both;"></div>
<div class="setting">
<fieldset>
<legend>Color Scheme:</legend>
<select name="ColorScheme" id="ColorScheme">
<option value="Auto">Auto</option>
<option value="WhiteOnBlack">White On Black</option>
<option value="BlackOnWhite">Black On White</option>
</select><br />
<span class="footnote">(Auto = Black on White during day, White on Black at night)</span>
</fieldset>
</div>
<div class="setting">
<fieldset>
<legend>Status:</legend>
<input type="checkbox" name="ShowBT" id="ShowBT" value="ShowBT" checked="checked" />
<label for="ShowBT">Show Bluetooth Status</label><br /><br />
<input type="checkbox" name="BTVibes" id="BTVibes" value="BTVibes" checked="checked" />
<label for="ShowBT">Vibrate on Connect/Disconnect</label><br /><br />
<input type="checkbox" name="ShowBatt" id="ShowBatt" value="ShowBatt" checked="checked" />
<label for="ShowBT">Show Battery Status</label>
</fieldset>
</div>
<div class="setting">
<fieldset>
<legend>Show Tomorrow's Forecast After:</legend>
<select name="ForecastHour" id="ForecastHour">
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18" selected="selected">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="0">00</option>
</select>:
<select name="ForecastMin" id="ForecastMin">
<option value="0">00</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
</select>
</fieldset>
</div>
<div class="setting">
<fieldset>
<legend>Weather Location:</legend>
<input type="checkbox" name="UseGPS" id="UseGPS" value="UseGPS" checked="checked" onchange="updateGPS();" />
<label for="UseGPS">Use GPS Location</label> <span style="font-style: italic;">OR</span><br /><br />
<label for="WeatherLoc">Use Fixed Location:</label><br />
<input type="text" name="WeatherLoc" id="WeatherLoc" style="width: 90%" onchange="updateWeatherLoc();" /><br />
<span class="footnote">(Must work in Yahoo Weather and identify a unique place - e.g. City, State or City, Country)</span>
</fieldset>
</div>
<div class="setting">
<fieldset>
<legend>Temperature Unit:</legend>
<select name="TempUnit" id="TempUnit">
<option value="Auto">Auto</option>
<option value="C">Celcius</option>
<option value="F">Fahrenheit</option>
</select>
</fieldset>
</div>
<div class="setting">
<fieldset>
<legend>Weather Update Interval:</legend>
<select name="UpdateInterval" id="UpdateInterval">
<option value="20">Every 20 minutes</option>
<option value="30">Every 30 minutes</option>
<option value="0">Every 60 minutes</option>
</select><br />
<span class="footnote">(Starting on the hour)</span>
</fieldset>
</div>
<div class="setting">
<fieldset>
<legend>First Day of the Week:</legend>
<select name="FirstDay" id="FirstDay">
<option value="0" selected="selected">Sunday</option>
<option value="1">Monday</option>
</select>
</fieldset>
</div>
<div class="setting">
<fieldset>
<legend>Calendar Weeks:</legend>
<select name="CalOffset" id="CalOffset">
<option value="0" selected="selected">Last wk + this wk + next wk</option>
<option value="7">This week + next 2 weeks</option>
</select>
</fieldset>
</div>
<div class="setting">
<fieldset>
<input type="button" value="Apply & Save" onclick="applySettings();" />
<div style="float: right; font-size: xx-small;">
v1.10
</div>
</fieldset>
</div>
</body>
</html>