diff --git a/.github/ISSUE_TEMPLATE/Bug_report.yml b/.github/ISSUE_TEMPLATE/Bug_report.yml index b2c3625..e4752aa 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.yml +++ b/.github/ISSUE_TEMPLATE/Bug_report.yml @@ -10,7 +10,7 @@ body: Also, you accept that, if this issue it's invalid in any way, will be discarded without receiving any response about it. If you're not sure if it's a bug, please [ask here](https://github.com/Jopyth/MMM-Remote-Control/discussions). - + Thanks for taking the time to help Remote Control get better every day! - type: input attributes: @@ -26,7 +26,7 @@ body: description: | example: - NodeJS: 14.17.5 - placeholder: '14.17.5' + placeholder: "14.17.5" validations: required: true - type: input @@ -35,7 +35,7 @@ body: description: | example: - MM: 2.16.0 - placeholder: '2.16.0' + placeholder: "2.16.0" validations: required: true - type: input @@ -44,15 +44,15 @@ body: description: | example: - Remote Control: 2.3.6 - placeholder: '2.3.6' + placeholder: "2.3.6" validations: required: true - type: checkboxes attributes: label: Did you try using just Remote Control alone with MM? options: - - label: I have and the error still happening - required: true + - label: I have and the error still happening + required: true - type: textarea attributes: label: Description @@ -115,4 +115,4 @@ body: label: Additional info description: Everything else that you think could be useful for us. ;D validations: - required: false \ No newline at end of file + required: false diff --git a/.github/ISSUE_TEMPLATE/Feature_request.yml b/.github/ISSUE_TEMPLATE/Feature_request.yml index 180aeb6..d373d45 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.yml +++ b/.github/ISSUE_TEMPLATE/Feature_request.yml @@ -29,4 +29,4 @@ body: label: Additional info description: Everything else that you think could be useful for us. ;D validations: - required: false \ No newline at end of file + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a6ecb4f..07fe55d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,4 +2,4 @@ blank_issues_enabled: false contact_links: - name: Discussions url: https://github.com/Jopyth/MMM-Remote-Control/discussions - about: Don't know how to do it? Ask the community! \ No newline at end of file + about: Don't know how to do it? Ask the community! diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ff1301d..3918fe7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,4 +16,4 @@ You can click them in preview mode! If clicking those links let you with the same description, just erase everything above and tell us what's your PR about! ---> \ No newline at end of file +--> diff --git a/.github/PULL_REQUEST_TEMPLATE/Bug_fixes.md b/.github/PULL_REQUEST_TEMPLATE/Bug_fixes.md index 400c80e..522744b 100644 --- a/.github/PULL_REQUEST_TEMPLATE/Bug_fixes.md +++ b/.github/PULL_REQUEST_TEMPLATE/Bug_fixes.md @@ -23,4 +23,4 @@ Fixes # ### Additional info - \ No newline at end of file + diff --git a/.github/PULL_REQUEST_TEMPLATE/Feature_addition.md b/.github/PULL_REQUEST_TEMPLATE/Feature_addition.md index 7bfdc5c..0a84832 100644 --- a/.github/PULL_REQUEST_TEMPLATE/Feature_addition.md +++ b/.github/PULL_REQUEST_TEMPLATE/Feature_addition.md @@ -24,4 +24,4 @@ You can now erase this warning, and complete the steps below. Cheers :D ### Additional info - \ No newline at end of file + diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 7ddc52d..7c10449 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,6 +1,6 @@ -name: 'Close stale issues and PRs' +name: "Close stale issues and PRs" on: - schedule: [{cron: "0 12 * * *"},{cron: "0 0 * * *"}] + schedule: [{ cron: "0 12 * * *" }, { cron: "0 0 * * *" }] jobs: stale: @@ -23,8 +23,8 @@ jobs: days-before-pr-stale: 30 days-before-issue-close: 7 days-before-pr-close: 7 - stale-issue-label: 'stale' - exempt-issue-labels: 'working,help wanted,PR Welcome!' - stale-pr-label: 'stale' - exempt-pr-labels: 'working,help wanted' + stale-issue-label: "stale" + exempt-issue-labels: "working,help wanted,PR Welcome!" + stale-pr-label: "stale" + exempt-pr-labels: "working,help wanted" exempt-all-milestones: true diff --git a/API/README.md b/API/README.md index 716230a..b877ee7 100644 --- a/API/README.md +++ b/API/README.md @@ -2,7 +2,7 @@ ## Introduction -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. +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. 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). @@ -83,7 +83,7 @@ $ curl -X POST http://magicmirrorip:8080/api/module/alert/showalert \ }' ``` -***For convenience, the remainder of the examples omit the API Key*** +**_For convenience, the remainder of the examples omit the API Key_** ## Secure Endpoints @@ -106,13 +106,13 @@ Setting secureEndpoints to false allow every endpoint to be reachable externally There are three general categories of API commands: -**1. MMM-Remote-Control Internal Commands** -- these are used to call the existing commands that MMM-Remote-Control already exposes. For example, to turn off the monitor ("MONITOROFF"): +**1. MMM-Remote-Control Internal Commands** -- these are used to call the existing commands that MMM-Remote-Control already exposes. For example, to turn off the monitor ("MONITOROFF"): ```bash curl -X GET http://magicmirrorip:8080/api/monitor/off ``` -**2. External APIs (Guessed)** -- when this module first loads, it parses all of the installed modules' source code and checks for any custom notifications that are used. From this basic search, it tries to "guess" notification actions that may be valid, without them being explicitly defined anywhere else. For example, the "alert" command examples above are not defined within this module, the 'alert' module just looks for a notification, "SHOW_ALERT"--this is exposed as a `/module/alert/showalert` action in the External API processor. Full credit to this idea goes to `juzim` from the MMM-Api module. +**2. External APIs (Guessed)** -- when this module first loads, it parses all of the installed modules' source code and checks for any custom notifications that are used. From this basic search, it tries to "guess" notification actions that may be valid, without them being explicitly defined anywhere else. For example, the "alert" command examples above are not defined within this module, the 'alert' module just looks for a notification, "SHOW_ALERT"--this is exposed as a `/module/alert/showalert` action in the External API processor. Full credit to this idea goes to `juzim` from the MMM-Api module. **3. External APIs (Explicit)** -- these commands are developed when a module loads and sends a "REGISTER_API" notification with command details to this module. These commands will overwrite any "guessed" commands and can provide a way for a module to define its own API, but still use the same routes already in place. @@ -128,12 +128,12 @@ Or check it in your own installation using `:moduleName`: Name or Identifier for an installed & activated module. +| Method | URL | Description | +| ------ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| GET | /api/module | Return a list of all external API actions registered. | +| GET | /api/module/:moduleName | Returns registered API actions for a given module
`:moduleName`: Name or Identifier for an installed & activated module. | -- *NOTE:* Just because an action appears in this list, does not necessarily mean it is valid and the related module will do what you want. Consult each modules' README for details on what notifications can be used and how. +- _NOTE:_ Just because an action appears in this list, does not necessarily mean it is valid and the related module will do what you want. Consult each modules' README for details on what notifications can be used and how. #### Example @@ -145,43 +145,43 @@ curl -X GET http://magicmirrorip:8080/api/module/newsfeed ```json { - "success": true, - "module": "newsfeed", - "path": "newsfeed", - "actions": { - "newsitems": { - "notification": "NEWS_ITEMS" - }, - "articlenext": { - "notification": "ARTICLE_NEXT" - }, - "articleprevious": { - "notification": "ARTICLE_PREVIOUS" - }, - "articlemoredetails": { - "notification": "ARTICLE_MORE_DETAILS" - }, - "articlescrollup": { - "notification": "ARTICLE_SCROLL_UP" - }, - "articlelessdetails": { - "notification": "ARTICLE_LESS_DETAILS" - }, - "articletogglefull": { - "notification": "ARTICLE_TOGGLE_FULL" - } + "success": true, + "module": "newsfeed", + "path": "newsfeed", + "actions": { + "newsitems": { + "notification": "NEWS_ITEMS" }, - "guessed": true + "articlenext": { + "notification": "ARTICLE_NEXT" + }, + "articleprevious": { + "notification": "ARTICLE_PREVIOUS" + }, + "articlemoredetails": { + "notification": "ARTICLE_MORE_DETAILS" + }, + "articlescrollup": { + "notification": "ARTICLE_SCROLL_UP" + }, + "articlelessdetails": { + "notification": "ARTICLE_LESS_DETAILS" + }, + "articletogglefull": { + "notification": "ARTICLE_TOGGLE_FULL" + } + }, + "guessed": true } ``` -| Parameter | Description | -| :-: | -- | -| `"success"` | Result of the GET call -| `"module"` | Module name -| `"path"` | API path to use. All lower case, with "MMM-" and "-"s removed (e.g. MMM-Remote-Control's path if it had one would be `/api/module/remotecontrol/`). Can be customized for explicit External APIs. -| `"actions"` | The list of actions registered, along with the respective notifications that they will call.
For example, `GET /api/module/newsfeed/articlenext` will send a `"ARTICLE_NEXT"` notification to the `newsfeed` module -| `"guessed"` | Whether or not the API actions were guessed (not all are reliable) or if they were explicitly provided by the module. +| Parameter | Description | +| :---------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `"success"` | Result of the GET call | +| `"module"` | Module name | +| `"path"` | API path to use. All lower case, with "MMM-" and "-"s removed (e.g. MMM-Remote-Control's path if it had one would be `/api/module/remotecontrol/`). Can be customized for explicit External APIs. | +| `"actions"` | The list of actions registered, along with the respective notifications that they will call.
For example, `GET /api/module/newsfeed/articlenext` will send a `"ARTICLE_NEXT"` notification to the `newsfeed` module | +| `"guessed"` | Whether or not the API actions were guessed (not all are reliable) or if they were explicitly provided by the module. | ### 3. External APIs (Explicit) - Extending Another Module with this API @@ -195,30 +195,30 @@ let payload = { path: "mymodulename", actions: { actionName: { - method: "GET", - notification: "NOTIFICATION_TO_SEND", - payload: ObjectToSend, - prettyName: "Action Name" + method: "GET", + notification: "NOTIFICATION_TO_SEND", + payload: ObjectToSend, + prettyName: "Action Name" }, anotherActionName: { - method: "POST", - notification: "NOTIFICATION_TO_SEND" + method: "POST", + notification: "NOTIFICATION_TO_SEND" } } }; this.sendNotification("REGISTER_API", payload); ``` -| Parameter | Description | -| :-: | - | -| `module` | Actual Name of your Module (e.g. "MMM-Your-Module-Name, or just use `this.name`) -| `path` | Path to use in the API (e.g. `path: "mymodulename"`) translates to `/api/module/mymodulename` -| `actions` | An `Object` defining the actions you want to expose. See below for details. -| `actionName` | The name for your action (e.g. called from `/api/module/mymodulename/actionName`). -| `method` | *Optional:* The HTTP Method to use.
Valid options are: `"GET"` or `"POST"`. If `method` is not provided in an action, then both `"GET"` or `"POST"` methods will be treated as valid. -| `notification` | The notification to send to your module. When the API receives a valid action, it passes a Module Notification to your module. It is your responsibility to do something with that notification to make the action work. -| `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. -| `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:
1. URL Parameter, if used. See notes on `payload` Object below.
2. Query String, if used. API key will be removed.
3. Request body, if `POST` method is used and a body sent.
4. Finally, this parameter. +| Parameter | Description | +| :------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `module` | Actual Name of your Module (e.g. "MMM-Your-Module-Name, or just use `this.name`) | +| `path` | Path to use in the API (e.g. `path: "mymodulename"`) translates to `/api/module/mymodulename` | +| `actions` | An `Object` defining the actions you want to expose. See below for details. | +| `actionName` | The name for your action (e.g. called from `/api/module/mymodulename/actionName`). | +| `method` | _Optional:_ The HTTP Method to use.
Valid options are: `"GET"` or `"POST"`. If `method` is not provided in an action, then both `"GET"` or `"POST"` methods will be treated as valid. | +| `notification` | The notification to send to your module. When the API receives a valid action, it passes a Module Notification to your module. It is your responsibility to do something with that notification to make the action work. | +| `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. | +| `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:
1. URL Parameter, if used. See notes on `payload` Object below.
2. Query String, if used. API key will be removed.
3. Request body, if `POST` method is used and a body sent.
4. Finally, this parameter. | #### About the `payload` object diff --git a/API/api.js b/API/api.js index 7130116..20c75f7 100644 --- a/API/api.js +++ b/API/api.js @@ -103,7 +103,7 @@ module.exports = { }, createApiRoutes() { - var self = this; + let self = this; this.getApiKey(); @@ -128,7 +128,7 @@ module.exports = { if (typeof this.apiKey !== "undefined") { if (!("authorization" in req.headers) || req.headers.authorization.search(/(apikey|bearer)/gi) === -1) { // API Key was not provided as a header. Check the URL. - var query = url.parse(req.url, true).query; + let query = url.parse(req.url, true).query; if ("apiKey" in query) { if (query.apiKey !== this.apiKey) { return res.status(401).json({ success: false, message: "Unauthorized: Wrong API Key Provided!" }); @@ -183,7 +183,7 @@ module.exports = { this.expressRouter.route('/classes/:value') .get((req, res) => { - var classes = self.getConfig().modules.find(m => m.module === "MMM-Remote-Control").config || {}; + let classes = self.getConfig().modules.find(m => m.module === "MMM-Remote-Control").config || {}; const val = decodeURIComponent(req.params.value) if(classes.classes && classes.classes[val]) { self.executeQuery({ action: "MANAGE_CLASSES", payload: { classes: req.params.value} }, res); @@ -280,7 +280,7 @@ module.exports = { this.expressRouter.route('/monitor/:action?/:delayed?') .get((req, res) => { if (!req.params.action) { req.params.action = "STATUS"; } - var actionName = req.params.action.toUpperCase(); + let actionName = req.params.action.toUpperCase(); this.executeQuery(this.checkDelay({ action: `MONITOR${actionName}` }, req), res); }) .post((req, res) => { @@ -325,9 +325,9 @@ module.exports = { }, mergeData() { - var extApiRoutes = this.externalApiRoutes; - var modules = this.configData.moduleData - var query = {success: true, data: []}; + let extApiRoutes = this.externalApiRoutes; + let modules = this.configData.moduleData + let query = {success: true, data: []}; modules.forEach((mod) => { if (extApiRoutes[mod.name] === undefined) { @@ -342,7 +342,7 @@ module.exports = { answerModuleApi(req, res) { if (!this.checkInitialized(res)) { return; } - var dataMerged = this.mergeData().data + let dataMerged = this.mergeData().data if (!req.params.moduleName) { res.json({ success: true, data: dataMerged }); @@ -373,7 +373,7 @@ module.exports = { return; } - var action = req.params.action.toUpperCase(); + let action = req.params.action.toUpperCase(); if (["SHOW", "HIDE", "FORCE", "TOGGLE", "DEFAULTS"].indexOf(action) !== -1) { // /api/modules part of the code if (action === "DEFAULTS") { diff --git a/MMM-Remote-Control.js b/MMM-Remote-Control.js index a6043c6..64eb188 100644 --- a/MMM-Remote-Control.js +++ b/MMM-Remote-Control.js @@ -161,9 +161,9 @@ Module.register("MMM-Remote-Control", { }, buildCssContent(brightness) { - var css = ""; + let css = ""; - var defaults = { + let defaults = { "body": parseInt("aa", 16), "header": parseInt("99", 16), ".dimmed": parseInt("66", 16), @@ -171,8 +171,8 @@ Module.register("MMM-Remote-Control", { ".bright": parseInt("ff", 16) }; - for (var key in defaults) { - var value = defaults[key] / 100 * brightness; + for (let key in defaults) { + let value = defaults[key] / 100 * brightness; value = Math.round(value); value = Math.min(value, 255); if (value < 16) { @@ -180,7 +180,7 @@ Module.register("MMM-Remote-Control", { } else { value = value.toString(16); } - var extra = ""; + let extra = ""; if (key === "header") { extra = "border-bottom: 1px solid #" + value + value + value + ";"; } @@ -199,13 +199,13 @@ Module.register("MMM-Remote-Control", { this.brightness = newBrightnessValue; - var style = document.getElementById('remote-control-styles'); + let style = document.getElementById('remote-control-styles'); if (!style) { // create custom css if not existing style = document.createElement('style'); style.type = 'text/css'; style.id = 'remote-control-styles'; - var parent = document.getElementsByTagName('head')[0]; + let parent = document.getElementsByTagName('head')[0]; parent.appendChild(style); } @@ -225,29 +225,29 @@ Module.register("MMM-Remote-Control", { }, createOverlay(brightness) { - var overlay = document.getElementById('remote-control-overlay'); + let overlay = document.getElementById('remote-control-overlay'); if (!overlay) { // if not existing, create overlay overlay = document.createElement("div"); overlay.id = "remote-control-overlay"; - var parent = document.body; + let parent = document.body; parent.insertBefore(overlay, parent.firstChild); } - var bgColor = "rgba(0,0,0," + (100 - brightness) / 100 + ")"; + let bgColor = "rgba(0,0,0," + (100 - brightness) / 100 + ")"; overlay.style.backgroundColor = bgColor; }, removeOverlay() { - var overlay = document.getElementById('remote-control-overlay'); + let overlay = document.getElementById('remote-control-overlay'); if (overlay) { - var parent = document.body; + let parent = document.body; parent.removeChild(overlay); } }, getDom() { - var wrapper = document.createElement("div"); - var portToShow = '' + let wrapper = document.createElement("div"); + let portToShow = '' if (this.addresses.length === 0) { this.addresses = ["ip-of-your-mirror"]; } @@ -262,10 +262,10 @@ Module.register("MMM-Remote-Control", { }, sendCurrentData() { - var self = this; + let self = this; - var modules = MM.getModules(); - var currentModuleData = []; + let modules = MM.getModules(); + let currentModuleData = []; modules.enumerate(function(module) { let modData = Object.assign({}, module.data); modData.hidden = module.hidden; @@ -273,7 +273,7 @@ Module.register("MMM-Remote-Control", { modData.config = module.config; currentModuleData.push(modData); }); - var configData = { + let configData = { moduleData: currentModuleData, brightness: this.brightness, settingsVersion: this.settingsVersion, diff --git a/README.md b/README.md index 141e62d..33e5e7f 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ npm install }, ``` -- (3) For security reasons, the MagicMirror² (and therefore the Remote Control) is *not* reachable externally. -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)). -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`: +- (3) For security reasons, the MagicMirror² (and therefore the Remote Control) is _not_ reachable externally. + 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)). + 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`: ```js address : '0.0.0.0', @@ -73,7 +73,7 @@ You can also add multiple devices in an IP range (e.g. all devices with `192.168 - (5) Access the remote interface on [http://192.168.xxx.xxx:8080/remote.html](http://192.168.xxx.xxx:8080/remote.html) (replace with IP address of your RaspberryPi). -Note: If your user does not have `sudo` rights, the shutdown does not work (it *should* work for everyone who did not change anything on this matter). +Note: If your user does not have `sudo` rights, the shutdown does not work (it _should_ work for everyone who did not change anything on this matter). ### Update @@ -122,7 +122,7 @@ If this happens, simply reconfigure and save it again. ## Call methods from other modules You can call any of the methods provided in the UI directly through a GET request, or a module notification. -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. +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. ### Examples @@ -144,52 +144,52 @@ See some specific examples for controlling your mirror from other modules and ad #### System Control -| Action | Description | -| :-: | ------------- | -| SHUTDOWN | Shutdown your RaspberryPi | -| REBOOT | Restart your RaspberryPi | -| MONITORON | Switch your display on. Also sends a `"USER_PRESENCE": true` notification. | -| MONITOROFF | Switch your display off. Also sends a `"USER_PRESENCE": false` notification. | +| Action | Description | +| :-----------: | ----------------------------------------------------------------------------- | +| SHUTDOWN | Shutdown your RaspberryPi | +| REBOOT | Restart your RaspberryPi | +| MONITORON | Switch your display on. Also sends a `"USER_PRESENCE": true` notification. | +| MONITOROFF | Switch your display off. Also sends a `"USER_PRESENCE": false` notification. | | MONITORTOGGLE | Toggle the display on or off (with respective `"USER_PRESENCE"` notification. | -| MONITORSTATUS | Report back the monitor status (on or off) | +| MONITORSTATUS | Report back the monitor status (on or off) | #### MagicMirror² Control -| Action | Description | -| :-: | ------------- | -| RESTART | Restart your MagicMirror² | -| REFRESH | Refresh mirror page | -| UPDATE | Update MagicMirror² and any of it's modules | -| SAVE | Save the current configuration (show and hide status of modules, and brightness), will be applied after the mirror starts | +| Action | Description | +| :--------: | -------------------------------------------------------------------------------------------------------------------------------------- | +| RESTART | Restart your MagicMirror² | +| REFRESH | Refresh mirror page | +| UPDATE | Update MagicMirror² and any of it's modules | +| SAVE | Save the current configuration (show and hide status of modules, and brightness), will be applied after the mirror starts | | BRIGHTNESS | Change mirror brightness, with the new value specified by `value`. `100` equals the default, possible range is between `10` and `200`. | #### MagicMirror² Electron Browser Window Control -| Action | Description | -| :-: | ------------- | -| MINIMIZE | Minimize the browser window. | +| Action | Description | +| :--------------: | ---------------------------------- | +| MINIMIZE | Minimize the browser window. | | TOGGLEFULLSCREEN | Toggle fullscreen mode on and off. | -| DEVTOOLS | Open the DevTools console window. | +| DEVTOOLS | Open the DevTools console window. | #### Module Control -| Action | Description | -| :-: | ------------- | -| 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. | -| SHOW | Show a module (see above for how to specify which one). | -| TOGGLE | Toggle a module's visibility (see above for how to specify which one). | -| FORCE | Force a module to show (see above for how to specify which one). | -| MODULE_DATA | Returns a JSON format of the data displayed in the UI, including all valid identifiers for the `HIDE` and `SHOW` action. | +| Action | Description | +| :---------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 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. | +| SHOW | Show a module (see above for how to specify which one). | +| TOGGLE | Toggle a module's visibility (see above for how to specify which one). | +| FORCE | Force a module to show (see above for how to specify which one). | +| MODULE_DATA | Returns a JSON format of the data displayed in the UI, including all valid identifiers for the `HIDE` and `SHOW` action. | #### Alerts and Notifications -| Action | Description | -| :-: | ------------- | -| SHOW_ALERT | Show Default Alert/Notification | -| HIDE_ALERT | Hide Default Alert/Notification | -| USER_PRESENCE | Will send a notification "USER_PRESENCE" = true or false (according to "value" to all other modules. See examples above| -| NOTIFICATION | To send a notification to all modules, see the example in the [API README](API/README.md) | -| DELAYED | Send any of the above nested inside a "DELAYED" call to delay the action. Default is 10s. See Delayed Actions below. | +| Action | Description | +| :-----------: | ----------------------------------------------------------------------------------------------------------------------- | +| SHOW_ALERT | Show Default Alert/Notification | +| HIDE_ALERT | Hide Default Alert/Notification | +| USER_PRESENCE | Will send a notification "USER_PRESENCE" = true or false (according to "value" to all other modules. See examples above | +| NOTIFICATION | To send a notification to all modules, see the example in the [API README](API/README.md) | +| DELAYED | Send any of the above nested inside a "DELAYED" call to delay the action. Default is 10s. See Delayed Actions below. | ### Format of module data response @@ -197,13 +197,23 @@ The response will be in the JSON format, here is an example: ```json { -"moduleData":[ - {"hidden":false,"name":"alert","identifier":"module_0_alert"}, - {"hidden":true,"name":"clock","identifier":"module_1_clock","position":"bottom_right"}, - {"hidden":false,"name":"weather","identifier":"module_2_weather","position":"top_right"} -], -"brightness":40, -"settingsVersion":1 + "moduleData": [ + { "hidden": false, "name": "alert", "identifier": "module_0_alert" }, + { + "hidden": true, + "name": "clock", + "identifier": "module_1_clock", + "position": "bottom_right" + }, + { + "hidden": false, + "name": "weather", + "identifier": "module_2_weather", + "position": "top_right" + } + ], + "brightness": 40, + "settingsVersion": 1 } ``` @@ -212,23 +222,22 @@ The response will be in the JSON format, here is an example: You can delay an action by sending the notification nested inside of a `"DELAYED"` notification. Below is an example of turning off the monitor in 60s. ```js -this.sendSocketNotification("REMOTE_ACTION", - { - action: "DELAYED", - did: "SOME_UNIQUE_ID", // Optional; Some string, in case you want to cancel later. - timeout: 60, // Optional; Default 10s - abort: false, // Optional; send true to cancel an existing timer - query: { - action: "MONITOROFF" - } - }); +this.sendSocketNotification("REMOTE_ACTION", { + action: "DELAYED", + did: "SOME_UNIQUE_ID", // Optional; Some string, in case you want to cancel later. + timeout: 60, // Optional; Default 10s + abort: false, // Optional; send true to cancel an existing timer + query: { + action: "MONITOROFF" + } +}); ``` Can also be used with the [API](https://documenter.getpostman.com/view/6167403/Rzfni66c) by adding `/delay?timeout=10s&did=something` to some routes. ### Using Custom Commands -Depending on your installation, some `shell` commands used by this module are not appropriate and can be overwritten by something that will work for you. To overwrite the commands, add a `customCommand` object to your config section. The following commands are supported: +Depending on your installation, some `shell` commands used by this module are not appropriate and can be overwritten by something that will work for you. To overwrite the commands, add a `customCommand` object to your config section. The following commands are supported: ```js customCommand: { @@ -267,15 +276,15 @@ An example menu is provided in this module's folder, titled `custom_menu.example #### Key Components -| Name | Description | -| :-: | - | -| `id` | The HTML id prefix to use for the menu item. -| `type` | The item type, either `'menu'` or `'item'`. `'menu'` is used to indicate the item is a sub-menu and has an ``items`` array. `'item'` is used for single menu items and will send a socket "REMOTE_ACTION" notification back to the server. This requires `action:` and `content:` parameters before it can do anything. -| `text` | The text to display. You can use the translate string `'%%TRANSLATE:YOUR_KEY_HERE%%'`, but remember to also update the appropriate file in `/translations`. -| `icon` | The [FontAwesome](https://fontawesome.com/v4.7.0/icons/) icon to use (without the leading `-fa`) -| `items` | An array of sub-menu items to use with `"type":"menu"`. Should be the same format as the top level menu (i.e. the menu structure is recursive). -| `action` | The `REMOTE_ACTION` notification action name, usually `NOTIFICATION`. Required for `"type":"item"` items to be able to do anything. -| `content` | The `REMOTE_ACTION` action payload to send. Usually for `"NOTIFICATION"`, this is of the form `{ "notification": "NOTIFICATION_TO_SEND", "payload": "PAYLOAD_TO_SEND"}` +| Name | Description | +| :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | The HTML id prefix to use for the menu item. | +| `type` | The item type, either `'menu'` or `'item'`. `'menu'` is used to indicate the item is a sub-menu and has an `items` array. `'item'` is used for single menu items and will send a socket "REMOTE_ACTION" notification back to the server. This requires `action:` and `content:` parameters before it can do anything. | +| `text` | The text to display. You can use the translate string `'%%TRANSLATE:YOUR_KEY_HERE%%'`, but remember to also update the appropriate file in `/translations`. | +| `icon` | The [FontAwesome](https://fontawesome.com/v4.7.0/icons/) icon to use (without the leading `-fa`) | +| `items` | An array of sub-menu items to use with `"type":"menu"`. Should be the same format as the top level menu (i.e. the menu structure is recursive). | +| `action` | The `REMOTE_ACTION` notification action name, usually `NOTIFICATION`. Required for `"type":"item"` items to be able to do anything. | +| `content` | The `REMOTE_ACTION` action payload to send. Usually for `"NOTIFICATION"`, this is of the form `{ "notification": "NOTIFICATION_TO_SEND", "payload": "PAYLOAD_TO_SEND"}` | ## License diff --git a/custom_menu.example.json b/custom_menu.example.json index cd8f6e7..bb198b8 100644 --- a/custom_menu.example.json +++ b/custom_menu.example.json @@ -1,76 +1,78 @@ { - "id": "custom", - "type": "menu", - "icon": "id-card-o", - "text": "%%TRANSLATE:CUSTOM_MENU%%", - "items": [{ - "id": "custom-item-1", - "type": "item", - "icon": "dot-circle-o", - "text": "Menu Item 1", - "action": "NOTIFICATION", - "content": { - "notification": "NOTIFICATION_TEXT_1", + "id": "custom", + "type": "menu", + "icon": "id-card-o", + "text": "%%TRANSLATE:CUSTOM_MENU%%", + "items": [ + { + "id": "custom-item-1", + "type": "item", + "icon": "dot-circle-o", + "text": "Menu Item 1", + "action": "NOTIFICATION", + "content": { + "notification": "NOTIFICATION_TEXT_1", + "payload": "This notification requires a string payload" + } + }, + { + "id": "custom-item-2", + "type": "item", + "icon": "dot-circle-o", + "text": "Menu Item 2", + "action": "NOTIFICATION", + "content": { + "notification": "NOTIFICATION_TEXT_2", + "payload": { + "title": "Payload Object", + "message": "This notification requires a payload object" + } + } + }, + { + "id": "custom-item-3", + "type": "item", + "icon": "dot-circle-o", + "text": "Menu Item 3", + "action": "NOTIFICATION", + "content": { + "notification": "NOTIFICATION_TEXT_3", + "payload": null + } + }, + { + "id": "level2", + "type": "menu", + "menu": "custom", + "icon": "bars", + "text": "Sub-Menu", + "items": [ + { + "id": "custom-item-4", + "type": "item", + "icon": "dot-circle-o", + "text": "Sub-Menu Item 1", + "action": "NOTIFICATION", + "content": { + "notification": "NOTIFICATION_TEXT_4", "payload": "This notification requires a string payload" - } - }, - { - "id": "custom-item-2", - "type": "item", - "icon": "dot-circle-o", - "text": "Menu Item 2", - "action": "NOTIFICATION", - "content": { - "notification": "NOTIFICATION_TEXT_2", + } + }, + { + "id": "custom-item-2", + "type": "item", + "icon": "dot-circle-o", + "text": "Sub-Menu Item 2", + "action": "NOTIFICATION", + "content": { + "notification": "NOTIFICATION_TEXT_5", "payload": { - "title": "Payload Object", - "message": "This notification requires a payload object" + "title": "Payload Object", + "message": "This notification requires a payload object" } - } - }, - { - "id": "custom-item-3", - "type": "item", - "icon": "dot-circle-o", - "text": "Menu Item 3", - "action": "NOTIFICATION", - "content": { - "notification": "NOTIFICATION_TEXT_3", - "payload": null - } - }, - { - "id": "level2", - "type": "menu", - "menu": "custom", - "icon": "bars", - "text": "Sub-Menu", - "items": [{ - "id": "custom-item-4", - "type": "item", - "icon": "dot-circle-o", - "text": "Sub-Menu Item 1", - "action": "NOTIFICATION", - "content": { - "notification": "NOTIFICATION_TEXT_4", - "payload": "This notification requires a string payload" - } - }, - { - "id": "custom-item-2", - "type": "item", - "icon": "dot-circle-o", - "text": "Sub-Menu Item 2", - "action": "NOTIFICATION", - "content": { - "notification": "NOTIFICATION_TEXT_5", - "payload": { - "title": "Payload Object", - "message": "This notification requires a payload object" - } - } - } - ] - } - ] -} \ No newline at end of file + } + } + ] + } + ] +} diff --git a/docs/index.html b/docs/index.html index b23ac37..b140744 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,130 +1,142 @@ - - + - - - Remote Control API - - - - - - + } + + + +
-
+ + - - + - - + document.addEventListener("click", function () { + setTimeout(function () { + let cambio = document.getElementsByClassName("response-controls"); + for (let i = 0; i < cambio.length; i++) { + if (cambio[i].parentNode.lastChild != cambio[i]) + cambio[i].parentNode.appendChild(cambio[i]); + } + let place = document.getElementsByClassName( + "parameters-col_description" + ); + try { + for (let i = 0; i < place.length; i++) { + if (place[i].getElementsByTagName("input") != undefined) { + z = place[i].getElementsByTagName("input"); + for (let x = 0; x < z.length; x++) { + if ( + z[x].placeholder.split(" - ")[1] != undefined && + (z[x].placeholder = z[x].placeholder.split(" - ")[1]) + ) + z[x].parentNode.removeChild(z[x].parentNode.children[0]); + } + } + } + } catch (err) { + console.log(err); + } + let code = document.querySelectorAll( + ".response-col_description__inner code" + ); + for (let i = 0; i < code.length; i++) { + code[i].style.background = "#41444e"; + code[i].style.color = "#ffffff"; + } + let sel = document.querySelectorAll("select.content-type"); + for (let i = 0; i < sel.length; i++) { + if (sel[i].childNodes.length <= 1) + sel[i].parentNode.parentNode.removeChild(sel[i].parentNode); + } + }, 100); + }); + }; + + + diff --git a/docs/swagger.json b/docs/swagger.json index ebb569d..3ffd159 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -38,10 +38,7 @@ "paths": { "/api/test": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Test the API to make sure it's working.", "responses": { "200": { @@ -64,9 +61,7 @@ }, "/api/saves": { "get": { - "tags": [ - "API" - ], + "tags": ["API"], "summary": "Return backups of the config file", "security": [ { @@ -98,10 +93,7 @@ }, "/api/classes/{:value}": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "Show or use a class", "parameters": [ { @@ -154,10 +146,7 @@ }, "/api/command/{:value}": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Execute command saved in config", "parameters": [ { @@ -205,9 +194,7 @@ }, "/api/config": { "get": { - "tags": [ - "API" - ], + "tags": ["API"], "summary": "Return the current MagicMirror² configuration", "security": [ { @@ -249,10 +236,7 @@ }, "/api/config/edit": { "post": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Modify the current MagicMirror² configuration", "security": [ { @@ -326,10 +310,7 @@ }, "/api/monitor/{:action}": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Control the connected display, turning it on or off.", "parameters": [ { @@ -382,10 +363,7 @@ }, "/api/monitor/": { "post": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Control the connected display, turning it on or off.", "security": [ { @@ -412,10 +390,7 @@ }, "/api/shutdown": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Shutdown the system", "security": [ { @@ -449,10 +424,7 @@ }, "/api/reboot": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Reboot the system", "security": [ { @@ -486,10 +458,7 @@ }, "/api/restart": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Restart your MagicMirror² instance if using PM2 to control it.", "security": [ { @@ -523,10 +492,7 @@ }, "/api/minimize": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Minimize the browser instance (Electron)", "security": [ { @@ -560,10 +526,7 @@ }, "/api/togglefullscreen": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Toggle fullscreen (Electron)", "security": [ { @@ -597,10 +560,7 @@ }, "/api/devtools": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Toggle devtools (Electron)", "security": [ { @@ -634,9 +594,7 @@ }, "/api/translations": { "get": { - "tags": [ - "API" - ], + "tags": ["API"], "summary": "Returns the currently translations file.", "security": [ { @@ -734,10 +692,7 @@ }, "/api/refresh": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Refresh the screen of your MagicMirror² instance.", "security": [ { @@ -760,9 +715,7 @@ }, "/api/save": { "get": { - "tags": [ - "API" - ], + "tags": ["API"], "summary": "Saves the MMM-Remote-Control defaults to a file.", "security": [ { @@ -794,10 +747,7 @@ }, "/api/brightness/{:setting}": { "get": { - "tags": [ - "Mirror Control", - "API" - ], + "tags": ["Mirror Control", "API"], "summary": "Get or set the brightness of the Mirror by passing a numerical value (1~100)", "parameters": [ { @@ -834,10 +784,7 @@ }, "/api/userpresence/{:value}": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "Get or set user presence status", "security": [ { @@ -873,10 +820,7 @@ }, "/api/module/{:moduleName}": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "See available actions for a module", "parameters": [ { @@ -929,10 +873,7 @@ }, "/api/module/{:moduleName*}/{:action}": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "Execute an action in the module.", "parameters": [ { @@ -974,10 +915,7 @@ }, "/api/module/installed": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "List of all modules currently installed on the machine", "security": [ { @@ -1015,10 +953,7 @@ }, "/api/module/available": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "List of modules available for installation", "security": [ { @@ -1056,10 +991,7 @@ }, "/api/update/{:moduleName}": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "Update the module", "parameters": [ { @@ -1121,10 +1053,7 @@ }, "/api/install": { "post": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "Install a module", "security": [ { @@ -1169,10 +1098,7 @@ }, "/api/notification/{:notification*}/{:p}": { "get": { - "tags": [ - "Module Control", - "API" - ], + "tags": ["Module Control", "API"], "summary": "Send generic notifications to the API", "parameters": [ { @@ -1214,9 +1140,7 @@ }, "/config-help.html": { "get": { - "tags": [ - "Legacy" - ], + "tags": ["Legacy"], "summary": "Send generic notifications to the API", "parameters": [ { @@ -1244,9 +1168,7 @@ }, "/remote": { "get": { - "tags": [ - "Legacy" - ], + "tags": ["Legacy"], "summary": "Send generic notifications to the API", "parameters": [ { @@ -1274,9 +1196,7 @@ }, "/get": { "get": { - "tags": [ - "Legacy" - ], + "tags": ["Legacy"], "summary": "Send generic notifications to the API", "parameters": [ { @@ -1304,9 +1224,7 @@ }, "/post": { "post": { - "tags": [ - "Legacy" - ], + "tags": ["Legacy"], "summary": "Send generic notifications to the API", "parameters": [ { @@ -1342,4 +1260,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules.json b/modules.json index e51c0cc..afee4d8 100644 --- a/modules.json +++ b/modules.json @@ -3177,4 +3177,4 @@ "author": "Menturan", "desc": "Displays Swedish name of the day." } -] \ No newline at end of file +] diff --git a/node_helper.js b/node_helper.js index b599246..b3dacc8 100644 --- a/node_helper.js +++ b/node_helper.js @@ -18,7 +18,7 @@ const bodyParser = require("body-parser"); const express = require("express"); const _ = require("lodash"); -var defaultModules = require(path.resolve(__dirname + "/../../modules/default/defaultmodules.js")); +let defaultModules = require(path.resolve(__dirname + "/../../modules/default/defaultmodules.js")); Module = { configDefaults: {}, @@ -34,7 +34,7 @@ Module = { module.exports = NodeHelper.create(Object.assign({ // Subclass start method. start: function() { - var self = this; + let self = this; this.initialized = false; Log.log("Starting node helper for: " + self.name); @@ -82,9 +82,9 @@ module.exports = NodeHelper.create(Object.assign({ }, loadTimers() { - var delay = 24*3600; + let delay = 24*3600; - var self = this; + let self = this; clearTimeout(this.delayedQueryTimers['update']) this.delayedQueryTimers['update'] = setTimeout(function () { @@ -95,8 +95,8 @@ module.exports = NodeHelper.create(Object.assign({ combineConfig() { // function copied from MagicMirrorOrg (MIT) - var defaults = require(__dirname + "/../../js/defaults.js"); - var configFilename = path.resolve(__dirname + "/../../config/config.js"); + let defaults = require(__dirname + "/../../js/defaults.js"); + let configFilename = path.resolve(__dirname + "/../../config/config.js"); if (typeof(global.configuration_file) !== "undefined") { configFilename = global.configuration_file; } @@ -104,8 +104,8 @@ module.exports = NodeHelper.create(Object.assign({ this.thisConfig = {}; try { fs.accessSync(configFilename, fs.F_OK); - var c = require(configFilename); - var config = Object.assign({}, defaults, c); + let c = require(configFilename); + let config = Object.assign({}, defaults, c); this.configOnHd = config; // Get the configuration for this module. if ("modules" in this.configOnHd) { @@ -131,7 +131,7 @@ module.exports = NodeHelper.create(Object.assign({ }, createRoutes() { - var self = this; + let self = this; this.expressApp.get("/remote.html", function(req, res) { if (self.template === "") { @@ -139,33 +139,33 @@ module.exports = NodeHelper.create(Object.assign({ } else { res.contentType("text/html"); res.set('Content-Security-Policy', "frame-ancestors http://*:*") - var transformedData = self.fillTemplates(self.template); + let transformedData = self.fillTemplates(self.template); res.send(transformedData); } }); this.expressApp.get("/get", function(req, res) { - var query = url.parse(req.url, true).query; + let query = url.parse(req.url, true).query; self.answerGet(query, res); }); this.expressApp.post("/post", function(req, res) { - var query = url.parse(req.url, true).query; + let query = url.parse(req.url, true).query; self.answerPost(query, req, res); }); this.expressApp.get("/config-help.html", function(req, res) { - var query = url.parse(req.url, true).query; + let query = url.parse(req.url, true).query; self.answerConfigHelp(query, res); }); this.expressApp.get("/remote", function(req, res) { - var query = url.parse(req.url, true).query; + let query = url.parse(req.url, true).query; if (query.action && ["COMMAND"].indexOf(query.action)===-1) { - var result = self.executeQuery(query, res); + let result = self.executeQuery(query, res); if (result === true) { return; } @@ -186,8 +186,8 @@ module.exports = NodeHelper.create(Object.assign({ }, updateModuleList(force) { - var self = this; - var downloadModules = require('./scripts/download_modules'); + let self = this; + let downloadModules = require('./scripts/download_modules'); downloadModules({ force: force, callback: (result) => { @@ -198,7 +198,7 @@ module.exports = NodeHelper.create(Object.assign({ }, readModuleData() { - var self = this; + let self = this; fs.readFile(path.resolve(__dirname + "/modules.json"), (err, data) => { self.modulesAvailable = JSON.parse(data.toString()); @@ -219,8 +219,8 @@ module.exports = NodeHelper.create(Object.assign({ id: "MagicMirrorOrg/MagicMirror", url: "https://docs.magicmirror.builders/modules/introduction.html" }); - var module = self.modulesAvailable[self.modulesAvailable.length - 1]; - var modulePath = "modules/default/" + defaultModules[i]; + let module = self.modulesAvailable[self.modulesAvailable.length - 1]; + let modulePath = "modules/default/" + defaultModules[i]; self.loadModuleDefaultConfig(module, modulePath, i === defaultModules.length-1); } @@ -239,15 +239,15 @@ module.exports = NodeHelper.create(Object.assign({ }, addModule(folderName, lastOne) { - var self = this; + let self = this; - var modulePath = this.getModuleDir() + "/" + folderName; + let modulePath = this.getModuleDir() + "/" + folderName; fs.stat(modulePath, (err, stats) => { if (stats.isDirectory()) { - var isInList = false; - var currentModule; + let isInList = false; + let currentModule; self.modulesInstalled.push(folderName); - for (var i = 0; i < self.modulesAvailable.length; i++) { + for (let i = 0; i < self.modulesAvailable.length; i++) { if (self.modulesAvailable[i].longname === folderName) { isInList = true; self.modulesAvailable[i].installed = true; @@ -255,7 +255,7 @@ module.exports = NodeHelper.create(Object.assign({ } } if (!isInList) { - var newModule = { + let newModule = { longname: folderName, name: self.formatName(folderName), isDefaultModule: false, @@ -271,7 +271,7 @@ module.exports = NodeHelper.create(Object.assign({ self.loadModuleDefaultConfig(currentModule, modulePath, lastOne); // check for available updates - var stat; + let stat; try { stat = fs.statSync(path.join(modulePath, '.git')); } catch (err) { @@ -280,7 +280,7 @@ module.exports = NodeHelper.create(Object.assign({ return; } - var sg = simpleGit(modulePath); + let sg = simpleGit(modulePath); sg.fetch().status(function(err, data) { if (!err) { if (data.behind > 0) { @@ -294,7 +294,7 @@ module.exports = NodeHelper.create(Object.assign({ Log.error(error); } try { - var baseUrl = result[0].refs.fetch; + let baseUrl = result[0].refs.fetch; // replacements baseUrl = baseUrl.replace(".git", "").replace("github.com:", "github.com/"); // if cloned with ssh @@ -311,10 +311,10 @@ module.exports = NodeHelper.create(Object.assign({ loadModuleDefaultConfig(module, modulePath, lastOne) { // function copied from MagicMirrorOrg (MIT) - var filename = path.resolve(modulePath + "/" + module.longname + ".js"); + let filename = path.resolve(modulePath + "/" + module.longname + ".js"); try { fs.accessSync(filename, fs.F_OK); - var jsFile = require(filename); + const jsFile = require(filename); /* Defaults are stored when Module.register is called during require(filename); */ } catch (e) { if (e.code == "ENOENT") { @@ -332,7 +332,7 @@ module.exports = NodeHelper.create(Object.assign({ answerConfigHelp(query, res) { if (defaultModules.indexOf(query.module) !== -1) { // default module - var dir = path.resolve(__dirname + "/.."); + let dir = path.resolve(__dirname + "/.."); let git = simpleGit(dir); git.revparse(["HEAD"], function(error, result) { if (error) { @@ -343,13 +343,13 @@ module.exports = NodeHelper.create(Object.assign({ }); return; } - var modulePath = this.getModuleDir() + "/" + query.module; + let modulePath = this.getModuleDir() + "/" + query.module; let git = simpleGit(modulePath); git.getRemotes(true, function(error, result) { if (error) { Log.error(error); } - var baseUrl = result[0].refs.fetch; + let baseUrl = result[0].refs.fetch; // replacements baseUrl = baseUrl.replace(".git", "").replace("github.com:", "github.com/"); // if cloned with ssh @@ -365,17 +365,17 @@ module.exports = NodeHelper.create(Object.assign({ }, getConfig() { - var config = this.configOnHd; + let config = this.configOnHd; for (let i = 0; i < config.modules.length; i++) { - var current = config.modules[i]; - var def = Module.configDefaults[current.module]; + let current = config.modules[i]; + let def = Module.configDefaults[current.module]; if (!("config" in current)) { current.config = {}; } if (!def) { def = {}; } - for (var key in def) { + for (let key in def) { if (!(key in current.config)) { current.config[key] = def[key]; } @@ -388,7 +388,7 @@ module.exports = NodeHelper.create(Object.assign({ // remove cached version delete require.cache[require.resolve(__dirname + "/../../js/defaults.js")]; // then reload default config - var defaultConfig = require(__dirname + "/../../js/defaults.js"); + let defaultConfig = require(__dirname + "/../../js/defaults.js"); for (let key in defaultConfig) { if (defaultConfig.hasOwnProperty(key) && config && config.hasOwnProperty(key) && _.isEqual(defaultConfig[key], config[key])) { @@ -397,8 +397,8 @@ module.exports = NodeHelper.create(Object.assign({ } for (let i = 0; i < config.modules.length; i++) { - var current = config.modules[i]; - var def = Module.configDefaults[current.module]; + let current = config.modules[i]; + let def = Module.configDefaults[current.module]; if (!def) { def = {}; } @@ -419,18 +419,18 @@ module.exports = NodeHelper.create(Object.assign({ }, answerPost(query, req, res) { - var self = this; + let self = this; if (query.data === "config") { - var backupHistorySize = 5; - var configPath = path.resolve("config/config.js"); + let backupHistorySize = 5; + let configPath = path.resolve("config/config.js"); - var best = -1; - var bestTime = null; - for (var i = backupHistorySize - 1; i > 0; i--) { + let best = -1; + let bestTime = null; + for (let i = backupHistorySize - 1; i > 0; i--) { let backupPath = path.resolve("config/config.js.backup" + i); try { - var stats = fs.statSync(backupPath); + let stats = fs.statSync(backupPath); if (best === -1 || stats.mtime < bestTime) { best = i; bestTime = stats.mtime; @@ -451,16 +451,16 @@ module.exports = NodeHelper.create(Object.assign({ } let backupPath = path.resolve("config/config.js.backup" + best); - var source = fs.createReadStream(configPath); - var destination = fs.createWriteStream(backupPath); + let source = fs.createReadStream(configPath); + let destination = fs.createWriteStream(backupPath); // back up last config source.pipe(destination, { end: false }); source.on("end", () => { self.configOnHd = self.removeDefaultValues(req.body); - var header = "/*************** AUTO GENERATED BY REMOTE CONTROL MODULE ***************/\n\nvar config = \n"; - var footer = "\n\n/*************** DO NOT EDIT THE LINE BELOW ***************/\nif (typeof module !== 'undefined') {module.exports = config;}\n"; + let header = "/*************** AUTO GENERATED BY REMOTE CONTROL MODULE ***************/\n\nvar config = \n"; + let footer = "\n\n/*************** DO NOT EDIT THE LINE BELOW ***************/\nif (typeof module !== 'undefined') {module.exports = config;}\n"; fs.writeFile(configPath, header + util.inspect(self.configOnHd, { showHidden: false, @@ -483,7 +483,7 @@ module.exports = NodeHelper.create(Object.assign({ }, answerGet(query, res) { - var self = this; + let self = this; if (query.data === "moduleAvailable") { this.modulesAvailable.sort(function(a, b) { return a.name.localeCompare(b.name); }); @@ -491,10 +491,10 @@ module.exports = NodeHelper.create(Object.assign({ return; } if (query.data === "moduleInstalled") { - var filterInstalled = function(value) { + let filterInstalled = function(value) { return value.installed && !value.isDefaultModule; }; - var installed = self.modulesAvailable.filter(filterInstalled); + let installed = self.modulesAvailable.filter(filterInstalled); installed.sort(function(a, b) { return a.name.localeCompare(b.name); }); @@ -506,7 +506,7 @@ module.exports = NodeHelper.create(Object.assign({ return; } if (query.data === "mmUpdateAvailable") { - var sg = simpleGit(__dirname + "/.."); + let sg = simpleGit(__dirname + "/.."); sg.fetch().status((err, data) => { if (!err) { if (data.behind > 0) { @@ -523,18 +523,18 @@ module.exports = NodeHelper.create(Object.assign({ return; } if (query.data === "classes") { - var thisConfig = this.getConfig().modules.find(m => m.module === "MMM-Remote-Control").config || {}; + let thisConfig = this.getConfig().modules.find(m => m.module === "MMM-Remote-Control").config || {}; this.sendResponse(res, undefined, { query: query, data: thisConfig.classes ? thisConfig.classes : {} }); return; } if (query.data === "saves") { - var backupHistorySize = 5; + let backupHistorySize = 5; let times = []; - for (var i = backupHistorySize - 1; i > 0; i--) { + for (let i = backupHistorySize - 1; i > 0; i--) { let backupPath = path.resolve("config/config.js.backup" + i); try { - var stats = fs.statSync(backupPath); + let stats = fs.statSync(backupPath); times.push(stats.mtime) } catch (e) { continue; @@ -578,7 +578,7 @@ module.exports = NodeHelper.create(Object.assign({ timeout = 3000; } - var waitObject = { + let waitObject = { finished: false, run: function() { if (this.finished) { @@ -689,8 +689,8 @@ module.exports = NodeHelper.create(Object.assign({ }, executeQuery(query, res) { - var self = this; - var opts = { timeout: 15000 }; + let self = this; + let opts = { timeout: 15000 }; if (["SHUTDOWN", "REBOOT"].indexOf(query.action) !== -1) { this.shutdownControl(query.action, opts, res); @@ -758,10 +758,10 @@ module.exports = NodeHelper.create(Object.assign({ if (query.action === "SHOW_ALERT") { self.sendResponse(res); - var type = query.type ? query.type : "alert"; - var title = query.title ? query.title : "Note"; - var message = query.message ? query.message : "Attention!"; - var timer = query.timer ? query.timer : 4; + let type = query.type ? query.type : "alert"; + let title = query.title ? query.title : "Note"; + let message = query.message ? query.message : "Attention!"; + let timer = query.timer ? query.timer : 4; self.sendSocketNotification(query.action, { type: type, @@ -777,7 +777,7 @@ module.exports = NodeHelper.create(Object.assign({ } if (query.action === 'NOTIFICATION') { try { - var payload = {}; // Assume empty JSON-object if no payload is provided + let payload = {}; // Assume empty JSON-object if no payload is provided if (typeof query.payload === 'undefined') { payload = query.payload; } else if (typeof query.payload === 'object') { @@ -867,14 +867,14 @@ module.exports = NodeHelper.create(Object.assign({ }, installModule(url, res, data) { - var self = this; + let self = this; simpleGit(path.resolve(__dirname + "/..")).clone(url, path.basename(url), function(error, result) { if (error) { Log.error(error); self.sendResponse(res, error); } else { - var workDir = path.resolve(__dirname + "/../" + path.basename(url)); + let workDir = path.resolve(__dirname + "/../" + path.basename(url)); exec("npm install", { cwd: workDir, timeout: 120000 }, (error, stdout, stderr) => { if (error) { Log.error(error); @@ -892,14 +892,14 @@ module.exports = NodeHelper.create(Object.assign({ updateModule(module, res) { Log.log("UPDATE " + (module || "MagicMirror")); - var self = this; + let self = this; - var path = __dirname + "/../../"; - var name = "MM"; + let path = __dirname + "/../../"; + let name = "MM"; if (typeof module !== 'undefined' && module !== 'undefined') { if (self.modulesAvailable) { - var modData = self.modulesAvailable.find(m => m.longname === module); + let modData = self.modulesAvailable.find(m => m.longname === module); if (modData === undefined) { this.sendResponse(res, new Error("Unknown Module"), { info: modules }); return; @@ -912,7 +912,7 @@ module.exports = NodeHelper.create(Object.assign({ Log.log("path: " + path + " name: " + name); - var git = simpleGit(path); + let git = simpleGit(path); git.reset('hard').then(() => { git.pull((error, result) => { if (error) { @@ -930,7 +930,7 @@ module.exports = NodeHelper.create(Object.assign({ self.readModuleData(); fs.readdir(path, function(err, files) { if (files.includes("CHANGELOG.md")) { - var chlog = fs.readFileSync(path+"/CHANGELOG.md", 'utf-8') + let chlog = fs.readFileSync(path+"/CHANGELOG.md", 'utf-8') self.sendResponse(res, undefined, { code: "restart", info: name + " updated.", chlog: chlog }); } else { self.sendResponse(res, undefined, { code: "restart", info: name + " updated."}); @@ -958,7 +958,7 @@ module.exports = NodeHelper.create(Object.assign({ this.sendResponse(res, err, { reason: "PM2 not installed or unlinked" }); return; } - var pm2 = require('pm2'); + let pm2 = require('pm2'); let processName = query.processName || this.thisConfig.pm2ProcessName || "mm"; pm2.connect((err) => { @@ -967,7 +967,7 @@ module.exports = NodeHelper.create(Object.assign({ return; } - var actionName = query.action.toLowerCase(); + let actionName = query.action.toLowerCase(); Log.log(`PM2 process: ${actionName} ${processName}`); switch (actionName) { @@ -998,16 +998,16 @@ module.exports = NodeHelper.create(Object.assign({ }, saveDefaultSettings() { - var moduleData = this.configData.moduleData; - var simpleModuleData = []; - for (var k = 0; k < moduleData.length; k++) { + let moduleData = this.configData.moduleData; + let simpleModuleData = []; + for (let k = 0; k < moduleData.length; k++) { simpleModuleData.push({}); simpleModuleData[k].identifier = moduleData[k].identifier; simpleModuleData[k].hidden = moduleData[k].hidden; simpleModuleData[k].lockStrings = moduleData[k].lockStrings; } - var text = JSON.stringify({ + let text = JSON.stringify({ moduleData: simpleModuleData, brightness: this.configData.brightness, settingsVersion: this.configData.settingsVersion @@ -1025,7 +1025,7 @@ module.exports = NodeHelper.create(Object.assign({ }, loadDefaultSettings() { - var self = this; + let self = this; fs.readFile(path.resolve(__dirname + "/settings.json"), function(err, data) { if (err) { @@ -1045,7 +1045,7 @@ module.exports = NodeHelper.create(Object.assign({ }, loadTranslation(language) { - var self = this; + let self = this; fs.readFile(path.resolve(__dirname + "/translations/" + language + ".json"), function(err, data) { if (err) { @@ -1076,11 +1076,11 @@ module.exports = NodeHelper.create(Object.assign({ getIpAddresses() { // module started, answer with current IP address - var interfaces = os.networkInterfaces(); - var addresses = []; - for (var k in interfaces) { - for (var k2 in interfaces[k]) { - var address = interfaces[k][k2]; + let interfaces = os.networkInterfaces(); + let addresses = []; + for (let k in interfaces) { + for (let k2 in interfaces[k]) { + let address = interfaces[k][k2]; if (address.family === "IPv4" && !address.internal) { addresses.push(address.address); } @@ -1090,7 +1090,7 @@ module.exports = NodeHelper.create(Object.assign({ }, socketNotificationReceived(notification, payload) { - var self = this; + let self = this; if (notification === "CURRENT_STATUS") { this.configData = payload; @@ -1118,13 +1118,13 @@ module.exports = NodeHelper.create(Object.assign({ } } if (notification === "UNDO_CONFIG") { - var backupHistorySize = 5; - var iteration = -1 + let backupHistorySize = 5; + let iteration = -1 - for (var i = backupHistorySize - 1; i > 0; i--) { + for (let i = backupHistorySize - 1; i > 0; i--) { let backupPath = path.resolve("config/config.js.backup" + i); try { - var stats = fs.statSync(backupPath); + let stats = fs.statSync(backupPath); if(stats.mtime.toISOString()==payload) { iteration = i i = -1 @@ -1137,8 +1137,8 @@ module.exports = NodeHelper.create(Object.assign({ this.answerGet({data: "saves"}, { isSocket: true }) return } - var backupPath = path.resolve("config/config.js.backup" + iteration); - var req = require(backupPath) + let backupPath = path.resolve("config/config.js.backup" + iteration); + let req = require(backupPath) this.answerPost({ data: "config" }, { body: req }, { isSocket: true }); } diff --git a/remote-control.css b/remote-control.css index a6763c7..c3d4b81 100644 --- a/remote-control.css +++ b/remote-control.css @@ -1,7 +1,7 @@ #remote-control-overlay { position: fixed; z-index: 2; - background-color: rgba(0,0,0,0.1); + background-color: rgb(0 0 0 / 10%); width: 100%; height: 100%; } diff --git a/remote.css b/remote.css index d190bc1..f21d511 100644 --- a/remote.css +++ b/remote.css @@ -1,617 +1,621 @@ html { - cursor: auto; + cursor: auto; } body { - margin: 10px; - height: calc(100% - 20px); - width: calc(100% - 20px); + margin: 10px; + height: calc(100% - 20px); + width: calc(100% - 20px); } a { - color: white; + color: white; } .menu-element { - flex: 0 0 auto; + flex: 0 0 auto; } .symbol-text-padding { - padding-left: 0.2em; - padding-right: 0.5em; + padding-left: 0.2em; + padding-right: 0.5em; } .fill { - height: 100%; - display: flex; - flex-direction: column; + height: 100%; + display: flex; + flex-direction: column; } .above-fold { - flex: 0 0 auto; + flex: 0 0 auto; } .below-fold { - border-top: 1px solid #666; - margin-top: 7px; - padding-top: 7px; - flex: 1 1 auto; - overflow-y: auto; - display: flex; - flex-direction: column; + border-top: 1px solid #666; + margin-top: 7px; + padding-top: 7px; + flex: 1 1 auto; + overflow-y: auto; + display: flex; + flex-direction: column; } .hide-border { - border-top: 0px; - margin-top: 0px; - padding-top: 0px; + border-top: 0; + margin-top: 0; + padding-top: 0; } .menu-container { - display: flex; - flex-direction: column; - min-height: min-content; + display: flex; + flex-direction: column; + min-height: min-content; } .menu { - display: flex; - flex-direction: row; - flex-wrap: wrap; - align-content: flex-start; - align-items: stretch; - justify-content: space-between; - overflow-y: hidden; + display: flex; + flex-flow: row wrap; + place-content: flex-start space-between; + align-items: stretch; + overflow-y: hidden; } .sub-menu { - display: flex; - flex-direction: row; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; + display: flex; + flex-flow: row wrap; + align-items: center; + justify-content: space-between; } .result-list { - width: 100%; + width: 100%; } .results { - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; } .results:last-child { - margin-bottom: 2em; + margin-bottom: 2em; } .one-line { - flex: 1 0 auto; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - align-items: center; + flex: 1 0 auto; + display: flex; + flex-flow: row nowrap; + align-items: center; } .flex-like-button { - flex: 0 1 auto; - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; + flex: 0 1 auto; + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; } .button { - cursor: pointer; - border: 1px solid #666; - border-radius: 0.2em; - padding: 0.1em; - margin: 0.1em; - - flex: 0 1 auto; - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; + cursor: pointer; + border: 1px solid #666; + border-radius: 0.2em; + padding: 0.1em; + margin: 0.1em; + flex: 0 1 auto; + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; } .button.bright { - border: 1px solid #999; + border: 1px solid #999; } -.button>* { - flex: 0 0 auto; +.button > * { + flex: 0 0 auto; } .text { - flex: 1 1 auto; - margin-left: 0.2em; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - min-width: 0; + flex: 1 1 auto; + margin-left: 0.2em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; } .fa-angle-right { - margin-right: 0.5em; - text-align: right; + margin-right: 0.5em; + text-align: right; } .status-indicator { - display: none; - margin: 0.1em; - padding: 0.1em; + display: none; + margin: 0.1em; + padding: 0.1em; } .overlay { - position: absolute; - width: 100%; - height: 100%; - background: black; - opacity: 0.5; + position: absolute; + width: 100%; + height: 100%; + background: black; + opacity: 0.5; } .result { - position: absolute; - top: -5px; - width: 70%; - height: 50%; - left: 15%; - top: 25%; - background: black; - border: 2px solid #666; - display: flex; - border-radius: 0.2em; - flex-direction: column; - justify-content: center; - font-size: 25px; - line-height: 1.5em; + position: absolute; + width: 70%; + height: 50%; + left: 15%; + top: 25%; + background: black; + border: 2px solid #666; + display: flex; + border-radius: 0.2em; + flex-direction: column; + justify-content: center; + font-size: 25px; + line-height: 1.5em; } .module-line { - margin-bottom: 5px; + margin-bottom: 5px; } #config-modules-results .module-line { - display: flex; - justify-content: space-between; - flex-wrap: wrap; - align-items: center; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + align-items: center; } -#config-modules-results .module-line>span { - overflow-x: auto; - white-space: nowrap; +#config-modules-results .module-line > span { + overflow-x: auto; + white-space: nowrap; } #update-module-results .module-line { - display: flex; - justify-content: space-between; - flex-wrap: wrap; - align-items: center; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + align-items: center; } -#update-module-results .module-line>span { - overflow-x: auto; - white-space: nowrap; +#update-module-results .module-line > span { + overflow-x: auto; + white-space: nowrap; } -.results>div:nth-child(even) { - background-color: #222; +.results > div:nth-child(even) { + background-color: #222; } -#add-module-results>div { - background-color: #000; +#add-module-results > div { + background-color: #000; } -#visible-modules-results>div { - background-color: #000; +#visible-modules-results > div { + background-color: #000; } #alert input { - box-sizing: border-box; - width: 100%; + box-sizing: border-box; + width: 100%; } #alert textarea { - box-sizing: border-box; - width: 100%; + box-sizing: border-box; + width: 100%; } input, select, textarea { - flex: 3 0 auto; - background: #000; - color: #999; - font-size: inherit; - font: inherit; - border: 2px solid #999; - -moz-border-radius: 0.2em; - -webkit-border-radius: 0.2em; - border-radius: 0.2em; - padding: 0.2em; + flex: 3 0 auto; + background: #000; + color: #999; + font-size: inherit; + font-family: inherit; + font-weight: inherit; + font-style: inherit; + border: 2px solid #999; + border-radius: 0.2em; + padding: 0.2em; } select { - flex: 1 0 auto; + flex: 1 0 auto; } input:focus, select:focus, textarea:focus { - color: #FFF; - border: 2px solid #FFF; - background-color: #444; + color: #fff; + border: 2px solid #fff; + background-color: #444; } input:focus.input-error { - border: 2px solid #F44; + border: 2px solid #f44; } .config-label { - display: flex; - flex-wrap: wrap; - justify-content: space-between; - align-items: center; - align-content: space-around; - margin-bottom: 0.8em; + display: flex; + flex-wrap: wrap; + place-content: space-around space-between; + align-items: center; + margin-bottom: 0.8em; } .label-name { - flex: 1 1 auto; - white-space: nowrap; - overflow-x: auto; + flex: 1 1 auto; + white-space: nowrap; + overflow-x: auto; } .type-edit { - flex: 0 0 auto; - white-space: nowrap; - color: #666; + flex: 0 0 auto; + white-space: nowrap; + color: #666; } .highlight { - color: #FFF; - background-color: #444; + color: #fff; + background-color: #444; } .highlight .type-edit { - color: #999; + color: #999; } .highlight .button { - border: 1px solid #999; + border: 1px solid #999; } .bottom-spacing { - margin-bottom: 0.8em; + margin-bottom: 0.8em; } .search-container { - position: relative; + position: relative; } .delete-button { - cursor: pointer; - position: absolute; - right: 0.5em; - top: 0.5em; + cursor: pointer; + position: absolute; + right: 0.5em; + top: 0.5em; } .popup .delete-button { - right: 0.25em; - top: 0.25em; + right: 0.25em; + top: 0.25em; } .result .delete-button { - right: 0.25em; - top: 0.25em; + right: 0.25em; + top: 0.25em; } /* general toggle rules */ -.toggled-off>*>.fa-toggle-on { - display: none; +.toggled-off > * > .fa-toggle-on { + display: none; } -.toggled-off>.fa-toggle-on { - display: none; +.toggled-off > .fa-toggle-on { + display: none; } -.toggled-on>*>.fa-toggle-off { - display: none; +.toggled-on > * > .fa-toggle-off { + display: none; } -.toggled-on>.fa-toggle-off { - display: none; +.toggled-on > .fa-toggle-off { + display: none; } /* edit button specific stuff */ -.module-line>*>.fa-lock { - display: none; +.module-line > * > .fa-lock { + display: none; } -.external-locked>*>.fa-lock.inner-small-label { - display: inline-block; +.external-locked > * > .fa-lock.inner-small-label { + display: inline-block; } .slider-container { - vertical-align: middle; - width: calc(100% - 4em); + vertical-align: middle; + width: calc(100% - 4em); } .stack { - position: relative; - display: inline-block; - height: 1em; - line-height: 1em; - font-size: 1em; - vertical-align: middle; + position: relative; + display: inline-block; + height: 1em; + line-height: 1em; + font-size: 1em; + vertical-align: middle; } .inner-label { - font-size: 0.9em; + font-size: 0.9em; } .inner-monitor-label { - font-size: 0.5em; - top: -0.15em; - left: -0.05em; + font-size: 0.5em; + top: -0.15em; + left: -0.05em; } .inner-small-label { - font-size: 0.4em; - left: -0.5em; + font-size: 0.4em; + left: -0.5em; } .outer-label { - font-size: 1em; + font-size: 1em; } .slider { - border: 0px; + border: 0; } .popup { - width: calc(100% - 4px); - height: calc(100% - 4px); - background-color: black; - position: absolute; - border: 2px solid #999; - top: 0px; - border-radius: 5px; - display: none; - overflow-y: auto; + width: calc(100% - 4px); + height: calc(100% - 4px); + background-color: black; + position: absolute; + border: 2px solid #999; + top: 0; + border-radius: 5px; + display: none; + overflow-y: auto; } .success-popup { - width: 30%; - min-width: 100px; - background-color: black; - position: absolute; - bottom: 0px; - display: none; - padding: 6px; - background: black; - border: 2px solid #666; - border-radius: 0.2em; - font-size: 20px; - line-height: 1.5em; + width: 30%; + min-width: 100px; + background-color: black; + position: absolute; + bottom: 0; + display: none; + padding: 6px; + border: 2px solid #666; + border-radius: 0.2em; + font-size: 20px; + line-height: 1.5em; } .popup-contents { - padding: 5px 10px 5px 10px; - display: flex; - flex-direction: column; - height: calc(100% - 10px); - width: calc(100% - 20px); + padding: 5px 10px; + display: flex; + flex-direction: column; + height: calc(100% - 10px); + width: calc(100% - 20px); } .title { - flex: 0 0 auto; - margin: 0.2em 1.5em 0.2em 0.5em; - text-align: center; + flex: 0 0 auto; + margin: 0.2em 1.5em 0.2em 0.5em; + text-align: center; } .subtitle { - flex: 0 1 auto; - padding-right: 5px; - text-align: right; - font-style: italic; + flex: 0 1 auto; + padding-right: 5px; + text-align: right; + font-style: italic; } .indent { - border: 1px dashed #666; - margin: 0em 0em 0.8em 0em; - padding: 5px 8px 5px 8px; + border: 1px dashed #666; + margin: 0 0 0.8em; + padding: 5px 8px; } .disabled { - border: 2px solid #222; + border: 2px solid #222; } .align-right { - text-align: right; + text-align: right; } .flex-fill { - flex: 1 1 auto; - overflow-y: auto; - overflow-x: auto; + flex: 1 1 auto; + overflow: auto; } .fixed-size { - flex: 0 0 auto; + flex: 0 0 auto; } .add-input-wrapper { - display: flex; - align-items: stretch; - align-content: stretch; + display: flex; + align-items: stretch; + align-content: stretch; } .add-input-wrapper .fa-plus { - justify-content: space-around; + justify-content: space-around; } #load-error { - font-size: medium; - line-height: normal; + font-size: medium; + line-height: normal; } .inline-menu-element { - display: inline-block; + display: inline-block; } .hidden { - display: none; + display: none; } /* checkbox shenanigans */ .visual-checkbox { - text-align: center; + text-align: center; } -input[type=checkbox] { - opacity: 0; +input[type="checkbox"] { + opacity: 0; } -input[type=checkbox]~.fa-square-o { - display: block; +input[type="checkbox"] ~ .fa-square-o { + display: block; } -input[type=checkbox]~.fa-check-square-o { - display: none; +input[type="checkbox"] ~ .fa-check-square-o { + display: none; } -input[type=checkbox]:checked~.fa-square-o { - display: none; +input[type="checkbox"]:checked ~ .fa-square-o { + display: none; } -input[type=checkbox]:checked~.fa-check-square-o { - display: block; +input[type="checkbox"]:checked ~ .fa-check-square-o { + display: block; } /* slider appearance created with https://danielstern.ca/range.css/?ref=css-tricks#/ */ -input[type=range] { - -webkit-appearance: none; - background: #000000; - width: calc(100% - 0.5em); -} - -input[type=range]:focus { - outline: none; -} - -input[type=range]::-webkit-slider-runnable-track { - width: 100%; - height: 10px; - cursor: pointer; - box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0); - background: #999999; - border-radius: 10px; - border: 2px solid rgba(0, 0, 0, 0); -} - -input[type=range]::-webkit-slider-thumb { - box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0); - border: 2px solid rgba(0, 0, 0, 0); - height: 30px; - width: 30px; - border-radius: 30px; - background: #ffffff; - cursor: pointer; - -webkit-appearance: none; - margin-top: -12px; -} - -input[type=range]:focus::-webkit-slider-runnable-track { - background: #9c9c9c; -} - -input[type=range]::-moz-range-track { - width: 100%; - height: 10px; - cursor: pointer; - box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0); - background: #999999; - border-radius: 10px; - border: 2px solid rgba(0, 0, 0, 0); -} - -input[type=range]::-moz-range-thumb { - box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0); - border: 2px solid rgba(0, 0, 0, 0); - height: 30px; - width: 30px; - border-radius: 30px; - background: #ffffff; - cursor: pointer; -} - -input[type=range]::-ms-track { - width: 100%; - height: 10px; - cursor: pointer; - background: transparent; - border-color: transparent; - color: transparent; -} - -input[type=range]::-ms-fill-lower { - background: #969696; - border: 2px solid rgba(0, 0, 0, 0); - border-radius: 20px; - box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0); -} - -input[type=range]::-ms-fill-upper { - background: #999999; - border: 2px solid rgba(0, 0, 0, 0); - border-radius: 20px; - box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0); -} - -input[type=range]::-ms-thumb { - box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0); - border: 2px solid rgba(0, 0, 0, 0); - height: 30px; - width: 30px; - border-radius: 30px; - background: #ffffff; - cursor: pointer; - height: 10px; -} - -input[type=range]:focus::-ms-fill-lower { - background: #999999; -} - -input[type=range]:focus::-ms-fill-upper { - background: #9c9c9c; +input[type="range"] { + appearance: none; + background: #000; + width: calc(100% - 0.5em); +} + +input[type="range"]:focus { + outline: none; +} + +input[type="range"]::-webkit-slider-runnable-track { + width: 100%; + height: 10px; + cursor: pointer; + box-shadow: + 0 0 0 rgb(0 0 0 / 0%), + 0 0 0 rgb(13 13 13 / 0%); + background: #999; + border-radius: 10px; + border: 2px solid rgb(0 0 0 / 0%); +} + +input[type="range"]::-webkit-slider-thumb { + box-shadow: + 0 0 0 rgb(0 0 0 / 0%), + 0 0 0 rgb(13 13 13 / 0%); + border: 2px solid rgb(0 0 0 / 0%); + height: 30px; + width: 30px; + border-radius: 30px; + background: #fff; + cursor: pointer; + appearance: none; + margin-top: -12px; +} + +input[type="range"]:focus::-webkit-slider-runnable-track { + background: #9c9c9c; +} + +input[type="range"]::-moz-range-track { + width: 100%; + height: 10px; + cursor: pointer; + box-shadow: + 0 0 0 rgb(0 0 0 / 0%), + 0 0 0 rgb(13 13 13 / 0%); + background: #999; + border-radius: 10px; + border: 2px solid rgb(0 0 0 / 0%); +} + +input[type="range"]::-moz-range-thumb { + box-shadow: + 0 0 0 rgb(0 0 0 / 0%), + 0 0 0 rgb(13 13 13 / 0%); + border: 2px solid rgb(0 0 0 / 0%); + height: 30px; + width: 30px; + border-radius: 30px; + background: #fff; + cursor: pointer; +} + +input[type="range"]::-ms-track { + width: 100%; + height: 10px; + cursor: pointer; + background: transparent; + border-color: transparent; + color: transparent; +} + +input[type="range"]::-ms-fill-lower { + background: #969696; + border: 2px solid rgb(0 0 0 / 0%); + border-radius: 20px; + box-shadow: + 0 0 0 rgb(0 0 0 / 0%), + 0 0 0 rgb(13 13 13 / 0%); +} + +input[type="range"]::-ms-fill-upper { + background: #999; + border: 2px solid rgb(0 0 0 / 0%); + border-radius: 20px; + box-shadow: + 0 0 0 rgb(0 0 0 / 0%), + 0 0 0 rgb(13 13 13 / 0%); +} + +input[type="range"]::-ms-thumb { + box-shadow: + 0 0 0 rgb(0 0 0 / 0%), + 0 0 0 rgb(13 13 13 / 0%); + border: 2px solid rgb(0 0 0 / 0%); + width: 30px; + border-radius: 30px; + background: #fff; + cursor: pointer; + height: 10px; +} + +input[type="range"]:focus::-ms-fill-lower { + background: #999; +} + +input[type="range"]:focus::-ms-fill-upper { + background: #9c9c9c; } code, samp, kbd { - font-family: "Courier New", Courier, monospace, sans-serif; - text-align: left; + font-family: "Courier New", Courier, monospace, sans-serif; + text-align: left; } pre code { - line-height: .6em; - font-size: -50%; + line-height: 0.6em; + font-size: -50%; } pre { - padding: 0.3em 0.5em 0.2em 0.7em; - border-left: 2px solid #ccc; - margin: 1em 0.3em 0.2em 0.6em; - overflow: auto; - width: 90%; - max-height: 35vh; + padding: 0.3em 0.5em 0.2em 0.7em; + border-left: 2px solid #ccc; + margin: 1em 0.3em 0.2em 0.6em; + overflow: auto; + width: 90%; + max-height: 35vh; } #changelog { - max-height: 30vh; - font-size: small; - overflow: scroll; + max-height: 30vh; + font-size: small; + overflow: scroll; } diff --git a/remote.js b/remote.js index 1e06950..8763c22 100644 --- a/remote.js +++ b/remote.js @@ -33,7 +33,7 @@ var Remote = { this._socket = this._socket = new MMSocket(this.name); } - var self = this; + let self = this; this._socket.setNotificationCallback(function(notification, payload) { self.socketNotificationReceived(notification, payload); }); @@ -72,7 +72,7 @@ var Remote = { } else if (payload.query.data === "mmUpdateAvailable") { this.mmUpdateCallback(payload.result); } else if (payload.query.data === "brightness") { - var slider = document.getElementById("brightness-slider"); + let slider = document.getElementById("brightness-slider"); slider.value = payload.result; } else if (payload.query.data === "translations") { this.translations = payload.data; @@ -83,7 +83,7 @@ var Remote = { return; } if ("code" in payload && payload.code === "restart") { - var chlog = new showdown.Converter() + let chlog = new showdown.Converter() chlog.setFlavor('github') this.offerRestart(payload.chlog ? payload.info + "
" + chlog.makeHtml(payload.chlog) + "
": payload.info); return; @@ -147,7 +147,7 @@ var Remote = { }, loadToggleButton(element, toggleCallback) { - var self = this; + let self = this; element.addEventListener("click", function(event) { if (self.hasClass(event.currentTarget, "toggled-off")) { @@ -163,33 +163,33 @@ var Remote = { }, filter(pattern) { - var filterInstalled = false; + let filterInstalled = false; if ("installed".indexOf(pattern) !== -1) { filterInstalled = true; pattern = pattern.replace("installed"); } pattern = pattern.trim(); - var regex = new RegExp(pattern, "i"); - var searchIn = ["author", "desc", "longname", "name"]; + let regex = new RegExp(pattern, "i"); + let searchIn = ["author", "desc", "longname", "name"]; - var data = this.savedData.moduleAvailable; - for (var i = 0; i < data.length; i++) { - var currentData = data[i]; - var id = "install-module-" + i; - var element = document.getElementById(id); + let data = this.savedData.moduleAvailable; + for (let i = 0; i < data.length; i++) { + let currentData = data[i]; + let id = "install-module-" + i; + let element = document.getElementById(id); if (pattern === "" || pattern === undefined) { // cleared search input, show all element.style.display = ""; continue; } - var match = false; + let match = false; if (filterInstalled && currentData.installed) { match = true; } - for (var k = 0; k < searchIn.length; k++) { - var key = searchIn[k]; + for (let k = 0; k < searchIn.length; k++) { + let key = searchIn[k]; if (match || (currentData[key] && currentData[key].match(regex))) { match = true; break; @@ -223,15 +223,15 @@ var Remote = { }, loadOtherElements() { - var self = this; + let self = this; - var slider = document.getElementById("brightness-slider"); + let slider = document.getElementById("brightness-slider"); slider.addEventListener("change", function(event) { self.sendSocketNotification("REMOTE_ACTION", { action: "BRIGHTNESS", value: slider.value }); }, false); - var input = document.getElementById("add-module-search"); - var deleteButton = document.getElementById("delete-search-input"); + let input = document.getElementById("add-module-search"); + let deleteButton = document.getElementById("delete-search-input"); input.addEventListener("input", function(event) { self.filter(input.value); @@ -252,22 +252,22 @@ var Remote = { }, showMenu(newMenu) { - var self = this; + let self = this; if (this.currentMenu === "settings-menu") { // check for unsaved changes - var changes = this.deletedModules.length + this.changedModules.length; + let changes = this.deletedModules.length + this.changedModules.length; if (changes > 0) { - var wrapper = document.createElement("div"); - var text = document.createElement("span"); + let wrapper = document.createElement("div"); + let text = document.createElement("span"); text.innerHTML = this.translate("UNSAVED_CHANGES"); wrapper.appendChild(text); - var ok = self.createSymbolText("fa fa-check-circle", this.translate("OK"), function() { + let ok = self.createSymbolText("fa fa-check-circle", this.translate("OK"), function() { self.setStatus("none"); }); wrapper.appendChild(ok); - var discard = self.createSymbolText("fa fa-warning", this.translate("DISCARD"), function() { + let discard = self.createSymbolText("fa fa-warning", this.translate("DISCARD"), function() { self.deletedModules = []; self.changedModules = []; window.location.hash = newMenu; @@ -283,7 +283,7 @@ var Remote = { } } - var belowFold = document.getElementById("below-fold"); + let belowFold = document.getElementById("below-fold"); if (newMenu === "main-menu") { if (!this.hasClass(belowFold, "hide-border")) { belowFold.className += " hide-border"; @@ -323,13 +323,13 @@ var Remote = { }) } - var allMenus = document.getElementsByClassName("menu-element"); + let allMenus = document.getElementsByClassName("menu-element"); for (let i = 0; i < allMenus.length; i++) { this.hide(allMenus[i]); } - var currentMenu = document.getElementsByClassName(newMenu); + let currentMenu = document.getElementsByClassName(newMenu); for (let i = 0; i < currentMenu.length; i++) { this.show(currentMenu[i]); @@ -341,7 +341,7 @@ var Remote = { }, setStatus(status, message, customContent) { - var self = this; + let self = this; if (this.autoHideTimer !== undefined) { clearTimeout(this.autoHideTimer); @@ -354,7 +354,7 @@ var Remote = { return; } - var parent = document.getElementById("result-contents"); + let parent = document.getElementById("result-contents"); while (parent.firstChild) { parent.removeChild(parent.firstChild); } @@ -372,9 +372,9 @@ var Remote = { return; } - var symbol; - var text; - var close = true; + let symbol; + let text; + let close = true; if (status === "loading") { symbol = "fa-spinner fa-pulse"; text = this.translate("LOADING"); @@ -405,14 +405,14 @@ var Remote = { }, getWithStatus(params, callback) { - var self = this; + let self = this; self.setStatus("loading"); self.get("remote", params, function(response) { if (callback) { callback(response); } else { - var result = JSON.parse(response); + let result = JSON.parse(response); if (result.success) { if (result.info) { self.setStatus("success", result.info); @@ -439,9 +439,9 @@ var Remote = { }, install(url, index) { - var self = this; + let self = this; - var $downloadButton = $("#download-button"); + let $downloadButton = $("#download-button"); $downloadButton.children(":first").removeClass("fa-download").addClass("fa-spinner fa-pulse"); $downloadButton.children(":last").html(" " + self.translate("DOWNLOADING")); this.sendSocketNotification("REMOTE_ACTION", { action: "INSTALL", url: url, index: index }); @@ -449,7 +449,7 @@ var Remote = { installCallback(result) { if (result.success) { - var bgElement = document.getElementById("install-module-" + result.index); + let bgElement = document.getElementById("install-module-" + result.index); bgElement.firstChild.className = "fa fa-fw fa-check-circle"; this.savedData.moduleAvailable[result.index].installed = true; this.createAddingPopup(result.index); @@ -460,8 +460,8 @@ var Remote = { }, get(route, params, callback, timeout) { - var req = new XMLHttpRequest(); - var url = route + "?" + params; + let req = new XMLHttpRequest(); + let url = route + "?" + params; req.open("GET", url, true); if (timeout) { @@ -482,10 +482,10 @@ var Remote = { }, loadList(listname, dataId, callback) { - var self = this; + let self = this; - var loadingIndicator = document.getElementById(listname + "-loading"); - var parent = document.getElementById(listname + "-results"); + let loadingIndicator = document.getElementById(listname + "-loading"); + let parent = document.getElementById(listname + "-results"); while (parent.firstChild) { parent.removeChild(parent.firstChild); @@ -496,11 +496,11 @@ var Remote = { }, loadListCallback(result) { - var self = this; + let self = this; - var loadingIndicator = document.getElementById(result.query.listname + "-loading"); - var emptyIndicator = document.getElementById(result.query.listname + "-empty"); - var parent = document.getElementById(result.query.listname + "-results"); + let loadingIndicator = document.getElementById(result.query.listname + "-loading"); + let emptyIndicator = document.getElementById(result.query.listname + "-empty"); + let parent = document.getElementById(result.query.listname + "-results"); self.hide(loadingIndicator); self.savedData[result.query.data] = false; @@ -545,11 +545,11 @@ var Remote = { }, getVisibilityStatus(data) { - var status = "toggled-on"; - var modules = []; + let status = "toggled-on"; + let modules = []; if (data.hidden) { status = "toggled-off"; - for (var i = 0; i < data.lockStrings.length; i++) { + for (let i = 0; i < data.lockStrings.length; i++) { if (data.lockStrings[i].indexOf("MMM-Remote-Control") >= 0) { continue; } @@ -563,7 +563,7 @@ var Remote = { }, addToggleElements(parent) { - var outerSpan = document.createElement("span"); + let outerSpan = document.createElement("span"); outerSpan.className = "stack fa-fw"; spanClasses = [ @@ -572,8 +572,8 @@ var Remote = { "fa fa-fw fa-lock inner-small-label fa-stack-1x" ]; - for (var i = 0; i < spanClasses.length; i++) { - var innerSpan = document.createElement("span"); + for (let i = 0; i < spanClasses.length; i++) { + let innerSpan = document.createElement("span"); innerSpan.className = spanClasses[i]; outerSpan.appendChild(innerSpan); } @@ -582,29 +582,29 @@ var Remote = { }, loadBrightness() { - var self = this; + let self = this; console.log("Load brightness..."); this.sendSocketNotification("REMOTE_ACTION", { data: "brightness" }); }, makeToggleButton(moduleBox, visibilityStatus) { - var self = this; + let self = this; self.loadToggleButton(moduleBox, function(toggledOn, event) { if (toggledOn) { if (self.hasClass(event.currentTarget, "external-locked")) { - var wrapper = document.createElement("div"); - var warning = document.createElement("span"); + let wrapper = document.createElement("div"); + let warning = document.createElement("span"); warning.innerHTML = self.translate("LOCKSTRING_WARNING").replace("LIST_OF_MODULES", visibilityStatus.modules); wrapper.appendChild(warning); - var ok = self.createSymbolText("fa fa-check-circle", self.translate("OK"), function() { + let ok = self.createSymbolText("fa fa-check-circle", self.translate("OK"), function() { self.setStatus("none"); }); wrapper.appendChild(ok); - var force = self.createSymbolText("fa fa-warning", self.translate("FORCE_SHOW"), function(target) { + let force = self.createSymbolText("fa fa-warning", self.translate("FORCE_SHOW"), function(target) { return function() { target.className = target.className.replace(" external-locked", "").replace("toggled-off", "toggled-on"); self.showModule(target.id, true); @@ -626,25 +626,25 @@ var Remote = { }, loadVisibleModules() { - var self = this; + let self = this; console.log("Load visible modules..."); this.loadList("visible-modules", "modules", function(parent, moduleData) { - for (var i = 0; i < moduleData.length; i++) { + for (let i = 0; i < moduleData.length; i++) { if (!moduleData[i].position) { // skip invisible modules continue; } - var visibilityStatus = self.getVisibilityStatus(moduleData[i]); + let visibilityStatus = self.getVisibilityStatus(moduleData[i]); - var moduleBox = document.createElement("div"); + let moduleBox = document.createElement("div"); moduleBox.className = "button module-line " + visibilityStatus.status; moduleBox.id = moduleData[i].identifier; self.addToggleElements(moduleBox); - var text = document.createElement("span"); + let text = document.createElement("span"); text.className = "text"; text.innerHTML = " " + self.formatName(moduleData[i].name); if ("header" in moduleData[i]) { @@ -663,14 +663,14 @@ var Remote = { if (element === undefined) { element = "div"; } - var wrapper = document.createElement(element); + let wrapper = document.createElement(element); if (eventListener) { wrapper.className = "button"; } - var symbolElement = document.createElement("span"); + let symbolElement = document.createElement("span"); symbolElement.className = symbol; wrapper.appendChild(symbolElement); - var textElement = document.createElement("span"); + let textElement = document.createElement("span"); textElement.innerHTML = text; textElement.className = "symbol-text-padding"; wrapper.appendChild(textElement); @@ -681,30 +681,30 @@ var Remote = { }, recreateConfigElement(key, previousType, newType) { - var input = document.getElementById(key); - var oldGUI = input.parentNode; + let input = document.getElementById(key); + let oldGUI = input.parentNode; if (previousType === "array" || previousType === "object") { oldGUI = input; } - var path = key.split("/"); - var name = path[path.length - 1]; + let path = key.split("/"); + let name = path[path.length - 1]; - var current = this.currentConfig; - for (var i = 1; i < path.length - 1; i++) { + let current = this.currentConfig; + for (let i = 1; i < path.length - 1; i++) { current = current[path[i]]; } - var initialValue = this.values[this.types.indexOf(newType)]; - var newGUI = this.createObjectGUI(key, name, initialValue); + let initialValue = this.values[this.types.indexOf(newType)]; + let newGUI = this.createObjectGUI(key, name, initialValue); oldGUI.parentNode.replaceChild(newGUI, oldGUI); }, createTypeEditSelection(key, parent, type, oldElement) { - var self = this; + let self = this; - var previousType = oldElement.children[1].innerHTML.slice(1).toLowerCase(); - var select = document.createElement("select"); - for (var i = 0; i < this.types.length; i++) { - var option = document.createElement("option"); + let previousType = oldElement.children[1].innerHTML.slice(1).toLowerCase(); + let select = document.createElement("select"); + for (let i = 0; i < this.types.length; i++) { + let option = document.createElement("option"); option.innerHTML = this.formatName(this.types[i]); option.value = this.types[i]; if (this.types[i] === type) { @@ -713,7 +713,7 @@ var Remote = { select.appendChild(option); } select.addEventListener("change", function(event) { - var newType = select.options[select.selectedIndex].innerHTML.toLowerCase(); + let newType = select.options[select.selectedIndex].innerHTML.toLowerCase(); if (previousType !== newType) { self.recreateConfigElement(key, previousType, newType); } else { @@ -727,7 +727,7 @@ var Remote = { }, createConfigLabel(key, name, type, forcedType, symbol) { - var self = this; + let self = this; if (symbol === undefined) { symbol = "fa-tag"; @@ -736,23 +736,23 @@ var Remote = { symbol = "fa-hashtag"; name = name.substring(1); } - var label = document.createElement("label"); + let label = document.createElement("label"); label.htmlFor = key; label.className = "config-label"; - var desc = Remote.createSymbolText("fa fa-fw " + symbol, this.formatLabel(name), false, "span"); + let desc = Remote.createSymbolText("fa fa-fw " + symbol, this.formatLabel(name), false, "span"); desc.className = "label-name"; label.appendChild(desc); if (!forcedType) { - var typeLabel = Remote.createSymbolText("fa fa-fw fa-pencil", this.formatName(type), function(event) { - var thisElement = event.currentTarget; + let typeLabel = Remote.createSymbolText("fa fa-fw fa-pencil", this.formatName(type), function(event) { + let thisElement = event.currentTarget; label.replaceChild(self.createTypeEditSelection(key, label, type, thisElement), thisElement); }, "span"); typeLabel.className += " type-edit"; label.appendChild(typeLabel); - var remove = Remote.createSymbolText("fa fa-fw fa-times-circle", this.translate("DELETE_ENTRY"), function(event) { - var thisElement = event.currentTarget; + let remove = Remote.createSymbolText("fa fa-fw fa-times-circle", this.translate("DELETE_ENTRY"), function(event) { + let thisElement = event.currentTarget; if (type === "array" || type === "object") { thisElement = thisElement.parentNode; } @@ -768,18 +768,18 @@ var Remote = { if (element === undefined) { element = "input"; } - var input = document.createElement(element); + let input = document.createElement(element); input.className = "config-input"; if (!omitValue) { input.value = value; } input.id = key; input.addEventListener("focus", function(event) { - var label = event.currentTarget.parentNode; + let label = event.currentTarget.parentNode; label.className = label.className + " highlight"; }, false); input.addEventListener("blur", function(event) { - var label = event.currentTarget.parentNode; + let label = event.currentTarget.parentNode; label.className = label.className.replace(" highlight", ""); }, false); @@ -787,18 +787,18 @@ var Remote = { }, createVisualCheckbox(key, wrapper, input, className, value) { - var visualCheckbox = document.createElement("span"); + let visualCheckbox = document.createElement("span"); visualCheckbox.className = "visual-checkbox fa fa-fw " + className; wrapper.appendChild(visualCheckbox); }, createConfigElement(type) { - var self = this; + let self = this; return { string: function(key, name, value, type, forcedType) { - var label = self.createConfigLabel(key, name, type, forcedType); - var input = self.createConfigInput(key, value); + let label = self.createConfigLabel(key, name, type, forcedType); + let input = self.createConfigInput(key, value); input.type = "text"; label.appendChild(input); if (key === "/header") { @@ -807,8 +807,8 @@ var Remote = { return label; }, number: function(key, name, value, type, forcedType) { - var label = self.createConfigLabel(key, name, type, forcedType); - var input = self.createConfigInput(key, value); + let label = self.createConfigLabel(key, name, type, forcedType); + let input = self.createConfigInput(key, value); input.type = "number"; if (value % 1 !== 0) { input.step = 0.01; @@ -817,9 +817,9 @@ var Remote = { return label; }, boolean: function(key, name, value, type, forcedType) { - var label = self.createConfigLabel(key, name, type, forcedType); + let label = self.createConfigLabel(key, name, type, forcedType); - var input = self.createConfigInput(key, value, true); + let input = self.createConfigInput(key, value, true); input.type = "checkbox"; label.appendChild(input); console.log(value); @@ -833,8 +833,8 @@ var Remote = { return label; }, undefined: function(key, name, value, type, forcedType) { - var label = self.createConfigLabel(key, name, type, forcedType); - var input = self.createConfigInput(key, value); + let label = self.createConfigLabel(key, name, type, forcedType); + let input = self.createConfigInput(key, value); input.type = "text"; input.disabled = "disabled"; input.className += " disabled undefined"; @@ -843,8 +843,8 @@ var Remote = { return label; }, null: function(key, name, value, type, forcedType) { - var label = self.createConfigLabel(key, name, type, forcedType); - var input = self.createConfigInput(key, value); + let label = self.createConfigLabel(key, name, type, forcedType); + let input = self.createConfigInput(key, value); input.type = "text"; input.disabled = "disabled"; input.className += " disabled null"; @@ -853,12 +853,12 @@ var Remote = { return label; }, position: function(key, name, value, type, forcedType) { - var label = self.createConfigLabel(key, name, type, forcedType); - var select = self.createConfigInput(key, value, false, "select"); + let label = self.createConfigLabel(key, name, type, forcedType); + let select = self.createConfigInput(key, value, false, "select"); select.className = "config-input"; select.id = key; - for (var i = 0; i < self.validPositions.length; i++) { - var option = document.createElement("option"); + for (let i = 0; i < self.validPositions.length; i++) { + let option = document.createElement("option"); option.value = self.validPositions[i]; if (self.validPositions[i]) { option.innerHTML = self.formatPosition(self.validPositions[i]); @@ -906,34 +906,34 @@ var Remote = { }, createObjectGUI(path, name, dataToEdit) { - var self = this; + let self = this; - var type = this.getTypeAsString(dataToEdit, path); - var forcedType = this.hasForcedType(path); + let type = this.getTypeAsString(dataToEdit, path); + let forcedType = this.hasForcedType(path); if (this.createConfigElement(type)) { // recursion stop return this.createConfigElement(type)(path, name, dataToEdit, type, forcedType); } // object and array - var wrapper = document.createElement("div"); + let wrapper = document.createElement("div"); wrapper.id = path; wrapper.className = "indent config-input " + type; if (type === "array") { // array - var add = this.createSymbolText("fa fa-fw fa-plus", this.translate("ADD_ENTRY")); + let add = this.createSymbolText("fa fa-fw fa-plus", this.translate("ADD_ENTRY")); add.className += " bottom-spacing button"; wrapper.appendChild(this.createConfigLabel(path, name, type, forcedType, "fa-list-ol")); wrapper.appendChild(add); - for (var i = 0; i < dataToEdit.length; i++) { - var newName = "#" + i; + for (let i = 0; i < dataToEdit.length; i++) { + let newName = "#" + i; wrapper.appendChild(this.createObjectGUI(path + "/" + newName, newName, dataToEdit[i])); } add.addEventListener("click", function() { - var lastIndex = dataToEdit.length - 1; - var lastType = self.getTypeAsString(path + "/#" + lastIndex, dataToEdit[lastIndex]); + let lastIndex = dataToEdit.length - 1; + let lastType = self.getTypeAsString(path + "/#" + lastIndex, dataToEdit[lastIndex]); dataToEdit.push(self.values[self.types.indexOf(lastType)]); - var nextName = "#" + (lastIndex + 1); + let nextName = "#" + (lastIndex + 1); wrapper.appendChild(self.createObjectGUI(path + "/" + nextName, nextName, dataToEdit[dataToEdit.length - 1])); }, false); return wrapper; @@ -943,19 +943,19 @@ var Remote = { if (path !== "") { wrapper.appendChild(this.createConfigLabel(path, name, type, forcedType, "fa-list-ul")); - var addElement = self.createConfigLabel(path + "/", this.translate("ADD_ENTRY"), type, true, "fa-plus"); + let addElement = self.createConfigLabel(path + "/", this.translate("ADD_ENTRY"), type, true, "fa-plus"); addElement.className += " bottom-spacing"; - var inputWrapper = document.createElement("div"); + let inputWrapper = document.createElement("div"); inputWrapper.className = "add-input-wrapper"; - var input = self.createConfigInput(path + "/", ""); + let input = self.createConfigInput(path + "/", ""); input.type = "text"; input.placeholder = this.translate("NEW_ENTRY_NAME"); addElement.appendChild(inputWrapper); inputWrapper.appendChild(input); - var addFunction = function() { - var existingKey = Object.keys(dataToEdit)[0]; - var lastType = self.getTypeAsString(path + "/" + existingKey, dataToEdit[existingKey]); - var key = input.value; + let addFunction = function() { + let existingKey = Object.keys(dataToEdit)[0]; + let lastType = self.getTypeAsString(path + "/" + existingKey, dataToEdit[existingKey]); + let key = input.value; if (key === "" || document.getElementById(path + "/" + key)) { if (!self.hasClass(input, "input-error")) { input.className += " input-error"; @@ -964,29 +964,29 @@ var Remote = { } input.className = input.className.replace(" input-error", ""); dataToEdit[key] = self.values[self.types.indexOf(lastType)]; - var newElement = self.createObjectGUI(path + "/" + key, key, dataToEdit[key]); + let newElement = self.createObjectGUI(path + "/" + key, key, dataToEdit[key]); wrapper.insertBefore(newElement, addElement.nextSibling); input.value = ""; }; - var symbol = document.createElement("span"); + let symbol = document.createElement("span"); symbol.className = "fa fa-fw fa-plus-square button"; symbol.addEventListener("click", addFunction, false); inputWrapper.appendChild(symbol); input.onkeypress = function(e) { if (!e) e = window.event; - var keyCode = e.keyCode || e.which; + let keyCode = e.keyCode || e.which; if (keyCode == "13") { addFunction(); } }; wrapper.appendChild(addElement); } - var keys = Object.keys(dataToEdit); + let keys = Object.keys(dataToEdit); if (path === "") { keys = ["module", "disabled", "position", "header", "config"]; } for (let i = 0; i < keys.length; i++) { - var key = keys[i]; + let key = keys[i]; if (dataToEdit.hasOwnProperty(key)) { wrapper.appendChild(this.createObjectGUI(path + "/" + key, key, dataToEdit[key])); } @@ -999,12 +999,12 @@ var Remote = { }, appendConfigMenu(index, wrapper) { - var self = this; + let self = this; - var menuElement = self.createSymbolText("small fa fa-fw fa-navicon", self.translate("MENU"), function(event) { - var elements = document.getElementsByClassName("sub-menu"); - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; + let menuElement = self.createSymbolText("small fa fa-fw fa-navicon", self.translate("MENU"), function(event) { + let elements = document.getElementsByClassName("sub-menu"); + for (let i = 0; i < elements.length; i++) { + let element = elements[i]; if (self.hasClass(element, "hidden")) { element.className = element.className.replace("hidden", ""); } else { @@ -1015,21 +1015,21 @@ var Remote = { menuElement.className += " fixed-size"; wrapper.appendChild(menuElement); - var menuDiv = document.createElement("div"); + let menuDiv = document.createElement("div"); menuDiv.className = "fixed-size sub-menu hidden"; - var help = self.createSymbolText("fa fa-fw fa-question-circle", self.translate("HELP"), function(event) { + let help = self.createSymbolText("fa fa-fw fa-question-circle", self.translate("HELP"), function(event) { window.open("config-help.html?module=" + self.currentConfig.module, "_blank"); }); menuDiv.appendChild(help); - var undo = self.createSymbolText("fa fa-fw fa-undo", self.translate("RESET"), function(event) { + let undo = self.createSymbolText("fa fa-fw fa-undo", self.translate("RESET"), function(event) { self.createConfigPopup(index); }); menuDiv.appendChild(undo); - var save = self.createSymbolText("fa fa-fw fa-save", self.translate("SAVE"), function(event) { + let save = self.createSymbolText("fa fa-fw fa-save", self.translate("SAVE"), function(event) { self.savedData.config.modules[index] = self.getModuleConfigFromUI(); self.changedModules.push(index); - var parent = document.getElementById("edit-module-" + index).parentNode; + let parent = document.getElementById("edit-module-" + index).parentNode; if (parent.children.length === 2) { parent.insertBefore(self.createChangedWarning(), parent.children[1]); } @@ -1039,7 +1039,7 @@ var Remote = { wrapper.appendChild(menuDiv); - var line = document.createElement("header"); + let line = document.createElement("header"); line.className = "header"; wrapper.appendChild(line); }, @@ -1061,16 +1061,16 @@ var Remote = { }, getModuleConfigFromUI() { - var rootElement = {}; - var elements = document.getElementsByClassName("config-input"); - for (var i = 0; i < elements.length; i++) { - var path = elements[i].id; - var splitPath = path.split("/"); - var parent = rootElement; + let rootElement = {}; + let elements = document.getElementsByClassName("config-input"); + for (let i = 0; i < elements.length; i++) { + let path = elements[i].id; + let splitPath = path.split("/"); + let parent = rootElement; for (var k = 1; k < splitPath.length - 1; k++) { parent = this.navigate(parent, splitPath[k]); } - var name = splitPath[k]; + let name = splitPath[k]; if (this.hasClass(elements[i], "null")) { this.setValue(parent, name, null); continue; @@ -1088,7 +1088,7 @@ var Remote = { continue; } - var value = elements[i].value; + let value = elements[i].value; if (name === "" || (path === "/position" && value === "")) { continue; } @@ -1104,13 +1104,13 @@ var Remote = { }, createConfigPopup(index) { - var self = this; + let self = this; if (typeof index === "string") { index = parseInt(index); } - var moduleData = this.savedData.config.modules; - var data = moduleData[index]; + let moduleData = this.savedData.config.modules; + let data = moduleData[index]; self.currentConfig = data; if (!("header" in self.currentConfig)) { @@ -1120,7 +1120,7 @@ var Remote = { self.currentConfig.position = ""; } - var wrapper = this.getPopupContent(); + let wrapper = this.getPopupContent(); let name = document.createElement("div"); name.innerHTML = self.formatName(data.module); @@ -1144,9 +1144,9 @@ var Remote = { }, createChangedWarning() { - var self = this; - var changed = Remote.createSymbolText("fa fa-fw fa-warning", this.translate("UNSAVED_CHANGES"), function() { - var saveButton = document.getElementById("save-config"); + let self = this; + let changed = Remote.createSymbolText("fa fa-fw fa-warning", this.translate("UNSAVED_CHANGES"), function() { + let saveButton = document.getElementById("save-config"); if (!self.hasClass(saveButton, "highlight")) { saveButton.className += " highlight"; } @@ -1156,13 +1156,13 @@ var Remote = { }, appendModuleEditElements(wrapper, moduleData) { - var self = this; - for (var i = 0; i < moduleData.length; i++) { - var innerWrapper = document.createElement("div"); + let self = this; + for (let i = 0; i < moduleData.length; i++) { + let innerWrapper = document.createElement("div"); innerWrapper.className = "module-line"; - var moduleBox = self.createSymbolText("fa fa-fw fa-pencil", self.formatName(moduleData[i].module), function(event) { - var i = event.currentTarget.id.replace("edit-module-", ""); + let moduleBox = self.createSymbolText("fa fa-fw fa-pencil", self.formatName(moduleData[i].module), function(event) { + let i = event.currentTarget.id.replace("edit-module-", ""); self.createConfigPopup(i); }, "span"); moduleBox.id = "edit-module-" + i; @@ -1172,10 +1172,10 @@ var Remote = { innerWrapper.appendChild(self.createChangedWarning()); } - var remove = Remote.createSymbolText("fa fa-fw fa-times-circle", this.translate("DELETE_ENTRY"), function(event) { - var i = event.currentTarget.parentNode.firstChild.id.replace("edit-module-", ""); + let remove = Remote.createSymbolText("fa fa-fw fa-times-circle", this.translate("DELETE_ENTRY"), function(event) { + let i = event.currentTarget.parentNode.firstChild.id.replace("edit-module-", ""); self.deletedModules.push(parseInt(i)); - var thisElement = event.currentTarget; + let thisElement = event.currentTarget; thisElement.parentNode.parentNode.removeChild(thisElement.parentNode); }, "span"); remove.className += " type-edit"; @@ -1186,20 +1186,20 @@ var Remote = { }, loadConfigModules() { - var self = this; + let self = this; console.log("Loading modules in config..."); this.changedModules = []; this.loadList("config-modules", "config", function(parent, configData) { - var moduleData = configData.modules; + let moduleData = configData.modules; if (self.addModule) { - var name = self.addModule; + let name = self.addModule; // we came here from adding a module self.get("get", "data=defaultConfig&module=" + name, function(response) { - var newData = JSON.parse(response); + let newData = JSON.parse(response); moduleData.push({ module: name, config: newData }); - var index = moduleData.length - 1; + let index = moduleData.length - 1; self.changedModules.push(index); self.appendModuleEditElements(parent, moduleData); self.createConfigPopup(index); @@ -1212,14 +1212,14 @@ var Remote = { }, loadClasses() { - var self = this; + let self = this; console.log("Loading classes..."); this.loadList("classes", "classes", function(parent, classes) { for(const i in classes) { $node = $("
").attr("id", "classes-before-result").attr("hidden", "true") $('#classes-results').append($node) - var content = Object.assign({}, { + let content = Object.assign({}, { id: i, text: i, icon: "dot-circle-o", @@ -1239,34 +1239,34 @@ var Remote = { }, createAddingPopup(index) { - var self = this; + let self = this; if (typeof index === "string") { index = parseInt(index); } - var data = this.savedData.moduleAvailable[index]; - var wrapper = this.getPopupContent(); + let data = this.savedData.moduleAvailable[index]; + let wrapper = this.getPopupContent(); - var name = document.createElement("div"); + let name = document.createElement("div"); name.innerHTML = data.name; name.className = "bright title"; wrapper.appendChild(name); - var author = document.createElement("div"); + let author = document.createElement("div"); author.innerHTML = self.translate("BY") + " " + data.author; author.className = "subtitle small"; wrapper.appendChild(author); - var desc = document.createElement("div"); + let desc = document.createElement("div"); desc.innerHTML = data.desc; desc.className = "small flex-fill"; wrapper.appendChild(desc); - var footer = document.createElement("div"); + let footer = document.createElement("div"); footer.className = "fixed-size sub-menu"; if (data.installed) { - var add = self.createSymbolText("fa fa-fw fa-plus", self.translate("ADD_THIS"), function(event) { + let add = self.createSymbolText("fa fa-fw fa-plus", self.translate("ADD_THIS"), function(event) { self.closePopup(); self.addModule = data.longname; window.location.hash = "settings-menu"; @@ -1285,7 +1285,7 @@ var Remote = { footer.appendChild(statusElement); } - var githubElement = self.createSymbolText("fa fa-fw fa-github", self.translate("CODE_LINK"), function(event) { + let githubElement = self.createSymbolText("fa fa-fw fa-github", self.translate("CODE_LINK"), function(event) { window.open(data.url, "_blank"); }); footer.appendChild(githubElement); @@ -1296,19 +1296,19 @@ var Remote = { }, loadModulesToAdd() { - var self = this; + let self = this; console.log("Loading modules to add..."); this.loadList("add-module", "moduleAvailable", function(parent, modules) { - for (var i = 0; i < modules.length; i++) { - var symbol = "fa fa-fw fa-cloud"; + for (let i = 0; i < modules.length; i++) { + let symbol = "fa fa-fw fa-cloud"; if (modules[i].installed) { symbol = "fa fa-fw fa-check-circle"; } - var moduleBox = self.createSymbolText(symbol, modules[i].name, function(event) { - var index = event.currentTarget.id.replace("install-module-", ""); + let moduleBox = self.createSymbolText(symbol, modules[i].name, function(event) { + let index = event.currentTarget.id.replace("install-module-", ""); self.createAddingPopup(index); }); moduleBox.className = "button module-line"; @@ -1319,30 +1319,30 @@ var Remote = { }, offerRestart(message) { - var wrapper = document.createElement("div"); + let wrapper = document.createElement("div"); - var info = document.createElement("span"); + let info = document.createElement("span"); info.innerHTML = message; wrapper.appendChild(info); - var restart = this.createSymbolText("fa fa-fw fa-recycle", this.translate("RESTARTMM"), buttons["restart-mm-button"]); + let restart = this.createSymbolText("fa fa-fw fa-recycle", this.translate("RESTARTMM"), buttons["restart-mm-button"]); restart.children[1].className += " text"; wrapper.appendChild(restart); this.setStatus("success", false, wrapper); }, offerReload(message) { - var wrapper = document.createElement("div"); + let wrapper = document.createElement("div"); - var info = document.createElement("span"); + let info = document.createElement("span"); info.innerHTML = message; wrapper.appendChild(info); - var restart = this.createSymbolText("fa fa-fw fa-recycle", this.translate("RESTARTMM"), buttons["restart-mm-button"]); + let restart = this.createSymbolText("fa fa-fw fa-recycle", this.translate("RESTARTMM"), buttons["restart-mm-button"]); restart.children[1].className += " text"; wrapper.appendChild(restart); - var reload = this.createSymbolText("fa fa-fw fa-globe", this.translate("REFRESHMM"), buttons["refresh-mm-button"]); + let reload = this.createSymbolText("fa fa-fw fa-globe", this.translate("REFRESHMM"), buttons["refresh-mm-button"]); reload.children[1].className += " text"; wrapper.appendChild(reload); @@ -1350,14 +1350,14 @@ var Remote = { }, offerOptions: function(message, data) { - var wrapper = document.createElement("div"); + let wrapper = document.createElement("div"); - var info = document.createElement("span"); + let info = document.createElement("span"); info.innerHTML = message; wrapper.appendChild(info); for(const b in data) { - var restart = this.createSymbolText("fa fa-fw fa-recycle", b, data[b]); + let restart = this.createSymbolText("fa fa-fw fa-recycle", b, data[b]); restart.children[1].className += " text"; wrapper.appendChild(restart); } @@ -1371,8 +1371,8 @@ var Remote = { mmUpdateCallback(result) { if (window.location.hash.substring(1) == "update-menu") { - var element = document.getElementById("update-mm-status"); - var updateButton = document.getElementById("update-mm-button"); + let element = document.getElementById("update-mm-status"); + let updateButton = document.getElementById("update-mm-button"); if (result) { self.show(element); updateButton.className += " bright"; @@ -1384,7 +1384,7 @@ var Remote = { }, loadModulesToUpdate() { - var self = this; + let self = this; console.log("Loading modules to update..."); @@ -1392,13 +1392,13 @@ var Remote = { this.sendSocketNotification("REMOTE_ACTION", { data: "mmUpdateAvailable" }); this.loadList("update-module", "moduleInstalled", function(parent, modules) { - for (var i = 0; i < modules.length; i++) { - var symbol = "fa fa-fw fa-toggle-up"; - var innerWrapper = document.createElement("div"); + for (let i = 0; i < modules.length; i++) { + let symbol = "fa fa-fw fa-toggle-up"; + let innerWrapper = document.createElement("div"); innerWrapper.className = "module-line"; let moduleBox = self.createSymbolText(symbol, modules[i].name, function(event) { - var module = event.currentTarget.id.replace("update-module-", ""); + let module = event.currentTarget.id.replace("update-module-", ""); self.updateModule(module); }); moduleBox.className = "button"; @@ -1419,22 +1419,22 @@ var Remote = { }, undoConfigMenu() { - var self = this; + let self = this; if (this.saving) { return; } - var undoButton = document.getElementById("undo-config"); + let undoButton = document.getElementById("undo-config"); undoButton.className = undoButton.className.replace(" highlight", ""); this.setStatus("loading"); this.sendSocketNotification("REMOTE_ACTION", {data: "saves"}); }, undoConfigMenuCallback(result) { - var self = this; + let self = this; if (result.success) { - var dates = {}; + let dates = {}; for(const i in result.data) { dates[new Date(result.data[i])] = function() { console.log(result.data[i]) @@ -1448,7 +1448,7 @@ var Remote = { }, undoConfig(date) { - var self = this; + let self = this; // prevent saving before current saving is finished if (this.saving) { @@ -1461,19 +1461,19 @@ var Remote = { }, saveConfig() { - var self = this; + let self = this; // prevent saving before current saving is finished if (this.saving) { return; } - var saveButton = document.getElementById("save-config"); + let saveButton = document.getElementById("save-config"); saveButton.className = saveButton.className.replace(" highlight", ""); this.saving = true; this.setStatus("loading"); - var configData = this.savedData.config; - var remainingModules = []; - for (var i = 0; i < configData.modules.length; i++) { + let configData = this.savedData.config; + let remainingModules = []; + for (let i = 0; i < configData.modules.length; i++) { if (this.deletedModules.indexOf(i) !== -1) { continue; } else { @@ -1486,7 +1486,7 @@ var Remote = { }, saveConfigCallback(result) { - var self = this; + let self = this; if (result.success) { self.offerReload(self.translate("DONE")); @@ -1582,19 +1582,19 @@ var buttons = { window.location.hash = "edit-menu"; }, "settings-button": function () { - var self = Remote; + let self = Remote; - var wrapper = document.createElement("div"); - var text = document.createElement("span"); + let wrapper = document.createElement("div"); + let text = document.createElement("span"); text.innerHTML = self.translate("EXPERIMENTAL"); wrapper.appendChild(text); - var panic = self.createSymbolText("fa fa-life-ring", self.translate("PANIC"), function() { + let panic = self.createSymbolText("fa fa-life-ring", self.translate("PANIC"), function() { self.setStatus("none"); }); wrapper.appendChild(panic); - var danger = self.createSymbolText("fa fa-warning", self.translate("NO_RISK_NO_FUN"), function() { + let danger = self.createSymbolText("fa fa-warning", self.translate("NO_RISK_NO_FUN"), function() { window.location.hash = "settings-menu"; }); wrapper.appendChild(danger); @@ -1627,16 +1627,16 @@ var buttons = { // settings menu buttons "brightness-reset": function () { - var element = document.getElementById("brightness-slider"); + let element = document.getElementById("brightness-slider"); element.value = 100; Remote.sendSocketNotification("REMOTE_ACTION", { action: "BRIGHTNESS", value: 100 }); }, // edit menu buttons "show-all-button": function () { - var parent = document.getElementById("visible-modules-results"); - var buttons = parent.children; - for (var i = 0; i < buttons.length; i++) { + let parent = document.getElementById("visible-modules-results"); + let buttons = parent.children; + for (let i = 0; i < buttons.length; i++) { if (Remote.hasClass(buttons[i], "external-locked")) { continue; } @@ -1645,9 +1645,9 @@ var buttons = { } }, "hide-all-button": function () { - var parent = document.getElementById("visible-modules-results"); - var buttons = parent.children; - for (var i = 0; i < buttons.length; i++) { + let parent = document.getElementById("visible-modules-results"); + let buttons = parent.children; + for (let i = 0; i < buttons.length; i++) { buttons[i].className = buttons[i].className.replace("toggled-on", "toggled-off"); Remote.hideModule(buttons[i].id); } @@ -1655,19 +1655,19 @@ var buttons = { // power menu buttons "shut-down-button": function () { - var self = Remote; + let self = Remote; - var wrapper = document.createElement("div"); - var text = document.createElement("span"); + let wrapper = document.createElement("div"); + let text = document.createElement("span"); text.innerHTML = self.translate("CONFIRM_SHUTDOWN"); wrapper.appendChild(text); - var ok = self.createSymbolText("fa fa-power-off", self.translate("SHUTDOWN"), function() { + let ok = self.createSymbolText("fa fa-power-off", self.translate("SHUTDOWN"), function() { Remote.sendSocketNotification("REMOTE_ACTION", { action: "SHUTDOWN" }); }); wrapper.appendChild(ok); - var cancel = self.createSymbolText("fa fa-times", self.translate("CANCEL"), function() { + let cancel = self.createSymbolText("fa fa-times", self.translate("CANCEL"), function() { self.setStatus("none"); }); wrapper.appendChild(cancel); @@ -1675,19 +1675,19 @@ var buttons = { self.setStatus(false, false, wrapper); }, "restart-button": function() { - var self = Remote; + let self = Remote; - var wrapper = document.createElement("div"); - var text = document.createElement("span"); + let wrapper = document.createElement("div"); + let text = document.createElement("span"); text.innerHTML = self.translate("CONFIRM_RESTART"); wrapper.appendChild(text); - var ok = self.createSymbolText("fa fa-refresh", self.translate("RESTART"), function() { + let ok = self.createSymbolText("fa fa-refresh", self.translate("RESTART"), function() { Remote.sendSocketNotification("REMOTE_ACTION", { action: "REBOOT" }); }); wrapper.appendChild(ok); - var cancel = self.createSymbolText("fa fa-times", self.translate("CANCEL"), function() { + let cancel = self.createSymbolText("fa fa-times", self.translate("CANCEL"), function() { self.setStatus("none"); }); wrapper.appendChild(cancel); @@ -1749,10 +1749,10 @@ var buttons = { // alert menu "send-alert-button": function () { - var kvpairs = {}; - var form = document.getElementById("alert"); - for (var i = 0; i < form.elements.length; i++) { - var e = form.elements[i]; + let kvpairs = {}; + let form = document.getElementById("alert"); + for (let i = 0; i < form.elements.length; i++) { + let e = form.elements[i]; kvpairs[e.name] = e.value; } Remote.sendSocketNotification("REMOTE_ACTION", kvpairs); @@ -1789,5 +1789,5 @@ window.onhashchange = function () { }; // loading successful, remove error message -var loadError = document.getElementById("load-error"); +let loadError = document.getElementById("load-error"); loadError.parentNode.removeChild(loadError); diff --git a/scripts/download_modules.js b/scripts/download_modules.js index 404273d..bb855d2 100644 --- a/scripts/download_modules.js +++ b/scripts/download_modules.js @@ -15,7 +15,7 @@ const path = require("path"); const fs = require("fs"); const util = require("util"); -var downloadModules = { +let downloadModules = { defaults: { modulesFile: path.resolve(__dirname, "../modules.json"), // Path to modules file sourceUrl: 'https://raw.githubusercontent.com/wiki/MagicMirrorOrg/MagicMirror/3rd-Party-Modules.md', // Source url @@ -69,8 +69,8 @@ var downloadModules = { .then((response) => response.text()) .then((body) => { let modules = this.parseList(body); - var json = JSON.stringify(modules, undefined, 2); - var jsonPath = this.config.modulesFile; + let json = JSON.stringify(modules, undefined, 2); + let jsonPath = this.config.modulesFile; fs.writeFile(jsonPath, json, "utf8", (err, data) => { if (err) { console.error("MODULE LIST ERROR: modules.json updating fail:" + err.message); diff --git a/translations/ca.json b/translations/ca.json index e9a0293..5f4ecf2 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -1,88 +1,87 @@ { - "TITLE": "Menú MagicMirror²", - - "EDIT_MENU_NAME": "Editar Vista", - "SHUTDOWN_MENU_NAME": "Encendre/Apagar", - "CONFIGURE_MENU_NAME": "Editar config.js", - "VIEW_MIRROR": "MagicMirror²", - - "BACK": "Endarrera", - - "BRIGHTNESS": "Brillantor", - - "REFRESHMM" : "Recarregar Navegador", - "MONITOROFF": "Apagar monitor", - "MONITORON": "Encendre monitor", - "MONITORTIMED": "Encendre monitor breument", - "RESTART": "Reiniciar RPi", - "RESTARTMM": "Recarregar MagicMirror²", - "SHUTDOWN": "Apagar RPi", - "FULLSCREEN": "Pantalla sencera", - "MINIMIZE": "Minimitzar Navegador", - "DEVTOOLS": "Obrir Eines per desenvolupadors", - - "SHOWALL": "Mostrar Tots", - "HIDEALL": "Amagar Tots", - - "ADD_MODULE": "Afegir mòdul", - "SEARCH": "Buscar …", - "INSTALLED": "Instal.lat", - "DOWNLOAD": "Descarrega", - "DOWNLOADING": "Descarregant …", - "CODE_LINK": "Veure còdig", - "BY": "per", - "ADD_THIS": "Afegir aquest mòdul", - "HELP": "Veure Readme", - "MENU": "Menú", - "RESET": "Reset", - "NO_HEADER": "(sense capcelera)", - "NO_POSITION": "(invisible)", - "ADD_ENTRY": "Afegir entrada", - "NEW_ENTRY_NAME": "(nom de la nova entrada)", - "DELETE_ENTRY": "Esborrar", - "UNSAVED_CHANGES": "Canvis sense guardar", - "OK": "Ok", - "DISCARD": "Descartar canvis", - "CANCEL": "Cancel.lar", - - "NO_MODULES_LOADED": "No hi han móduls carregats.", - "SAVE": "Guardar", - - "EXPERIMENTAL": "Aquesta es una funciò experimental, pot corrompre el teu arxiu config. Fes còpia de seguretat primer, per si de cas!
Vols continuar?", - "PANIC": "No m'importa.", - "NO_RISK_NO_FUN": "Qui no arrisca no pisca!", - - "CONFIRM_SHUTDOWN": "El sistema s'apagarà.", - "CONFIRM_RESTART": "El sistema es recarregarà.", - - "LOAD_ERROR": "Si ves este mensaje, un error ha ocurrido cargando el archivo javascript. Si us plau, revisa aquest enllaç per veure si es un problema amb el teu navegador:", - "ISSUE_LINK": "Pàgina de problemes de Github", - - "DONE": "Fet.", - "ERROR": "Error!", - "LOADING": "Carregant …", - - "LOCKSTRING_WARNING": "Aquest mòdul ha estat ocultat per LIST_OF_MODULES, no pot ser mostrat.", - "FORCE_SHOW": "Fes-ho igualment.", - - "UPDATE_MENU_NAME" : "Actualitzacions", - "UPDATEMM" : "Actualitza MagicMirror²", - "UPDATE_AVAILABLE" : "Actualitzaciò disponible", - - "ALERT_MENU_NAME" : "Alertes / Notificacions", - "SENDALERT" : "Envia alerta", - "HIDEALERT" : "Oculta alerta", - "FORM_TYPE" : "Tipus:", - "FORM_ALERT" : "Alerta", - "FORM_NOTIFICATION" : "Notificaciò", - "FORM_TITLE" : "Títol:", - "FORM_TITLE_PLACEHOLDER" : "Introdueix títol...", - "FORM_MESSAGE" : "Missatge:", - "FORM_MESSAGE_PLACEHOLDER" : "Introdueix missatge...", - "FORM_SECONDS" : "Segons:", - - "RESPONSE_ERROR": "No ha funcionat. Comprova els MM logs per més detalls", - "MODULE_CONTROLS": "Controls de mòduls", - "CUSTOM_MENU": "El meu Menú Personalitzat" - + "TITLE": "Menú MagicMirror²", + + "EDIT_MENU_NAME": "Editar Vista", + "SHUTDOWN_MENU_NAME": "Encendre/Apagar", + "CONFIGURE_MENU_NAME": "Editar config.js", + "VIEW_MIRROR": "MagicMirror²", + + "BACK": "Endarrera", + + "BRIGHTNESS": "Brillantor", + + "REFRESHMM": "Recarregar Navegador", + "MONITOROFF": "Apagar monitor", + "MONITORON": "Encendre monitor", + "MONITORTIMED": "Encendre monitor breument", + "RESTART": "Reiniciar RPi", + "RESTARTMM": "Recarregar MagicMirror²", + "SHUTDOWN": "Apagar RPi", + "FULLSCREEN": "Pantalla sencera", + "MINIMIZE": "Minimitzar Navegador", + "DEVTOOLS": "Obrir Eines per desenvolupadors", + + "SHOWALL": "Mostrar Tots", + "HIDEALL": "Amagar Tots", + + "ADD_MODULE": "Afegir mòdul", + "SEARCH": "Buscar …", + "INSTALLED": "Instal.lat", + "DOWNLOAD": "Descarrega", + "DOWNLOADING": "Descarregant …", + "CODE_LINK": "Veure còdig", + "BY": "per", + "ADD_THIS": "Afegir aquest mòdul", + "HELP": "Veure Readme", + "MENU": "Menú", + "RESET": "Reset", + "NO_HEADER": "(sense capcelera)", + "NO_POSITION": "(invisible)", + "ADD_ENTRY": "Afegir entrada", + "NEW_ENTRY_NAME": "(nom de la nova entrada)", + "DELETE_ENTRY": "Esborrar", + "UNSAVED_CHANGES": "Canvis sense guardar", + "OK": "Ok", + "DISCARD": "Descartar canvis", + "CANCEL": "Cancel.lar", + + "NO_MODULES_LOADED": "No hi han móduls carregats.", + "SAVE": "Guardar", + + "EXPERIMENTAL": "Aquesta es una funciò experimental, pot corrompre el teu arxiu config. Fes còpia de seguretat primer, per si de cas!
Vols continuar?", + "PANIC": "No m'importa.", + "NO_RISK_NO_FUN": "Qui no arrisca no pisca!", + + "CONFIRM_SHUTDOWN": "El sistema s'apagarà.", + "CONFIRM_RESTART": "El sistema es recarregarà.", + + "LOAD_ERROR": "Si ves este mensaje, un error ha ocurrido cargando el archivo javascript. Si us plau, revisa aquest enllaç per veure si es un problema amb el teu navegador:", + "ISSUE_LINK": "Pàgina de problemes de Github", + + "DONE": "Fet.", + "ERROR": "Error!", + "LOADING": "Carregant …", + + "LOCKSTRING_WARNING": "Aquest mòdul ha estat ocultat per LIST_OF_MODULES, no pot ser mostrat.", + "FORCE_SHOW": "Fes-ho igualment.", + + "UPDATE_MENU_NAME": "Actualitzacions", + "UPDATEMM": "Actualitza MagicMirror²", + "UPDATE_AVAILABLE": "Actualitzaciò disponible", + + "ALERT_MENU_NAME": "Alertes / Notificacions", + "SENDALERT": "Envia alerta", + "HIDEALERT": "Oculta alerta", + "FORM_TYPE": "Tipus:", + "FORM_ALERT": "Alerta", + "FORM_NOTIFICATION": "Notificaciò", + "FORM_TITLE": "Títol:", + "FORM_TITLE_PLACEHOLDER": "Introdueix títol...", + "FORM_MESSAGE": "Missatge:", + "FORM_MESSAGE_PLACEHOLDER": "Introdueix missatge...", + "FORM_SECONDS": "Segons:", + + "RESPONSE_ERROR": "No ha funcionat. Comprova els MM logs per més detalls", + "MODULE_CONTROLS": "Controls de mòduls", + "CUSTOM_MENU": "El meu Menú Personalitzat" } diff --git a/translations/da.json b/translations/da.json index de8abcb..6fb827d 100644 --- a/translations/da.json +++ b/translations/da.json @@ -1,88 +1,87 @@ { - "TITLE": "MagicMirror² Menu", - - "EDIT_MENU_NAME": "Udseende", - "SHUTDOWN_MENU_NAME": "Strøm", - "CONFIGURE_MENU_NAME": "Rediger config.js", - "VIEW_MIRROR": "MagicMirror²", - - "BACK": "Tilbage", - - "BRIGHTNESS": "Lysstyrke", - - "REFRESHMM" : "Genindlæs Browser", - "MONITOROFF": "Sluk skærm", - "MONITORON": "Tænd skærm", - "MONITORTIMED": "Tænd skærm kortvarig", - "RESTART": "Genstart", - "RESTARTMM": "Genstart MagicMirror²", - "SHUTDOWN": "Luk ned", - "FULLSCREEN": "Toggle fuldskærm", - "MINIMIZE": "Minimer Browser", - "DEVTOOLS": "Åben DevTools", - - "SHOWALL": "Vis alle", - "HIDEALL": "Skjul alle", - - "ADD_MODULE": "Tilføj modul", - "SEARCH": "Søg …", - "INSTALLED": "Installeret", - "DOWNLOAD": "Download", - "DOWNLOADING": "Downloading …", - "CODE_LINK": "Vis kode", - "BY": "af", - "ADD_THIS": "Tilføj dette modul", - "HELP": "Vis readme", - "MENU": "Menu", - "RESET": "Nulstil", - "NO_HEADER": "(ingen overskrift)", - "NO_POSITION": "(usynlig)", - "ADD_ENTRY": "Tilføj post", - "NEW_ENTRY_NAME": "(skriv navn på ny post)", - "DELETE_ENTRY": "Slet", - "UNSAVED_CHANGES": "Ikke-gemte ændringer", - "OK": "Ok", - "DISCARD": "Forkast ændringer", - "CANCEL": "Annullere", - - "NO_MODULES_LOADED": "Ingen moduler indlæst.", - "SAVE": "Gem", - - "EXPERIMENTAL": "Dette er en eksperimentel funktion, det kan ødelægge din konfigurationsfil. Sikkerhedskopier først din konfiguration, hvis det er tilfældet!
Vil du fortsætte?", - "PANIC": "Glem det.", - "NO_RISK_NO_FUN": "Selvfølgelig!", - - "CONFIRM_SHUTDOWN": "Systemet lukker ned.", - "CONFIRM_RESTART": "Systemet genstarter", - - "LOAD_ERROR": "Hvis du ser denne meddelelse, opstod der en fejl under indlæsning af javascript-filen. Gå til følgende link og se, om dette er et kendt problem med din browser:", - "ISSUE_LINK": "Github fejlrapportering", - - "DONE": "Færdig.", - "ERROR": "Fejl!", - "LOADING": "Indlæser …", - - "LOCKSTRING_WARNING": "Dette modul blev skjult af LIST_OF_MODULES, det kan ikke vises.", - "FORCE_SHOW": "Gør det alligevel.", - - "UPDATE_MENU_NAME" : "Opdateringer", - "UPDATEMM" : "Opdater MagicMirror²", - "UPDATE_AVAILABLE" : "Opdatering tilgængelig", - - "ALERT_MENU_NAME" : "Alarm", - "SENDALERT" : "Send", - "HIDEALERT" : "Skjul", - "FORM_TYPE" : "Type:", - "FORM_ALERT" : "Alarm", - "FORM_NOTIFICATION" : "Notifikation", - "FORM_TITLE" : "Titel:", - "FORM_TITLE_PLACEHOLDER" : "Skriv titel...", - "FORM_MESSAGE" : "Besked:", - "FORM_MESSAGE_PLACEHOLDER" : "Skriv besked...", - "FORM_SECONDS" : "Sekunder:", - - - "RESPONSE_ERROR": "Nå, det virkede ikke. Kontroller MM-logfilerne for at få flere oplysninger", - "MODULE_CONTROLS": "Modul kontrol", - "CUSTOM_MENU": "Min tilpassede menu" + "TITLE": "MagicMirror² Menu", + + "EDIT_MENU_NAME": "Udseende", + "SHUTDOWN_MENU_NAME": "Strøm", + "CONFIGURE_MENU_NAME": "Rediger config.js", + "VIEW_MIRROR": "MagicMirror²", + + "BACK": "Tilbage", + + "BRIGHTNESS": "Lysstyrke", + + "REFRESHMM": "Genindlæs Browser", + "MONITOROFF": "Sluk skærm", + "MONITORON": "Tænd skærm", + "MONITORTIMED": "Tænd skærm kortvarig", + "RESTART": "Genstart", + "RESTARTMM": "Genstart MagicMirror²", + "SHUTDOWN": "Luk ned", + "FULLSCREEN": "Toggle fuldskærm", + "MINIMIZE": "Minimer Browser", + "DEVTOOLS": "Åben DevTools", + + "SHOWALL": "Vis alle", + "HIDEALL": "Skjul alle", + + "ADD_MODULE": "Tilføj modul", + "SEARCH": "Søg …", + "INSTALLED": "Installeret", + "DOWNLOAD": "Download", + "DOWNLOADING": "Downloading …", + "CODE_LINK": "Vis kode", + "BY": "af", + "ADD_THIS": "Tilføj dette modul", + "HELP": "Vis readme", + "MENU": "Menu", + "RESET": "Nulstil", + "NO_HEADER": "(ingen overskrift)", + "NO_POSITION": "(usynlig)", + "ADD_ENTRY": "Tilføj post", + "NEW_ENTRY_NAME": "(skriv navn på ny post)", + "DELETE_ENTRY": "Slet", + "UNSAVED_CHANGES": "Ikke-gemte ændringer", + "OK": "Ok", + "DISCARD": "Forkast ændringer", + "CANCEL": "Annullere", + + "NO_MODULES_LOADED": "Ingen moduler indlæst.", + "SAVE": "Gem", + + "EXPERIMENTAL": "Dette er en eksperimentel funktion, det kan ødelægge din konfigurationsfil. Sikkerhedskopier først din konfiguration, hvis det er tilfældet!
Vil du fortsætte?", + "PANIC": "Glem det.", + "NO_RISK_NO_FUN": "Selvfølgelig!", + + "CONFIRM_SHUTDOWN": "Systemet lukker ned.", + "CONFIRM_RESTART": "Systemet genstarter", + + "LOAD_ERROR": "Hvis du ser denne meddelelse, opstod der en fejl under indlæsning af javascript-filen. Gå til følgende link og se, om dette er et kendt problem med din browser:", + "ISSUE_LINK": "Github fejlrapportering", + + "DONE": "Færdig.", + "ERROR": "Fejl!", + "LOADING": "Indlæser …", + + "LOCKSTRING_WARNING": "Dette modul blev skjult af LIST_OF_MODULES, det kan ikke vises.", + "FORCE_SHOW": "Gør det alligevel.", + + "UPDATE_MENU_NAME": "Opdateringer", + "UPDATEMM": "Opdater MagicMirror²", + "UPDATE_AVAILABLE": "Opdatering tilgængelig", + + "ALERT_MENU_NAME": "Alarm", + "SENDALERT": "Send", + "HIDEALERT": "Skjul", + "FORM_TYPE": "Type:", + "FORM_ALERT": "Alarm", + "FORM_NOTIFICATION": "Notifikation", + "FORM_TITLE": "Titel:", + "FORM_TITLE_PLACEHOLDER": "Skriv titel...", + "FORM_MESSAGE": "Besked:", + "FORM_MESSAGE_PLACEHOLDER": "Skriv besked...", + "FORM_SECONDS": "Sekunder:", + + "RESPONSE_ERROR": "Nå, det virkede ikke. Kontroller MM-logfilerne for at få flere oplysninger", + "MODULE_CONTROLS": "Modul kontrol", + "CUSTOM_MENU": "Min tilpassede menu" } diff --git a/translations/de.json b/translations/de.json index 1c5aa4b..23c8123 100644 --- a/translations/de.json +++ b/translations/de.json @@ -1,76 +1,76 @@ { - "TITLE": "MagicMirror² Menü", + "TITLE": "MagicMirror² Menü", - "EDIT_MENU_NAME": "Ansicht editieren", - "SHUTDOWN_MENU_NAME": "Energieoptionen", - "CONFIGURE_MENU_NAME": "Einstellungen", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Ansicht editieren", + "SHUTDOWN_MENU_NAME": "Energieoptionen", + "CONFIGURE_MENU_NAME": "Einstellungen", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Zurück", + "BACK": "Zurück", - "BRIGHTNESS": "Helligkeit", + "BRIGHTNESS": "Helligkeit", - "REFRESHMM" : "Browser neu laden", - "MONITOROFF": "Bildschirm ausschalten", - "MONITORON": "Bildschirm einschalten", - "RESTART": "Neu starten", - "RESTARTMM": "Starte MagicMirror² neu", - "SHUTDOWN": "Ausschalten", + "REFRESHMM": "Browser neu laden", + "MONITOROFF": "Bildschirm ausschalten", + "MONITORON": "Bildschirm einschalten", + "RESTART": "Neu starten", + "RESTARTMM": "Starte MagicMirror² neu", + "SHUTDOWN": "Ausschalten", - "SHOWALL": "Alle", - "HIDEALL": "Alle", + "SHOWALL": "Alle", + "HIDEALL": "Alle", - "ADD_MODULE": "Neues Modul", - "SEARCH": "Suchen …", - "INSTALLED": "Installiert", - "DOWNLOAD": "Download", - "DOWNLOADING": "Downloading …", - "CODE_LINK": "Code ansehen", - "BY": "von", - "ADD_THIS": "Hinzufügen", - "HELP": "Hilfe", - "MENU": "Menü", - "RESET": "Reset", - "NO_HEADER": "(kein Header)", - "NO_POSITION": "(unsichtbar)", - "ADD_ENTRY": "Neuer Eintrag", - "NEW_ENTRY_NAME": "(Name eintragen)", - "DELETE_ENTRY": "Löschen", - "UNSAVED_CHANGES": "Nicht gespeicherte Änderungen", - "OK": "Ok", - "DISCARD": "Verwerfen", - "CANCEL": "Abbrechen", + "ADD_MODULE": "Neues Modul", + "SEARCH": "Suchen …", + "INSTALLED": "Installiert", + "DOWNLOAD": "Download", + "DOWNLOADING": "Downloading …", + "CODE_LINK": "Code ansehen", + "BY": "von", + "ADD_THIS": "Hinzufügen", + "HELP": "Hilfe", + "MENU": "Menü", + "RESET": "Reset", + "NO_HEADER": "(kein Header)", + "NO_POSITION": "(unsichtbar)", + "ADD_ENTRY": "Neuer Eintrag", + "NEW_ENTRY_NAME": "(Name eintragen)", + "DELETE_ENTRY": "Löschen", + "UNSAVED_CHANGES": "Nicht gespeicherte Änderungen", + "OK": "Ok", + "DISCARD": "Verwerfen", + "CANCEL": "Abbrechen", - "NO_MODULES_LOADED": "Keine Module geladen.", - "SAVE": "Speichern", + "NO_MODULES_LOADED": "Keine Module geladen.", + "SAVE": "Speichern", - "EXPERIMENTAL": "Dies ist ein experimentelles Feature, es könnte Probleme verursachen. Mache ein Backup von deiner config!
Weiter machen?", - "PANIC": "Lieber nicht.", - "NO_RISK_NO_FUN": "Ich liebe das Risiko!", + "EXPERIMENTAL": "Dies ist ein experimentelles Feature, es könnte Probleme verursachen. Mache ein Backup von deiner config!
Weiter machen?", + "PANIC": "Lieber nicht.", + "NO_RISK_NO_FUN": "Ich liebe das Risiko!", - "CONFIRM_SHUTDOWN": "Das System wird ausgeschaltet.", - "CONFIRM_RESTART": "Das System wird neu starten.", + "CONFIRM_SHUTDOWN": "Das System wird ausgeschaltet.", + "CONFIRM_RESTART": "Das System wird neu starten.", - "LOAD_ERROR": "Wenn du diese Nachricht lesen kannst, konnte die javascript Datei nicht korrekt geladen werden. Bitte folge dem Link, und sehe nach, ob dies ein bekanntes Problem mit deinem Browser ist:", - "ISSUE_LINK": "Github Issue Seite", + "LOAD_ERROR": "Wenn du diese Nachricht lesen kannst, konnte die javascript Datei nicht korrekt geladen werden. Bitte folge dem Link, und sehe nach, ob dies ein bekanntes Problem mit deinem Browser ist:", + "ISSUE_LINK": "Github Issue Seite", - "DONE": "Fertig.", - "ERROR": "Fehler!", - "LOADING": "Lade …", + "DONE": "Fertig.", + "ERROR": "Fehler!", + "LOADING": "Lade …", - "UPDATE_MENU_NAME" : "Updates", - "UPDATEMM" : "Update MagicMirror²", - "UPDATE_AVAILABLE" : "Update verfügbar", + "UPDATE_MENU_NAME": "Updates", + "UPDATEMM": "Update MagicMirror²", + "UPDATE_AVAILABLE": "Update verfügbar", - "ALERT_MENU_NAME" : "Alert", - "SENDALERT" : "Senden", - "HIDEALERT" : "Verstecken", - "FORM_TYPE" : "Typ:", - "FORM_ALERT" : "Groß", - "FORM_NOTIFICATION" : "Klein", - "FORM_TITLE" : "Titel:", - "FORM_TITLE_PLACEHOLDER" : "Title eingeben...", - "FORM_MESSAGE" : "Nachricht:", - "FORM_MESSAGE_PLACEHOLDER" : "Nachricht eingeben...", - "FORM_SECONDS" : "Sekunden:" + "ALERT_MENU_NAME": "Alert", + "SENDALERT": "Senden", + "HIDEALERT": "Verstecken", + "FORM_TYPE": "Typ:", + "FORM_ALERT": "Groß", + "FORM_NOTIFICATION": "Klein", + "FORM_TITLE": "Titel:", + "FORM_TITLE_PLACEHOLDER": "Title eingeben...", + "FORM_MESSAGE": "Nachricht:", + "FORM_MESSAGE_PLACEHOLDER": "Nachricht eingeben...", + "FORM_SECONDS": "Sekunden:" } diff --git a/translations/en.json b/translations/en.json index cda9fd0..9a55396 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1,88 +1,87 @@ { - "TITLE": "MagicMirror² Menu", - - "EDIT_MENU_NAME": "Edit view", - "SHUTDOWN_MENU_NAME": "Power", - "CONFIGURE_MENU_NAME": "Edit config.js", - "VIEW_MIRROR": "MagicMirror²", - - "BACK": "Back", - - "BRIGHTNESS": "Brightness", - - "REFRESHMM" : "Refresh Browser", - "MONITOROFF": "Turn monitor OFF", - "MONITORON": "Turn monitor ON", - "MONITORTIMED": "Turn monitor ON briefly", - "RESTART": "Restart", - "RESTARTMM": "Restart MagicMirror²", - "SHUTDOWN": "Shutdown", - "FULLSCREEN": "Toggle Fullscreen", - "MINIMIZE": "Minimize Browser", - "DEVTOOLS": "Open DevTools", - - "SHOWALL": "All", - "HIDEALL": "All", - - "ADD_MODULE": "Add module", - "SEARCH": "Search …", - "INSTALLED": "Installed", - "DOWNLOAD": "Download", - "DOWNLOADING": "Downloading …", - "CODE_LINK": "View code", - "BY": "by", - "ADD_THIS": "Add this module", - "HELP": "Show readme", - "MENU": "Menu", - "RESET": "Reset", - "NO_HEADER": "(no header)", - "NO_POSITION": "(invisible)", - "ADD_ENTRY": "Add entry", - "NEW_ENTRY_NAME": "(enter name of new entry)", - "DELETE_ENTRY": "Delete", - "UNSAVED_CHANGES": "Unsaved changes", - "OK": "Ok", - "DISCARD": "Discard changes", - "CANCEL": "Cancel", - - "NO_MODULES_LOADED": "No module loaded.", - "SAVE": "Save", - - "EXPERIMENTAL": "This is an experimental feature, it could corrupt your config file. Backup your config first, just in case!
Do you want to continue?", - "PANIC": "Never mind.", - "NO_RISK_NO_FUN": "No risk no fun!", - - "CONFIRM_SHUTDOWN": "The system will shut down.", - "CONFIRM_RESTART": "The system will restart.", - - "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:", - "ISSUE_LINK": "Github issue page", - - "DONE": "Done.", - "ERROR": "Error!", - "LOADING": "Loading …", - - "LOCKSTRING_WARNING": "This module was hidden by LIST_OF_MODULES, it can not be shown.", - "FORCE_SHOW": "Do it anyway.", - - "UPDATE_MENU_NAME" : "Updates", - "UPDATEMM" : "Update MagicMirror²", - "UPDATE_AVAILABLE" : "Update available", - - "ALERT_MENU_NAME" : "Alert", - "SENDALERT" : "Send", - "HIDEALERT" : "Hide", - "FORM_TYPE" : "Type:", - "FORM_ALERT" : "Alert", - "FORM_NOTIFICATION" : "Notification", - "FORM_TITLE" : "Title:", - "FORM_TITLE_PLACEHOLDER" : "Enter title...", - "FORM_MESSAGE" : "Message:", - "FORM_MESSAGE_PLACEHOLDER" : "Enter message...", - "FORM_SECONDS" : "Seconds:", - - - "RESPONSE_ERROR": "Well that didn't work. Check the MM logs for more details", - "MODULE_CONTROLS": "Module Controls", - "CUSTOM_MENU": "My Custom Menu" + "TITLE": "MagicMirror² Menu", + + "EDIT_MENU_NAME": "Edit view", + "SHUTDOWN_MENU_NAME": "Power", + "CONFIGURE_MENU_NAME": "Edit config.js", + "VIEW_MIRROR": "MagicMirror²", + + "BACK": "Back", + + "BRIGHTNESS": "Brightness", + + "REFRESHMM": "Refresh Browser", + "MONITOROFF": "Turn monitor OFF", + "MONITORON": "Turn monitor ON", + "MONITORTIMED": "Turn monitor ON briefly", + "RESTART": "Restart", + "RESTARTMM": "Restart MagicMirror²", + "SHUTDOWN": "Shutdown", + "FULLSCREEN": "Toggle Fullscreen", + "MINIMIZE": "Minimize Browser", + "DEVTOOLS": "Open DevTools", + + "SHOWALL": "All", + "HIDEALL": "All", + + "ADD_MODULE": "Add module", + "SEARCH": "Search …", + "INSTALLED": "Installed", + "DOWNLOAD": "Download", + "DOWNLOADING": "Downloading …", + "CODE_LINK": "View code", + "BY": "by", + "ADD_THIS": "Add this module", + "HELP": "Show readme", + "MENU": "Menu", + "RESET": "Reset", + "NO_HEADER": "(no header)", + "NO_POSITION": "(invisible)", + "ADD_ENTRY": "Add entry", + "NEW_ENTRY_NAME": "(enter name of new entry)", + "DELETE_ENTRY": "Delete", + "UNSAVED_CHANGES": "Unsaved changes", + "OK": "Ok", + "DISCARD": "Discard changes", + "CANCEL": "Cancel", + + "NO_MODULES_LOADED": "No module loaded.", + "SAVE": "Save", + + "EXPERIMENTAL": "This is an experimental feature, it could corrupt your config file. Backup your config first, just in case!
Do you want to continue?", + "PANIC": "Never mind.", + "NO_RISK_NO_FUN": "No risk no fun!", + + "CONFIRM_SHUTDOWN": "The system will shut down.", + "CONFIRM_RESTART": "The system will restart.", + + "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:", + "ISSUE_LINK": "Github issue page", + + "DONE": "Done.", + "ERROR": "Error!", + "LOADING": "Loading …", + + "LOCKSTRING_WARNING": "This module was hidden by LIST_OF_MODULES, it can not be shown.", + "FORCE_SHOW": "Do it anyway.", + + "UPDATE_MENU_NAME": "Updates", + "UPDATEMM": "Update MagicMirror²", + "UPDATE_AVAILABLE": "Update available", + + "ALERT_MENU_NAME": "Alert", + "SENDALERT": "Send", + "HIDEALERT": "Hide", + "FORM_TYPE": "Type:", + "FORM_ALERT": "Alert", + "FORM_NOTIFICATION": "Notification", + "FORM_TITLE": "Title:", + "FORM_TITLE_PLACEHOLDER": "Enter title...", + "FORM_MESSAGE": "Message:", + "FORM_MESSAGE_PLACEHOLDER": "Enter message...", + "FORM_SECONDS": "Seconds:", + + "RESPONSE_ERROR": "Well that didn't work. Check the MM logs for more details", + "MODULE_CONTROLS": "Module Controls", + "CUSTOM_MENU": "My Custom Menu" } diff --git a/translations/es.json b/translations/es.json index 77a7955..86a756f 100644 --- a/translations/es.json +++ b/translations/es.json @@ -1,88 +1,87 @@ { - "TITLE": "Menú MagicMirror²", - - "EDIT_MENU_NAME": "Editar Vista", - "SHUTDOWN_MENU_NAME": "Encendido", - "CONFIGURE_MENU_NAME": "Editar config.js", - "VIEW_MIRROR": "MagicMirror²", - - "BACK": "Atrás", - - "BRIGHTNESS": "Brillo", - - "REFRESHMM" : "Recargar Navegador", - "MONITOROFF": "Apagar monitor", - "MONITORON": "Encender monitor", - "MONITORTIMED": "Encender monitor brevemente", - "RESTART": "Recargar", - "RESTARTMM": "Recargar MagicMirror²", - "SHUTDOWN": "Apagar RPi", - "FULLSCREEN": "Pantalla completa", - "MINIMIZE": "Minimizar Navegador", - "DEVTOOLS": "Abrir herram. para desarrolladores", - - "SHOWALL": "Mostrar Todos", - "HIDEALL": "Ocultar Todos", - - "ADD_MODULE": "Añadir módulo", - "SEARCH": "Buscar …", - "INSTALLED": "Instalado", - "DOWNLOAD": "Descarga", - "DOWNLOADING": "Descargando …", - "CODE_LINK": "Ver código", - "BY": "por", - "ADD_THIS": "Añadir este módulo", - "HELP": "Ver Readme", - "MENU": "Menú", - "RESET": "Reset", - "NO_HEADER": "(sin cabecera)", - "NO_POSITION": "(invisible)", - "ADD_ENTRY": "Añadir entrada", - "NEW_ENTRY_NAME": "(nombre de la nueva entrada)", - "DELETE_ENTRY": "Borrar", - "UNSAVED_CHANGES": "Cambios sin guardar", - "OK": "Ok", - "DISCARD": "Descartar cambios", - "CANCEL": "Cancelar", - - "NO_MODULES_LOADED": "No hay modulos cargados.", - "SAVE": "Guardar", - - "EXPERIMENTAL": "Esta es una función experimental, puede corromper tu archivo config. Haz copia de tu configuración primero, por si acaso!
Quieres continuar?", - "PANIC": "No me importa.", - "NO_RISK_NO_FUN": "Sin riesgo no hay recompensa!", - - "CONFIRM_SHUTDOWN": "El sistema se apagará.", - "CONFIRM_RESTART": "El sistema se recargará.", - - "LOAD_ERROR": "Si ves este mensaje, un error ha ocurrido cargando el archivo javascript. Por favor, revisa este enlace para ver si es un problema con tu navegador:", - "ISSUE_LINK": "Página de problemas de Github", - - "DONE": "Hecho.", - "ERROR": "Error!", - "LOADING": "Cargando …", - - "LOCKSTRING_WARNING": "Este módulo fué ocultado por LIST_OF_MODULES, no puede ser mostrado.", - "FORCE_SHOW": "Hazlo igualmente.", - - "UPDATE_MENU_NAME" : "Actualizaciones", - "UPDATEMM" : "Actualiza MagicMirror²", - "UPDATE_AVAILABLE" : "Actualización disponible", - - "ALERT_MENU_NAME" : "Alertas / Notificaciones", - "SENDALERT" : "Envía alerta", - "HIDEALERT" : "Oculta alerta", - "FORM_TYPE" : "Tipo:", - "FORM_ALERT" : "Alerta", - "FORM_NOTIFICATION" : "Notificación", - "FORM_TITLE" : "Título:", - "FORM_TITLE_PLACEHOLDER" : "Introduce título...", - "FORM_MESSAGE" : "Mensaje:", - "FORM_MESSAGE_PLACEHOLDER" : "Introduce mensaje...", - "FORM_SECONDS" : "Segundos:", - - "RESPONSE_ERROR": "No ha funcionado. Comprueba los MM logs para más detalles", - "MODULE_CONTROLS": "Controles de módulos", - "CUSTOM_MENU": "Mi Menú Personalizado" - + "TITLE": "Menú MagicMirror²", + + "EDIT_MENU_NAME": "Editar Vista", + "SHUTDOWN_MENU_NAME": "Encendido", + "CONFIGURE_MENU_NAME": "Editar config.js", + "VIEW_MIRROR": "MagicMirror²", + + "BACK": "Atrás", + + "BRIGHTNESS": "Brillo", + + "REFRESHMM": "Recargar Navegador", + "MONITOROFF": "Apagar monitor", + "MONITORON": "Encender monitor", + "MONITORTIMED": "Encender monitor brevemente", + "RESTART": "Recargar", + "RESTARTMM": "Recargar MagicMirror²", + "SHUTDOWN": "Apagar RPi", + "FULLSCREEN": "Pantalla completa", + "MINIMIZE": "Minimizar Navegador", + "DEVTOOLS": "Abrir herram. para desarrolladores", + + "SHOWALL": "Mostrar Todos", + "HIDEALL": "Ocultar Todos", + + "ADD_MODULE": "Añadir módulo", + "SEARCH": "Buscar …", + "INSTALLED": "Instalado", + "DOWNLOAD": "Descarga", + "DOWNLOADING": "Descargando …", + "CODE_LINK": "Ver código", + "BY": "por", + "ADD_THIS": "Añadir este módulo", + "HELP": "Ver Readme", + "MENU": "Menú", + "RESET": "Reset", + "NO_HEADER": "(sin cabecera)", + "NO_POSITION": "(invisible)", + "ADD_ENTRY": "Añadir entrada", + "NEW_ENTRY_NAME": "(nombre de la nueva entrada)", + "DELETE_ENTRY": "Borrar", + "UNSAVED_CHANGES": "Cambios sin guardar", + "OK": "Ok", + "DISCARD": "Descartar cambios", + "CANCEL": "Cancelar", + + "NO_MODULES_LOADED": "No hay modulos cargados.", + "SAVE": "Guardar", + + "EXPERIMENTAL": "Esta es una función experimental, puede corromper tu archivo config. Haz copia de tu configuración primero, por si acaso!
Quieres continuar?", + "PANIC": "No me importa.", + "NO_RISK_NO_FUN": "Sin riesgo no hay recompensa!", + + "CONFIRM_SHUTDOWN": "El sistema se apagará.", + "CONFIRM_RESTART": "El sistema se recargará.", + + "LOAD_ERROR": "Si ves este mensaje, un error ha ocurrido cargando el archivo javascript. Por favor, revisa este enlace para ver si es un problema con tu navegador:", + "ISSUE_LINK": "Página de problemas de Github", + + "DONE": "Hecho.", + "ERROR": "Error!", + "LOADING": "Cargando …", + + "LOCKSTRING_WARNING": "Este módulo fué ocultado por LIST_OF_MODULES, no puede ser mostrado.", + "FORCE_SHOW": "Hazlo igualmente.", + + "UPDATE_MENU_NAME": "Actualizaciones", + "UPDATEMM": "Actualiza MagicMirror²", + "UPDATE_AVAILABLE": "Actualización disponible", + + "ALERT_MENU_NAME": "Alertas / Notificaciones", + "SENDALERT": "Envía alerta", + "HIDEALERT": "Oculta alerta", + "FORM_TYPE": "Tipo:", + "FORM_ALERT": "Alerta", + "FORM_NOTIFICATION": "Notificación", + "FORM_TITLE": "Título:", + "FORM_TITLE_PLACEHOLDER": "Introduce título...", + "FORM_MESSAGE": "Mensaje:", + "FORM_MESSAGE_PLACEHOLDER": "Introduce mensaje...", + "FORM_SECONDS": "Segundos:", + + "RESPONSE_ERROR": "No ha funcionado. Comprueba los MM logs para más detalles", + "MODULE_CONTROLS": "Controles de módulos", + "CUSTOM_MENU": "Mi Menú Personalizado" } diff --git a/translations/fr.json b/translations/fr.json index bb0778b..7101833 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -1,80 +1,80 @@ { - "TITLE": "MagicMirror² Menu", + "TITLE": "MagicMirror² Menu", - "EDIT_MENU_NAME": "Afficher ou cacher les modules", - "SHUTDOWN_MENU_NAME": "Alimentation", - "CONFIGURE_MENU_NAME": "Éditer le fichier config.js", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Afficher ou cacher les modules", + "SHUTDOWN_MENU_NAME": "Alimentation", + "CONFIGURE_MENU_NAME": "Éditer le fichier config.js", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Retour", + "BACK": "Retour", - "BRIGHTNESS": "Luminosité", + "BRIGHTNESS": "Luminosité", - "REFRESHMM" : "Recharger l'affichage", - "MONITOROFF": "Éteindre le miroir", - "MONITORON": "Allumer le miroir", - "MONITORTIMED": "Allumer brièvement le miroir", - "RESTART": "Redémarrer RPI", - "RESTARTMM": "Redémarrer MagicMirror²", - "SHUTDOWN": "Éteindre RPI", + "REFRESHMM": "Recharger l'affichage", + "MONITOROFF": "Éteindre le miroir", + "MONITORON": "Allumer le miroir", + "MONITORTIMED": "Allumer brièvement le miroir", + "RESTART": "Redémarrer RPI", + "RESTARTMM": "Redémarrer MagicMirror²", + "SHUTDOWN": "Éteindre RPI", - "SHOWALL": "Tout voir", - "HIDEALL": "Tout cacher", + "SHOWALL": "Tout voir", + "HIDEALL": "Tout cacher", - "ADD_MODULE": "Ajouter un module", - "SEARCH": "Rechercher …", - "INSTALLED": "Installer", - "DOWNLOAD": "Télécharger", - "DOWNLOADING": "Téléchargements …", - "CODE_LINK": "Voir le code", - "BY": "par", - "ADD_THIS": "Ajouter ce module", - "HELP": "Voir le readme", - "MENU": "Menu", - "RESET": "Réinitialiser", - "NO_HEADER": "(no header)", - "NO_POSITION": "(invisible)", - "ADD_ENTRY": "Ajouter une entrée", - "NEW_ENTRY_NAME": "Entrer le nom", - "DELETE_ENTRY": "Supprimer", - "UNSAVED_CHANGES": "Changements non sauvegardés", - "OK": "Ok", - "DISCARD": "Ignorer les changements", - "CANCEL": "Annuler", + "ADD_MODULE": "Ajouter un module", + "SEARCH": "Rechercher …", + "INSTALLED": "Installer", + "DOWNLOAD": "Télécharger", + "DOWNLOADING": "Téléchargements …", + "CODE_LINK": "Voir le code", + "BY": "par", + "ADD_THIS": "Ajouter ce module", + "HELP": "Voir le readme", + "MENU": "Menu", + "RESET": "Réinitialiser", + "NO_HEADER": "(no header)", + "NO_POSITION": "(invisible)", + "ADD_ENTRY": "Ajouter une entrée", + "NEW_ENTRY_NAME": "Entrer le nom", + "DELETE_ENTRY": "Supprimer", + "UNSAVED_CHANGES": "Changements non sauvegardés", + "OK": "Ok", + "DISCARD": "Ignorer les changements", + "CANCEL": "Annuler", - "NO_MODULES_LOADED": "Aucun module chargé.", - "SAVE": "Enregistrer", + "NO_MODULES_LOADED": "Aucun module chargé.", + "SAVE": "Enregistrer", - "EXPERIMENTAL": "Ceci est une fonctionnalité expérimentale, elle peut casser votre configuration. Enregistrez votre configuration au cas où !
Voulez vous continuer ?", - "PANIC": "Non, tant pis !", - "NO_RISK_NO_FUN": "On a qu'une vie ! Go !", + "EXPERIMENTAL": "Ceci est une fonctionnalité expérimentale, elle peut casser votre configuration. Enregistrez votre configuration au cas où !
Voulez vous continuer ?", + "PANIC": "Non, tant pis !", + "NO_RISK_NO_FUN": "On a qu'une vie ! Go !", - "CONFIRM_SHUTDOWN": "Le système va s'éteindre.", - "CONFIRM_RESTART": "Le système va redémarrer.", + "CONFIRM_SHUTDOWN": "Le système va s'éteindre.", + "CONFIRM_RESTART": "Le système va redémarrer.", - "LOAD_ERROR": "Si vous voyez ce message, une erreur s'est produite lors du chargement du fichier javascript. S'il vous plaît allez sur le lien suivant et voir si cela est un problème connu avec votre navigateur:", - "ISSUE_LINK": "Page d'aide sur Github", + "LOAD_ERROR": "Si vous voyez ce message, une erreur s'est produite lors du chargement du fichier javascript. S'il vous plaît allez sur le lien suivant et voir si cela est un problème connu avec votre navigateur:", + "ISSUE_LINK": "Page d'aide sur Github", - "DONE": "Fait.", - "ERROR": "Erreur!", - "LOADING": "Chargement …", + "DONE": "Fait.", + "ERROR": "Erreur!", + "LOADING": "Chargement …", - "LOCKSTRING_WARNING": "Ce module a été masqué par LIST_OF_MODULES, il ne peut pas être affiché.", - "FORCE_SHOW": "Fais-le quand même.", + "LOCKSTRING_WARNING": "Ce module a été masqué par LIST_OF_MODULES, il ne peut pas être affiché.", + "FORCE_SHOW": "Fais-le quand même.", - "UPDATE_MENU_NAME" : "Mises à jour", - "UPDATEMM" : "Update MagicMirror²", - "UPDATE_AVAILABLE" : "Mise à jour disponible", + "UPDATE_MENU_NAME": "Mises à jour", + "UPDATEMM": "Update MagicMirror²", + "UPDATE_AVAILABLE": "Mise à jour disponible", - "ALERT_MENU_NAME" : "Alerte", - "SENDALERT" : "Envoyer", - "HIDEALERT" : "Cacher", - "FORM_TYPE" : "Type:", - "FORM_ALERT" : "Alerte", - "FORM_NOTIFICATION" : "Notification", - "FORM_TITLE" : "Titre:", - "FORM_TITLE_PLACEHOLDER" : "Entrez le titre...", - "FORM_MESSAGE" : "Message:", - "FORM_MESSAGE_PLACEHOLDER" : "Entrez le message...", - "FORM_SECONDS" : "Secondes:" + "ALERT_MENU_NAME": "Alerte", + "SENDALERT": "Envoyer", + "HIDEALERT": "Cacher", + "FORM_TYPE": "Type:", + "FORM_ALERT": "Alerte", + "FORM_NOTIFICATION": "Notification", + "FORM_TITLE": "Titre:", + "FORM_TITLE_PLACEHOLDER": "Entrez le titre...", + "FORM_MESSAGE": "Message:", + "FORM_MESSAGE_PLACEHOLDER": "Entrez le message...", + "FORM_SECONDS": "Secondes:" } diff --git a/translations/id.json b/translations/id.json index 5594f27..f873347 100644 --- a/translations/id.json +++ b/translations/id.json @@ -1,77 +1,77 @@ { - "TITLE": "Menu MagicMirror²", + "TITLE": "Menu MagicMirror²", - "EDIT_MENU_NAME": "Sunting tampilan", - "SHUTDOWN_MENU_NAME": "Power", - "CONFIGURE_MENU_NAME": "Sunting config.js", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Sunting tampilan", + "SHUTDOWN_MENU_NAME": "Power", + "CONFIGURE_MENU_NAME": "Sunting config.js", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Kembali", + "BACK": "Kembali", - "BRIGHTNESS": "Kecerahan", + "BRIGHTNESS": "Kecerahan", - "REFRESHMM" : "Refresh Browser", - "MONITOROFF": "Matikan monitor", - "MONITORON": "Nyalakan monitor", - "MONITORTIMED": "Nyalakan monitor sebentar", - "RESTART": "Restart", - "RESTARTMM": "Restart MagicMirror²", - "SHUTDOWN": "Matikan", + "REFRESHMM": "Refresh Browser", + "MONITOROFF": "Matikan monitor", + "MONITORON": "Nyalakan monitor", + "MONITORTIMED": "Nyalakan monitor sebentar", + "RESTART": "Restart", + "RESTARTMM": "Restart MagicMirror²", + "SHUTDOWN": "Matikan", - "SHOWALL": "Semua", - "HIDEALL": "Semua", + "SHOWALL": "Semua", + "HIDEALL": "Semua", - "ADD_MODULE": "Tambah modul", - "SEARCH": "Cari …", - "INSTALLED": "Terinstal", - "DOWNLOAD": "Unduh", - "DOWNLOADING": "Sedang mengunduh …", - "CODE_LINK": "Lihat kode", - "BY": "oleh", - "ADD_THIS": "Tambahkan modul ini", - "HELP": "Lihat readme", - "MENU": "Menu", - "RESET": "Reset", - "NO_HEADER": "(tidak ada judul)", - "NO_POSITION": "(tersembunyi)", - "ADD_ENTRY": "Tambah entri", - "NEW_ENTRY_NAME": "(masukkan nama entri baru)", - "DELETE_ENTRY": "Hapus", - "UNSAVED_CHANGES": "Perubahan tidak tersimpan", - "OK": "Ok", - "DISCARD": "Abaikan perubahan", - "CANCEL": "Membatalkan", + "ADD_MODULE": "Tambah modul", + "SEARCH": "Cari …", + "INSTALLED": "Terinstal", + "DOWNLOAD": "Unduh", + "DOWNLOADING": "Sedang mengunduh …", + "CODE_LINK": "Lihat kode", + "BY": "oleh", + "ADD_THIS": "Tambahkan modul ini", + "HELP": "Lihat readme", + "MENU": "Menu", + "RESET": "Reset", + "NO_HEADER": "(tidak ada judul)", + "NO_POSITION": "(tersembunyi)", + "ADD_ENTRY": "Tambah entri", + "NEW_ENTRY_NAME": "(masukkan nama entri baru)", + "DELETE_ENTRY": "Hapus", + "UNSAVED_CHANGES": "Perubahan tidak tersimpan", + "OK": "Ok", + "DISCARD": "Abaikan perubahan", + "CANCEL": "Membatalkan", - "NO_MODULES_LOADED": "Tidak ada modul yang dimuat.", - "SAVE": "Simpan", + "NO_MODULES_LOADED": "Tidak ada modul yang dimuat.", + "SAVE": "Simpan", - "EXPERIMENTAL": "Ini adalah fitur percobaan, dapat merusak file config Anda. Backup config Anda terlebih dahulu, untuk berjaga-jaga!
Yakin untuk lanjut?", - "PANIC": "Gak usah dipikirin.", - "NO_RISK_NO_FUN": "Tanpa resiko tidak ada kesenangan!", + "EXPERIMENTAL": "Ini adalah fitur percobaan, dapat merusak file config Anda. Backup config Anda terlebih dahulu, untuk berjaga-jaga!
Yakin untuk lanjut?", + "PANIC": "Gak usah dipikirin.", + "NO_RISK_NO_FUN": "Tanpa resiko tidak ada kesenangan!", - "CONFIRM_SHUTDOWN": "Sistem akan matikan.", - "CONFIRM_RESTART": "Sistem akan restart.", + "CONFIRM_SHUTDOWN": "Sistem akan matikan.", + "CONFIRM_RESTART": "Sistem akan restart.", - "LOAD_ERROR": "Jika Anda melihat pesan ini, telah terjadi kesalahan ketika memuat file javascript. Silakan kunjungi link berikut dan cek masalah ini di browser Anda:", - "ISSUE_LINK": "Halaman isu Github", + "LOAD_ERROR": "Jika Anda melihat pesan ini, telah terjadi kesalahan ketika memuat file javascript. Silakan kunjungi link berikut dan cek masalah ini di browser Anda:", + "ISSUE_LINK": "Halaman isu Github", - "DONE": "Selesai.", - "ERROR": "Error!", - "LOADING": "Memuat …", + "DONE": "Selesai.", + "ERROR": "Error!", + "LOADING": "Memuat …", - "UPDATE_MENU_NAME" : "Pembaharuan", - "UPDATEMM" : "Perbarui MagicMirror²", - "UPDATE_AVAILABLE" : "Pembaharuan tersedia", + "UPDATE_MENU_NAME": "Pembaharuan", + "UPDATEMM": "Perbarui MagicMirror²", + "UPDATE_AVAILABLE": "Pembaharuan tersedia", - "ALERT_MENU_NAME" : "Peringatan", - "SENDALERT" : "Kirim", - "HIDEALERT" : "Sembunyikan", - "FORM_TYPE" : "Tipe:", - "FORM_ALERT" : "Peringatan", - "FORM_NOTIFICATION" : "Pemberitahuan", - "FORM_TITLE" : "Judul:", - "FORM_TITLE_PLACEHOLDER" : "Tuliskan judul...", - "FORM_MESSAGE" : "Pesan:", - "FORM_MESSAGE_PLACEHOLDER" : "Tuliskan pesan...", - "FORM_SECONDS" : "Detik:" + "ALERT_MENU_NAME": "Peringatan", + "SENDALERT": "Kirim", + "HIDEALERT": "Sembunyikan", + "FORM_TYPE": "Tipe:", + "FORM_ALERT": "Peringatan", + "FORM_NOTIFICATION": "Pemberitahuan", + "FORM_TITLE": "Judul:", + "FORM_TITLE_PLACEHOLDER": "Tuliskan judul...", + "FORM_MESSAGE": "Pesan:", + "FORM_MESSAGE_PLACEHOLDER": "Tuliskan pesan...", + "FORM_SECONDS": "Detik:" } diff --git a/translations/it.json b/translations/it.json index 71cfb3e..ac1d652 100644 --- a/translations/it.json +++ b/translations/it.json @@ -1,80 +1,80 @@ { - "TITLE": "Menù MagicMirror²", + "TITLE": "Menù MagicMirror²", - "EDIT_MENU_NAME": "Modifica vista", - "SHUTDOWN_MENU_NAME": "Alimentazione", - "CONFIGURE_MENU_NAME": "Modifica config.js", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Modifica vista", + "SHUTDOWN_MENU_NAME": "Alimentazione", + "CONFIGURE_MENU_NAME": "Modifica config.js", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Indietro", + "BACK": "Indietro", - "BRIGHTNESS": "Luminosità", + "BRIGHTNESS": "Luminosità", - "REFRESHMM" : "Aggiorna browser", - "MONITOROFF": "Spegni il monitor", - "MONITORON": "Accendi il monitor", - "MONITORTIMED": "Accendi brevemente il monitor", - "RESTART": "Riavvia", - "RESTARTMM": "Riavvia MagicMirror²", - "SHUTDOWN": "Spegni", + "REFRESHMM": "Aggiorna browser", + "MONITOROFF": "Spegni il monitor", + "MONITORON": "Accendi il monitor", + "MONITORTIMED": "Accendi brevemente il monitor", + "RESTART": "Riavvia", + "RESTARTMM": "Riavvia MagicMirror²", + "SHUTDOWN": "Spegni", - "SHOWALL": "Tutto", - "HIDEALL": "Tutto", + "SHOWALL": "Tutto", + "HIDEALL": "Tutto", - "ADD_MODULE": "Aggiungi modulo", - "SEARCH": "Cerca …", - "INSTALLED": "Installati", - "DOWNLOAD": "Scarica", - "DOWNLOADING": "Sto scaricando …", - "CODE_LINK": "Vedi sorgente", - "BY": "di", - "ADD_THIS": "Aggiungi questo modulo", - "HELP": "Visualizza il file readme", - "MENU": "Menù", - "RESET": "Ripristina", - "NO_HEADER": "(nessuna intestazione)", - "NO_POSITION": "(invisibile)", - "ADD_ENTRY": "Aggiungi voce", - "NEW_ENTRY_NAME": "(inserisci il nome della nuova voce)", - "DELETE_ENTRY": "Elimina", - "UNSAVED_CHANGES": "Modifiche non salvate", - "OK": "Ok", - "DISCARD": "Annulla modifiche", - "CANCEL": "Annulla", + "ADD_MODULE": "Aggiungi modulo", + "SEARCH": "Cerca …", + "INSTALLED": "Installati", + "DOWNLOAD": "Scarica", + "DOWNLOADING": "Sto scaricando …", + "CODE_LINK": "Vedi sorgente", + "BY": "di", + "ADD_THIS": "Aggiungi questo modulo", + "HELP": "Visualizza il file readme", + "MENU": "Menù", + "RESET": "Ripristina", + "NO_HEADER": "(nessuna intestazione)", + "NO_POSITION": "(invisibile)", + "ADD_ENTRY": "Aggiungi voce", + "NEW_ENTRY_NAME": "(inserisci il nome della nuova voce)", + "DELETE_ENTRY": "Elimina", + "UNSAVED_CHANGES": "Modifiche non salvate", + "OK": "Ok", + "DISCARD": "Annulla modifiche", + "CANCEL": "Annulla", - "NO_MODULES_LOADED": "Nessun modulo caricato.", - "SAVE": "Salva", + "NO_MODULES_LOADED": "Nessun modulo caricato.", + "SAVE": "Salva", - "EXPERIMENTAL": "Questa è una funzione sperimentale e potrebbe rendere illeggibile il file config. Effettua prima il backup del tuo config per sicurezza!
Vuoi continuare?", - "PANIC": "Nessun problema.", - "NO_RISK_NO_FUN": "Chi non risica non rosica!", + "EXPERIMENTAL": "Questa è una funzione sperimentale e potrebbe rendere illeggibile il file config. Effettua prima il backup del tuo config per sicurezza!
Vuoi continuare?", + "PANIC": "Nessun problema.", + "NO_RISK_NO_FUN": "Chi non risica non rosica!", - "CONFIRM_SHUTDOWN": "Il sistema verrà arrestato.", - "CONFIRM_RESTART": "Il sistema verrà riavviato.", + "CONFIRM_SHUTDOWN": "Il sistema verrà arrestato.", + "CONFIRM_RESTART": "Il sistema verrà riavviato.", - "LOAD_ERROR": "Se leggi questo messaggo allora c'è stato un errore nel caricare il file javascript. Per favore vai al link seguente e verifica se sia un problema conosciuto del tuo browser:", - "ISSUE_LINK": "Pagina Github del problema", + "LOAD_ERROR": "Se leggi questo messaggo allora c'è stato un errore nel caricare il file javascript. Per favore vai al link seguente e verifica se sia un problema conosciuto del tuo browser:", + "ISSUE_LINK": "Pagina Github del problema", - "DONE": "Fatto.", - "ERROR": "Errore!", - "LOADING": "Sto caricando …", + "DONE": "Fatto.", + "ERROR": "Errore!", + "LOADING": "Sto caricando …", - "LOCKSTRING_WARNING": "Questo modulo è stato nascosto da LIST_OF_MODULES e non può essere mostrato.", - "FORCE_SHOW": "Procedi comunque.", + "LOCKSTRING_WARNING": "Questo modulo è stato nascosto da LIST_OF_MODULES e non può essere mostrato.", + "FORCE_SHOW": "Procedi comunque.", - "UPDATE_MENU_NAME" : "Aggiornamenti", - "UPDATEMM" : "Aggiorna MagicMirror²", - "UPDATE_AVAILABLE" : "Aggiornamento disponibile", + "UPDATE_MENU_NAME": "Aggiornamenti", + "UPDATEMM": "Aggiorna MagicMirror²", + "UPDATE_AVAILABLE": "Aggiornamento disponibile", - "ALERT_MENU_NAME" : "Avviso", - "SENDALERT" : "Invia", - "HIDEALERT" : "Nascondi", - "FORM_TYPE" : "Tipo:", - "FORM_ALERT" : "Avviso", - "FORM_NOTIFICATION" : "Notifica", - "FORM_TITLE" : "Titolo:", - "FORM_TITLE_PLACEHOLDER" : "Inserisci il titolo...", - "FORM_MESSAGE" : "Messaggio:", - "FORM_MESSAGE_PLACEHOLDER" : "Inserisci il messaggio...", - "FORM_SECONDS" : "Secondi:" -} \ No newline at end of file + "ALERT_MENU_NAME": "Avviso", + "SENDALERT": "Invia", + "HIDEALERT": "Nascondi", + "FORM_TYPE": "Tipo:", + "FORM_ALERT": "Avviso", + "FORM_NOTIFICATION": "Notifica", + "FORM_TITLE": "Titolo:", + "FORM_TITLE_PLACEHOLDER": "Inserisci il titolo...", + "FORM_MESSAGE": "Messaggio:", + "FORM_MESSAGE_PLACEHOLDER": "Inserisci il messaggio...", + "FORM_SECONDS": "Secondi:" +} diff --git a/translations/nb.json b/translations/nb.json index 0b40fa2..c49ba65 100644 --- a/translations/nb.json +++ b/translations/nb.json @@ -1,80 +1,80 @@ { - "TITLE": "MagicMirror² Meny", + "TITLE": "MagicMirror² Meny", - "EDIT_MENU_NAME": "Rediger visning", - "SHUTDOWN_MENU_NAME": "Strøm", - "CONFIGURE_MENU_NAME": "Rediger config.js", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Rediger visning", + "SHUTDOWN_MENU_NAME": "Strøm", + "CONFIGURE_MENU_NAME": "Rediger config.js", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Tilbake", + "BACK": "Tilbake", - "BRIGHTNESS": "Lysstyrke", + "BRIGHTNESS": "Lysstyrke", - "REFRESHMM" : "Oppdater nettleseren", - "MONITOROFF": "Slå av skjermen", - "MONITORON": "Slå på skjermen", - "MONITORTIMED": "Slå skjermen på kort", - "RESTART": "Omstart", - "RESTARTMM": "Restart MagicMirror²", - "SHUTDOWN": "Slå av", + "REFRESHMM": "Oppdater nettleseren", + "MONITOROFF": "Slå av skjermen", + "MONITORON": "Slå på skjermen", + "MONITORTIMED": "Slå skjermen på kort", + "RESTART": "Omstart", + "RESTARTMM": "Restart MagicMirror²", + "SHUTDOWN": "Slå av", - "SHOWALL": "Alle", - "HIDEALL": "Alle", + "SHOWALL": "Alle", + "HIDEALL": "Alle", - "ADD_MODULE": "Legg til modul", - "SEARCH": "Søk …", - "INSTALLED": "Installert", - "DOWNLOAD": "Last ned", - "DOWNLOADING": "Laster ned …", - "CODE_LINK": "Se kildekode", - "BY": "av", - "ADD_THIS": "Legg til denne modulen", - "HELP": "Vis readme", - "MENU": "Meny", - "RESET": "Reset", - "NO_HEADER": "(ingen topptekst)", - "NO_POSITION": "(usynlig)", - "ADD_ENTRY": "Legg til oppføring", - "NEW_ENTRY_NAME": "(skriv inn navn på ny oppføring)", - "DELETE_ENTRY": "Slett", - "UNSAVED_CHANGES": "Ulagrede endringer", - "OK": "Ok", - "DISCARD": "Forkaste endringer", - "CANCEL": "Avbryt", + "ADD_MODULE": "Legg til modul", + "SEARCH": "Søk …", + "INSTALLED": "Installert", + "DOWNLOAD": "Last ned", + "DOWNLOADING": "Laster ned …", + "CODE_LINK": "Se kildekode", + "BY": "av", + "ADD_THIS": "Legg til denne modulen", + "HELP": "Vis readme", + "MENU": "Meny", + "RESET": "Reset", + "NO_HEADER": "(ingen topptekst)", + "NO_POSITION": "(usynlig)", + "ADD_ENTRY": "Legg til oppføring", + "NEW_ENTRY_NAME": "(skriv inn navn på ny oppføring)", + "DELETE_ENTRY": "Slett", + "UNSAVED_CHANGES": "Ulagrede endringer", + "OK": "Ok", + "DISCARD": "Forkaste endringer", + "CANCEL": "Avbryt", - "NO_MODULES_LOADED": "Ingen modul lastet.", - "SAVE": "Lagre", + "NO_MODULES_LOADED": "Ingen modul lastet.", + "SAVE": "Lagre", - "EXPERIMENTAL": "Dette er en eksperimentell funksjon, det kan ødelegge konfigurasjonsfilen din. Sikkerhetskopier din konfigurasjon først, bare i tilfelle!
Vil du fortsette?", - "PANIC": "Glem det.", - "NO_RISK_NO_FUN": "Ingen risiko, ingen morro!", + "EXPERIMENTAL": "Dette er en eksperimentell funksjon, det kan ødelegge konfigurasjonsfilen din. Sikkerhetskopier din konfigurasjon først, bare i tilfelle!
Vil du fortsette?", + "PANIC": "Glem det.", + "NO_RISK_NO_FUN": "Ingen risiko, ingen morro!", - "CONFIRM_SHUTDOWN": "Systemet slås av.", - "CONFIRM_RESTART": "Systemet vil starte på nytt.", + "CONFIRM_SHUTDOWN": "Systemet slås av.", + "CONFIRM_RESTART": "Systemet vil starte på nytt.", - "LOAD_ERROR": "Hvis du ser denne meldingen, oppstod det en feil ved lasting av javascriptfilen. Vennligst gå til den følgende lenken og se om dette er et kjent problem med nettleseren din:", - "ISSUE_LINK": "Github problem side", + "LOAD_ERROR": "Hvis du ser denne meldingen, oppstod det en feil ved lasting av javascriptfilen. Vennligst gå til den følgende lenken og se om dette er et kjent problem med nettleseren din:", + "ISSUE_LINK": "Github problem side", - "DONE": "Ferdig.", - "ERROR": "Feil!", - "LOADING": "Laster …", + "DONE": "Ferdig.", + "ERROR": "Feil!", + "LOADING": "Laster …", - "LOCKSTRING_WARNING": "Denne modulen ble skjult av LIST_OF_MODULES, det kan ikke vises.", - "FORCE_SHOW": "Gjør det likevel.", + "LOCKSTRING_WARNING": "Denne modulen ble skjult av LIST_OF_MODULES, det kan ikke vises.", + "FORCE_SHOW": "Gjør det likevel.", - "UPDATE_MENU_NAME" : "Oppdateringer", - "UPDATEMM" : "Oppdater MagicMirror²", - "UPDATE_AVAILABLE" : "Oppdatering tilgjengelig", + "UPDATE_MENU_NAME": "Oppdateringer", + "UPDATEMM": "Oppdater MagicMirror²", + "UPDATE_AVAILABLE": "Oppdatering tilgjengelig", - "ALERT_MENU_NAME" : "Varsling", - "SENDALERT" : "Send", - "HIDEALERT" : "Skjul", - "FORM_TYPE" : "Type:", - "FORM_ALERT" : "Varsling", - "FORM_NOTIFICATION" : "Melding", - "FORM_TITLE" : "Tittel:", - "FORM_TITLE_PLACEHOLDER" : "Skriv inn tittel...", - "FORM_MESSAGE" : "Beskjed:", - "FORM_MESSAGE_PLACEHOLDER" : "Skriv inn melding...", - "FORM_SECONDS" : "Sekunder:" + "ALERT_MENU_NAME": "Varsling", + "SENDALERT": "Send", + "HIDEALERT": "Skjul", + "FORM_TYPE": "Type:", + "FORM_ALERT": "Varsling", + "FORM_NOTIFICATION": "Melding", + "FORM_TITLE": "Tittel:", + "FORM_TITLE_PLACEHOLDER": "Skriv inn tittel...", + "FORM_MESSAGE": "Beskjed:", + "FORM_MESSAGE_PLACEHOLDER": "Skriv inn melding...", + "FORM_SECONDS": "Sekunder:" } diff --git a/translations/nl.json b/translations/nl.json index b786fe9..077e6f2 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -1,77 +1,77 @@ { - "TITLE": "MagicMirror² Menu", + "TITLE": "MagicMirror² Menu", - "EDIT_MENU_NAME": "Aanzicht aanpassen", - "SHUTDOWN_MENU_NAME": "Stroom", - "CONFIGURE_MENU_NAME": "config.js aanpassen", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Aanzicht aanpassen", + "SHUTDOWN_MENU_NAME": "Stroom", + "CONFIGURE_MENU_NAME": "config.js aanpassen", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Terug", + "BACK": "Terug", - "BRIGHTNESS": "Helderheid", + "BRIGHTNESS": "Helderheid", - "REFRESHMM" : "Browser verversen", - "MONITOROFF": "Schakel monitor UIT", - "MONITORON": "Schakel monitor AAN", - "MONITORTIMED": "Schakel monitor korstondig AAN", - "RESTART": "Herstarten", - "RESTARTMM": "MagicMirror² herstarten", - "SHUTDOWN": "Uitschakelen", + "REFRESHMM": "Browser verversen", + "MONITOROFF": "Schakel monitor UIT", + "MONITORON": "Schakel monitor AAN", + "MONITORTIMED": "Schakel monitor korstondig AAN", + "RESTART": "Herstarten", + "RESTARTMM": "MagicMirror² herstarten", + "SHUTDOWN": "Uitschakelen", - "SHOWALL": "Alles", - "HIDEALL": "Alles", + "SHOWALL": "Alles", + "HIDEALL": "Alles", - "ADD_MODULE": "Module toevoegen", - "SEARCH": "Zoeken …", - "INSTALLED": "Gëinstalleerd", - "DOWNLOAD": "Download", - "DOWNLOADING": "Downloaden …", - "CODE_LINK": "View code", - "BY": "door", - "ADD_THIS": "Voeg deze module toe", - "HELP": "Toon 'readme'", - "MENU": "Menu", - "RESET": "Reset", - "NO_HEADER": "(geen header)", - "NO_POSITION": "(onzichtbaar)", - "ADD_ENTRY": "Nieuwe toevoeging", - "NEW_ENTRY_NAME": "(voor naam in van nieuwe toevoeging)", - "DELETE_ENTRY": "Verwijder", - "UNSAVED_CHANGES": "Onopgeslagen wijzigingen", - "OK": "Ok", - "DISCARD": "Wijzigingen ongedaan maken", - "CANCEL": "Annuleren", + "ADD_MODULE": "Module toevoegen", + "SEARCH": "Zoeken …", + "INSTALLED": "Gëinstalleerd", + "DOWNLOAD": "Download", + "DOWNLOADING": "Downloaden …", + "CODE_LINK": "View code", + "BY": "door", + "ADD_THIS": "Voeg deze module toe", + "HELP": "Toon 'readme'", + "MENU": "Menu", + "RESET": "Reset", + "NO_HEADER": "(geen header)", + "NO_POSITION": "(onzichtbaar)", + "ADD_ENTRY": "Nieuwe toevoeging", + "NEW_ENTRY_NAME": "(voor naam in van nieuwe toevoeging)", + "DELETE_ENTRY": "Verwijder", + "UNSAVED_CHANGES": "Onopgeslagen wijzigingen", + "OK": "Ok", + "DISCARD": "Wijzigingen ongedaan maken", + "CANCEL": "Annuleren", - "NO_MODULES_LOADED": "Geen module geladen.", - "SAVE": "Opslaan", + "NO_MODULES_LOADED": "Geen module geladen.", + "SAVE": "Opslaan", - "EXPERIMENTAL": "Dit is een experimentele feature, het kan je configuratie bestand onleesbaar maken. Sla voor de zekerheid eerst je configuratie op!
Weet je zeker dat je wilt doorgaan?", - "PANIC": "Laat maar.", - "NO_RISK_NO_FUN": "No guts, no glory!", + "EXPERIMENTAL": "Dit is een experimentele feature, het kan je configuratie bestand onleesbaar maken. Sla voor de zekerheid eerst je configuratie op!
Weet je zeker dat je wilt doorgaan?", + "PANIC": "Laat maar.", + "NO_RISK_NO_FUN": "No guts, no glory!", - "CONFIRM_SHUTDOWN": "Het systeem wordt uitgeschakeld.", - "CONFIRM_RESTART": "Het systeem wordt opnieuw gestart.", + "CONFIRM_SHUTDOWN": "Het systeem wordt uitgeschakeld.", + "CONFIRM_RESTART": "Het systeem wordt opnieuw gestart.", - "LOAD_ERROR": "Wanneer je dit bericht ziet, dan is er een fout opgetreden bij het laden van het javascript bestand. Ga naar de volgende link en controlleer of dit een bekend probleem is het de browser die je gebruikt:", - "ISSUE_LINK": "Github issue pagina", + "LOAD_ERROR": "Wanneer je dit bericht ziet, dan is er een fout opgetreden bij het laden van het javascript bestand. Ga naar de volgende link en controlleer of dit een bekend probleem is het de browser die je gebruikt:", + "ISSUE_LINK": "Github issue pagina", - "DONE": "Klaar.", - "ERROR": "Fout!", - "LOADING": "Laden …", + "DONE": "Klaar.", + "ERROR": "Fout!", + "LOADING": "Laden …", - "UPDATE_MENU_NAME" : "Updates", - "UPDATEMM" : "MagicMirror² updaten", - "UPDATE_AVAILABLE" : "Update beschikbaar", + "UPDATE_MENU_NAME": "Updates", + "UPDATEMM": "MagicMirror² updaten", + "UPDATE_AVAILABLE": "Update beschikbaar", - "ALERT_MENU_NAME" : "Waarschuwing", - "SENDALERT" : "Verstuur", - "HIDEALERT" : "Verberg", - "FORM_TYPE" : "Type:", - "FORM_ALERT" : "Waarschuwing", - "FORM_NOTIFICATION" : "Notificatie", - "FORM_TITLE" : "Titel:", - "FORM_TITLE_PLACEHOLDER" : "Voor titel in...", - "FORM_MESSAGE" : "Bericht:", - "FORM_MESSAGE_PLACEHOLDER" : "Voer bericht in...", - "FORM_SECONDS" : "Seconden:" + "ALERT_MENU_NAME": "Waarschuwing", + "SENDALERT": "Verstuur", + "HIDEALERT": "Verberg", + "FORM_TYPE": "Type:", + "FORM_ALERT": "Waarschuwing", + "FORM_NOTIFICATION": "Notificatie", + "FORM_TITLE": "Titel:", + "FORM_TITLE_PLACEHOLDER": "Voor titel in...", + "FORM_MESSAGE": "Bericht:", + "FORM_MESSAGE_PLACEHOLDER": "Voer bericht in...", + "FORM_SECONDS": "Seconden:" } diff --git a/translations/pt.json b/translations/pt.json index cff4a55..37deb3c 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -1,77 +1,77 @@ { - "TITLE": "Menu do MagicMirror²", + "TITLE": "Menu do MagicMirror²", - "EDIT_MENU_NAME": "Editar a aparência", - "SHUTDOWN_MENU_NAME": "Ligar/Desligar", - "CONFIGURE_MENU_NAME": "Editar o config.js", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Editar a aparência", + "SHUTDOWN_MENU_NAME": "Ligar/Desligar", + "CONFIGURE_MENU_NAME": "Editar o config.js", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Voltar", + "BACK": "Voltar", - "BRIGHTNESS": "Luminosidade", + "BRIGHTNESS": "Luminosidade", - "REFRESHMM" : "Atualizar página", - "MONITOROFF": "Desligar o monitor", - "MONITORON": "Ligar o monitor", - "MONITORTIMED": "Ligar o monitor temporariamente", - "RESTART": "Reiniciar", - "RESTARTMM": "Reiniciar o MagicMirror²", - "SHUTDOWN": "Desligar", + "REFRESHMM": "Atualizar página", + "MONITOROFF": "Desligar o monitor", + "MONITORON": "Ligar o monitor", + "MONITORTIMED": "Ligar o monitor temporariamente", + "RESTART": "Reiniciar", + "RESTARTMM": "Reiniciar o MagicMirror²", + "SHUTDOWN": "Desligar", - "SHOWALL": "Todos", - "HIDEALL": "Todos", + "SHOWALL": "Todos", + "HIDEALL": "Todos", - "ADD_MODULE": "Adicionar módulo", - "SEARCH": "Procurar …", - "INSTALLED": "Instalado", - "DOWNLOAD": "Descarregar", - "DOWNLOADING": "A descarregar …", - "CODE_LINK": "Ver o código", - "BY": "por", - "ADD_THIS": "Adicionar este módulo", - "HELP": "Instruções", - "MENU": "Menu", - "RESET": "Reset", - "NO_HEADER": "(sem cabeçalho)", - "NO_POSITION": "(invisível)", - "ADD_ENTRY": "Adicionar entrada", - "NEW_ENTRY_NAME": "(inserir nome da nova entrada)", - "DELETE_ENTRY": "Eliminar", - "UNSAVED_CHANGES": "Alterações não guardadas", - "OK": "Ok", - "DISCARD": "Cancelar alterações", - "CANCEL": "Cancelar", + "ADD_MODULE": "Adicionar módulo", + "SEARCH": "Procurar …", + "INSTALLED": "Instalado", + "DOWNLOAD": "Descarregar", + "DOWNLOADING": "A descarregar …", + "CODE_LINK": "Ver o código", + "BY": "por", + "ADD_THIS": "Adicionar este módulo", + "HELP": "Instruções", + "MENU": "Menu", + "RESET": "Reset", + "NO_HEADER": "(sem cabeçalho)", + "NO_POSITION": "(invisível)", + "ADD_ENTRY": "Adicionar entrada", + "NEW_ENTRY_NAME": "(inserir nome da nova entrada)", + "DELETE_ENTRY": "Eliminar", + "UNSAVED_CHANGES": "Alterações não guardadas", + "OK": "Ok", + "DISCARD": "Cancelar alterações", + "CANCEL": "Cancelar", - "NO_MODULES_LOADED": "Nenhum módulo carregado.", - "SAVE": "Guardar", + "NO_MODULES_LOADED": "Nenhum módulo carregado.", + "SAVE": "Guardar", - "EXPERIMENTAL": "Esta é uma função experimental e pode corromper o seu ficheiro de configuração. Faça backup da sua configuração por precaução!
Deseja continuar?", - "PANIC": "Deixa lá.", - "NO_RISK_NO_FUN": "Quem não arrisca, não petisca!", + "EXPERIMENTAL": "Esta é uma função experimental e pode corromper o seu ficheiro de configuração. Faça backup da sua configuração por precaução!
Deseja continuar?", + "PANIC": "Deixa lá.", + "NO_RISK_NO_FUN": "Quem não arrisca, não petisca!", - "CONFIRM_SHUTDOWN": "O sistema irá desligar.", - "CONFIRM_RESTART": "O sistema irá reiniciar.", + "CONFIRM_SHUTDOWN": "O sistema irá desligar.", + "CONFIRM_RESTART": "O sistema irá reiniciar.", - "LOAD_ERROR": "Ocorreu um erro ao ler o seu ficheiro. Por favor, visite este website e veja se o caso aplica-se a si.", - "ISSUE_LINK": "Página do problema no Github", + "LOAD_ERROR": "Ocorreu um erro ao ler o seu ficheiro. Por favor, visite este website e veja se o caso aplica-se a si.", + "ISSUE_LINK": "Página do problema no Github", - "DONE": "Concluído.", - "ERROR": "Erro!", - "LOADING": "A carregar …", + "DONE": "Concluído.", + "ERROR": "Erro!", + "LOADING": "A carregar …", - "UPDATE_MENU_NAME" : "Atualizações", - "UPDATEMM" : "Atualizar o MagicMirror²", - "UPDATE_AVAILABLE" : "Atualização disponível", + "UPDATE_MENU_NAME": "Atualizações", + "UPDATEMM": "Atualizar o MagicMirror²", + "UPDATE_AVAILABLE": "Atualização disponível", - "ALERT_MENU_NAME" : "Alerta", - "SENDALERT" : "Enviar", - "HIDEALERT" : "Esconder", - "FORM_TYPE" : "Tipo:", - "FORM_ALERT" : "Alerta", - "FORM_NOTIFICATION" : "Notificação", - "FORM_TITLE" : "Título:", - "FORM_TITLE_PLACEHOLDER" : "Digite o título...", - "FORM_MESSAGE" : "Mensagem:", - "FORM_MESSAGE_PLACEHOLDER" : "Digite a mensagem...", - "FORM_SECONDS" : "Segundos:" + "ALERT_MENU_NAME": "Alerta", + "SENDALERT": "Enviar", + "HIDEALERT": "Esconder", + "FORM_TYPE": "Tipo:", + "FORM_ALERT": "Alerta", + "FORM_NOTIFICATION": "Notificação", + "FORM_TITLE": "Título:", + "FORM_TITLE_PLACEHOLDER": "Digite o título...", + "FORM_MESSAGE": "Mensagem:", + "FORM_MESSAGE_PLACEHOLDER": "Digite a mensagem...", + "FORM_SECONDS": "Segundos:" } diff --git a/translations/sv.json b/translations/sv.json index 47d795d..8b85230 100644 --- a/translations/sv.json +++ b/translations/sv.json @@ -1,77 +1,77 @@ { - "TITLE": "MagicMirror² Meny", + "TITLE": "MagicMirror² Meny", - "EDIT_MENU_NAME": "Editera synlighet", - "SHUTDOWN_MENU_NAME": "Av och På", - "CONFIGURE_MENU_NAME": "Editera config.js", - "VIEW_MIRROR": "MagicMirror²", + "EDIT_MENU_NAME": "Editera synlighet", + "SHUTDOWN_MENU_NAME": "Av och På", + "CONFIGURE_MENU_NAME": "Editera config.js", + "VIEW_MIRROR": "MagicMirror²", - "BACK": "Tillbaka", + "BACK": "Tillbaka", - "BRIGHTNESS": "Ljusstyrka", + "BRIGHTNESS": "Ljusstyrka", - "REFRESHMM" : "Uppdatea Webläsaren", - "MONITOROFF": "Sätt skärmen i vila", - "MONITORON": "Väck skärmen", - "MONITORTIMED": "Väck skärmen en kort stund", - "RESTART": "Starta om", - "RESTARTMM": "Starta om MagicMirror²", - "SHUTDOWN": "Stäng av", + "REFRESHMM": "Uppdatea Webläsaren", + "MONITOROFF": "Sätt skärmen i vila", + "MONITORON": "Väck skärmen", + "MONITORTIMED": "Väck skärmen en kort stund", + "RESTART": "Starta om", + "RESTARTMM": "Starta om MagicMirror²", + "SHUTDOWN": "Stäng av", - "SHOWALL": "Alla", - "HIDEALL": "Alla", + "SHOWALL": "Alla", + "HIDEALL": "Alla", - "ADD_MODULE": "Lägg till modul", - "SEARCH": "Sök …", - "INSTALLED": "Installerad", - "DOWNLOAD": "Ladda ned", - "DOWNLOADING": "Laddar ner …", - "CODE_LINK": "Titta på källkod", - "BY": "av", - "ADD_THIS": "Lägg till modul", - "HELP": "Visa läsmig", - "MENU": "Meny", - "RESET": "Återgå", - "NO_HEADER": "(ingen överskrift)", - "NO_POSITION": "(osynlig)", - "ADD_ENTRY": "Lägg till värde", - "NEW_ENTRY_NAME": "(Skriv ett namn på värdet)", - "DELETE_ENTRY": "Tabort", - "UNSAVED_CHANGES": "Osparade ändringar", - "OK": "Ok", - "DISCARD": "Spara inte ändringar", - "CANCEL": "Avbryt", + "ADD_MODULE": "Lägg till modul", + "SEARCH": "Sök …", + "INSTALLED": "Installerad", + "DOWNLOAD": "Ladda ned", + "DOWNLOADING": "Laddar ner …", + "CODE_LINK": "Titta på källkod", + "BY": "av", + "ADD_THIS": "Lägg till modul", + "HELP": "Visa läsmig", + "MENU": "Meny", + "RESET": "Återgå", + "NO_HEADER": "(ingen överskrift)", + "NO_POSITION": "(osynlig)", + "ADD_ENTRY": "Lägg till värde", + "NEW_ENTRY_NAME": "(Skriv ett namn på värdet)", + "DELETE_ENTRY": "Tabort", + "UNSAVED_CHANGES": "Osparade ändringar", + "OK": "Ok", + "DISCARD": "Spara inte ändringar", + "CANCEL": "Avbryt", - "NO_MODULES_LOADED": "Ingen modul laddad.", - "SAVE": "Spara", + "NO_MODULES_LOADED": "Ingen modul laddad.", + "SAVE": "Spara", - "EXPERIMENTAL": "Detta är en experimentell funktion, den skulle kunna förstöra din konfigfil. Se till du har en kopia på din konfigfil innan du går vidare, för att vara på säkra sidan!
Vill du fortsätta?", - "PANIC": "Nej, strunta i det.", - "NO_RISK_NO_FUN": "Ja, kör på! Ingen risk, inget kul!", + "EXPERIMENTAL": "Detta är en experimentell funktion, den skulle kunna förstöra din konfigfil. Se till du har en kopia på din konfigfil innan du går vidare, för att vara på säkra sidan!
Vill du fortsätta?", + "PANIC": "Nej, strunta i det.", + "NO_RISK_NO_FUN": "Ja, kör på! Ingen risk, inget kul!", - "CONFIRM_SHUTDOWN": "Systemet stängs av.", - "CONFIRM_RESTART": "Systemet startas om.", + "CONFIRM_SHUTDOWN": "Systemet stängs av.", + "CONFIRM_RESTART": "Systemet startas om.", - "LOAD_ERROR": "Om du ser detta meddelande så har något gott fel när javascriptfilen laddades. Vänligen gå till följande länk och se om det är ett känt problem med din Webbläsare:", - "ISSUE_LINK": "Githubs ärendesida", + "LOAD_ERROR": "Om du ser detta meddelande så har något gott fel när javascriptfilen laddades. Vänligen gå till följande länk och se om det är ett känt problem med din Webbläsare:", + "ISSUE_LINK": "Githubs ärendesida", - "DONE": "Klart.", - "ERROR": "Fel!", - "LOADING": "Laddar …", + "DONE": "Klart.", + "ERROR": "Fel!", + "LOADING": "Laddar …", - "UPDATE_MENU_NAME" : "Uppdateringar", - "UPDATEMM" : "Uppdatera MagicMirror²", - "UPDATE_AVAILABLE" : "Uppdatering tillgänglig", + "UPDATE_MENU_NAME": "Uppdateringar", + "UPDATEMM": "Uppdatera MagicMirror²", + "UPDATE_AVAILABLE": "Uppdatering tillgänglig", - "ALERT_MENU_NAME" : "Larm", - "SENDALERT" : "Skicka", - "HIDEALERT" : "Göm", - "FORM_TYPE" : "Sort:", - "FORM_ALERT" : "Larm", - "FORM_NOTIFICATION" : "Notifikation", - "FORM_TITLE" : "Titel:", - "FORM_TITLE_PLACEHOLDER" : "Skriv titel...", - "FORM_MESSAGE" : "Meddelande:", - "FORM_MESSAGE_PLACEHOLDER" : "Skriv meddelande...", - "FORM_SECONDS" : "Sekunder:" + "ALERT_MENU_NAME": "Larm", + "SENDALERT": "Skicka", + "HIDEALERT": "Göm", + "FORM_TYPE": "Sort:", + "FORM_ALERT": "Larm", + "FORM_NOTIFICATION": "Notifikation", + "FORM_TITLE": "Titel:", + "FORM_TITLE_PLACEHOLDER": "Skriv titel...", + "FORM_MESSAGE": "Meddelande:", + "FORM_MESSAGE_PLACEHOLDER": "Skriv meddelande...", + "FORM_SECONDS": "Sekunder:" } diff --git a/translations/zh-cn.json b/translations/zh-cn.json index 76105d0..44bae32 100644 --- a/translations/zh-cn.json +++ b/translations/zh-cn.json @@ -1,88 +1,87 @@ { - "TITLE": "MagicMirror² Menu 魔镜菜单", - - "EDIT_MENU_NAME": "编辑界面", - "SHUTDOWN_MENU_NAME": "电源", - "CONFIGURE_MENU_NAME": "编辑 config.js", - "VIEW_MIRROR": "MagicMirror²", - - "BACK": "返回", - - "BRIGHTNESS": "亮度", - - "REFRESHMM" : "刷新界面", - "MONITOROFF": "关闭显示器", - "MONITORON": "打开显示器", - "MONITORTIMED": "短暂打开显示器", - "RESTART": "重启", - "RESTARTMM": "重启 MagicMirror²", - "SHUTDOWN": "关闭", - "FULLSCREEN": "切换全屏", - "MINIMIZE": "最小化魔镜", - "DEVTOOLS": "打开开发者工具", - - "SHOWALL": "打开全部", - "HIDEALL": "关闭全部", - - "ADD_MODULE": "添加模块", - "SEARCH": "搜索 …", - "INSTALLED": "安装", - "DOWNLOAD": "下载", - "DOWNLOADING": "下载中 …", - "CODE_LINK": "查看代码", - "BY": "by", - "ADD_THIS": "添加此模块", - "HELP": "帮助", - "MENU": "菜单", - "RESET": "重置", - "NO_HEADER": "(无标题)", - "NO_POSITION": "(隐藏)", - "ADD_ENTRY": "添加配置项", - "NEW_ENTRY_NAME": "(添加配置项字段名)", - "DELETE_ENTRY": "删除", - "UNSAVED_CHANGES": "未保存更新", - "OK": "Ok", - "DISCARD": "放弃更改", - "CANCEL": "取消", - - "NO_MODULES_LOADED": "无模块.", - "SAVE": "保存", - - "EXPERIMENTAL": "这是一个实验特性, 它可能会损坏你的配置文件. 先备份你的配置文件,以防万一!
是否继续?", - "PANIC": "不搞了.", - "NO_RISK_NO_FUN": "就是折腾!", - - "CONFIRM_SHUTDOWN": "即将关机.", - "CONFIRM_RESTART": "即将重启.", - - "LOAD_ERROR": "如果你看到这个消息, 说明加载javascript文件时出错。请转到以下链接,查看浏览器是否存在已知问题:", - "ISSUE_LINK": "Issue链接", - - "DONE": "完成.", - "ERROR": "错误!", - "LOADING": "加载中 …", - - "LOCKSTRING_WARNING": "This module was hidden by LIST_OF_MODULES, it can not be shown.", - "FORCE_SHOW": "继续.", - - "UPDATE_MENU_NAME" : "更新", - "UPDATEMM" : "更新 MagicMirror²", - "UPDATE_AVAILABLE" : "更新可用", - - "ALERT_MENU_NAME" : "通知", - "SENDALERT" : "发送", - "HIDEALERT" : "隐藏", - "FORM_TYPE" : "分类:", - "FORM_ALERT" : "警告", - "FORM_NOTIFICATION" : "通知", - "FORM_TITLE" : "标题:", - "FORM_TITLE_PLACEHOLDER" : "输入标题...", - "FORM_MESSAGE" : "消息:", - "FORM_MESSAGE_PLACEHOLDER" : "输入消息...", - "FORM_SECONDS" : "显示时长(秒):", - - - "RESPONSE_ERROR": "操作失败. 查看 MagicMirror² 日志获取更多信息", - "MODULE_CONTROLS": "模块控制", - "CUSTOM_MENU": "自定义菜单" + "TITLE": "MagicMirror² Menu 魔镜菜单", + + "EDIT_MENU_NAME": "编辑界面", + "SHUTDOWN_MENU_NAME": "电源", + "CONFIGURE_MENU_NAME": "编辑 config.js", + "VIEW_MIRROR": "MagicMirror²", + + "BACK": "返回", + + "BRIGHTNESS": "亮度", + + "REFRESHMM": "刷新界面", + "MONITOROFF": "关闭显示器", + "MONITORON": "打开显示器", + "MONITORTIMED": "短暂打开显示器", + "RESTART": "重启", + "RESTARTMM": "重启 MagicMirror²", + "SHUTDOWN": "关闭", + "FULLSCREEN": "切换全屏", + "MINIMIZE": "最小化魔镜", + "DEVTOOLS": "打开开发者工具", + + "SHOWALL": "打开全部", + "HIDEALL": "关闭全部", + + "ADD_MODULE": "添加模块", + "SEARCH": "搜索 …", + "INSTALLED": "安装", + "DOWNLOAD": "下载", + "DOWNLOADING": "下载中 …", + "CODE_LINK": "查看代码", + "BY": "by", + "ADD_THIS": "添加此模块", + "HELP": "帮助", + "MENU": "菜单", + "RESET": "重置", + "NO_HEADER": "(无标题)", + "NO_POSITION": "(隐藏)", + "ADD_ENTRY": "添加配置项", + "NEW_ENTRY_NAME": "(添加配置项字段名)", + "DELETE_ENTRY": "删除", + "UNSAVED_CHANGES": "未保存更新", + "OK": "Ok", + "DISCARD": "放弃更改", + "CANCEL": "取消", + + "NO_MODULES_LOADED": "无模块.", + "SAVE": "保存", + + "EXPERIMENTAL": "这是一个实验特性, 它可能会损坏你的配置文件. 先备份你的配置文件,以防万一!
是否继续?", + "PANIC": "不搞了.", + "NO_RISK_NO_FUN": "就是折腾!", + + "CONFIRM_SHUTDOWN": "即将关机.", + "CONFIRM_RESTART": "即将重启.", + + "LOAD_ERROR": "如果你看到这个消息, 说明加载javascript文件时出错。请转到以下链接,查看浏览器是否存在已知问题:", + "ISSUE_LINK": "Issue链接", + + "DONE": "完成.", + "ERROR": "错误!", + "LOADING": "加载中 …", + + "LOCKSTRING_WARNING": "This module was hidden by LIST_OF_MODULES, it can not be shown.", + "FORCE_SHOW": "继续.", + + "UPDATE_MENU_NAME": "更新", + "UPDATEMM": "更新 MagicMirror²", + "UPDATE_AVAILABLE": "更新可用", + + "ALERT_MENU_NAME": "通知", + "SENDALERT": "发送", + "HIDEALERT": "隐藏", + "FORM_TYPE": "分类:", + "FORM_ALERT": "警告", + "FORM_NOTIFICATION": "通知", + "FORM_TITLE": "标题:", + "FORM_TITLE_PLACEHOLDER": "输入标题...", + "FORM_MESSAGE": "消息:", + "FORM_MESSAGE_PLACEHOLDER": "输入消息...", + "FORM_SECONDS": "显示时长(秒):", + + "RESPONSE_ERROR": "操作失败. 查看 MagicMirror² 日志获取更多信息", + "MODULE_CONTROLS": "模块控制", + "CUSTOM_MENU": "自定义菜单" }