Merge branch 'develop' into single_line_news

This commit is contained in:
Andrew McOlash 2017-03-17 07:18:13 -05:00 committed by GitHub
commit d3fd9a188d
3 changed files with 19 additions and 1 deletions

View File

@ -48,6 +48,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add test for compliments module for parts of day
- Korean Translation.
- Added console warning on startup when deprecated config options are used
- Add option to display temperature unit label to the current weather module
- Added ability to disable wrapping of news items
### Fixed

View File

@ -33,6 +33,7 @@ The following properties can be configured:
| `appid` | The [OpenWeatherMap](https://home.openweathermap.org) API key, which can be obtained by creating an OpenWeatherMap account. <br><br> This value is **REQUIRED**
| `units` | What units to use. Specified by config.js <br><br> **Possible values:** `config.units` = Specified by config.js, `default` = Kelvin, `metric` = Celsius, `imperial` =Fahrenheit <br> **Default value:** `config.units`
| `roundTemp` | Round temperature value to nearest integer. <br><br> **Possible values:** `true` (round to integer) or `false` (display exact value with decimal point) <br> **Default value:** `false`
| `degreeLabel` | Show the degree label for your chosen units (Metric = C, Imperial = F, Kelvins = K). <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
| `updateInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `600000` (10 minutes)
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `1000` (1 second)
| `timeFormat` | Use 12 or 24 hour format. <br><br> **Possible values:** `12` or `24` <br> **Default value:** uses value of _config.timeFormat_

View File

@ -24,6 +24,7 @@ Module.register("currentweather",{
useBeaufort: true,
lang: config.language,
showHumidity: false,
degreeLabel: false,
initialLoadDelay: 0, // 0 seconds delay
retryDelay: 2500,
@ -182,9 +183,24 @@ Module.register("currentweather",{
weatherIcon.className = "wi weathericon " + this.weatherType;
large.appendChild(weatherIcon);
var degreeLabel = "";
if (this.config.degreeLabel) {
switch (this.config.units ) {
case "metric":
degreeLabel = "C";
break;
case "imperial":
degreeLabel = "F";
break;
case "default":
degreeLabel = "K";
break;
}
}
var temperature = document.createElement("span");
temperature.className = "bright";
temperature.innerHTML = " " + this.temperature + "&deg;";
temperature.innerHTML = " " + this.temperature + "&deg;" + degreeLabel;
large.appendChild(temperature);
wrapper.appendChild(large);