added possibility to color max and min temprature

This commit is contained in:
Jeremias Arnstadt 2017-01-28 18:01:37 +01:00
parent 8010e6220d
commit 09ba1e2470
2 changed files with 12 additions and 0 deletions

View File

@ -17,3 +17,11 @@
padding-left: 20px; padding-left: 20px;
padding-right: 0; padding-right: 0;
} }
.weatherforecast tr.colored .min-temp {
color: #BCDDFF;
}
.weatherforecast tr.colored .max-temp {
color: #FF8E99;
}

View File

@ -23,6 +23,7 @@ Module.register("weatherforecast",{
lang: config.language, lang: config.language,
fade: true, fade: true,
fadePoint: 0.25, // Start on 1/4th of the list. fadePoint: 0.25, // Start on 1/4th of the list.
colored: false,
initialLoadDelay: 2500, // 2.5 seconds delay. This delay is used to keep the OpenWeather API happy. initialLoadDelay: 2500, // 2.5 seconds delay. This delay is used to keep the OpenWeather API happy.
retryDelay: 2500, retryDelay: 2500,
@ -120,6 +121,9 @@ Module.register("weatherforecast",{
var forecast = this.forecast[f]; var forecast = this.forecast[f];
var row = document.createElement("tr"); var row = document.createElement("tr");
if (this.config.colored) {
row.className = "colored";
}
table.appendChild(row); table.appendChild(row);
var dayCell = document.createElement("td"); var dayCell = document.createElement("td");