|
|
|
@ -17,7 +17,7 @@ function loadWeather(reload) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (userPosition.coords.accuracy > 99999) {
|
|
|
|
|
app.dialog.alert("Couldn't find your location. Wait for a GPS signal and try again.", "Error");
|
|
|
|
|
app.dialog.alert("Couldn't find your location. Wait a few seconds and press the reload button.", "Error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -197,15 +197,16 @@ function loadWeather(reload) {
|
|
|
|
|
var low = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.min)) : Math.round(resp.forecast[i].temp.min));
|
|
|
|
|
var high = (getStorage("units") == "metric" ? Math.round(ftoc(resp.forecast[i].temp.max)) + " °C" : Math.round(resp.forecast[i].temp.max) + " °F");
|
|
|
|
|
var precipcolor = precipChanceToColor(resp.forecast[i].precipitation.chance);
|
|
|
|
|
var uvcolor = uvIndexToColor(resp.forecast[i].uv_index);
|
|
|
|
|
forecastItems.push({
|
|
|
|
|
day: (i == 0 ? "Today" : formatTimestamp('l', resp.forecast[i].date)),
|
|
|
|
|
temps: low + " to " + high,
|
|
|
|
|
uv_index: resp.forecast[i].uv_index,
|
|
|
|
|
uv_color: uvIndexToColor(resp.forecast[i].uv_index),
|
|
|
|
|
uv_foreground: uvIndexToColor(resp.forecast[i].uv_index) == "yellow" ? "black" : "white",
|
|
|
|
|
uv_color: uvcolor,
|
|
|
|
|
uv_foreground: (uvcolor == "purple" ? "white" : "black"),
|
|
|
|
|
precip_chance: Math.round(resp.forecast[i].precipitation.chance * 100),
|
|
|
|
|
precip_color: precipcolor,
|
|
|
|
|
precip_foreground: precipcolor == "lightblue" ? "black" : "white"
|
|
|
|
|
precip_foreground: precipcolor == "blue" ? "white" : "black"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|