mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Added option to calendar module that colors only the symbol instead of the whole line
This commit is contained in:
parent
05ef68e079
commit
8053256203
@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
- Enabled translation of feelsLike for module currentweather
|
- Enabled translation of feelsLike for module currentweather
|
||||||
- Added support for on-going calendar events
|
- Added support for on-going calendar events
|
||||||
|
- Added option to calendar module that colors only the symbol instead of the whole line
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Use Electron 2 Beta. **Please test!**
|
- Use Electron 2 Beta. **Please test!**
|
||||||
|
@ -53,11 +53,13 @@ The following properties can be configured:
|
|||||||
|
|
||||||
The `calendars` property contains an array of the configured calendars.
|
The `calendars` property contains an array of the configured calendars.
|
||||||
The `colored` property gives the option for an individual color for each calendar.
|
The `colored` property gives the option for an individual color for each calendar.
|
||||||
|
The `coloredSymbolOnly` property will apply color to the symbol only, not the whole line. This is only applicable when `colored` is also enabled.
|
||||||
|
|
||||||
#### Default value:
|
#### Default value:
|
||||||
````javascript
|
````javascript
|
||||||
config: {
|
config: {
|
||||||
colored: false,
|
colored: false,
|
||||||
|
coloredSymbolOnly: false,
|
||||||
calendars: [
|
calendars: [
|
||||||
{
|
{
|
||||||
url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',
|
url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',
|
||||||
|
@ -31,6 +31,7 @@ Module.register("calendar", {
|
|||||||
hidePrivate: false,
|
hidePrivate: false,
|
||||||
hideOngoing: false,
|
hideOngoing: false,
|
||||||
colored: false,
|
colored: false,
|
||||||
|
coloredSymbolOnly: false,
|
||||||
calendars: [
|
calendars: [
|
||||||
{
|
{
|
||||||
symbol: "calendar",
|
symbol: "calendar",
|
||||||
@ -135,7 +136,7 @@ Module.register("calendar", {
|
|||||||
var event = events[e];
|
var event = events[e];
|
||||||
var eventWrapper = document.createElement("tr");
|
var eventWrapper = document.createElement("tr");
|
||||||
|
|
||||||
if (this.config.colored) {
|
if (this.config.colored && !this.config.coloredSymbolOnly) {
|
||||||
eventWrapper.style.cssText = "color:" + this.colorForUrl(event.url);
|
eventWrapper.style.cssText = "color:" + this.colorForUrl(event.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,6 +144,11 @@ Module.register("calendar", {
|
|||||||
|
|
||||||
if (this.config.displaySymbol) {
|
if (this.config.displaySymbol) {
|
||||||
var symbolWrapper = document.createElement("td");
|
var symbolWrapper = document.createElement("td");
|
||||||
|
|
||||||
|
if (this.config.colored && this.config.coloredSymbolOnly) {
|
||||||
|
symbolWrapper.style.cssText = "color:" + this.colorForUrl(event.ulr);
|
||||||
|
}
|
||||||
|
|
||||||
symbolWrapper.className = "symbol align-right";
|
symbolWrapper.className = "symbol align-right";
|
||||||
var symbols = this.symbolsForUrl(event.url);
|
var symbols = this.symbolsForUrl(event.url);
|
||||||
if(typeof symbols === "string") {
|
if(typeof symbols === "string") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user