mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 21:13:49 +00:00
Merge branch 'develop' into develop
This commit is contained in:
commit
4d21f8d022
@ -15,6 +15,8 @@ _This release is scheduled to be released on 2020-07-01._
|
|||||||
|
|
||||||
- Added prettier for an even cleaner codebase
|
- Added prettier for an even cleaner codebase
|
||||||
|
|
||||||
|
- Hide Sunrise/Sunset in Weather module
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
- Cleaned up alert module code
|
- Cleaned up alert module code
|
||||||
@ -23,6 +25,7 @@ _This release is scheduled to be released on 2020-07-01._
|
|||||||
- Switch to most of the eslint:recommended rules and fix warnings
|
- Switch to most of the eslint:recommended rules and fix warnings
|
||||||
- Replaced insecure links with https ones
|
- Replaced insecure links with https ones
|
||||||
- Cleaned up all "no-undef" warnings from eslint
|
- Cleaned up all "no-undef" warnings from eslint
|
||||||
|
- Added location title wrapping for calendar module
|
||||||
|
|
||||||
### Deleted
|
### Deleted
|
||||||
|
|
||||||
@ -33,6 +36,7 @@ _This release is scheduled to be released on 2020-07-01._
|
|||||||
- The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973)
|
- The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973)
|
||||||
- Add backward compatibility for old module code in socketclient.js [#1973](https://github.com/MichMich/MagicMirror/issues/1973)
|
- Add backward compatibility for old module code in socketclient.js [#1973](https://github.com/MichMich/MagicMirror/issues/1973)
|
||||||
- Support multiple instances of calendar module with different config [#1109](https://github.com/MichMich/MagicMirror/issues/1109)
|
- Support multiple instances of calendar module with different config [#1109](https://github.com/MichMich/MagicMirror/issues/1109)
|
||||||
|
- Fix the use of "maxNumberOfDays" in the module "weatherforecast" [#2018](https://github.com/MichMich/MagicMirror/issues/2018)
|
||||||
|
|
||||||
## [2.11.0] - 2020-04-01
|
## [2.11.0] - 2020-04-01
|
||||||
|
|
||||||
|
@ -17,8 +17,11 @@ Module.register("calendar", {
|
|||||||
displayRepeatingCountTitle: false,
|
displayRepeatingCountTitle: false,
|
||||||
defaultRepeatingCountTitle: "",
|
defaultRepeatingCountTitle: "",
|
||||||
maxTitleLength: 25,
|
maxTitleLength: 25,
|
||||||
|
maxLocationTitleLength: 25,
|
||||||
wrapEvents: false, // wrap events to multiple lines breaking at maxTitleLength
|
wrapEvents: false, // wrap events to multiple lines breaking at maxTitleLength
|
||||||
|
wrapLocationEvents: false,
|
||||||
maxTitleLines: 3,
|
maxTitleLines: 3,
|
||||||
|
maxEventTitleLines: 3,
|
||||||
fetchInterval: 5 * 60 * 1000, // Update every 5 minutes.
|
fetchInterval: 5 * 60 * 1000, // Update every 5 minutes.
|
||||||
animationSpeed: 2000,
|
animationSpeed: 2000,
|
||||||
fade: true,
|
fade: true,
|
||||||
@ -45,6 +48,9 @@ Module.register("calendar", {
|
|||||||
"De verjaardag van ": "",
|
"De verjaardag van ": "",
|
||||||
"'s birthday": ""
|
"'s birthday": ""
|
||||||
},
|
},
|
||||||
|
locationTitleReplace: {
|
||||||
|
"street ": ""
|
||||||
|
},
|
||||||
broadcastEvents: true,
|
broadcastEvents: true,
|
||||||
excludedEvents: [],
|
excludedEvents: [],
|
||||||
sliceMultiDayEvents: false,
|
sliceMultiDayEvents: false,
|
||||||
@ -245,7 +251,7 @@ Module.register("calendar", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
titleWrapper.innerHTML = this.titleTransform(event.title) + repeatingCountTitle;
|
titleWrapper.innerHTML = this.titleTransform(event.title, this.config.titleReplace, this.config.wrapEvents, this.config.maxTitleLength, this.config.maxTitleLines) + repeatingCountTitle;
|
||||||
|
|
||||||
var titleClass = this.titleClassForUrl(event.url);
|
var titleClass = this.titleClassForUrl(event.url);
|
||||||
|
|
||||||
@ -393,7 +399,7 @@ Module.register("calendar", {
|
|||||||
var descCell = document.createElement("td");
|
var descCell = document.createElement("td");
|
||||||
descCell.className = "location";
|
descCell.className = "location";
|
||||||
descCell.colSpan = "2";
|
descCell.colSpan = "2";
|
||||||
descCell.innerHTML = event.location;
|
descCell.innerHTML = this.titleTransform(event.location, this.config.locationTitleReplace, this.config.wrapLocationEvents, this.config.maxLocationTitleLength, this.config.maxEventTitleLines);
|
||||||
locationRow.appendChild(descCell);
|
locationRow.appendChild(descCell);
|
||||||
|
|
||||||
wrapper.appendChild(locationRow);
|
wrapper.appendChild(locationRow);
|
||||||
@ -724,9 +730,9 @@ Module.register("calendar", {
|
|||||||
*
|
*
|
||||||
* return string - The transformed title.
|
* return string - The transformed title.
|
||||||
*/
|
*/
|
||||||
titleTransform: function (title) {
|
titleTransform: function (title, titleReplace, wrapEvents, maxTitleLength, maxTitleLines) {
|
||||||
for (var needle in this.config.titleReplace) {
|
for (var needle in titleReplace) {
|
||||||
var replacement = this.config.titleReplace[needle];
|
var replacement = titleReplace[needle];
|
||||||
|
|
||||||
var regParts = needle.match(/^\/(.+)\/([gim]*)$/);
|
var regParts = needle.match(/^\/(.+)\/([gim]*)$/);
|
||||||
if (regParts) {
|
if (regParts) {
|
||||||
@ -737,7 +743,7 @@ Module.register("calendar", {
|
|||||||
title = title.replace(needle, replacement);
|
title = title.replace(needle, replacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
title = this.shorten(title, this.config.maxTitleLength, this.config.wrapEvents, this.config.maxTitleLines);
|
title = this.shorten(title, maxTitleLength, wrapEvents, maxTitleLines);
|
||||||
return title;
|
return title;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -22,14 +22,16 @@
|
|||||||
{% if config.showHumidity and current.humidity %}
|
{% if config.showHumidity and current.humidity %}
|
||||||
<span>{{ current.humidity | decimalSymbol }}</span><sup> <i class="wi wi-humidity humidityIcon"></i></sup>
|
<span>{{ current.humidity | decimalSymbol }}</span><sup> <i class="wi wi-humidity humidityIcon"></i></sup>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="wi dimmed wi-{{ current.nextSunAction() }}"></span>
|
{% if config.showSun %}
|
||||||
<span>
|
<span class="wi dimmed wi-{{ current.nextSunAction() }}"></span>
|
||||||
{% if current.nextSunAction() === "sunset" %}
|
<span>
|
||||||
{{ current.sunset | formatTime }}
|
{% if current.nextSunAction() === "sunset" %}
|
||||||
{% else %}
|
{{ current.sunset | formatTime }}
|
||||||
{{ current.sunrise | formatTime }}
|
{% else %}
|
||||||
{% endif %}
|
{{ current.sunrise | formatTime }}
|
||||||
</span>
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="large light">
|
<div class="large light">
|
||||||
|
@ -31,6 +31,7 @@ Module.register("weather", {
|
|||||||
useBeaufort: true,
|
useBeaufort: true,
|
||||||
lang: config.language,
|
lang: config.language,
|
||||||
showHumidity: false,
|
showHumidity: false,
|
||||||
|
showSun: true,
|
||||||
degreeLabel: false,
|
degreeLabel: false,
|
||||||
decimalSymbol: ".",
|
decimalSymbol: ".",
|
||||||
showIndoorTemperature: false,
|
showIndoorTemperature: false,
|
||||||
|
@ -294,6 +294,8 @@ Module.register("weatherforecast", {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params += "&cnt=" + (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays);
|
||||||
|
|
||||||
params += "&units=" + this.config.units;
|
params += "&units=" + this.config.units;
|
||||||
params += "&lang=" + this.config.lang;
|
params += "&lang=" + this.config.lang;
|
||||||
params += "&APPID=" + this.config.appid;
|
params += "&APPID=" + this.config.appid;
|
||||||
|
@ -28,6 +28,7 @@ let config = {
|
|||||||
initialLoadDelay: 3000,
|
initialLoadDelay: 3000,
|
||||||
useBeaufort: false,
|
useBeaufort: false,
|
||||||
showWindDirectionAsArrow: true,
|
showWindDirectionAsArrow: true,
|
||||||
|
showSun: false,
|
||||||
showHumidity: true,
|
showHumidity: true,
|
||||||
roundTemp: true,
|
roundTemp: true,
|
||||||
degreeLabel: true
|
degreeLabel: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user