diff --git a/.eslintrc.json b/.eslintrc.json index 83309505..150a081d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,11 +4,13 @@ "quotes": ["error", "double"], "max-len": ["error", 250], "curly": "error", - "camelcase": ["error", {"properties": "never"}] + "camelcase": ["error", {"properties": "never"}], + "no-trailing-spaces": ["error"], + "no-irregular-whitespace": ["error"] }, "env": { "browser": true, "node": true, "es6": true } -} \ No newline at end of file +} diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ee3b7219..25445886 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -23,7 +23,7 @@ To run StyleLint, use `grunt stylelint`. ### Submitting Issues -Please only submit reproducible issues. +Please only submit reproducible issues. If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: [https://forum.magicmirror.builders/category/15/bug-hunt](https://forum.magicmirror.builders/category/15/bug-hunt) Problems installing or configuring your MagicMirror? Check out: [https://forum.magicmirror.builders/category/10/troubleshooting](https://forum.magicmirror.builders/category/10/troubleshooting) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 215950e0..acecd6f9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ -> Please send your pull requests the develop branch. +> Please send your pull requests the develop branch. > Don't forget to add the change to CHANGELOG.md. * Does the pull request solve a **related** issue? diff --git a/CHANGELOG.md b/CHANGELOG.md index ee5b97f2..b9ae75e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Solve an issue where module margins would appear when the first module of a section was hidden. - Solved visual display errors on chrome, if all modules in one of the right sections are hidden. - Global and Module default config values are no longer modified when setting config values. -- Hide a region if all modules in a region are hidden. Prevention unwanted margins. +- Hide a region if all modules in a region are hidden. Prevention unwanted margins. - Replaced `electron-prebuilt` package with `electron` in order to fix issues that would happen after 2017. - Documentation of alert module diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 4c42dcde..cd995a1e 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -18,7 +18,7 @@ echo ' \$$$$$$ |' echo ' \______/' echo -e "\e[0m" -# Define the tested version of Node.js. +# Define the tested version of Node.js. NODE_TESTED="v5.1.0" #Determine which Pi is running. @@ -49,19 +49,19 @@ if command_exists node; then echo -e "\e[0mMinimum Node version: \e[1m$NODE_TESTED\e[0m" echo -e "\e[0mInstalled Node version: \e[1m$NODE_CURRENT\e[0m" if version_gt $NODE_TESTED $NODE_CURRENT; then - echo -e "\e[96mNode should be upgraded.\e[0m" - NODE_INSTALL=true + echo -e "\e[96mNode should be upgraded.\e[0m" + NODE_INSTALL=true - #Check if a node process is currenlty running. - #If so abort installation. - if pgrep "node" > /dev/null; then - echo -e "\e[91mA Node process is currently running. Can't upgrade." - echo "Please quit all Node processes and restart the installer." - exit; + #Check if a node process is currenlty running. + #If so abort installation. + if pgrep "node" > /dev/null; then + echo -e "\e[91mA Node process is currently running. Can't upgrade." + echo "Please quit all Node processes and restart the installer." + exit; fi - else - echo -e "\e[92mNo Node.js upgrade nessecery.\e[0m" + else + echo -e "\e[92mNo Node.js upgrade nessecery.\e[0m" fi else @@ -116,27 +116,27 @@ fi # Check if plymouth is installed (default with PIXEL desktop environment), then install custom splashscreen. echo -e "\e[96mCheck plymouth installation ...\e[0m" if command_exists plymouth; then - THEME_DIR="/usr/share/plymouth/themes" - echo -e "\e[90mSplashscreen: Checking themes directory.\e[0m" - if [ -d $THEME_DIR ]; then - echo -e "\e[90mSplashscreen: Create theme directory if not exists.\e[0m" - if [ ! -d $THEME_DIR/MagicMirror ]; then - sudo mkdir $THEME_DIR/MagicMirror - fi + THEME_DIR="/usr/share/plymouth/themes" + echo -e "\e[90mSplashscreen: Checking themes directory.\e[0m" + if [ -d $THEME_DIR ]; then + echo -e "\e[90mSplashscreen: Create theme directory if not exists.\e[0m" + if [ ! -d $THEME_DIR/MagicMirror ]; then + sudo mkdir $THEME_DIR/MagicMirror + fi - if sudo cp ~/MagicMirror/splashscreen/splash.png $THEME_DIR/MagicMirror/splash.png && sudo cp ~/MagicMirror/splashscreen/MagicMirror.plymouth $THEME_DIR/MagicMirror/MagicMirror.plymouth && sudo cp ~/MagicMirror/splashscreen/MagicMirror.script $THEME_DIR/MagicMirror/MagicMirror.script; then - echo -e "\e[90mSplashscreen: Theme copied successfully.\e[0m" - if sudo plymouth-set-default-theme -R MagicMirror; then - echo -e "\e[92mSplashscreen: Changed theme to MagicMirror successfully.\e[0m" - else - echo -e "\e[91mSplashscreen: Couldn't change theme to MagicMirror!\e[0m" - fi - else - echo -e "\e[91mSplashscreen: Copying theme failed!\e[0m" - fi - else - echo -e "\e[91mSplashscreen: Themes folder doesn't exist!\e[0m" - fi + if sudo cp ~/MagicMirror/splashscreen/splash.png $THEME_DIR/MagicMirror/splash.png && sudo cp ~/MagicMirror/splashscreen/MagicMirror.plymouth $THEME_DIR/MagicMirror/MagicMirror.plymouth && sudo cp ~/MagicMirror/splashscreen/MagicMirror.script $THEME_DIR/MagicMirror/MagicMirror.script; then + echo -e "\e[90mSplashscreen: Theme copied successfully.\e[0m" + if sudo plymouth-set-default-theme -R MagicMirror; then + echo -e "\e[92mSplashscreen: Changed theme to MagicMirror successfully.\e[0m" + else + echo -e "\e[91mSplashscreen: Couldn't change theme to MagicMirror!\e[0m" + fi + else + echo -e "\e[91mSplashscreen: Copying theme failed!\e[0m" + fi + else + echo -e "\e[91mSplashscreen: Themes folder doesn't exist!\e[0m" + fi else echo -e "\e[93mplymouth is not installed.\e[0m"; fi diff --git a/js/class.js b/js/class.js index 01a92603..6c56f656 100644 --- a/js/class.js +++ b/js/class.js @@ -79,7 +79,7 @@ function cloneObject(obj) { var temp = obj.constructor(); // give temp the original obj's constructor for (var key in obj) { temp[key] = cloneObject(obj[key]); - + if (key === "lockStrings") { Log.log(key); } diff --git a/js/defaults.js b/js/defaults.js index b5b11561..4639e2b3 100644 --- a/js/defaults.js +++ b/js/defaults.js @@ -12,7 +12,7 @@ var defaults = { kioskmode: false, electronOptions: {}, ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], - + language: "en", timeFormat: 24, units: "metric", diff --git a/js/electron.js b/js/electron.js index edd4896b..173abe68 100644 --- a/js/electron.js +++ b/js/electron.js @@ -18,15 +18,15 @@ const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { - + var electronOptionsDefaults = { - width: 800, - height: 600, - x: 0, + width: 800, + height: 600, + x: 0, y: 0, - darkTheme: true, + darkTheme: true, webPreferences: { - nodeIntegration: false, + nodeIntegration: false, zoomFactor: config.zoom } } diff --git a/js/server.js b/js/server.js index c1174561..f1de2420 100644 --- a/js/server.js +++ b/js/server.js @@ -41,7 +41,7 @@ var Server = function(config, callback) { app.get("/version", function(req,res) { res.send(global.version); }); - + app.get("/", function(req, res) { var html = fs.readFileSync(path.resolve(global.root_path + "/index.html"), {encoding: "utf8"}); html = html.replace("#VERSION#", global.version); diff --git a/modules/README.md b/modules/README.md index 7884e432..42a31dfa 100644 --- a/modules/README.md +++ b/modules/README.md @@ -82,11 +82,11 @@ Any properties defined in the defaults object, will be merged with the module co *Introduced in version: 2.1.0.* -A string that defines the minimum version of the MagicMirror framework. If it is set, the system compares the required version with the users version. If the version of the user is out of date, it won't run the module. Make sure to also set this value in the Node helper. +A string that defines the minimum version of the MagicMirror framework. If it is set, the system compares the required version with the users version. If the version of the user is out of date, it won't run the module. Make sure to also set this value in the Node helper. **Note:** Since this check is introduced in version 2.1.0, this check will not be run in older versions. Keep this in mind if you get issue reports on your module. -Example: +Example: ````javascript requiresVersion: "2.1.0", ```` @@ -117,7 +117,7 @@ The getScripts method is called to request any additional scripts that need to b getScripts: function() { return [ 'script.js', // will try to load it from the vendor folder, otherwise it will load is from the module folder. - 'moment.js', // this file is available in the vendor folder, so it doesn't need to be available in the module folder. + 'moment.js', // this file is available in the vendor folder, so it doesn't need to be available in the module folder. this.file('anotherfile.js'), // this file will be loaded straight from the module folder. 'https://code.jquery.com/jquery-2.2.3.min.js', // this file will be loaded from the jquery servers. ] @@ -339,7 +339,7 @@ Visiblity locking helps the module system to prevent unwanted hide/show actions. ````javascript moduleA.hide(0, {lockString: "module_b_identifier"}); ```` -Module A is now hidden, and has an lock array with the following strings: +Module A is now hidden, and has an lock array with the following strings: ````javascript moduleA.lockStrings == ["module_b_identifier"] moduleA.hidden == true @@ -474,7 +474,7 @@ A string that defines the minimum version of the MagicMirror framework. If it is **Note:** Since this check is introduced in version 2.1.0, this check will not be run in older versions. Keep this in mind if you get issue reports on your module. -Example: +Example: ````javascript requiresVersion: "2.1.0", ```` diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index cc25a31c..787a0b4a 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -35,7 +35,6 @@ Module.register("alert",{ }, show_notification: function(message) { if (this.config.effect == "slide") {this.config.effect = this.config.effect + "-" + this.config.position;} - msg = ""; if (message.title) { msg += "" + message.title + ""; @@ -46,7 +45,7 @@ Module.register("alert",{ } msg += "" + message.message + ""; } - + new NotificationFx({ message: msg, layout: "growl", diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index de57f3b1..c5745152 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -109,7 +109,7 @@ The following properties can be configured: titleReplace: {'Birthday of ' : '', 'foo':'bar'} -
Default value: +
Default value: { "De verjaardag van ": "", @@ -158,7 +158,7 @@ The following properties can be configured: broadcastEvents If this property is set to true, the calendar will broadcast all the events to all other modules with the notification message: CALENDAR_EVENTS. The event objects are stored in an array and contain the following fields: title, startDate, endDate, fullDayEvent, location and geo.

Possible values: true, false
-
Default value: true +
Default value: true diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 3e0a0985..b636b30b 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -388,7 +388,7 @@ Module.register("calendar", { /* broadcastEvents() * Broadcasts the events to all other modules for reuse. - * The all events available in one array, sorted on startdate. + * The all events available in one array, sorted on startdate. */ broadcastEvents: function () { var eventList = []; diff --git a/modules/default/calendar/debug.js b/modules/default/calendar/debug.js index d52cdc9f..9b72d51d 100644 --- a/modules/default/calendar/debug.js +++ b/modules/default/calendar/debug.js @@ -1,5 +1,5 @@ /* CalendarFetcher Tester - * use this script with `node debug.js` to test the fetcher without the need + * use this script with `node debug.js` to test the fetcher without the need * of starting the MagicMirror core. Adjust the values below to your desire. * * By Michael Teeuw http://michaelteeuw.nl @@ -30,4 +30,3 @@ fetcher.onError(function(fetcher, error) { fetcher.startFetch(); console.log("Create fetcher done! "); - diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 4455b15a..c84c133e 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -220,7 +220,7 @@ Module.register("clock",{ wrapper.appendChild(digitalWrapper); } else { analogWrapper.style.padding = "20px 0 0 0"; - wrapper.appendChild(digitalWrapper); + wrapper.appendChild(digitalWrapper); wrapper.appendChild(analogWrapper); } } diff --git a/modules/default/compliments/README.md b/modules/default/compliments/README.md index ac410d30..430c4fbf 100644 --- a/modules/default/compliments/README.md +++ b/modules/default/compliments/README.md @@ -57,7 +57,7 @@ The following properties can be configured: - remoteFile + remoteFile External file from which to load the compliments

Possible values:Path to a JSON file containing compliments, configured as per the value of the compliments configuration (see below). An object with three arrays: @@ -136,7 +136,7 @@ config: { ### External Compliment File You may specify an external file that contains the three compliment arrays. This is particularly useful if you have a large number of compliments and do not wish to crowd your `config.js` file with a large array of compliments. -Adding the `remoteFile` variable will override an array you specify in the configuration file. +Adding the `remoteFile` variable will override an array you specify in the configuration file. This file must be straight JSON. Note that the array names need quotes around them ("morning", "afternoon", "evening", "snow", "rain", etc.). diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index b42ef12a..e92550ea 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -37,7 +37,7 @@ Module.register("currentweather",{ onlyTemp: false, roundTemp: false, - + iconTable: { "01d": "wi-day-sunny", "02d": "wi-day-cloudy", diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index 21d3910e..58c7b9ae 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -113,13 +113,13 @@ The following properties can be configured: removeEndTags: false, startTags: [], endTags: [] - - + + removeStartTags Some newsfeeds feature tags at the beginning of their titles or descriptions, such as [VIDEO]. This setting allows for the removal of specified tags from the beginning of an item's description and/or title.
-
Possible values:'title', 'description', 'both' +
Possible values:'title', 'description', 'both' @@ -131,7 +131,7 @@ The following properties can be configured: removeEndTags Remove specified tags from the end of an item's description and/or title.
-
Possible values:'title', 'description', 'both' +
Possible values:'title', 'description', 'both' @@ -173,7 +173,7 @@ The `feeds` property contains an array with multiple objects. These objects have The encoding of the news feed.

This property is optional.
Possible values:'UTF-8', 'ISO-8859-1', etc ... -
Default value: 'UTF-8' +
Default value: 'UTF-8' diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index 32fdabdf..74014208 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -29,7 +29,7 @@ Module.register("newsfeed",{ removeEndTags: "", startTags: [], endTags: [] - + }, // Define required scripts. @@ -112,17 +112,17 @@ Module.register("newsfeed",{ //Remove selected tags from the beginning of rss feed items (title or description) if (this.config.removeStartTags == "title" || "both") { - + for (f=0; f