Skip to content

Commit c95827d

Browse files
authored
Merge pull request #308 from KristjanESPERANTO/spellcheck
Add spell checker
2 parents 32d2d93 + 7e80ec4 commit c95827d

13 files changed

+140
-50
lines changed

.github/CONTRIBUTING.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
Thank you for contributing.
2-
We're trying to keep the module up to date and we're adding new features everytime.
1+
# Contributing
2+
3+
Thank you for contributing!
4+
5+
We're trying to keep the module up to date and we're adding new features every time.
36
Your contribution help us so much in a lot of ways.
47

5-
We ask you to keep contributing, and feel free to open as many issues and PR as you need.
8+
We ask you to keep contributing, and feel free to open as many issues and PR as you need.
9+
10+
## Developer commands
11+
12+
- `npm run test` - Run spelling check.

API/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Introduction
44

5-
The MMM-Remote-Control Module for MagicMirror² implements a RESTful(-ish) API to control the MagicMirror² using the existing functionality built-in to MMM-Remote-Control, as well as the notifications commands built into most modules. In addition, the API creates a basic framework which allows for each module to expand or customize their own API by a simple notificiation.
5+
The MMM-Remote-Control Module for MagicMirror² implements a RESTful(-ish) API to control the MagicMirror² using the existing functionality built-in to MMM-Remote-Control, as well as the notifications commands built into most modules. In addition, the API creates a basic framework which allows for each module to expand or customize their own API by a simple notification.
66

77
This expansion was developed by [shbatm](https://github.com/shbatm) using [juzim's MMM-Api](https://github.com/juzim/MMM-Api) and of-course, [jopyth's MMM-Remote-Control](https://github.com/jopyth/MMM-Remote-Control).
88

9-
Modified by [ezeholz](https://github.com/ezeholz) in the 2.2.0+, in the efford of making a more simplified version for everyone to use it.
9+
Modified by [ezeholz](https://github.com/ezeholz) in the 2.2.0+, in the effort of making a more simplified version for everyone to use it.
1010

1111
## Overview
1212

@@ -49,7 +49,7 @@ $ curl -X POST http://magicmirrorip:8080/api/notification/HELLO_WORLD \
4949

5050
Providing an API key is recommended; however, remains optional. If you wish to use an API key to authenticate, add an `apiKey:` option to the config section for this module.
5151

52-
If you ran the `installer.sh` script when you installed the module, a non-canoical UUID is generated for you to use; you can use this unique code, or use any string you wish.
52+
If you ran the `installer.sh` script when you installed the module, a non-canonical UUID is generated for you to use; you can use this unique code, or use any string you wish.
5353

5454
### Example Config Section
5555

@@ -185,14 +185,14 @@ curl -X GET http://magicmirrorip:8080/api/module/newsfeed
185185

186186
### 3. External APIs (Explicit) - Extending Another Module with this API
187187

188-
For module developers, you can extend the API to accomodate your needs by sending a "REGISTER_API" module notification. Below is an example and details.
188+
For module developers, you can extend the API to accommodate your needs by sending a "REGISTER_API" module notification. Below is an example and details.
189189

190-
If correctly formated, any details sent here will override the "guessed" action by #2 above.
190+
If correctly formatted, any details sent here will override the "guessed" action by #2 above.
191191

192192
```js
193193
let payload = {
194194
module: this.name,
195-
path: "modulename",
195+
path: "mymodulename",
196196
actions: {
197197
actionName: {
198198
method: "GET",
@@ -220,12 +220,12 @@ this.sendNotification("REGISTER_API", payload);
220220
| `prettyName` | *Optional:* You can specify a Formatted Name to use in dynamic menus, like the MMM-Remote-Control Module Control menu, otherwise one will be guessed based on the Notification text.
221221
| `payload` | *Optional:* If you always want the module to send the same `payload`, you can provide an `Object` here. It will be merged into the `payload` sent with the notification, which will also include:<br>1. URL Parameter, if used. See notes on `payload` Object below.<br>2. Query String, if used. API key will be removed.<br>3. Request body, if `POST` method is used and a body sent.<br>4. Finally, this parameter.
222222

223-
#### About the `payload` Object
223+
#### About the `payload` object
224224

225225
Your module will be sent a `payload` with the notification, depending on the request details, and if you provided a `payload` Object to send. It is a merged object, containing one or more of the following inputs.
226226

227-
1. URL Parameter. (e.g. `/api/module/mymodulename/action/:p`, where `:p` is the parameter). If nothing else below is passed or provided, this will be returned as a string. If anything else below is sent, this will be provided at `payload.param` in the notification's `payload` Object.
228-
2. Query String. Anything passed to the query string, except the API Key (if used) will be passed through `payload`. For example, `/api/module/mymodulename/action?param1=Something&param2=Else` will be passed in `payload` as `{ param1: "Something", param2: "Else" }`
227+
1. URL parameter. (e.g. `/api/module/mymodulename/action/:p`, where `:p` is the parameter). If nothing else below is passed or provided, this will be returned as a string. If anything else below is sent, this will be provided at `payload.param` in the notification's `payload` Object.
228+
2. Query String. Anything passed to the query string, except the API key (if used) will be passed through `payload`. For example, `/api/module/mymodulename/action?param1=Something&param2=Else` will be passed in `payload` as `{ param1: "Something", param2: "Else" }`
229229
3. `POST` Body. Same as query string above.
230230
4. Custom Payload. Any `Object` provided with the `payload:` key when you send the initial "REGISTER_API" notification.
231231

API/api.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* By shbatm
55
* MIT Licensed.
66
*/
7-
/* jshint node: true, esversion: 6 */
87

98
const path = require("path");
109
const url = require("url");
@@ -51,7 +50,7 @@ module.exports = {
5150
let getActions = function(content) {
5251
let re = /notification \=\=\=? (?:"|')([A-Z_-]+?)(?:"|')|case (?:"|')([A-Z_-]+)(?:"|')/g;
5352
let m;
54-
let availabeActions = [];
53+
let availableActions = [];
5554
if (re.test(content)) {
5655
content.match(re).forEach((match) => {
5756
let n = match.replace(re, '$1');
@@ -62,11 +61,11 @@ module.exports = {
6261
'KEYPRESS_MODE_CHANGED',
6362
'USER_PRESENCE'
6463
].indexOf(n) === -1) {
65-
availabeActions.push(n);
64+
availableActions.push(n);
6665
}
6766
});
6867
}
69-
return availabeActions;
68+
return availableActions;
7069
};
7170

7271
let skippedModules = ['clock', 'compliments', 'MMM-Remote-Control'];
@@ -118,7 +117,7 @@ module.exports = {
118117
// Route for testing the api at http://mirror:8080/api/test
119118
this.expressRouter.route(['/test','/']) // Test without apiKey
120119
.get((req, res) => {
121-
if (!this.checkInititialized(res)) { return; }
120+
if (!this.checkInitialized(res)) { return; }
122121
res.json({ success: true });
123122
});
124123

@@ -342,7 +341,7 @@ module.exports = {
342341
},
343342

344343
answerModuleApi(req, res) {
345-
if (!this.checkInititialized(res)) { return; }
344+
if (!this.checkInitialized(res)) { return; }
346345
var dataMerged = this.mergeData().data
347346

348347
if (!req.params.moduleName) {
@@ -427,7 +426,7 @@ module.exports = {
427426
}
428427
// If only a URL Parameter is passed, it will be sent as a string
429428
// If we have either a query string or a payload already provided w the action,
430-
// then the paramteter will be inside the payload.param property.
429+
// then the parameter will be inside the payload.param property.
431430
delete req.query.apiKey;
432431
let query = { notification: n };
433432
if (req.params.p && req.params.p === "delay") {
@@ -478,7 +477,7 @@ module.exports = {
478477
return;
479478
},
480479

481-
checkInititialized(res) {
480+
checkInitialized(res) {
482481
if (!this.initialized) {
483482
this.sendResponse(res, "Not initialized, have you opened or refreshed your browser since the last time you started MagicMirror²?");
484483
return false;

CHANGELOG.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6-
and this project adheres to [Semantic Versioning](http://semver.org/).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/).
7+
8+
## [2.5.0] - Unreleased (`develop` branch)
9+
10+
### Added
11+
12+
- Added a spell checker and fixed problems that were found.
713

814
## [2.4.0] - 2024-10-08
915

@@ -120,7 +126,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
120126
### Added
121127

122128
- Updates now show if there's an update available every day (#52)
123-
- Templates for issues and PRs, and also stale for automanagement of issues.
129+
- Templates for issues and PRs, and also stale for auto management of issues.
124130
- Close Dev Tools (#119)
125131
- Undo Config Implementation [Beta]
126132
- Classes to show, hide or toggle multiple modules at once (#34)
@@ -150,7 +156,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
150156

151157
## [2.1.0] - 2020-11-01
152158

153-
Hello! Ezequiel here. Just wanted to say thanks for trust in me, in the past days I made a lot of changes into the code, adding some functions that'll surely be in a future release, and also putting everything together in my fork. I answered almost every issue raised, and tried to help every person that use this module. Today, I'm glad to be able to share everything I learned to all of you. I apologize for some fast and uncommented commits, I just thinked that some things needed to be fixed ASAP.
159+
Hello! Ezequiel here. Just wanted to say thanks for trust in me, in the past days I made a lot of changes into the code, adding some functions that'll surely be in a future release, and also putting everything together in my fork. I answered almost every issue raised, and tried to help every person that use this module. Today, I'm glad to be able to share everything I learned to all of you. I apologize for some fast and uncommented commits, I just thought that some things needed to be fixed ASAP.
154160
See you in future commits, issues and PRs :D
155161

156162
### Fixed
@@ -162,7 +168,7 @@ See you in future commits, issues and PRs :D
162168
- IP now showing (#194)
163169
- MM restart button don't just stop anymore (#126)
164170
- Saving config should work as expected now (#153)
165-
- installer.sh now detects where's the node instalation (#222)
171+
- installer.sh now detects where's the node installation (#222)
166172

167173
### Added
168174

@@ -178,7 +184,7 @@ See you in future commits, issues and PRs :D
178184

179185
## [2.0.1] - 2020-10-28
180186

181-
**Huge thanks to [@ezeholz](https://github.com/ezeholz)** who has offered to maintain the module fron now on!
187+
**Huge thanks to [@ezeholz](https://github.com/ezeholz)** who has offered to maintain the module from now on!
182188
Credit for this (and future) versions and releases goes to @ezeholz (unless noted otherwise).
183189

184190
Now requires MagicMirror² version 2.7.
@@ -191,7 +197,7 @@ Now requires MagicMirror² version 2.7.
191197

192198
## [2.0.0] - 2019-02-21
193199

194-
Huge shoutout to [shbatm](https://github.com/shbatm) for his work on this new major version, which brings a new API, custom menus and commands and lots of other stuff:
200+
Huge shout out to [shbatm](https://github.com/shbatm) for his work on this new major version, which brings a new API, custom menus and commands and lots of other stuff:
195201

196202
### Added
197203

@@ -307,7 +313,7 @@ Huge shoutout to [shbatm](https://github.com/shbatm) for his work on this new ma
307313
- Menu to change the `config.js`
308314
- Modules can be installed, added, removed, configured
309315
- There will be backups of the five last versions of the `config.js` in the `config` folder
310-
- Some of these parts are hidden behind an "exprimental" warning, do **not** ignore that warning
316+
- Some of these parts are hidden behind an "experimental" warning, do **not** ignore that warning
311317
- NOTIFICATION action, see [README.md](README.md#notification-request) for details
312318

313319
### Changed

MMM-Remote-Control.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* MIT Licensed.
88
*/
99

10-
/* jshint esversion:6 */
11-
1210
Module.register("MMM-Remote-Control", {
1311

1412
requiresVersion: "2.12.0",

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This module for the [MagicMirror²](https://github.com/MagicMirrorOrg/MagicMirror) allows you to quickly shutdown your mirror through a web browser.
44
The website should work fine on any device (desktop, smart phone, tablet, ...).
5-
Since we all want our [SD cards to live a long and prosper life](http://raspberrypi.stackexchange.com/a/383) we properly shut down before pulling the power plug everytime, am I right?
5+
Since we all want our [SD cards to live a long and prosper life](http://raspberrypi.stackexchange.com/a/383) we properly shut down before pulling the power plug every time, am I right?
66
Additionally you can hide and show modules on your mirror and do other cool stuff.
77

88
![The Main Menu](.github/main.png)
@@ -55,7 +55,7 @@ npm install
5555

5656
- (3) For security reasons, the MagicMirror² (and therefore the Remote Control) is *not* reachable externally.
5757
To change this, configure `address`, and `ipWhitelist` in your `config.js` (see [these lines in the sample config](https://github.com/MagicMirrorOrg/MagicMirror/blob/master/config/config.js.sample#L12-L22)).
58-
For example change `address` to `0.0.0.0` and add two allowed devices with IP-Adresses `192.168.0.42` and `192.168.0.50`:
58+
For example change `address` to `0.0.0.0` and add two allowed devices with IP addresses `192.168.0.42` and `192.168.0.50`:
5959

6060
```js
6161
address : '0.0.0.0',
@@ -122,7 +122,7 @@ If this happens, simply reconfigure and save it again.
122122
## Call methods from other modules
123123
124124
You can call any of the methods provided in the UI directly through a GET request, or a module notification.
125-
For example you can use [MMM-ModuleScheduler](https://forum.magicmirror.builders/topic/691/mmm-modulescheduler) to automatically shutdown your RasberryPi at a certain time, or integrate it with home automation systems. Or use [MMM-Navigate](https://github.com/Ax-LED/MMM-Navigate) to allow direct actions from your Mirror by using a rotating button.
125+
For example you can use [MMM-ModuleScheduler](https://forum.magicmirror.builders/topic/691/mmm-modulescheduler) to automatically shutdown your RaspberryPi at a certain time, or integrate it with home automation systems. Or use [MMM-Navigate](https://github.com/Ax-LED/MMM-Navigate) to allow direct actions from your Mirror by using a rotating button.
126126
127127
### Examples
128128
@@ -177,7 +177,7 @@ See some specific examples for controlling your mirror from other modules and ad
177177
| :-: | ------------- |
178178
| HIDE | Hide a module, with the name (or identifier--see `MODULE_DATA` action) specified by `module` in the payload. You can also send `module: "all"` to hide all modules. |
179179
| SHOW | Show a module (see above for how to specify which one). |
180-
| TOGGLE | Toggle a module's visiblity (see above for how to specify which one). |
180+
| TOGGLE | Toggle a module's visibility (see above for how to specify which one). |
181181
| FORCE | Force a module to show (see above for how to specify which one). |
182182
| MODULE_DATA | Returns a JSON format of the data displayed in the UI, including all valid identifiers for the `HIDE` and `SHOW` action. |
183183
@@ -243,7 +243,7 @@ Depending on your installation, some `shell` commands used by this module are no
243243
### Custom Classes
244244
245245
You probably wanna hide or show some modules at the same time, right? It's everything that we want this module for, of course.
246-
Well, now you can add as many classes as you like, and define whether they show themself, hide or toggle between the two stages!
246+
Well, now you can add as many classes as you like, and define whether they show themselves, hide or toggle between the two stages!
247247
248248
```js
249249
classes: {

cspell.config.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"words": [
5+
"apikey",
6+
"articlelessdetails",
7+
"articlemoredetails",
8+
"articlenext",
9+
"articleprevious",
10+
"articlescrollup",
11+
"articletogglefull",
12+
"Ausschalten",
13+
"Bethge",
14+
"bokmål",
15+
"cambio",
16+
"chlog",
17+
"defaultmodules",
18+
"Energieoptionen",
19+
"extdocs",
20+
"ezeholz",
21+
"Ezequiel",
22+
"Flickr",
23+
"FULLSCREEN",
24+
"HIDEALERT",
25+
"HIDEALL",
26+
"jopyth",
27+
"juzim",
28+
"kapsolas",
29+
"Keyport",
30+
"khassel",
31+
"Kristjan",
32+
"kvpairs",
33+
"listname",
34+
"LOCKSTRING",
35+
"lockstrings",
36+
"longname",
37+
"MODULEAPI",
38+
"MONITOROFF",
39+
"MONITORON",
40+
"MONITORSTATUS",
41+
"MONITORTIMED",
42+
"MONITORTOGGLE",
43+
"mymodulename",
44+
"mypayload",
45+
"Mysh",
46+
"navicon",
47+
"newsfeed",
48+
"newsitems",
49+
"Norsk",
50+
"plusplus",
51+
"REFRESHMM",
52+
"remotecontrol",
53+
"RESTARTMM",
54+
"revparse",
55+
"SENDALERT",
56+
"shbatm",
57+
"showalert",
58+
"SHOWALL",
59+
"somthingelse",
60+
"TOGGLEFULLSCREEN",
61+
"UPDATEMM",
62+
"userpresence",
63+
"vcgencmd",
64+
"Wooo",
65+
"xsmall",
66+
"YOURAPIKEY"
67+
],
68+
"ignorePaths": [
69+
"modules.json",
70+
"node_modules/**",
71+
"translations/**",
72+
"*.min.js"
73+
],
74+
"dictionaries": [
75+
"node"
76+
]
77+
}

custom_menu.example.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"text": "Menu Item 1",
1111
"action": "NOTIFICATION",
1212
"content": {
13-
"notification": "NOTIFCATION_TEXT_1",
13+
"notification": "NOTIFICATION_TEXT_1",
1414
"payload": "This notification requires a string payload"
1515
}
1616
},
@@ -21,7 +21,7 @@
2121
"text": "Menu Item 2",
2222
"action": "NOTIFICATION",
2323
"content": {
24-
"notification": "NOTIFCATION_TEXT_2",
24+
"notification": "NOTIFICATION_TEXT_2",
2525
"payload": {
2626
"title": "Payload Object",
2727
"message": "This notification requires a payload object"
@@ -35,7 +35,7 @@
3535
"text": "Menu Item 3",
3636
"action": "NOTIFICATION",
3737
"content": {
38-
"notification": "NOTIFCATION_TEXT_3",
38+
"notification": "NOTIFICATION_TEXT_3",
3939
"payload": null
4040
}
4141
},
@@ -52,7 +52,7 @@
5252
"text": "Sub-Menu Item 1",
5353
"action": "NOTIFICATION",
5454
"content": {
55-
"notification": "NOTIFCATION_TEXT_4",
55+
"notification": "NOTIFICATION_TEXT_4",
5656
"payload": "This notification requires a string payload"
5757
}
5858
},
@@ -63,7 +63,7 @@
6363
"text": "Sub-Menu Item 2",
6464
"action": "NOTIFICATION",
6565
"content": {
66-
"notification": "NOTIFCATION_TEXT_5",
66+
"notification": "NOTIFICATION_TEXT_5",
6767
"payload": {
6868
"title": "Payload Object",
6969
"message": "This notification requires a payload object"

docs/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@
700700
"NO_RISK_NO_FUN": "No risk no fun!",
701701
"CONFIRM_SHUTDOWN": "The system will shut down.",
702702
"CONFIRM_RESTART": "The system will restart.",
703-
"LOAD_ERROR": "If you see this message, an errror occured when loading the javascript file. Please go to the following link and see if this a known problem with your browser:",
703+
"LOAD_ERROR": "If you see this message, an error occurred when loading the javascript file. Please go to the following link and see if this a known problem with your browser:",
704704
"ISSUE_LINK": "Github issue page",
705705
"DONE": "Done.",
706706
"ERROR": "Error!",

0 commit comments

Comments
 (0)