mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge branch 'develop' of github.com:javiersigler/MagicMirror into task/improve_dockerfile
This commit is contained in:
commit
bb8c0f1d9c
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [2.1.2] - Unreleased
|
||||
|
||||
### Changed
|
||||
|
||||
### Added
|
||||
- Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option.
|
||||
|
||||
### Updated
|
||||
- Added missing keys to Polish translation.
|
||||
- Added missing key to German translation.
|
||||
|
||||
## [2.1.1] - 2017-04-01
|
||||
|
||||
|
51
Gruntfile.js
51
Gruntfile.js
@ -6,12 +6,20 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
configFile: ".eslintrc.json"
|
||||
},
|
||||
target: ["js/*.js", "modules/default/*.js", "modules/default/*/*.js",
|
||||
"serveronly/*.js", "*.js", "tests/*/*.js", "!modules/default/alert/notificationFx.js",
|
||||
"!modules/default/alert/modernizr.custom.js", "!modules/default/alert/classie.js",
|
||||
target: [
|
||||
"js/*.js",
|
||||
"modules/default/*.js",
|
||||
"modules/default/*/*.js",
|
||||
"serveronly/*.js",
|
||||
"*.js",
|
||||
"tests/**/*.js",
|
||||
"!modules/default/alert/notificationFx.js",
|
||||
"!modules/default/alert/modernizr.custom.js",
|
||||
"!modules/default/alert/classie.js",
|
||||
"config/*",
|
||||
"translations/translations.js", "vendor/vendor.js"
|
||||
|
||||
"translations/translations.js",
|
||||
"vendor/vendor.js",
|
||||
"modules/node_modules/node_helper/index.js"
|
||||
]
|
||||
},
|
||||
stylelint: {
|
||||
@ -19,14 +27,26 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
configFile: ".stylelintrc"
|
||||
},
|
||||
src: ["css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"]
|
||||
src: [
|
||||
"css/main.css",
|
||||
"modules/default/calendar/calendar.css",
|
||||
"modules/default/clock/clock_styles.css",
|
||||
"modules/default/currentweather/currentweather.css",
|
||||
"modules/default/weatherforcast/weatherforcast.css"
|
||||
]
|
||||
}
|
||||
},
|
||||
jsonlint: {
|
||||
main: {
|
||||
src: ["package.json", ".eslintrc.json", ".stylelintrc", "translations/*.json",
|
||||
"modules/default/*/translations/*.json", "installers/pm2_MagicMirror.json",
|
||||
"vendor/package.js"],
|
||||
src: [
|
||||
"package.json",
|
||||
".eslintrc.json",
|
||||
".stylelintrc",
|
||||
"translations/*.json",
|
||||
"modules/default/*/translations/*.json",
|
||||
"installers/pm2_MagicMirror.json",
|
||||
"vendor/package.js"
|
||||
],
|
||||
options: {
|
||||
reporter: "jshint"
|
||||
}
|
||||
@ -58,11 +78,20 @@ module.exports = function(grunt) {
|
||||
"MD038": false
|
||||
}
|
||||
},
|
||||
src: ["README.md", "CHANGELOG.md", "LICENSE.md", "modules/README.md", "modules/default/**/*.md", "!modules/default/calendar/vendor/ical.js/readme.md"]
|
||||
src: [
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.md",
|
||||
"modules/README.md",
|
||||
"modules/default/**/*.md",
|
||||
"!modules/default/calendar/vendor/ical.js/readme.md"
|
||||
]
|
||||
}
|
||||
},
|
||||
yamllint: {
|
||||
all: [".travis.yml"]
|
||||
all: [
|
||||
".travis.yml"
|
||||
]
|
||||
}
|
||||
});
|
||||
grunt.loadNpmTasks("grunt-eslint");
|
||||
|
@ -6,7 +6,11 @@
|
||||
|
||||
var config = {
|
||||
port: 8080,
|
||||
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses.
|
||||
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
|
||||
// or add a specific IPv4 of 192.168.1.5 :
|
||||
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
|
||||
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
|
||||
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
|
||||
|
||||
language: "en",
|
||||
timeFormat: 24,
|
||||
|
@ -65,7 +65,7 @@ if command_exists node; then
|
||||
fi
|
||||
|
||||
else
|
||||
echo -e "\e[92mNo Node.js upgrade nessecery.\e[0m"
|
||||
echo -e "\e[92mNo Node.js upgrade necessary.\e[0m"
|
||||
fi
|
||||
|
||||
else
|
||||
|
@ -31,6 +31,7 @@ The following properties can be configured:
|
||||
| `displaySymbol` | Display a symbol in front of an entry. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||
| `defaultSymbol` | The default symbol. <br><br> **Possible values:** See [Font Awsome](http://fontawesome.io/icons/) website. <br> **Default value:** `calendar`
|
||||
| `maxTitleLength` | The maximum title length. <br><br> **Possible values:** `10` - `50` <br> **Default value:** `25`
|
||||
| `wrapEvents` | Wrap event titles to multiple lines. Breaks lines at the length defined by `maxTitleLength`. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||
| `fetchInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `300000` (5 minutes)
|
||||
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `2000` (2 seconds)
|
||||
| `fade` | Fade the future events to black. (Gradient) <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||
|
@ -2,6 +2,7 @@
|
||||
padding-left: 0;
|
||||
padding-right: 10px;
|
||||
font-size: 80%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.calendar .symbol span {
|
||||
@ -19,4 +20,5 @@
|
||||
.calendar .time {
|
||||
padding-left: 30px;
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ Module.register("calendar", {
|
||||
displayRepeatingCountTitle: false,
|
||||
defaultRepeatingCountTitle: "",
|
||||
maxTitleLength: 25,
|
||||
wrapEvents: false, // wrap events to multiple lines breaking at maxTitleLength
|
||||
fetchInterval: 5 * 60 * 1000, // Update every 5 minutes.
|
||||
animationSpeed: 2000,
|
||||
fade: true,
|
||||
@ -414,15 +415,38 @@ Module.register("calendar", {
|
||||
*
|
||||
* argument string string - The string to shorten.
|
||||
* argument maxLength number - The max length of the string.
|
||||
* argument wrapEvents - Wrap the text after the line has reached maxLength
|
||||
*
|
||||
* return string - The shortened string.
|
||||
*/
|
||||
shorten: function (string, maxLength) {
|
||||
if (string.length > maxLength) {
|
||||
return string.slice(0, maxLength) + "…";
|
||||
}
|
||||
shorten: function (string, maxLength, wrapEvents) {
|
||||
if (wrapEvents) {
|
||||
var temp = "";
|
||||
var currentLine = "";
|
||||
var words = string.split(" ");
|
||||
|
||||
return string;
|
||||
for (var i = 0; i < words.length; i++) {
|
||||
var word = words[i];
|
||||
if (currentLine.length + word.length < 25 - 1) { // max - 1 to account for a space
|
||||
currentLine += (word + " ");
|
||||
} else {
|
||||
if (currentLine.length > 0) {
|
||||
temp += (currentLine + "<br>" + word + " ");
|
||||
} else {
|
||||
temp += (word + "<br>");
|
||||
}
|
||||
currentLine = "";
|
||||
}
|
||||
}
|
||||
|
||||
return temp + currentLine;
|
||||
} else {
|
||||
if (string.length > maxLength) {
|
||||
return string.slice(0, maxLength) + "…";
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* capFirst(string)
|
||||
@ -437,7 +461,7 @@ Module.register("calendar", {
|
||||
/* titleTransform(title)
|
||||
* Transforms the title of an event for usage.
|
||||
* Replaces parts of the text as defined in config.titleReplace.
|
||||
* Shortens title based on config.maxTitleLength
|
||||
* Shortens title based on config.maxTitleLength and config.wrapEvents
|
||||
*
|
||||
* argument title string - The title to transform.
|
||||
*
|
||||
@ -456,7 +480,7 @@ Module.register("calendar", {
|
||||
title = title.replace(needle, replacement);
|
||||
}
|
||||
|
||||
title = this.shorten(title, this.config.maxTitleLength);
|
||||
title = this.shorten(title, this.config.maxTitleLength, this.config.wrapEvents);
|
||||
return title;
|
||||
},
|
||||
|
||||
|
11
modules/node_modules/node_helper/index.js
generated
vendored
11
modules/node_modules/node_helper/index.js
generated
vendored
@ -20,7 +20,7 @@ NodeHelper = Class.extend({
|
||||
},
|
||||
|
||||
start: function() {
|
||||
console.log("Staring module helper: " + this.name);
|
||||
console.log("Starting module helper: " + this.name);
|
||||
},
|
||||
|
||||
/* socketNotificationReceived(notification, payload)
|
||||
@ -45,7 +45,7 @@ NodeHelper = Class.extend({
|
||||
/* setPath(path)
|
||||
* Set the module path.
|
||||
*
|
||||
* argument name string - Module name.
|
||||
* argument path string - Module path.
|
||||
*/
|
||||
setPath: function(path) {
|
||||
this.path = path;
|
||||
@ -98,9 +98,10 @@ NodeHelper = Class.extend({
|
||||
|
||||
// register catch all.
|
||||
socket.on("*", function(notification, payload) {
|
||||
if (notification !== "*")
|
||||
//console.log('received message in namespace: ' + namespace);
|
||||
self.socketNotificationReceived(notification, payload);
|
||||
if (notification !== "*") {
|
||||
//console.log('received message in namespace: ' + namespace);
|
||||
self.socketNotificationReceived(notification, payload);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "magicmirror",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2-dev",
|
||||
"description": "The open source modular smart mirror platform.",
|
||||
"main": "js/electron.js",
|
||||
"scripts": {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Magic Mirror Test config for default compliments
|
||||
/* Magic Mirror Test config for default compliments
|
||||
*
|
||||
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
|
||||
* MIT Licensed.
|
||||
|
@ -24,8 +24,8 @@ var config = {
|
||||
// Using exotic content. This is why dont accept go to JSON configuration file
|
||||
(function() {
|
||||
var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third",
|
||||
"middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right",
|
||||
"bottom_bar", "fullscreen_above", "fullscreen_below"];
|
||||
"middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right",
|
||||
"bottom_bar", "fullscreen_above", "fullscreen_below"];
|
||||
var modules = Array();
|
||||
for (idx in positions) {
|
||||
modules.push({
|
||||
|
@ -63,8 +63,8 @@ describe("'global.root_path' set in js/app.js", function() {
|
||||
});
|
||||
|
||||
it("should expect the global.version equals package.json file", function() {
|
||||
version_package = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
|
||||
expect(this.sandbox.global.version).to.equal(version_package);
|
||||
versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
|
||||
expect(this.sandbox.global.version).to.equal(versionPackage);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -7,6 +7,8 @@
|
||||
"RUNNING": "noch",
|
||||
"EMPTY": "Keine Termine.",
|
||||
|
||||
"WEEK": "Woche",
|
||||
|
||||
"N": "N",
|
||||
"NNE": "NNO",
|
||||
"NE": "NO",
|
||||
|
@ -3,9 +3,12 @@
|
||||
|
||||
"TODAY": "Dziś",
|
||||
"TOMORROW": "Jutro",
|
||||
"DAYAFTERTOMORROW": "Pojutrze",
|
||||
"RUNNING": "Koniec za",
|
||||
"EMPTY": "Brak wydarzeń.",
|
||||
|
||||
"WEEK": "Tydzień",
|
||||
|
||||
"N": "N",
|
||||
"NNE": "NNE",
|
||||
"NE": "NE",
|
||||
|
Loading…
x
Reference in New Issue
Block a user