Huge cleanup of white space

This commit is contained in:
Domi-G
2016-04-01 22:52:32 +02:00
committed by Michael Teeuw
parent e448e87252
commit 576c668d84
41 changed files with 127 additions and 175 deletions

View File

@@ -1,6 +1,6 @@
# Module: Calendar
The `calendar` module is one of the default modules of the MagicMirror.
This module displays events from a public .ical calendar. It can combine multiple calendars.
This module displays events from a public .ical calendar. It can combine multiple calendars.
## Using the module
@@ -13,7 +13,7 @@ modules: [
config: {
// The config property is optional.
// If no config is set, an example calendar is shown.
// See 'Configuration options' for more information.
// See 'Configuration options' for more information.
}
}
]
@@ -100,7 +100,7 @@ The following properties can be configured:
<td><code>titleReplace</code></td>
<td>An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title.<br>
<br><b>Example:</b> <br>
<code>
titleReplace: {'Birthday of ' : '', 'foo':'bar'}
</code>
@@ -149,4 +149,4 @@ config: {
</td>
</tr>
</tbody>
</table>
</table>

View File

@@ -20,4 +20,4 @@
.calendar .time {
padding-left: 30px;
text-align: right;
}
}

View File

@@ -14,10 +14,10 @@ Module.register('calendar',{
maximumEntries: 10, // Total Maximum Entries
displaySymbol: true,
defaultSymbol: 'calendar', // Fontawsome Symbol see http://fontawesome.io/cheatsheet/
maxTitleLength: 25,
maxTitleLength: 25,
fetchInterval: 5 * 60 * 1000, // Update every 5 minutes.
animationSpeed: 2000,
fade: true,
fade: true,
fadePoint: 0.25, // Start on 1/4th of the list.
calendars: [
{
@@ -58,7 +58,7 @@ Module.register('calendar',{
// Override socket notification handler.
socketNotificationReceived: function(notification, payload) {
if (notification === 'CALENDAR_EVENTS') {
if (notification === 'CALENDAR_EVENTS') {
if (this.hasCalendarURL(payload.url)) {
this.calendarData[payload.url] = payload.events;
}
@@ -237,4 +237,4 @@ Module.register('calendar',{
title = this.shorten(title, this.config.maxTitleLength);
return title;
}
});
});

View File

@@ -42,7 +42,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
for (var e in data) {
var event = data[e];
if (event.type === 'VEVENT') {
var startDate = (event.start.length === 8) ? moment(event.start, 'YYYYMMDD') : moment(new Date(event.start));
@@ -62,7 +62,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
rule.timeset[0].minute = startDate.format('m');
rule.timeset[0].second = startDate.format('s');
}
var oneYear = new Date();
oneYear.setFullYear(oneYear.getFullYear() + 1);
@@ -92,7 +92,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
newEvents.sort(function(a,b) {
return a.startDate - b.startDate;
});
events = newEvents.slice(0, maximumEntries);
self.broadcastEvents();
@@ -180,7 +180,7 @@ module.exports = NodeHelper.create({
console.log('Starting node helper for: ' + this.name);
},
// Override socketNotificationReceived method.
@@ -211,7 +211,7 @@ module.exports = NodeHelper.create({
if (typeof self.fetchers[url] === 'undefined') {
console.log('Create new calendar fetcher for url: ' + url + ' - Interval: ' + fetchInterval);
fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries);
fetcher.onReceive(function(fetcher) {
//console.log('Broadcast events.');
//console.log(fetcher.events());
@@ -239,4 +239,3 @@ module.exports = NodeHelper.create({
fetcher.startFetch();
}
});