diff --git a/.eslintignore b/.eslintignore index 25422889..2e1f92d3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,5 @@ vendor/ !/vendor/vendor.js -/modules/** !/modules/default/** !/modules/node_helper !/modules/node_helper/** diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7025dd7c..ee3b7219 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -3,57 +3,47 @@ Contribution Policy for MagicMirror² Thanks for contributing to MagicMirror²! -We hold our code to standard, and these standards are documented below. +We hold our code to standard, and these standards are documented below. -First, before you run the linters, you will need to install them all **and** install the development dependencies: +If you wish to run both linters, use `grunt` without any arguments. -```bash -(sudo) npm install -g jscs stylelint html-validator-cli -npm install -``` +### JavaScript: Run ESLint -### JavaScript: Run JSCS +We use [ESLint](http://eslint.org) on our JavaScript files. -We use [JSCS](http://jscs.info) on our JavaScript files. +Our ESLint configuration is in our .eslintrc.json and .eslintignore files. -Our JSCS configuration is in our .jscsrc file. - -To run JSCS, use `npm run jscs`. +To run ESLint, use `grunt eslint`. ### CSS: Run StyleLint We use [StyleLint](http://stylelint.io) to lint our CSS. Our configuration is in our .stylelintrc file. -To run StyleLint, use `npm run stylelint`. +To run StyleLint, use `grunt stylelint`. -### HTML: Run HTML Validator - -We use [NU Validator](https://validator.w3.org/nu) to validate our HTML. The configuration is in the command in the package.json file. - -To run HTML Validator, use `npm run htmlvalidator`. - -## Submitting Issues +### Submitting 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 - Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting +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) When submitting a new issue, please supply the following information: -**Platform** [ Raspberry Pi 2/3, Windows, Mac OS X, Linux, Etc ... ]: +**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). -**Node Version** [ 0.12.13 or later ]: +**Node Version**: Make sure it's version 0.12.13 or later. -**MagicMirror Version** [ V1 / V2-Beta ]: +**MagicMirror Version**: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2). -**Description:** Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. +**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. -**Steps to Reproduce:** List the step by step process to reproduce the issue. +**Steps to Reproduce**: List the step by step process to reproduce the issue. -**Expected Results:** Describe what you expected to see. +**Expected Results**: Describe what you expected to see. -**Actual Results:** Describe what you actually saw. +**Actual Results**: Describe what you actually saw. -**Configuration:** What does the used config.js file look like? (Don't forget to remove any sensitive information.) +**Configuration**: What does the used config.js file look like? Don't forget to remove any sensitive information! -**Additional Notes:** Provide any other relevant notes not previously mentioned (optional) +**Additional Notes**: Provide any other relevant notes not previously mentioned. This is optional. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 6d039bf1..736795d7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,21 +1,24 @@ 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 - Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting +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) -**Platform** [ Raspberry Pi 2/3, Windows, Mac OS X, Linux, Etc ... ]: +When submitting a new issue, please supply the following information: -**Node Version** [ 0.12.13 or later ]: +**Platform**: Place your platform here... give us your web browser/Electron version *and* your hardware (Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX). -**MagicMirror Version** [ V1 / V2-Beta ]: +**Node Version**: Make sure it's version 0.12.13 or later. -**Description:** Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. +**MagicMirror Version**: Now that the versions have split, tell us if you are using the PHP version (v1) or the newer JavaScript version (v2). -**Steps to Reproduce:** List the step by step process to reproduce the issue. +**Description**: Provide a detailed description about the issue and include specific details to help us understand the problem. Adding screenshots will help describing the problem. -**Expected Results:** Describe what you expected to see. +**Steps to Reproduce**: List the step by step process to reproduce the issue. -**Actual Results:** Describe what you actually saw. +**Expected Results**: Describe what you expected to see. -**Configuration:** What does the used config.js file look like? (Don't forget to remove any sensitive information.) +**Actual Results**: Describe what you actually saw. -**Additional Notes:** Provide any other relevant notes not previously mentioned (optional) +**Configuration**: What does the used config.js file look like? Don't forget to remove any sensitive information! + +**Additional Notes**: Provide any other relevant notes not previously mentioned. This is optional. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1ac9aaa1..215950e0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,7 @@ -> Please send your PR's the develop branch. -> Don't forget to add the change to changelog.md. +> 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? [yes | no] +* Does the pull request solve a **related** issue? * If so, can you reference the issue? -* What does the pull request accomplish? (please list) +* What does the pull request accomplish? Use a list if needed. * If it includes major visual changes please add screenshots. - - diff --git a/.stylelintrc b/.stylelintrc index 02300404..db05c713 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,4 +1,5 @@ { "extends": "stylelint-config-standard", - "font-family-name-quotes": "double-where-recommended" -} \ No newline at end of file + "font-family-name-quotes": "double-where-recommended", + "block-no-empty": false +} diff --git a/CHANGELOG.md b/CHANGELOG.md index c76d0362..20f95c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,30 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.0.5] - 2016-09-20 + +### Added +- Added ability to remove tags from the beginning or end of newsfeed items in 'newsfeed.js'. +- Added ability to define "the day after tomorrow" for calendar events (Definition for German and Dutch already included). +- Added CII Badge (we are compliant with the CII Best Practices) +- Add support for doing http basic auth when loading calendars +- Add the abilty to turn off and on the date display in the Clock Module + +### Fixed +- Fix typo in installer. +- Add message to unsupported Pi error to mention that Pi Zeros must use server only mode, as ARMv6 is unsupported. Closes #374. +- Fix API url for weather API. + +### Updated +- Force fullscreen when kioskmode is active. +- Update the .github templates and information with more modern information. +- Update the Gruntfile with a more functional StyleLint implementation. + ## [2.0.4] - 2016-08-07 ### Added - Brazilian Portuguese Translation. -- Option to enable Kios mode. +- Option to enable Kiosk mode. - Added ability to start the app with Dev Tools. - Added ability to turn off the date display in `clock.js` when in analog mode. - Greek Translation @@ -71,4 +90,4 @@ It includes (but is not limited to) the following features: ## [1.0.0] - 2014-02-16 ### Initial release of MagicMirror. -This was part of the blogpost: http://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the +This was part of the blogpost: [http://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the](http://michaelteeuw.nl/post/83916869600/magic-mirror-part-vi-production-of-the) diff --git a/Gruntfile.js b/Gruntfile.js index ac499fe3..e5bc690b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,21 +8,60 @@ module.exports = function(grunt) { }, target: ["js/*.js", "modules/default/*.js", "serveronly/*.js", "*.js"] }, - postcss: { - lint: { + stylelint: { + simple: { options: { - processors: [ - require("stylelint")({"extends": "stylelint-config-standard", "font-family-name-quotes": "double-where-recommended"}), - require("postcss-reporter")({ clearMessages: true }) - ] + configFile: ".stylelintrc" }, - dist: { - src: "**/**/**/**/**/**/**/**.css" + src: ["css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"] + } + }, + jsonlint: { + main: { + src: ["package.json", ".eslintrc.json", ".stylelint"], + options: { + reporter: "jshint" } } + }, + markdownlint: { + all: { + options: { + config: { + "default": true, + "line-length": false, + "blanks-around-headers": false, + "no-duplicate-header": false, + "no-inline-html": false, + "MD010": false, + "MD001": false, + "MD031": false, + "MD040": false, + "MD002": false, + "MD029": false, + "MD041": false, + "MD032": false, + "MD036": false, + "MD037": false, + "MD009": false, + "MD018": false, + "MD012": false, + "MD026": false, + "MD036": false, + "MD038": false + } + }, + src: ["README.md", "CHANGELOG.md", "LICENSE.md", "modules/README.md", "modules/default/**/*.md", "!modules/default/calendar/vendor/ical.js/readme.md"] + } + }, + yamllint: { + all: [".travis.yml"] } }); grunt.loadNpmTasks("grunt-eslint"); - grunt.loadNpmTasks("grunt-postcss"); - grunt.registerTask("default", ["eslint", "postcss:lint"]); + grunt.loadNpmTasks("grunt-stylelint"); + grunt.loadNpmTasks("grunt-jsonlint"); + grunt.loadNpmTasks("grunt-yamllint"); + grunt.loadNpmTasks("grunt-markdownlint"); + grunt.registerTask("default", ["eslint", "stylelint", "jsonlint", "markdownlint", "yamllint"]); }; \ No newline at end of file diff --git a/README.md b/README.md index 5d5f7176..d86cca7c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
-
+
@@ -24,17 +24,17 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec
## Usage
-#### Raspberry Pi Support
+### Raspberry Pi Support
Electron, the app wrapper around MagicMirror², only supports the Raspberry Pi 2 & 3. The Raspberry Pi 1 is currently **not** supported. If you want to run this on a Raspberry Pi 1, use the [server only](#server-only) feature and setup a fullscreen browser yourself.
-#### Automatic Installer (Raspberry Pi Only!)
+### Automatic Installer (Raspberry Pi Only!)
Execute the following command on your Raspberry Pi to install MagicMirror²:
````
curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh | bash
````
-#### Manual Installation
+### Manual Installation
1. Download and install the latest Node.js version.
2. Clone the repository and check out the beta branch: `git clone https://github.com/MichMich/MagicMirror`
@@ -45,23 +45,23 @@ curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installer
**Note:** if you want to debug on Raspberry Pi you can use `npm start dev` which will start the MagicMirror app with Dev Tools enabled.
-#### Server Only
+### Server Only
In some cases, you want to start the application without an actual app window. In this case, execute the following command from the MagicMirror folder: `node serveronly`. This will start the server, after which you can open the application in your browser of choice.
-#### Raspberry Configuration & Auto Start.
+### Raspberry Configuration & Auto Start.
The following wiki links are helpful in the configuration of your MagicMirror² operating system:
- [Configuring the Raspberry Pi](https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi)
- [Auto Starting MagicMirror](https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror)
-#### Updating you MagicMirror²
+### Updating your MagicMirror²
If you want to update your MagicMirror² to the latest version, use your terminal to go to your Magic Mirror folder and type the following command:
-````
+```bash
git pull
-````
+```
If you changed nothing more than the config or the modules, this should work without any problems.
Type `git status` to see your changes, if there are any, you can reset them with `git reset --hard`. After that, git pull should be possible.
diff --git a/css/main.css b/css/main.css
index 93d6a7ee..7ae902d6 100644
--- a/css/main.css
+++ b/css/main.css
@@ -1,10 +1,10 @@
html {
cursor: none;
- overflow:hidden;
+ overflow: hidden;
}
-::-webkit-scrollbar {
- display: none;
+::-webkit-scrollbar {
+ display: none;
}
body {
diff --git a/installers/raspberry.sh b/installers/raspberry.sh
index 824bf7cc..ce37e86f 100644
--- a/installers/raspberry.sh
+++ b/installers/raspberry.sh
@@ -28,6 +28,7 @@ ARM=$(uname -m)
if [ "$ARM" != "armv7l" ]; then
echo -e "\e[91mSorry, your Raspberry Pi is not supported."
echo -e "\e[91mPlease run MagicMirror on a Raspberry Pi 2 or 3."
+ echo -e "\e[91mIf this is a Pi Zero, you are in the same boat as the original Raspberry Pi. You must run in server only mode."
exit;
fi
@@ -68,7 +69,7 @@ else
NODE_INSTALL=true
fi
-# Install or upgare node if nessecery.
+# Install or upgrade node if necessary.
if $NODE_INSTALL; then
echo -e "\e[96mInstalling Node.js ...\e[90m"
diff --git a/js/electron.js b/js/electron.js
index 0a72aee9..75dc47fd 100644
--- a/js/electron.js
+++ b/js/electron.js
@@ -1,3 +1,5 @@
+/* jshint esversion: 6 */
+
"use strict";
const Server = require(__dirname + "/server.js");
@@ -28,17 +30,30 @@ function createWindow() {
mainWindow.loadURL("http://localhost:" + config.port);
// Open the DevTools if run with "npm start dev"
- if(process.argv[2] == "dev"){
+ if(process.argv[2] == "dev") {
mainWindow.webContents.openDevTools();
}
- // Emitted when the window is closed.
+ // Set responders for window events.
mainWindow.on("closed", function() {
- // Dereference the window object, usually you would store windows
- // in an array if your app supports multi windows, this is the time
- // when you should delete the corresponding element.
mainWindow = null;
});
+
+ if (config.kioskmode) {
+ mainWindow.on("blur", function() {
+ mainWindow.focus();
+ });
+
+ mainWindow.on("leave-full-screen", function() {
+ mainWindow.setFullScreen(true);
+ });
+
+ mainWindow.on("resize", function() {
+ setTimeout(function() {
+ mainWindow.reload();
+ }, 1000);
+ });
+ }
}
// This method will be called when Electron has finished
@@ -50,11 +65,7 @@ app.on("ready", function() {
// Quit when all windows are closed.
app.on("window-all-closed", function() {
- // On OS X it is common for applications and their menu bar
- // to stay active until the user quits explicitly with Cmd + Q
- if (process.platform !== "darwin") {
- app.quit();
- }
+ createWindow();
});
app.on("activate", function() {
diff --git a/modules/README.md b/modules/README.md
index 39072db5..f4a8debd 100644
--- a/modules/README.md
+++ b/modules/README.md
@@ -4,7 +4,7 @@ This document describes the way to develop your own MagicMirror² modules.
## Module structure
-All modules are loaded in de `modules` folder. The default modules are grouped together in the `modules/default` folder. Your module should be placed in a subfolder of `modules`. Note that any file or folder your create in the `modules` folder will be ignored by git, allowing you to upgrade the MagicMirror² without the loss of your files.
+All modules are loaded in the `modules` folder. The default modules are grouped together in the `modules/default` folder. Your module should be placed in a subfolder of `modules`. Note that any file or folder your create in the `modules` folder will be ignored by git, allowing you to upgrade the MagicMirror² without the loss of your files.
A module can be placed in one single folder. Or multiple modules can be grouped in a subfoler. Note that name of the module must be unique. Even when a module with a similar name is placed in a different folder, they can't be loaded at the same time.
diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md
index 05d12de8..936abdde 100644
--- a/modules/default/calendar/README.md
+++ b/modules/default/calendar/README.md
@@ -173,7 +173,7 @@ config: {
symbol
'Birthday'
user
pass
false
+ showDate
true
or false
+ true
+ displayType
animationSpeed
0
- 5000
- 2000
(2.5 seconds)
+ 2000
(2 seconds)
0
removeStartTags
'title'
, 'description'
, 'both'
+ startTags
['TAG']
or ['TAG1','TAG2',...]
+ removeEndTags
'title'
, 'description'
, 'both'
+ endTags
['TAG']
or ['TAG1','TAG2',...]
+