From 576c668d84b34b8ad7a0fd51b146fde60f721682 Mon Sep 17 00:00:00 2001 From: Domi-G Date: Fri, 1 Apr 2016 22:52:32 +0200 Subject: [PATCH 1/6] Huge cleanup of white space --- LICENSE | 2 +- README.md | 9 ++--- config/.gitignore | 2 +- config/config.js.sample | 6 +-- css/main.css | 2 +- fonts/Apache License.txt | 2 +- fonts/robot.css | 1 - fonts/roboto.css | 3 -- js/class.js | 30 +++++++------- js/defaults.js | 2 +- js/electron.js | 2 +- js/loader.js | 23 ++++------- js/logger.js | 2 +- js/main.js | 39 +++++++------------ js/module.js | 16 +++----- js/server.js | 2 +- js/socket.js | 8 +--- js/socketclient.js | 2 +- modules/default/calendar/README.md | 8 ++-- modules/default/calendar/calendar.css | 2 +- modules/default/calendar/calendar.js | 8 ++-- modules/default/calendar/node_helper.js | 11 +++--- modules/default/clock/README.md | 2 +- modules/default/clock/clock.js | 7 ++-- modules/default/compliments/README.md | 6 +-- modules/default/compliments/compliments.js | 11 +++--- modules/default/currentweather/README.md | 6 +-- .../default/currentweather/currentweather.css | 2 +- .../default/currentweather/currentweather.js | 15 ++++--- modules/default/defaultmodules.js | 2 +- modules/default/helloworld/README.md | 6 +-- modules/default/helloworld/helloworld.js | 3 +- modules/default/newsfeed/README.md | 9 ++--- modules/default/newsfeed/fetcher.js | 4 +- modules/default/newsfeed/newsfeed.js | 10 ++--- modules/default/newsfeed/newsfetcher.js | 8 ++-- modules/default/newsfeed/node_helper.js | 8 +--- modules/default/weatherforecast/README.md | 6 +-- .../weatherforecast/weatherforecast.css | 2 +- .../weatherforecast/weatherforecast.js | 11 +++--- vendor/vendor.js | 2 +- 41 files changed, 127 insertions(+), 175 deletions(-) diff --git a/LICENSE b/LICENSE index 399a003f..de5cf3da 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index 3df3738a..9a972b5a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # MagicMirror V2 -This version of the Magic Mirror software focusses on a modular plugin system. Besides that, the Magic Mirror software now also uses [Electron](http://electron.atom.io/), so no more webserver or browser installs necessary. +This version of the Magic Mirror software focusses on a modular plugin system. Besides that, the Magic Mirror software now also uses [Electron](http://electron.atom.io/), so no more webserver or browser installs necessary. #WARNING: THIS VERSION IS IN A VERY EARLY STAGE. IT IS NOT COMPLETED YET. PLEASE USE THE MASTER BRANCH. -##Usage +##Usage 1. Install [Node.js](https://nodejs.org/en/) 2. Execute `npm install && npm start`. @@ -21,7 +21,7 @@ Things that still have to be implemented or changed. ####Documentation - Write all the documentation. :) -##Modules +##Modules ### Default modules: - [**Clock**](modules/default/clock) @@ -39,6 +39,3 @@ Things that still have to be implemented or changed. - **[MMM-Facial-Recognition by PaViRo](https://github.com/paviro/MMM-Facial-Recognition)**
Facial recognition and module swapping based on the current user ... - **[MMM-Wunderlist by PaViRo](https://github.com/paviro/MMM-Wunderlist)**
Displays your Wunderlist todos on your mirror ... - - - diff --git a/config/.gitignore b/config/.gitignore index a2d72a24..1bf4259a 100644 --- a/config/.gitignore +++ b/config/.gitignore @@ -1 +1 @@ -config.js \ No newline at end of file +config.js diff --git a/config/config.js.sample b/config/config.js.sample index c4dc2c62..c18ce671 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -24,7 +24,7 @@ var config = { config: { calendars: [ { - symbol: 'calendar-check-o ', + symbol: 'calendar-check-o ', url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics' } ] @@ -60,9 +60,9 @@ var config = { } }, ] - + }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = config;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = config;} diff --git a/css/main.css b/css/main.css index 31dbcee4..d50e9f2c 100644 --- a/css/main.css +++ b/css/main.css @@ -135,4 +135,4 @@ sup { width: 100%; border-spacing: 0px; border-collapse: separate; -} \ No newline at end of file +} diff --git a/fonts/Apache License.txt b/fonts/Apache License.txt index 63d53024..aa4927d8 100755 --- a/fonts/Apache License.txt +++ b/fonts/Apache License.txt @@ -200,4 +200,4 @@ Font data copyright Google 2012 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/fonts/robot.css b/fonts/robot.css index 5f2e8d12..46236428 100644 --- a/fonts/robot.css +++ b/fonts/robot.css @@ -45,4 +45,3 @@ font-style: normal; } - diff --git a/fonts/roboto.css b/fonts/roboto.css index 3af3597b..25c33dfd 100644 --- a/fonts/roboto.css +++ b/fonts/roboto.css @@ -91,6 +91,3 @@ font-style: normal; } - - - diff --git a/js/class.js b/js/class.js index cd6cd2dc..726e1abc 100644 --- a/js/class.js +++ b/js/class.js @@ -2,24 +2,24 @@ * By John Resig http://ejohn.org/ * MIT Licensed. */ - + // Inspired by base2 and Prototype (function(){ var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; - + // The base Class implementation (does nothing) this.Class = function(){}; - + // Create a new Class that inherits from this class Class.extend = function(prop) { var _super = this.prototype; - + // Instantiate a base class (but only create the instance, // don't run the init constructor) initializing = true; var prototype = new this(); initializing = false; - + // Copy the properties over onto the new prototype for (var name in prop) { // Check if we're overwriting an existing function @@ -28,42 +28,42 @@ (function(name, fn){ return function() { var tmp = this._super; - + // Add a new ._super() method that is the same method // but on the super-class this._super = _super[name]; - + // The method only need to be bound temporarily, so we // remove it when we're done executing - var ret = fn.apply(this, arguments); + var ret = fn.apply(this, arguments); this._super = tmp; - + return ret; }; })(name, prop[name]) : prop[name]; } - + // The dummy class constructor function Class() { // All construction is actually done in the init method if ( !initializing && this.init ) this.init.apply(this, arguments); } - + // Populate our constructed prototype object Class.prototype = prototype; - + // Enforce the constructor to be what we expect Class.prototype.constructor = Class; - + // And make this class extendable Class.extend = arguments.callee; - + return Class; }; })(); /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = Class;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = Class;} diff --git a/js/defaults.js b/js/defaults.js index 33707784..f8656c44 100644 --- a/js/defaults.js +++ b/js/defaults.js @@ -55,4 +55,4 @@ var defaults = { /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = defaults;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = defaults;} diff --git a/js/electron.js b/js/electron.js index 74192f6c..b3a857a4 100755 --- a/js/electron.js +++ b/js/electron.js @@ -61,7 +61,7 @@ function loadModule(module) { var elements = module.split('/'); var moduleName = elements[elements.length - 1]; var moduleFolder = __dirname + '/../modules/' + module; - + if (defaultModules.indexOf(moduleName) !== -1) { moduleFolder = __dirname + '/../modules/default/' + module; } diff --git a/js/loader.js b/js/loader.js index 0c6f661c..4f650ac6 100644 --- a/js/loader.js +++ b/js/loader.js @@ -41,7 +41,7 @@ var Loader = (function() { } }; - loadNextModule(); + loadNextModule(); }; /* startModules() @@ -60,7 +60,7 @@ var Loader = (function() { /* getAllModules() * Retrieve list of all modules. * - * return array - module data as configured in config + * return array - module data as configured in config */ var getAllModules = function() { return config.modules; @@ -82,7 +82,7 @@ var Loader = (function() { var elements = module.split('/'); var moduleName = elements[elements.length - 1]; var moduleFolder = config.paths.modules + '/' + module; - + if (defaultModules.indexOf(moduleName) !== -1) { moduleFolder = config.paths.modules + '/default/' + module; } @@ -130,8 +130,8 @@ var Loader = (function() { afterLoad(); }); } - - }; + + }; /* bootstrapModule(module, mObj) * Bootstrap modules by setting the module data and loading the scripts & styles. @@ -154,8 +154,8 @@ var Loader = (function() { callback(); }); }); - - + + }; /* loadFile(fileName) @@ -194,7 +194,7 @@ var Loader = (function() { }; document.getElementsByTagName("head")[0].appendChild(stylesheet); - break; + break; } }; @@ -249,10 +249,3 @@ var Loader = (function() { }; })(); - - - - - - - diff --git a/js/logger.js b/js/logger.js index 27bb5ca5..1389c5f9 100644 --- a/js/logger.js +++ b/js/logger.js @@ -9,7 +9,7 @@ */ -// This logger is very simple, but needs to be extended. +// This logger is very simple, but needs to be extended. // This system can eventually be used to push the log messages to an external target. diff --git a/js/main.js b/js/main.js index 4bc15d02..a45c56b1 100644 --- a/js/main.js +++ b/js/main.js @@ -15,13 +15,13 @@ var MM = (function() { /* Private Methods */ /* createDomObjects() - * Create dom objects for all modules that + * Create dom objects for all modules that * are configured for a specific position. */ var createDomObjects = function() { for (var m in modules) { var module = modules[m]; - + if (typeof module.data.position === 'string') { var wrapper = selectWrapper(module.data.position); @@ -47,13 +47,11 @@ var MM = (function() { moduleContent.className = "module-content"; dom.appendChild(moduleContent); - - updateDom(module, 0); } } - sendNotification('DOM_OBJECTS_CREATED'); + sendNotification('DOM_OBJECTS_CREATED'); }; /* selectWrapper(position) @@ -99,7 +97,6 @@ var MM = (function() { if (!module.hidden) { - if (!moduleNeedsUpdate(module, newContent)) { return; } @@ -173,7 +170,7 @@ var MM = (function() { // the .display property. moduleWrapper.style.position = 'absolute'; - if (typeof callback === 'function') { callback(); } + if (typeof callback === 'function') { callback(); } }, speed); } }; @@ -194,10 +191,9 @@ var MM = (function() { moduleWrapper.style.opacity = 1; setTimeout(function() { - if (typeof callback === 'function') { callback(); } + if (typeof callback === 'function') { callback(); } }, speed); - } }; @@ -216,14 +212,14 @@ var MM = (function() { /* setSelectionMethodsForModules() * Adds special selectors on a collection of modules. - * + * * argument modules array - Array of modules. */ var setSelectionMethodsForModules = function(modules) { /* withClass(className) * filters a collection of modules based on classname(s). - * + * * argument className string/array - one or multiple classnames. (array or space devided) * * return array - Filtered collection of modules. @@ -245,7 +241,7 @@ var MM = (function() { if (classes.indexOf(searchClass.toLowerCase()) !== -1) { newModules.push(module); } - } + } } setSelectionMethodsForModules(newModules); @@ -254,7 +250,7 @@ var MM = (function() { /* exceptWithClass(className) * filters a collection of modules based on classname(s). (NOT) - * + * * argument className string/array - one or multiple classnames. (array or space devided) * * return array - Filtered collection of modules. @@ -280,7 +276,7 @@ var MM = (function() { } if (!foundClass) { newModules.push(module); - } + } } setSelectionMethodsForModules(newModules); @@ -289,7 +285,7 @@ var MM = (function() { /* exceptModule(module) * Removes a module instance from the collection. - * + * * argument module Module object - The module instance to remove from the collection. * * return array - Filtered collection of modules. @@ -310,7 +306,7 @@ var MM = (function() { /* enumerate(callback) * Walks thru a collection of modules and executes the callback with the module as an argument. - * + * * argument callback function - The function to execute with the module as an argument. */ var enumerate = function(callback) { @@ -320,8 +316,6 @@ var MM = (function() { } }; - - 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.exceptModule === 'undefined') { Object.defineProperty(modules, 'exceptModule', {value: exceptModule, enumerable: false}); } @@ -329,8 +323,6 @@ var MM = (function() { }; - - return { /* Public Methods */ @@ -399,7 +391,7 @@ var MM = (function() { Log.error('updateDom: Sender should be a module.'); return; } - + // Further implementation is done in the private method. updateDom(module, speed); }, @@ -442,8 +434,3 @@ var MM = (function() { })(); MM.init(); - - - - - diff --git a/js/module.js b/js/module.js index 20609b54..2c2c18d2 100644 --- a/js/module.js +++ b/js/module.js @@ -57,11 +57,11 @@ var Module = Class.extend({ */ getDom: function() { var nameWrapper = document.createElement("div"); - var name = document.createTextNode(this.name); + var name = document.createTextNode(this.name); nameWrapper.appendChild(name); var identifierWrapper = document.createElement("div"); - var identifier = document.createTextNode(this.identifier); + var identifier = document.createTextNode(this.identifier); identifierWrapper.appendChild(identifier); identifierWrapper.className = "small dimmed"; @@ -69,7 +69,7 @@ var Module = Class.extend({ div.appendChild(nameWrapper); div.appendChild(identifierWrapper); - return div; + return div; }, /* notificationReceived(notification, payload, sender) @@ -99,7 +99,6 @@ var Module = Class.extend({ }, - /********************************************* * The methods below don't need subclassing. * *********************************************/ @@ -262,12 +261,12 @@ Module.create = function(name) { if (obj === null || typeof obj !== 'object') { return obj; } - + var temp = obj.constructor(); // give temp the original obj's constructor for (var key in obj) { temp[key] = cloneObject(obj[key]); } - + return temp; } @@ -278,13 +277,10 @@ Module.create = function(name) { var ModuleClass = Module.extend(clonedDefinition); return new ModuleClass(); - + }; Module.register = function(name, moduleDefinition) { Log.log('Module registered: ' + name); Module.definitions[name] = moduleDefinition; }; - - - diff --git a/js/server.js b/js/server.js index 4440e1aa..aac4d839 100644 --- a/js/server.js +++ b/js/server.js @@ -31,4 +31,4 @@ var Server = function(config, callback) { } }; -module.exports = Server; \ No newline at end of file +module.exports = Server; diff --git a/js/socket.js b/js/socket.js index 4badc5f8..8f3abaf1 100644 --- a/js/socket.js +++ b/js/socket.js @@ -7,8 +7,6 @@ * MIT Licensed. */ - - var MMSocket = function(moduleName) { var self = this; @@ -18,7 +16,7 @@ var MMSocket = function(moduleName) { } self.moduleName = moduleName; - + self.socket = io('http://localhost:8080'); self.socket.on('notification', function (data) { @@ -35,6 +33,4 @@ var MMSocket = function(moduleName) { }); } }; -}; - - \ No newline at end of file +}; diff --git a/js/socketclient.js b/js/socketclient.js index 32142e94..c834679a 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -39,4 +39,4 @@ var MMSocket = function(moduleName) { } socket.emit(notification, payload); }; -}; \ No newline at end of file +}; diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 41d6242e..2c3ad142 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -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: titleReplace An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title.

Example:
- + titleReplace: {'Birthday of ' : '', 'foo':'bar'} @@ -149,4 +149,4 @@ config: { - \ No newline at end of file + diff --git a/modules/default/calendar/calendar.css b/modules/default/calendar/calendar.css index 36e175a0..a292a707 100644 --- a/modules/default/calendar/calendar.css +++ b/modules/default/calendar/calendar.css @@ -20,4 +20,4 @@ .calendar .time { padding-left: 30px; text-align: right; -} \ No newline at end of file +} diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 786b2aea..f7b837b0 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -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; } -}); \ No newline at end of file +}); diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index e9212869..09e212b0 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -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(); } }); - diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index c0674b28..ab65d3f4 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -12,7 +12,7 @@ modules: [ position: 'top_left', // This can be any of the regions. config: { // The config property is optional. - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. } } ] diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index df8ec2a5..b71f4313 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -33,7 +33,7 @@ Module.register('clock',{ // Set locale. moment.locale(config.language); }, - + // Override dom generator. getDom: function() { @@ -52,16 +52,15 @@ Module.register('clock',{ dateWrapper.innerHTML = moment().format('dddd, LL'); timeWrapper.innerHTML = moment().format((this.config.timeFormat === 24) ? 'HH:mm' : ('hh:mm')); secondsWrapper.innerHTML = moment().format('ss'); - + // Combine wrappers. wrapper.appendChild(dateWrapper); wrapper.appendChild(timeWrapper); if (this.config.displaySeconds) { timeWrapper.appendChild(secondsWrapper); } - + // Return the wrapper to the dom. return wrapper; } }); - diff --git a/modules/default/compliments/README.md b/modules/default/compliments/README.md index 210f88ed..bf5b9538 100644 --- a/modules/default/compliments/README.md +++ b/modules/default/compliments/README.md @@ -1,6 +1,6 @@ # Module: Compliments The `compliments` module is one of the default modules of the MagicMirror. -This module displays a random compliment. +This module displays a random compliment. ## Using the module @@ -14,7 +14,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. } } ] @@ -84,4 +84,4 @@ config: { ] } } -```` \ No newline at end of file +```` diff --git a/modules/default/compliments/compliments.js b/modules/default/compliments/compliments.js index 33586bad..d018680d 100644 --- a/modules/default/compliments/compliments.js +++ b/modules/default/compliments/compliments.js @@ -40,7 +40,7 @@ Module.register('compliments',{ // Define start sequence. start: function() { Log.info('Starting module: ' + this.name); - + this.lastComplimentIndex = -1; // Schedule update timer. @@ -105,19 +105,18 @@ Module.register('compliments',{ var index = this.randomIndex(compliments); return compliments[index]; - }, + }, // Override dom generator. getDom: function() { var complimentText = this.randomCompliment(); - var compliment = document.createTextNode(complimentText); + var compliment = document.createTextNode(complimentText); var wrapper = document.createElement("div"); wrapper.className = 'thin xlarge bright'; wrapper.appendChild(compliment); - return wrapper; + return wrapper; } - -}); +}); diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index c3834674..4a418ad9 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -12,7 +12,7 @@ modules: [ position: 'top_right', // This can be any of the regions. // Best results in left or right regions. config: { - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. } @@ -140,6 +140,6 @@ The following properties can be configured: } - + - \ No newline at end of file + diff --git a/modules/default/currentweather/currentweather.css b/modules/default/currentweather/currentweather.css index b953534b..cf0649dc 100644 --- a/modules/default/currentweather/currentweather.css +++ b/modules/default/currentweather/currentweather.css @@ -6,4 +6,4 @@ -ms-transform: translate(0px,-3px); /* IE 9 */ -webkit-transform: translate(0px,-3px); /* Safari */ transform: translate(0px,-3px); -} \ No newline at end of file +} diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 9c33a43b..17b23bce 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -65,7 +65,7 @@ Module.register('currentweather',{ // Set locale. moment.locale(config.language); - + this.windSpeed = null; this.sunriseSunsetTime = null; this.sunriseSunsetIcon = null; @@ -76,7 +76,7 @@ Module.register('currentweather',{ this.scheduleUpdate(this.config.initialLoadDelay); this.updateTimer = null; - + }, // Override dom generator. @@ -110,7 +110,7 @@ Module.register('currentweather',{ small.appendChild(windIcon); var windSpeed = document.createElement("span"); - windSpeed.innerHTML = " " + this.windSpeed; + windSpeed.innerHTML = " " + this.windSpeed; small.appendChild(windSpeed); var spacer = document.createElement("span"); @@ -122,7 +122,7 @@ Module.register('currentweather',{ small.appendChild(sunriseSunsetIcon); var sunriseSunsetTime = document.createElement("span"); - sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; + sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; small.appendChild(sunriseSunsetTime); var large = document.createElement("div"); @@ -134,7 +134,7 @@ Module.register('currentweather',{ var temperature = document.createElement("span"); temperature.className = "bright"; - temperature.innerHTML = " " + this.temperature + '°'; + temperature.innerHTML = " " + this.temperature + '°'; large.appendChild(temperature); wrapper.appendChild(small); @@ -206,7 +206,7 @@ Module.register('currentweather',{ var now = moment().format('x'); var sunrise = moment(data.sys.sunrise*1000).format('x'); var sunset = moment(data.sys.sunset*1000).format('x'); - + if (sunrise < now && sunset > now) { this.sunriseSunsetTime = moment(data.sys.sunset*1000).format((this.config.timeFormat === 24) ? 'HH:mm' : 'hh:mm a'); @@ -230,7 +230,7 @@ Module.register('currentweather',{ var nextLoad = this.config.updateInterval; if (typeof delay !== 'undefined' && delay >= 0) { nextLoad = delay; - } + } var self = this; setTimeout(function() { @@ -268,4 +268,3 @@ Module.register('currentweather',{ return parseFloat(temperature).toFixed(1); } }); - diff --git a/modules/default/defaultmodules.js b/modules/default/defaultmodules.js index a6b81c88..35a70eca 100644 --- a/modules/default/defaultmodules.js +++ b/modules/default/defaultmodules.js @@ -19,4 +19,4 @@ var defaultModules = [ /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = defaultModules;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = defaultModules;} diff --git a/modules/default/helloworld/README.md b/modules/default/helloworld/README.md index 5e8be905..dfbddeb1 100644 --- a/modules/default/helloworld/README.md +++ b/modules/default/helloworld/README.md @@ -9,7 +9,7 @@ modules: [ module: 'helloworld', position: 'bottom_bar', // This can be any of the regions. config: { - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. text: 'Hello world!', } } @@ -46,6 +46,6 @@ The following properties can be configured: - + - \ No newline at end of file + diff --git a/modules/default/helloworld/helloworld.js b/modules/default/helloworld/helloworld.js index 4b3af44e..4dc51eaf 100644 --- a/modules/default/helloworld/helloworld.js +++ b/modules/default/helloworld/helloworld.js @@ -19,9 +19,8 @@ Module.register('helloworld',{ getDom: function() { var wrapper = document.createElement("div"); wrapper.className = this.config.classes; - wrapper.innerHTML = this.config.text; + wrapper.innerHTML = this.config.text; return wrapper; } }); - diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index ca28bb37..8cfff7e7 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -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. } } ] @@ -40,7 +40,7 @@ The following properties can be configured:
Default value: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml' - + showPublishDate Display the publish date of an headline.
@@ -48,7 +48,7 @@ The following properties can be configured:
Default value: true or false - + reloadInterval How often does the content needs to be fetched? (Milliseconds)
@@ -70,7 +70,6 @@ The following properties can be configured:
Default value: 2000 (2.5 seconds) - + - diff --git a/modules/default/newsfeed/fetcher.js b/modules/default/newsfeed/fetcher.js index 4a41a41b..3a4a81c3 100644 --- a/modules/default/newsfeed/fetcher.js +++ b/modules/default/newsfeed/fetcher.js @@ -5,7 +5,7 @@ * MIT Licensed. */ -var NewsFetcher = require('./newsfetcher.js'); +var NewsFetcher = require('./newsfetcher.js'); /* Fetcher * Responsible for requesting an update on the set interval and broadcasting the data. @@ -20,7 +20,7 @@ var Fetcher = function(url, reloadInterval) { if (reloadInterval < 1000) { reloadInterval = 1000; } - + var reloadTimer = null; var items = []; diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index e330665d..b6640382 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -14,8 +14,8 @@ Module.register('newsfeed',{ feedUrl: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml', showPublishDate: true, reloadInterval: 5 * 60 * 1000, // every 5 minutes - updateInterval: 7.5 * 1000, - animationSpeed: 2.5 * 1000, + updateInterval: 7.5 * 1000, + animationSpeed: 2.5 * 1000, }, // Define required scripts. @@ -29,7 +29,7 @@ Module.register('newsfeed',{ // Set locale. moment.locale(config.language); - + this.newsItems = []; this.loaded = false; this.activeItem = 0; @@ -61,7 +61,7 @@ Module.register('newsfeed',{ } if (this.newsItems.length > 0) { - + if (this.config.showPublishDate) { var timestamp = document.createElement("div"); timestamp.className = "light small dimmed"; @@ -119,5 +119,3 @@ Module.register('newsfeed',{ return string.charAt(0).toUpperCase() + string.slice(1); } }); - - diff --git a/modules/default/newsfeed/newsfetcher.js b/modules/default/newsfeed/newsfetcher.js index a93d6d09..ed33f585 100644 --- a/modules/default/newsfeed/newsfetcher.js +++ b/modules/default/newsfeed/newsfetcher.js @@ -6,7 +6,7 @@ */ var FeedMe = require('feedme'); -var request = require('request'); +var request = require('request'); var NewsFetcher = function() { var self = this; @@ -40,8 +40,8 @@ var NewsFetcher = function() { * Fetch the new news items. * * attribute url string - The url to fetch. - * attribute success function(items) - Callback on succes. - * attribute error function(error) - Callback on error. + * attribute success function(items) - Callback on succes. + * attribute error function(error) - Callback on error. */ self.fetchNews = function(url, success, error) { self.successCallback = success; @@ -50,4 +50,4 @@ var NewsFetcher = function() { }; }; -module.exports = NewsFetcher; \ No newline at end of file +module.exports = NewsFetcher; diff --git a/modules/default/newsfeed/node_helper.js b/modules/default/newsfeed/node_helper.js index 2a4281a1..4199875d 100644 --- a/modules/default/newsfeed/node_helper.js +++ b/modules/default/newsfeed/node_helper.js @@ -7,7 +7,7 @@ var NodeHelper = require('node_helper'); var validUrl = require('valid-url'); -var Fetcher = require('./fetcher.js'); +var Fetcher = require('./fetcher.js'); module.exports = NodeHelper.create({ // Subclass start method. @@ -44,7 +44,7 @@ module.exports = NodeHelper.create({ if (typeof self.fetchers[url] === 'undefined') { console.log('Create new news fetcher for url: ' + url + ' - Interval: ' + reloadInterval); fetcher = new Fetcher(url, reloadInterval); - + fetcher.onReceive(function(fetcher) { self.sendSocketNotification('NEWS_ITEMS', { url: fetcher.url(), @@ -70,7 +70,3 @@ module.exports = NodeHelper.create({ fetcher.startFetch(); } }); - - - - diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 07deca8d..bea80514 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -12,7 +12,7 @@ modules: [ position: 'top_right', // This can be any of the regions. // Best results in left or right regions. config: { - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. } @@ -148,6 +148,6 @@ The following properties can be configured: } - + - \ No newline at end of file + diff --git a/modules/default/weatherforecast/weatherforecast.css b/modules/default/weatherforecast/weatherforecast.css index 77c02e34..6c511d11 100644 --- a/modules/default/weatherforecast/weatherforecast.css +++ b/modules/default/weatherforecast/weatherforecast.css @@ -11,4 +11,4 @@ .weatherforecast .min-temp { padding-left: 20px; padding-right: 0px; -} \ No newline at end of file +} diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 7a1668c5..d000680b 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -18,7 +18,7 @@ Module.register('weatherforecast',{ animationSpeed: 1000, timeFormat: config.timeFormat, lang: config.language, - fade: true, + fade: true, fadePoint: 0.25, // Start on 1/4th of the list. initialLoadDelay: 2500, // 2.5 seconds delay. This delay is used to keep the OpenWeather API happy. @@ -67,7 +67,7 @@ Module.register('weatherforecast',{ // Set locale. moment.locale(config.language); - + this.forecast = []; this.loaded = false; this.scheduleUpdate(this.config.initialLoadDelay); @@ -144,10 +144,10 @@ Module.register('weatherforecast',{ } } - + } - + return table; @@ -238,7 +238,7 @@ Module.register('weatherforecast',{ var nextLoad = this.config.updateInterval; if (typeof delay !== 'undefined' && delay >= 0) { nextLoad = delay; - } + } var self = this; clearTimeout(this.updateTimer); @@ -277,4 +277,3 @@ Module.register('weatherforecast',{ return parseFloat(temperature).toFixed(1); } }); - diff --git a/vendor/vendor.js b/vendor/vendor.js index 59931a81..083e39af 100644 --- a/vendor/vendor.js +++ b/vendor/vendor.js @@ -11,4 +11,4 @@ var vendor = { 'moment.js' : 'moment/moment-with-locales.min.js', 'weather-icons.css': 'weather-icons/weather-icons.css', 'font-awesome.css': 'font-awesome-4.5.0/css/font-awesome.min.css' -}; \ No newline at end of file +}; From 6f5c86775b708d19d3798267ffd23e491a1d2c62 Mon Sep 17 00:00:00 2001 From: Sam Vendittelli Date: Sat, 2 Apr 2016 06:27:44 +0100 Subject: [PATCH 2/6] Fixed cursor appearing in margin Cursor was appearing in the margin so moved `cursor: none` property to html. --- css/main.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/css/main.css b/css/main.css index d50e9f2c..ebb537a4 100644 --- a/css/main.css +++ b/css/main.css @@ -1,5 +1,8 @@ -body { +html { cursor: none; +} + +body { margin: 60px; position: absolute; height: calc(100% - 120px); From e38dd346d9f796807ea71035c18e3533ec245ba6 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 2 Apr 2016 19:17:30 +0200 Subject: [PATCH 3/6] Add the possibility to set the maximum number of days. --- modules/default/calendar/README.md | 6 ++++++ modules/default/calendar/calendar.js | 2 ++ modules/default/calendar/node_helper.js | 19 +++++++++---------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 2c3ad142..cfe4e2b8 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -40,6 +40,12 @@ The following properties can be configured:
Default value: 10 + + maximumNumberOfDays + The maximum number of days in the future.
+
Default value: 365 + + displaySymbol Display a symbol in front of an entry.
diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index f7b837b0..84045944 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -12,6 +12,7 @@ Module.register('calendar',{ // Define module defaults defaults: { maximumEntries: 10, // Total Maximum Entries + maximumNumberOfDays: 365, displaySymbol: true, defaultSymbol: 'calendar', // Fontawsome Symbol see http://fontawesome.io/cheatsheet/ maxTitleLength: 25, @@ -180,6 +181,7 @@ Module.register('calendar',{ this.sendSocketNotification('ADD_CALENDAR', { url: url, maximumEntries: this.config.maximumEntries, + maximumNumberOfDays: this.config.maximumNumberOfDays, fetchInterval: this.config.fetchInterval }); }, diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index 09e212b0..678a6498 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -10,7 +10,7 @@ var ical = require('ical'); var moment = require('moment'); var validUrl = require('valid-url'); -var CalendarFetcher = function(url, reloadInterval, maximumEntries) { +var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumberOfDays) { var self = this; var reloadTimer = null; @@ -42,6 +42,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) { for (var e in data) { var event = data[e]; + var today = moment().startOf('day'); if (event.type === 'VEVENT') { 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. // By adjusting the timeset property, this issue is solved. var now = new Date(); + if (rule.timeset[0].hour == now.getHours(), rule.timeset[0].minute == now.getMinutes(), rule.timeset[0].second == now.getSeconds()) { @@ -63,10 +65,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) { rule.timeset[0].second = startDate.format('s'); } - var oneYear = new Date(); - oneYear.setFullYear(oneYear.getFullYear() + 1); - - var dates = rule.between(new Date(), oneYear, true, limitFunction); + var dates = rule.between(new Date(), today.add(maximumNumberOfDays, 'days') , true, limitFunction); //console.log(dates); for (var d in dates) { startDate = moment(new Date(dates[d])); @@ -78,8 +77,8 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) { } else { // Single event. - var today = moment().startOf('day'); - if (startDate > today) { + + if (startDate > today && startDate <= today.add(maximumNumberOfDays, 'days')) { newEvents.push({ title: event.summary, startDate: startDate.format('x') @@ -187,7 +186,7 @@ module.exports = NodeHelper.create({ socketNotificationReceived: function(notification, payload) { if (notification === '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. */ - createFetcher: function(url, fetchInterval, maximumEntries) { + createFetcher: function(url, fetchInterval, maximumEntries, maximumNumberOfDays) { var self = this; if (!validUrl.isUri(url)){ @@ -210,7 +209,7 @@ module.exports = NodeHelper.create({ var fetcher; if (typeof self.fetchers[url] === 'undefined') { 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) { //console.log('Broadcast events.'); From 5eed80c28ea2fc145f810c65e677c78458451a30 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sun, 3 Apr 2016 19:52:13 +0200 Subject: [PATCH 4/6] Squashed commit of the following: commit e38dd346d9f796807ea71035c18e3533ec245ba6 Author: Michael Teeuw Date: Sat Apr 2 19:17:30 2016 +0200 Add the possibility to set the maximum number of days. commit 6f5c86775b708d19d3798267ffd23e491a1d2c62 Author: Sam Vendittelli 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. commit 576c668d84b34b8ad7a0fd51b146fde60f721682 Author: Domi-G Date: Fri Apr 1 22:52:32 2016 +0200 Huge cleanup of white space --- LICENSE | 2 +- README.md | 13 ++++--- config/.gitignore | 2 +- config/config.js.sample | 6 +-- css/main.css | 7 +++- fonts/Apache License.txt | 2 +- fonts/robot.css | 1 - fonts/roboto.css | 3 -- js/class.js | 30 +++++++------- js/defaults.js | 2 +- js/electron.js | 2 +- js/loader.js | 23 ++++------- js/logger.js | 2 +- js/main.js | 39 +++++++------------ js/module.js | 16 +++----- js/server.js | 2 +- js/socket.js | 8 +--- js/socketclient.js | 2 +- modules/default/calendar/README.md | 14 +++++-- modules/default/calendar/calendar.css | 2 +- modules/default/calendar/calendar.js | 10 +++-- modules/default/calendar/node_helper.js | 28 +++++++------ modules/default/clock/README.md | 2 +- modules/default/clock/clock.js | 7 ++-- modules/default/compliments/README.md | 6 +-- modules/default/compliments/compliments.js | 11 +++--- modules/default/currentweather/README.md | 6 +-- .../default/currentweather/currentweather.css | 2 +- .../default/currentweather/currentweather.js | 15 ++++--- modules/default/defaultmodules.js | 2 +- modules/default/helloworld/README.md | 6 +-- modules/default/helloworld/helloworld.js | 3 +- modules/default/newsfeed/README.md | 9 ++--- modules/default/newsfeed/fetcher.js | 4 +- modules/default/newsfeed/newsfeed.js | 10 ++--- modules/default/newsfeed/newsfetcher.js | 8 ++-- modules/default/newsfeed/node_helper.js | 8 +--- modules/default/weatherforecast/README.md | 6 +-- .../weatherforecast/weatherforecast.css | 2 +- .../weatherforecast/weatherforecast.js | 11 +++--- vendor/vendor.js | 2 +- 41 files changed, 152 insertions(+), 184 deletions(-) diff --git a/LICENSE b/LICENSE index 399a003f..de5cf3da 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index ea7c5f05..89e09927 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # MagicMirror V2 -This version of the Magic Mirror software focusses on a modular plugin system. Besides that, the Magic Mirror software now also uses [Electron](http://electron.atom.io/), so no more webserver or browser installs necessary. +This version of the Magic Mirror software focusses on a modular plugin system. Besides that, the Magic Mirror software now also uses [Electron](http://electron.atom.io/), so no more webserver or browser installs necessary. #WARNING: THIS VERSION IS IN A VERY EARLY STAGE. IT IS NOT COMPLETED YET. PLEASE USE THE MASTER BRANCH. +<<<<<<< HEAD ##Usage 1. Download the latest node version: `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) **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 1. Duplicate `config/config.js.sample` to `config/config.js`. @@ -28,7 +34,7 @@ Things that still have to be implemented or changed. ####Documentation - Write all the documentation. :) -##Modules +##Modules ### Default modules: - [**Clock**](modules/default/clock) @@ -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)**
Facial recognition and module swapping based on the current user ... - **[MMM-Wunderlist by PaViRo](https://github.com/paviro/MMM-Wunderlist)**
Displays your Wunderlist todos on your mirror ... - - - diff --git a/config/.gitignore b/config/.gitignore index a2d72a24..1bf4259a 100644 --- a/config/.gitignore +++ b/config/.gitignore @@ -1 +1 @@ -config.js \ No newline at end of file +config.js diff --git a/config/config.js.sample b/config/config.js.sample index 17e2d536..836bee21 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -27,7 +27,7 @@ var config = { config: { calendars: [ { - symbol: 'calendar-check-o ', + symbol: 'calendar-check-o ', url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics' } ] @@ -63,9 +63,9 @@ var config = { } }, ] - + }; /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = config;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = config;} diff --git a/css/main.css b/css/main.css index 31dbcee4..ebb537a4 100644 --- a/css/main.css +++ b/css/main.css @@ -1,5 +1,8 @@ -body { +html { cursor: none; +} + +body { margin: 60px; position: absolute; height: calc(100% - 120px); @@ -135,4 +138,4 @@ sup { width: 100%; border-spacing: 0px; border-collapse: separate; -} \ No newline at end of file +} diff --git a/fonts/Apache License.txt b/fonts/Apache License.txt index 63d53024..aa4927d8 100755 --- a/fonts/Apache License.txt +++ b/fonts/Apache License.txt @@ -200,4 +200,4 @@ Font data copyright Google 2012 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/fonts/robot.css b/fonts/robot.css index 5f2e8d12..46236428 100644 --- a/fonts/robot.css +++ b/fonts/robot.css @@ -45,4 +45,3 @@ font-style: normal; } - diff --git a/fonts/roboto.css b/fonts/roboto.css index 3af3597b..25c33dfd 100644 --- a/fonts/roboto.css +++ b/fonts/roboto.css @@ -91,6 +91,3 @@ font-style: normal; } - - - diff --git a/js/class.js b/js/class.js index cd6cd2dc..726e1abc 100644 --- a/js/class.js +++ b/js/class.js @@ -2,24 +2,24 @@ * By John Resig http://ejohn.org/ * MIT Licensed. */ - + // Inspired by base2 and Prototype (function(){ var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; - + // The base Class implementation (does nothing) this.Class = function(){}; - + // Create a new Class that inherits from this class Class.extend = function(prop) { var _super = this.prototype; - + // Instantiate a base class (but only create the instance, // don't run the init constructor) initializing = true; var prototype = new this(); initializing = false; - + // Copy the properties over onto the new prototype for (var name in prop) { // Check if we're overwriting an existing function @@ -28,42 +28,42 @@ (function(name, fn){ return function() { var tmp = this._super; - + // Add a new ._super() method that is the same method // but on the super-class this._super = _super[name]; - + // The method only need to be bound temporarily, so we // remove it when we're done executing - var ret = fn.apply(this, arguments); + var ret = fn.apply(this, arguments); this._super = tmp; - + return ret; }; })(name, prop[name]) : prop[name]; } - + // The dummy class constructor function Class() { // All construction is actually done in the init method if ( !initializing && this.init ) this.init.apply(this, arguments); } - + // Populate our constructed prototype object Class.prototype = prototype; - + // Enforce the constructor to be what we expect Class.prototype.constructor = Class; - + // And make this class extendable Class.extend = arguments.callee; - + return Class; }; })(); /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = Class;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = Class;} diff --git a/js/defaults.js b/js/defaults.js index 33707784..f8656c44 100644 --- a/js/defaults.js +++ b/js/defaults.js @@ -55,4 +55,4 @@ var defaults = { /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = defaults;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = defaults;} diff --git a/js/electron.js b/js/electron.js index 74192f6c..b3a857a4 100755 --- a/js/electron.js +++ b/js/electron.js @@ -61,7 +61,7 @@ function loadModule(module) { var elements = module.split('/'); var moduleName = elements[elements.length - 1]; var moduleFolder = __dirname + '/../modules/' + module; - + if (defaultModules.indexOf(moduleName) !== -1) { moduleFolder = __dirname + '/../modules/default/' + module; } diff --git a/js/loader.js b/js/loader.js index 0c6f661c..4f650ac6 100644 --- a/js/loader.js +++ b/js/loader.js @@ -41,7 +41,7 @@ var Loader = (function() { } }; - loadNextModule(); + loadNextModule(); }; /* startModules() @@ -60,7 +60,7 @@ var Loader = (function() { /* getAllModules() * Retrieve list of all modules. * - * return array - module data as configured in config + * return array - module data as configured in config */ var getAllModules = function() { return config.modules; @@ -82,7 +82,7 @@ var Loader = (function() { var elements = module.split('/'); var moduleName = elements[elements.length - 1]; var moduleFolder = config.paths.modules + '/' + module; - + if (defaultModules.indexOf(moduleName) !== -1) { moduleFolder = config.paths.modules + '/default/' + module; } @@ -130,8 +130,8 @@ var Loader = (function() { afterLoad(); }); } - - }; + + }; /* bootstrapModule(module, mObj) * Bootstrap modules by setting the module data and loading the scripts & styles. @@ -154,8 +154,8 @@ var Loader = (function() { callback(); }); }); - - + + }; /* loadFile(fileName) @@ -194,7 +194,7 @@ var Loader = (function() { }; document.getElementsByTagName("head")[0].appendChild(stylesheet); - break; + break; } }; @@ -249,10 +249,3 @@ var Loader = (function() { }; })(); - - - - - - - diff --git a/js/logger.js b/js/logger.js index 27bb5ca5..1389c5f9 100644 --- a/js/logger.js +++ b/js/logger.js @@ -9,7 +9,7 @@ */ -// This logger is very simple, but needs to be extended. +// This logger is very simple, but needs to be extended. // This system can eventually be used to push the log messages to an external target. diff --git a/js/main.js b/js/main.js index 4bc15d02..a45c56b1 100644 --- a/js/main.js +++ b/js/main.js @@ -15,13 +15,13 @@ var MM = (function() { /* Private Methods */ /* createDomObjects() - * Create dom objects for all modules that + * Create dom objects for all modules that * are configured for a specific position. */ var createDomObjects = function() { for (var m in modules) { var module = modules[m]; - + if (typeof module.data.position === 'string') { var wrapper = selectWrapper(module.data.position); @@ -47,13 +47,11 @@ var MM = (function() { moduleContent.className = "module-content"; dom.appendChild(moduleContent); - - updateDom(module, 0); } } - sendNotification('DOM_OBJECTS_CREATED'); + sendNotification('DOM_OBJECTS_CREATED'); }; /* selectWrapper(position) @@ -99,7 +97,6 @@ var MM = (function() { if (!module.hidden) { - if (!moduleNeedsUpdate(module, newContent)) { return; } @@ -173,7 +170,7 @@ var MM = (function() { // the .display property. moduleWrapper.style.position = 'absolute'; - if (typeof callback === 'function') { callback(); } + if (typeof callback === 'function') { callback(); } }, speed); } }; @@ -194,10 +191,9 @@ var MM = (function() { moduleWrapper.style.opacity = 1; setTimeout(function() { - if (typeof callback === 'function') { callback(); } + if (typeof callback === 'function') { callback(); } }, speed); - } }; @@ -216,14 +212,14 @@ var MM = (function() { /* setSelectionMethodsForModules() * Adds special selectors on a collection of modules. - * + * * argument modules array - Array of modules. */ var setSelectionMethodsForModules = function(modules) { /* withClass(className) * filters a collection of modules based on classname(s). - * + * * argument className string/array - one or multiple classnames. (array or space devided) * * return array - Filtered collection of modules. @@ -245,7 +241,7 @@ var MM = (function() { if (classes.indexOf(searchClass.toLowerCase()) !== -1) { newModules.push(module); } - } + } } setSelectionMethodsForModules(newModules); @@ -254,7 +250,7 @@ var MM = (function() { /* exceptWithClass(className) * filters a collection of modules based on classname(s). (NOT) - * + * * argument className string/array - one or multiple classnames. (array or space devided) * * return array - Filtered collection of modules. @@ -280,7 +276,7 @@ var MM = (function() { } if (!foundClass) { newModules.push(module); - } + } } setSelectionMethodsForModules(newModules); @@ -289,7 +285,7 @@ var MM = (function() { /* exceptModule(module) * Removes a module instance from the collection. - * + * * argument module Module object - The module instance to remove from the collection. * * return array - Filtered collection of modules. @@ -310,7 +306,7 @@ var MM = (function() { /* enumerate(callback) * Walks thru a collection of modules and executes the callback with the module as an argument. - * + * * argument callback function - The function to execute with the module as an argument. */ var enumerate = function(callback) { @@ -320,8 +316,6 @@ var MM = (function() { } }; - - 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.exceptModule === 'undefined') { Object.defineProperty(modules, 'exceptModule', {value: exceptModule, enumerable: false}); } @@ -329,8 +323,6 @@ var MM = (function() { }; - - return { /* Public Methods */ @@ -399,7 +391,7 @@ var MM = (function() { Log.error('updateDom: Sender should be a module.'); return; } - + // Further implementation is done in the private method. updateDom(module, speed); }, @@ -442,8 +434,3 @@ var MM = (function() { })(); MM.init(); - - - - - diff --git a/js/module.js b/js/module.js index 20609b54..2c2c18d2 100644 --- a/js/module.js +++ b/js/module.js @@ -57,11 +57,11 @@ var Module = Class.extend({ */ getDom: function() { var nameWrapper = document.createElement("div"); - var name = document.createTextNode(this.name); + var name = document.createTextNode(this.name); nameWrapper.appendChild(name); var identifierWrapper = document.createElement("div"); - var identifier = document.createTextNode(this.identifier); + var identifier = document.createTextNode(this.identifier); identifierWrapper.appendChild(identifier); identifierWrapper.className = "small dimmed"; @@ -69,7 +69,7 @@ var Module = Class.extend({ div.appendChild(nameWrapper); div.appendChild(identifierWrapper); - return div; + return div; }, /* notificationReceived(notification, payload, sender) @@ -99,7 +99,6 @@ var Module = Class.extend({ }, - /********************************************* * The methods below don't need subclassing. * *********************************************/ @@ -262,12 +261,12 @@ Module.create = function(name) { if (obj === null || typeof obj !== 'object') { return obj; } - + var temp = obj.constructor(); // give temp the original obj's constructor for (var key in obj) { temp[key] = cloneObject(obj[key]); } - + return temp; } @@ -278,13 +277,10 @@ Module.create = function(name) { var ModuleClass = Module.extend(clonedDefinition); return new ModuleClass(); - + }; Module.register = function(name, moduleDefinition) { Log.log('Module registered: ' + name); Module.definitions[name] = moduleDefinition; }; - - - diff --git a/js/server.js b/js/server.js index 4440e1aa..aac4d839 100644 --- a/js/server.js +++ b/js/server.js @@ -31,4 +31,4 @@ var Server = function(config, callback) { } }; -module.exports = Server; \ No newline at end of file +module.exports = Server; diff --git a/js/socket.js b/js/socket.js index 4badc5f8..8f3abaf1 100644 --- a/js/socket.js +++ b/js/socket.js @@ -7,8 +7,6 @@ * MIT Licensed. */ - - var MMSocket = function(moduleName) { var self = this; @@ -18,7 +16,7 @@ var MMSocket = function(moduleName) { } self.moduleName = moduleName; - + self.socket = io('http://localhost:8080'); self.socket.on('notification', function (data) { @@ -35,6 +33,4 @@ var MMSocket = function(moduleName) { }); } }; -}; - - \ No newline at end of file +}; diff --git a/js/socketclient.js b/js/socketclient.js index 32142e94..c834679a 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -39,4 +39,4 @@ var MMSocket = function(moduleName) { } socket.emit(notification, payload); }; -}; \ No newline at end of file +}; diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 41d6242e..cfe4e2b8 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -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. } } ] @@ -40,6 +40,12 @@ The following properties can be configured:
Default value: 10 + + maximumNumberOfDays + The maximum number of days in the future.
+
Default value: 365 + + displaySymbol Display a symbol in front of an entry.
@@ -100,7 +106,7 @@ The following properties can be configured: titleReplace An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title.

Example:
- + titleReplace: {'Birthday of ' : '', 'foo':'bar'} @@ -149,4 +155,4 @@ config: { - \ No newline at end of file + diff --git a/modules/default/calendar/calendar.css b/modules/default/calendar/calendar.css index 36e175a0..a292a707 100644 --- a/modules/default/calendar/calendar.css +++ b/modules/default/calendar/calendar.css @@ -20,4 +20,4 @@ .calendar .time { padding-left: 30px; text-align: right; -} \ No newline at end of file +} diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 786b2aea..84045944 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -12,12 +12,13 @@ Module.register('calendar',{ // Define module defaults defaults: { maximumEntries: 10, // Total Maximum Entries + maximumNumberOfDays: 365, 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 +59,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; } @@ -180,6 +181,7 @@ Module.register('calendar',{ this.sendSocketNotification('ADD_CALENDAR', { url: url, maximumEntries: this.config.maximumEntries, + maximumNumberOfDays: this.config.maximumNumberOfDays, fetchInterval: this.config.fetchInterval }); }, @@ -237,4 +239,4 @@ Module.register('calendar',{ title = this.shorten(title, this.config.maxTitleLength); return title; } -}); \ No newline at end of file +}); diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index e9212869..678a6498 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -10,7 +10,7 @@ var ical = require('ical'); var moment = require('moment'); var validUrl = require('valid-url'); -var CalendarFetcher = function(url, reloadInterval, maximumEntries) { +var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumberOfDays) { var self = this; var reloadTimer = null; @@ -42,7 +42,8 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) { for (var e in data) { var event = data[e]; - + var today = moment().startOf('day'); + if (event.type === 'VEVENT') { 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. // By adjusting the timeset property, this issue is solved. var now = new Date(); + if (rule.timeset[0].hour == now.getHours(), rule.timeset[0].minute == now.getMinutes(), rule.timeset[0].second == now.getSeconds()) { @@ -62,11 +64,8 @@ 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); - var dates = rule.between(new Date(), oneYear, true, limitFunction); + var dates = rule.between(new Date(), today.add(maximumNumberOfDays, 'days') , true, limitFunction); //console.log(dates); for (var d in dates) { startDate = moment(new Date(dates[d])); @@ -78,8 +77,8 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries) { } else { // Single event. - var today = moment().startOf('day'); - if (startDate > today) { + + if (startDate > today && startDate <= today.add(maximumNumberOfDays, 'days')) { newEvents.push({ title: event.summary, startDate: startDate.format('x') @@ -92,7 +91,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,14 +179,14 @@ module.exports = NodeHelper.create({ console.log('Starting node helper for: ' + this.name); - + }, // Override socketNotificationReceived method. socketNotificationReceived: function(notification, payload) { if (notification === '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. */ - createFetcher: function(url, fetchInterval, maximumEntries) { + createFetcher: function(url, fetchInterval, maximumEntries, maximumNumberOfDays) { var self = this; if (!validUrl.isUri(url)){ @@ -210,8 +209,8 @@ module.exports = NodeHelper.create({ var fetcher; if (typeof self.fetchers[url] === 'undefined') { 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) { //console.log('Broadcast events.'); //console.log(fetcher.events()); @@ -239,4 +238,3 @@ module.exports = NodeHelper.create({ fetcher.startFetch(); } }); - diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index c0674b28..ab65d3f4 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -12,7 +12,7 @@ modules: [ position: 'top_left', // This can be any of the regions. config: { // The config property is optional. - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. } } ] diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index df8ec2a5..b71f4313 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -33,7 +33,7 @@ Module.register('clock',{ // Set locale. moment.locale(config.language); }, - + // Override dom generator. getDom: function() { @@ -52,16 +52,15 @@ Module.register('clock',{ dateWrapper.innerHTML = moment().format('dddd, LL'); timeWrapper.innerHTML = moment().format((this.config.timeFormat === 24) ? 'HH:mm' : ('hh:mm')); secondsWrapper.innerHTML = moment().format('ss'); - + // Combine wrappers. wrapper.appendChild(dateWrapper); wrapper.appendChild(timeWrapper); if (this.config.displaySeconds) { timeWrapper.appendChild(secondsWrapper); } - + // Return the wrapper to the dom. return wrapper; } }); - diff --git a/modules/default/compliments/README.md b/modules/default/compliments/README.md index 210f88ed..bf5b9538 100644 --- a/modules/default/compliments/README.md +++ b/modules/default/compliments/README.md @@ -1,6 +1,6 @@ # Module: Compliments The `compliments` module is one of the default modules of the MagicMirror. -This module displays a random compliment. +This module displays a random compliment. ## Using the module @@ -14,7 +14,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. } } ] @@ -84,4 +84,4 @@ config: { ] } } -```` \ No newline at end of file +```` diff --git a/modules/default/compliments/compliments.js b/modules/default/compliments/compliments.js index 33586bad..d018680d 100644 --- a/modules/default/compliments/compliments.js +++ b/modules/default/compliments/compliments.js @@ -40,7 +40,7 @@ Module.register('compliments',{ // Define start sequence. start: function() { Log.info('Starting module: ' + this.name); - + this.lastComplimentIndex = -1; // Schedule update timer. @@ -105,19 +105,18 @@ Module.register('compliments',{ var index = this.randomIndex(compliments); return compliments[index]; - }, + }, // Override dom generator. getDom: function() { var complimentText = this.randomCompliment(); - var compliment = document.createTextNode(complimentText); + var compliment = document.createTextNode(complimentText); var wrapper = document.createElement("div"); wrapper.className = 'thin xlarge bright'; wrapper.appendChild(compliment); - return wrapper; + return wrapper; } - -}); +}); diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index c3834674..4a418ad9 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -12,7 +12,7 @@ modules: [ position: 'top_right', // This can be any of the regions. // Best results in left or right regions. config: { - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. } @@ -140,6 +140,6 @@ The following properties can be configured: } - + - \ No newline at end of file + diff --git a/modules/default/currentweather/currentweather.css b/modules/default/currentweather/currentweather.css index b953534b..cf0649dc 100644 --- a/modules/default/currentweather/currentweather.css +++ b/modules/default/currentweather/currentweather.css @@ -6,4 +6,4 @@ -ms-transform: translate(0px,-3px); /* IE 9 */ -webkit-transform: translate(0px,-3px); /* Safari */ transform: translate(0px,-3px); -} \ No newline at end of file +} diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 9c33a43b..17b23bce 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -65,7 +65,7 @@ Module.register('currentweather',{ // Set locale. moment.locale(config.language); - + this.windSpeed = null; this.sunriseSunsetTime = null; this.sunriseSunsetIcon = null; @@ -76,7 +76,7 @@ Module.register('currentweather',{ this.scheduleUpdate(this.config.initialLoadDelay); this.updateTimer = null; - + }, // Override dom generator. @@ -110,7 +110,7 @@ Module.register('currentweather',{ small.appendChild(windIcon); var windSpeed = document.createElement("span"); - windSpeed.innerHTML = " " + this.windSpeed; + windSpeed.innerHTML = " " + this.windSpeed; small.appendChild(windSpeed); var spacer = document.createElement("span"); @@ -122,7 +122,7 @@ Module.register('currentweather',{ small.appendChild(sunriseSunsetIcon); var sunriseSunsetTime = document.createElement("span"); - sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; + sunriseSunsetTime.innerHTML = " " + this.sunriseSunsetTime; small.appendChild(sunriseSunsetTime); var large = document.createElement("div"); @@ -134,7 +134,7 @@ Module.register('currentweather',{ var temperature = document.createElement("span"); temperature.className = "bright"; - temperature.innerHTML = " " + this.temperature + '°'; + temperature.innerHTML = " " + this.temperature + '°'; large.appendChild(temperature); wrapper.appendChild(small); @@ -206,7 +206,7 @@ Module.register('currentweather',{ var now = moment().format('x'); var sunrise = moment(data.sys.sunrise*1000).format('x'); var sunset = moment(data.sys.sunset*1000).format('x'); - + if (sunrise < now && sunset > now) { this.sunriseSunsetTime = moment(data.sys.sunset*1000).format((this.config.timeFormat === 24) ? 'HH:mm' : 'hh:mm a'); @@ -230,7 +230,7 @@ Module.register('currentweather',{ var nextLoad = this.config.updateInterval; if (typeof delay !== 'undefined' && delay >= 0) { nextLoad = delay; - } + } var self = this; setTimeout(function() { @@ -268,4 +268,3 @@ Module.register('currentweather',{ return parseFloat(temperature).toFixed(1); } }); - diff --git a/modules/default/defaultmodules.js b/modules/default/defaultmodules.js index d95b02f7..8545dd9a 100644 --- a/modules/default/defaultmodules.js +++ b/modules/default/defaultmodules.js @@ -20,4 +20,4 @@ var defaultModules = [ /*************** DO NOT EDIT THE LINE BELOW ***************/ -if (typeof module !== 'undefined') {module.exports = defaultModules;} \ No newline at end of file +if (typeof module !== 'undefined') {module.exports = defaultModules;} diff --git a/modules/default/helloworld/README.md b/modules/default/helloworld/README.md index 5e8be905..dfbddeb1 100644 --- a/modules/default/helloworld/README.md +++ b/modules/default/helloworld/README.md @@ -9,7 +9,7 @@ modules: [ module: 'helloworld', position: 'bottom_bar', // This can be any of the regions. config: { - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. text: 'Hello world!', } } @@ -46,6 +46,6 @@ The following properties can be configured: - + - \ No newline at end of file + diff --git a/modules/default/helloworld/helloworld.js b/modules/default/helloworld/helloworld.js index 4b3af44e..4dc51eaf 100644 --- a/modules/default/helloworld/helloworld.js +++ b/modules/default/helloworld/helloworld.js @@ -19,9 +19,8 @@ Module.register('helloworld',{ getDom: function() { var wrapper = document.createElement("div"); wrapper.className = this.config.classes; - wrapper.innerHTML = this.config.text; + wrapper.innerHTML = this.config.text; return wrapper; } }); - diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index ca28bb37..8cfff7e7 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -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. } } ] @@ -40,7 +40,7 @@ The following properties can be configured:
Default value: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml' - + showPublishDate Display the publish date of an headline.
@@ -48,7 +48,7 @@ The following properties can be configured:
Default value: true or false - + reloadInterval How often does the content needs to be fetched? (Milliseconds)
@@ -70,7 +70,6 @@ The following properties can be configured:
Default value: 2000 (2.5 seconds) - + - diff --git a/modules/default/newsfeed/fetcher.js b/modules/default/newsfeed/fetcher.js index 4a41a41b..3a4a81c3 100644 --- a/modules/default/newsfeed/fetcher.js +++ b/modules/default/newsfeed/fetcher.js @@ -5,7 +5,7 @@ * MIT Licensed. */ -var NewsFetcher = require('./newsfetcher.js'); +var NewsFetcher = require('./newsfetcher.js'); /* Fetcher * Responsible for requesting an update on the set interval and broadcasting the data. @@ -20,7 +20,7 @@ var Fetcher = function(url, reloadInterval) { if (reloadInterval < 1000) { reloadInterval = 1000; } - + var reloadTimer = null; var items = []; diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index e330665d..b6640382 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -14,8 +14,8 @@ Module.register('newsfeed',{ feedUrl: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml', showPublishDate: true, reloadInterval: 5 * 60 * 1000, // every 5 minutes - updateInterval: 7.5 * 1000, - animationSpeed: 2.5 * 1000, + updateInterval: 7.5 * 1000, + animationSpeed: 2.5 * 1000, }, // Define required scripts. @@ -29,7 +29,7 @@ Module.register('newsfeed',{ // Set locale. moment.locale(config.language); - + this.newsItems = []; this.loaded = false; this.activeItem = 0; @@ -61,7 +61,7 @@ Module.register('newsfeed',{ } if (this.newsItems.length > 0) { - + if (this.config.showPublishDate) { var timestamp = document.createElement("div"); timestamp.className = "light small dimmed"; @@ -119,5 +119,3 @@ Module.register('newsfeed',{ return string.charAt(0).toUpperCase() + string.slice(1); } }); - - diff --git a/modules/default/newsfeed/newsfetcher.js b/modules/default/newsfeed/newsfetcher.js index a93d6d09..ed33f585 100644 --- a/modules/default/newsfeed/newsfetcher.js +++ b/modules/default/newsfeed/newsfetcher.js @@ -6,7 +6,7 @@ */ var FeedMe = require('feedme'); -var request = require('request'); +var request = require('request'); var NewsFetcher = function() { var self = this; @@ -40,8 +40,8 @@ var NewsFetcher = function() { * Fetch the new news items. * * attribute url string - The url to fetch. - * attribute success function(items) - Callback on succes. - * attribute error function(error) - Callback on error. + * attribute success function(items) - Callback on succes. + * attribute error function(error) - Callback on error. */ self.fetchNews = function(url, success, error) { self.successCallback = success; @@ -50,4 +50,4 @@ var NewsFetcher = function() { }; }; -module.exports = NewsFetcher; \ No newline at end of file +module.exports = NewsFetcher; diff --git a/modules/default/newsfeed/node_helper.js b/modules/default/newsfeed/node_helper.js index 2a4281a1..4199875d 100644 --- a/modules/default/newsfeed/node_helper.js +++ b/modules/default/newsfeed/node_helper.js @@ -7,7 +7,7 @@ var NodeHelper = require('node_helper'); var validUrl = require('valid-url'); -var Fetcher = require('./fetcher.js'); +var Fetcher = require('./fetcher.js'); module.exports = NodeHelper.create({ // Subclass start method. @@ -44,7 +44,7 @@ module.exports = NodeHelper.create({ if (typeof self.fetchers[url] === 'undefined') { console.log('Create new news fetcher for url: ' + url + ' - Interval: ' + reloadInterval); fetcher = new Fetcher(url, reloadInterval); - + fetcher.onReceive(function(fetcher) { self.sendSocketNotification('NEWS_ITEMS', { url: fetcher.url(), @@ -70,7 +70,3 @@ module.exports = NodeHelper.create({ fetcher.startFetch(); } }); - - - - diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 07deca8d..bea80514 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -12,7 +12,7 @@ modules: [ position: 'top_right', // This can be any of the regions. // Best results in left or right regions. config: { - // See 'Configuration options' for more information. + // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. } @@ -148,6 +148,6 @@ The following properties can be configured: } - + - \ No newline at end of file + diff --git a/modules/default/weatherforecast/weatherforecast.css b/modules/default/weatherforecast/weatherforecast.css index 77c02e34..6c511d11 100644 --- a/modules/default/weatherforecast/weatherforecast.css +++ b/modules/default/weatherforecast/weatherforecast.css @@ -11,4 +11,4 @@ .weatherforecast .min-temp { padding-left: 20px; padding-right: 0px; -} \ No newline at end of file +} diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 7a1668c5..d000680b 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -18,7 +18,7 @@ Module.register('weatherforecast',{ animationSpeed: 1000, timeFormat: config.timeFormat, lang: config.language, - fade: true, + fade: true, fadePoint: 0.25, // Start on 1/4th of the list. initialLoadDelay: 2500, // 2.5 seconds delay. This delay is used to keep the OpenWeather API happy. @@ -67,7 +67,7 @@ Module.register('weatherforecast',{ // Set locale. moment.locale(config.language); - + this.forecast = []; this.loaded = false; this.scheduleUpdate(this.config.initialLoadDelay); @@ -144,10 +144,10 @@ Module.register('weatherforecast',{ } } - + } - + return table; @@ -238,7 +238,7 @@ Module.register('weatherforecast',{ var nextLoad = this.config.updateInterval; if (typeof delay !== 'undefined' && delay >= 0) { nextLoad = delay; - } + } var self = this; clearTimeout(this.updateTimer); @@ -277,4 +277,3 @@ Module.register('weatherforecast',{ return parseFloat(temperature).toFixed(1); } }); - diff --git a/vendor/vendor.js b/vendor/vendor.js index 59931a81..083e39af 100644 --- a/vendor/vendor.js +++ b/vendor/vendor.js @@ -11,4 +11,4 @@ var vendor = { 'moment.js' : 'moment/moment-with-locales.min.js', 'weather-icons.css': 'weather-icons/weather-icons.css', 'font-awesome.css': 'font-awesome-4.5.0/css/font-awesome.min.css' -}; \ No newline at end of file +}; From 40e3e71b4817934146946ff23ce4008943d4279a Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sun, 3 Apr 2016 19:53:36 +0200 Subject: [PATCH 5/6] Fix merge conflict. --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 89e09927..4fa345ce 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ 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. -<<<<<<< HEAD ##Usage 1. Download the latest node version: `wget https://nodejs.org/dist/latest/node-v5.10.0-linux-armv6l.tar.gz` for Pi 1 @@ -14,11 +13,6 @@ 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) **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 1. Duplicate `config/config.js.sample` to `config/config.js`. From 5554dce924966edc47627fa8ef20a7712af0d015 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sun, 3 Apr 2016 19:56:01 +0200 Subject: [PATCH 6/6] Fix merge conflict. --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 29ba491b..4fa345ce 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ 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. -<<<<<<< HEAD ##Usage 1. Download the latest node version: `wget https://nodejs.org/dist/latest/node-v5.10.0-linux-armv6l.tar.gz` for Pi 1 @@ -14,11 +13,6 @@ 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) **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`. ->>>>>>> e38dd346d9f796807ea71035c18e3533ec245ba6 ##Configuration 1. Duplicate `config/config.js.sample` to `config/config.js`.