mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Squashed commit of the following:
commite38dd346d9
Author: Michael Teeuw <michael@xonaymedia.nl> Date: Sat Apr 2 19:17:30 2016 +0200 Add the possibility to set the maximum number of days. commit6f5c86775b
Author: Sam Vendittelli <sam.vendittelli@hotmail.com> Date: Sat Apr 2 06:27:44 2016 +0100 Fixed cursor appearing in margin Cursor was appearing in the margin so moved `cursor: none` property to html. commit576c668d84
Author: Domi-G <lessuseguy+githubdomig@gmail.com> Date: Fri Apr 1 22:52:32 2016 +0200 Huge cleanup of white space
This commit is contained in:
@@ -3,6 +3,7 @@ This version of the Magic Mirror software focusses on a modular plugin system. B
|
|||||||
|
|
||||||
#WARNING: THIS VERSION IS IN A VERY EARLY STAGE. IT IS NOT COMPLETED YET. PLEASE USE THE MASTER BRANCH.
|
#WARNING: THIS VERSION IS IN A VERY EARLY STAGE. IT IS NOT COMPLETED YET. PLEASE USE THE MASTER BRANCH.
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
##Usage
|
##Usage
|
||||||
1. Download the latest node version:
|
1. Download the latest node version:
|
||||||
`wget https://nodejs.org/dist/latest/node-v5.10.0-linux-armv6l.tar.gz` for Pi 1
|
`wget https://nodejs.org/dist/latest/node-v5.10.0-linux-armv6l.tar.gz` for Pi 1
|
||||||
@@ -13,6 +14,11 @@ This version of the Magic Mirror software focusses on a modular plugin system. B
|
|||||||
5. `npm install && npm start` (You may have to restart your terminal before this works)
|
5. `npm install && npm start` (You may have to restart your terminal before this works)
|
||||||
|
|
||||||
**Important:** `npm start` does NOT work via SSH you have to execute it in a terminal session running in a window-manager.
|
**Important:** `npm start` does NOT work via SSH you have to execute it in a terminal session running in a window-manager.
|
||||||
|
=======
|
||||||
|
##Usage
|
||||||
|
1. Install [Node.js](https://nodejs.org/en/)
|
||||||
|
2. Execute `npm install && npm start`.
|
||||||
|
>>>>>>> v2-beta
|
||||||
|
|
||||||
##Configuration
|
##Configuration
|
||||||
1. Duplicate `config/config.js.sample` to `config/config.js`.
|
1. Duplicate `config/config.js.sample` to `config/config.js`.
|
||||||
@@ -47,6 +53,3 @@ Things that still have to be implemented or changed.
|
|||||||
- **[MMM-Facial-Recognition by PaViRo](https://github.com/paviro/MMM-Facial-Recognition)** <br> Facial recognition and module swapping based on the current user ...
|
- **[MMM-Facial-Recognition by PaViRo](https://github.com/paviro/MMM-Facial-Recognition)** <br> Facial recognition and module swapping based on the current user ...
|
||||||
|
|
||||||
- **[MMM-Wunderlist by PaViRo](https://github.com/paviro/MMM-Wunderlist)** <br> Displays your Wunderlist todos on your mirror ...
|
- **[MMM-Wunderlist by PaViRo](https://github.com/paviro/MMM-Wunderlist)** <br> Displays your Wunderlist todos on your mirror ...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
body {
|
html {
|
||||||
cursor: none;
|
cursor: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
margin: 60px;
|
margin: 60px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: calc(100% - 120px);
|
height: calc(100% - 120px);
|
||||||
|
@@ -45,4 +45,3 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,6 +91,3 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -249,10 +249,3 @@ var Loader = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
13
js/main.js
13
js/main.js
@@ -47,8 +47,6 @@ var MM = (function() {
|
|||||||
moduleContent.className = "module-content";
|
moduleContent.className = "module-content";
|
||||||
dom.appendChild(moduleContent);
|
dom.appendChild(moduleContent);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateDom(module, 0);
|
updateDom(module, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +97,6 @@ var MM = (function() {
|
|||||||
|
|
||||||
if (!module.hidden) {
|
if (!module.hidden) {
|
||||||
|
|
||||||
|
|
||||||
if (!moduleNeedsUpdate(module, newContent)) {
|
if (!moduleNeedsUpdate(module, newContent)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -197,7 +194,6 @@ var MM = (function() {
|
|||||||
if (typeof callback === 'function') { callback(); }
|
if (typeof callback === 'function') { callback(); }
|
||||||
}, speed);
|
}, speed);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -320,8 +316,6 @@ var MM = (function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (typeof modules.withClass === 'undefined') { Object.defineProperty(modules, 'withClass', {value: withClass, enumerable: false}); }
|
if (typeof modules.withClass === 'undefined') { Object.defineProperty(modules, 'withClass', {value: withClass, enumerable: false}); }
|
||||||
if (typeof modules.exceptWithClass === 'undefined') { Object.defineProperty(modules, 'exceptWithClass', {value: exceptWithClass, enumerable: false}); }
|
if (typeof modules.exceptWithClass === 'undefined') { Object.defineProperty(modules, 'exceptWithClass', {value: exceptWithClass, enumerable: false}); }
|
||||||
if (typeof modules.exceptModule === 'undefined') { Object.defineProperty(modules, 'exceptModule', {value: exceptModule, enumerable: false}); }
|
if (typeof modules.exceptModule === 'undefined') { Object.defineProperty(modules, 'exceptModule', {value: exceptModule, enumerable: false}); }
|
||||||
@@ -329,8 +323,6 @@ var MM = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/* Public Methods */
|
/* Public Methods */
|
||||||
|
|
||||||
@@ -442,8 +434,3 @@ var MM = (function() {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
MM.init();
|
MM.init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -99,7 +99,6 @@ var Module = Class.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************
|
/*********************************************
|
||||||
* The methods below don't need subclassing. *
|
* The methods below don't need subclassing. *
|
||||||
*********************************************/
|
*********************************************/
|
||||||
@@ -285,6 +284,3 @@ Module.register = function(name, moduleDefinition) {
|
|||||||
Log.log('Module registered: ' + name);
|
Log.log('Module registered: ' + name);
|
||||||
Module.definitions[name] = moduleDefinition;
|
Module.definitions[name] = moduleDefinition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,8 +7,6 @@
|
|||||||
* MIT Licensed.
|
* MIT Licensed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var MMSocket = function(moduleName) {
|
var MMSocket = function(moduleName) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
@@ -36,5 +34,3 @@ var MMSocket = function(moduleName) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@@ -40,6 +40,12 @@ The following properties can be configured:
|
|||||||
<br><b>Default value:</b> <code>10</code>
|
<br><b>Default value:</b> <code>10</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>maximumNumberOfDays</code></td>
|
||||||
|
<td>The maximum number of days in the future.<br>
|
||||||
|
<br><b>Default value:</b> <code>365</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>displaySymbol</code></td>
|
<td><code>displaySymbol</code></td>
|
||||||
<td>Display a symbol in front of an entry.<br>
|
<td>Display a symbol in front of an entry.<br>
|
||||||
|
@@ -12,6 +12,7 @@ Module.register('calendar',{
|
|||||||
// Define module defaults
|
// Define module defaults
|
||||||
defaults: {
|
defaults: {
|
||||||
maximumEntries: 10, // Total Maximum Entries
|
maximumEntries: 10, // Total Maximum Entries
|
||||||
|
maximumNumberOfDays: 365,
|
||||||
displaySymbol: true,
|
displaySymbol: true,
|
||||||
defaultSymbol: 'calendar', // Fontawsome Symbol see http://fontawesome.io/cheatsheet/
|
defaultSymbol: 'calendar', // Fontawsome Symbol see http://fontawesome.io/cheatsheet/
|
||||||
maxTitleLength: 25,
|
maxTitleLength: 25,
|
||||||
@@ -180,6 +181,7 @@ Module.register('calendar',{
|
|||||||
this.sendSocketNotification('ADD_CALENDAR', {
|
this.sendSocketNotification('ADD_CALENDAR', {
|
||||||
url: url,
|
url: url,
|
||||||
maximumEntries: this.config.maximumEntries,
|
maximumEntries: this.config.maximumEntries,
|
||||||
|
maximumNumberOfDays: this.config.maximumNumberOfDays,
|
||||||
fetchInterval: this.config.fetchInterval
|
fetchInterval: this.config.fetchInterval
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@@ -10,7 +10,7 @@ var ical = require('ical');
|
|||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var validUrl = require('valid-url');
|
var validUrl = require('valid-url');
|
||||||
|
|
||||||
var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
|
var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumberOfDays) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var reloadTimer = null;
|
var reloadTimer = null;
|
||||||
@@ -42,6 +42,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
|
|||||||
|
|
||||||
for (var e in data) {
|
for (var e in data) {
|
||||||
var event = data[e];
|
var event = data[e];
|
||||||
|
var today = moment().startOf('day');
|
||||||
|
|
||||||
if (event.type === 'VEVENT') {
|
if (event.type === 'VEVENT') {
|
||||||
var startDate = (event.start.length === 8) ? moment(event.start, 'YYYYMMDD') : moment(new Date(event.start));
|
var startDate = (event.start.length === 8) ? moment(event.start, 'YYYYMMDD') : moment(new Date(event.start));
|
||||||
@@ -54,6 +55,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
|
|||||||
// This causes the times of the recurring event to be incorrect.
|
// This causes the times of the recurring event to be incorrect.
|
||||||
// By adjusting the timeset property, this issue is solved.
|
// By adjusting the timeset property, this issue is solved.
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
|
|
||||||
if (rule.timeset[0].hour == now.getHours(),
|
if (rule.timeset[0].hour == now.getHours(),
|
||||||
rule.timeset[0].minute == now.getMinutes(),
|
rule.timeset[0].minute == now.getMinutes(),
|
||||||
rule.timeset[0].second == now.getSeconds()) {
|
rule.timeset[0].second == now.getSeconds()) {
|
||||||
@@ -63,10 +65,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
|
|||||||
rule.timeset[0].second = startDate.format('s');
|
rule.timeset[0].second = startDate.format('s');
|
||||||
}
|
}
|
||||||
|
|
||||||
var oneYear = new Date();
|
var dates = rule.between(new Date(), today.add(maximumNumberOfDays, 'days') , true, limitFunction);
|
||||||
oneYear.setFullYear(oneYear.getFullYear() + 1);
|
|
||||||
|
|
||||||
var dates = rule.between(new Date(), oneYear, true, limitFunction);
|
|
||||||
//console.log(dates);
|
//console.log(dates);
|
||||||
for (var d in dates) {
|
for (var d in dates) {
|
||||||
startDate = moment(new Date(dates[d]));
|
startDate = moment(new Date(dates[d]));
|
||||||
@@ -78,8 +77,8 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) {
|
|||||||
} else {
|
} else {
|
||||||
// Single event.
|
// Single event.
|
||||||
|
|
||||||
var today = moment().startOf('day');
|
|
||||||
if (startDate > today) {
|
if (startDate > today && startDate <= today.add(maximumNumberOfDays, 'days')) {
|
||||||
newEvents.push({
|
newEvents.push({
|
||||||
title: event.summary,
|
title: event.summary,
|
||||||
startDate: startDate.format('x')
|
startDate: startDate.format('x')
|
||||||
@@ -187,7 +186,7 @@ module.exports = NodeHelper.create({
|
|||||||
socketNotificationReceived: function(notification, payload) {
|
socketNotificationReceived: function(notification, payload) {
|
||||||
if (notification === 'ADD_CALENDAR') {
|
if (notification === 'ADD_CALENDAR') {
|
||||||
//console.log('ADD_CALENDAR: ');
|
//console.log('ADD_CALENDAR: ');
|
||||||
this.createFetcher(payload.url, payload.fetchInterval, payload.maximumEntries);
|
this.createFetcher(payload.url, payload.fetchInterval, payload.maximumEntries, payload.maximumNumberOfDays);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -199,7 +198,7 @@ module.exports = NodeHelper.create({
|
|||||||
* attribute reloadInterval number - Reload interval in milliseconds.
|
* attribute reloadInterval number - Reload interval in milliseconds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
createFetcher: function(url, fetchInterval, maximumEntries) {
|
createFetcher: function(url, fetchInterval, maximumEntries, maximumNumberOfDays) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
if (!validUrl.isUri(url)){
|
if (!validUrl.isUri(url)){
|
||||||
@@ -210,7 +209,7 @@ module.exports = NodeHelper.create({
|
|||||||
var fetcher;
|
var fetcher;
|
||||||
if (typeof self.fetchers[url] === 'undefined') {
|
if (typeof self.fetchers[url] === 'undefined') {
|
||||||
console.log('Create new calendar fetcher for url: ' + url + ' - Interval: ' + fetchInterval);
|
console.log('Create new calendar fetcher for url: ' + url + ' - Interval: ' + fetchInterval);
|
||||||
fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries);
|
fetcher = new CalendarFetcher(url, fetchInterval, maximumEntries, maximumNumberOfDays);
|
||||||
|
|
||||||
fetcher.onReceive(function(fetcher) {
|
fetcher.onReceive(function(fetcher) {
|
||||||
//console.log('Broadcast events.');
|
//console.log('Broadcast events.');
|
||||||
@@ -239,4 +238,3 @@ module.exports = NodeHelper.create({
|
|||||||
fetcher.startFetch();
|
fetcher.startFetch();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -64,4 +64,3 @@ Module.register('clock',{
|
|||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -120,4 +120,3 @@ Module.register('compliments',{
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -268,4 +268,3 @@ Module.register('currentweather',{
|
|||||||
return parseFloat(temperature).toFixed(1);
|
return parseFloat(temperature).toFixed(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -24,4 +24,3 @@ Module.register('helloworld',{
|
|||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -73,4 +73,3 @@ The following properties can be configured:
|
|||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@@ -119,5 +119,3 @@ Module.register('newsfeed',{
|
|||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@@ -70,7 +70,3 @@ module.exports = NodeHelper.create({
|
|||||||
fetcher.startFetch();
|
fetcher.startFetch();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -277,4 +277,3 @@ Module.register('weatherforecast',{
|
|||||||
return parseFloat(temperature).toFixed(1);
|
return parseFloat(temperature).toFixed(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user