Get weather source attribution from server (close #43)

Skylar Ittner 4 years ago
parent 304240bf91
commit 69f691caab

@ -1,4 +1,4 @@
/* /*
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
@ -57,6 +57,8 @@ function loadWeather(reload) {
} }
$("#forecast-location").text(resp.location_name); $("#forecast-location").text(resp.location_name);
$("#forecast-info").text("Forecast covers the next " + resp.forecast_hours + " hours (until " + timestampToTimeString(resp.forecast_until) + ")."); $("#forecast-info").text("Forecast covers the next " + resp.forecast_hours + " hours (until " + timestampToTimeString(resp.forecast_until) + ").");
$("#forecast-creditlink").text(resp.source.text);
$("#forecast-creditlink").attr("onclick", "openExternalBrowser('" + resp.source.url + "')");
} else { } else {
app.dialog.alert(resp.message, "Error"); app.dialog.alert(resp.message, "Error");
} }

@ -38,13 +38,13 @@
<h3>Wind speed: <span id="windspeed">...</span></h3> <h3>Wind speed: <span id="windspeed">...</span></h3>
</div> </div>
</div> </div>
<div class="block-footer"> <div class="block-footer">
<span id="forecast-location"></span> <span id="forecast-location"></span>
<br /> <br />
<span id="forecast-info"></span> <span id="forecast-info"></span>
<br /> <br />
<a href="" onclick="openExternalBrowser('https://darksky.net/poweredby/')">Powered by Dark Sky</a> <a id="forecast-creditlink" href="" onclick=""></a>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save