mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Fix lots of warnings
This commit is contained in:
parent
941d5d7cd9
commit
d08bd4e866
@ -12,5 +12,9 @@
|
||||
"ecmaFeatures": {
|
||||
"globalReturn": true
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-undef": "off",
|
||||
"no-unused-vars": "off"
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,8 @@
|
||||
initializing = false;
|
||||
|
||||
// Make a copy of all prototype properties, to prevent reference issues.
|
||||
for (var name in prototype) {
|
||||
prototype[name] = cloneObject(prototype[name]);
|
||||
for (var p in prototype) {
|
||||
prototype[p] = cloneObject(prototype[p]);
|
||||
}
|
||||
|
||||
// Copy the properties over onto the new prototype
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* exported defaults */
|
||||
|
||||
/* Magic Mirror
|
||||
* Config Defauls
|
||||
* Config Defaults
|
||||
*
|
||||
* By Michael Teeuw http://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global console */
|
||||
/* exported Log */
|
||||
|
||||
/* Magic Mirror
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* global Log, Class, Loader, Class , MM */
|
||||
/* exported Module */
|
||||
|
||||
/* Magic Mirror
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* exported Translator */
|
||||
|
||||
/* Magic Mirror
|
||||
* Translator (l10n)
|
||||
*
|
||||
@ -129,10 +130,10 @@ var Translator = (function() {
|
||||
if(Object.prototype.toString.call(template) !== "[object String]") {
|
||||
return template;
|
||||
}
|
||||
if(variables.fallback && !template.match(new RegExp("\{.+\}"))) {
|
||||
if(variables.fallback && !template.match(new RegExp("{.+}"))) {
|
||||
template = variables.fallback;
|
||||
}
|
||||
return template.replace(new RegExp("\{([^\}]+)\}", "g"), function(_unused, varName){
|
||||
return template.replace(new RegExp("{([^}]+)}", "g"), function(_unused, varName){
|
||||
return variables[varName] || "{"+varName+"}";
|
||||
});
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* exported Utils */
|
||||
|
||||
/* Magic Mirror
|
||||
* Utils
|
||||
*
|
||||
|
@ -254,6 +254,8 @@ Module.register("calendar", {
|
||||
titleWrapper.className = "title " + titleClass;
|
||||
}
|
||||
|
||||
var timeWrapper;
|
||||
|
||||
if(this.config.timeFormat === "dateheaders"){
|
||||
|
||||
if (event.fullDayEvent) {
|
||||
@ -261,10 +263,8 @@ Module.register("calendar", {
|
||||
titleWrapper.align = "left";
|
||||
|
||||
} else {
|
||||
|
||||
var timeClass = this.timeClassForUrl(event.url);
|
||||
var timeWrapper = document.createElement("td");
|
||||
timeWrapper.className = "time light " + timeClass;
|
||||
timeWrapper = document.createElement("td");
|
||||
timeWrapper.className = "time light " + this.timeClassForUrl(event.url);
|
||||
timeWrapper.align = "left";
|
||||
timeWrapper.style.paddingLeft = "2px";
|
||||
timeWrapper.innerHTML = moment(event.startDate, "x").format("LT");
|
||||
@ -274,7 +274,7 @@ Module.register("calendar", {
|
||||
|
||||
eventWrapper.appendChild(titleWrapper);
|
||||
} else {
|
||||
var timeWrapper = document.createElement("td");
|
||||
timeWrapper = document.createElement("td");
|
||||
|
||||
eventWrapper.appendChild(titleWrapper);
|
||||
//console.log(event.today);
|
||||
@ -370,8 +370,7 @@ Module.register("calendar", {
|
||||
}
|
||||
//timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll');
|
||||
//console.log(event);
|
||||
var timeClass = this.timeClassForUrl(event.url);
|
||||
timeWrapper.className = "time light " + timeClass;
|
||||
timeWrapper.className = "time light " + this.timeClassForUrl(event.url);
|
||||
eventWrapper.appendChild(timeWrapper);
|
||||
}
|
||||
|
||||
@ -424,15 +423,12 @@ Module.register("calendar", {
|
||||
switch (timeFormat) {
|
||||
case 12: {
|
||||
return { longDateFormat: {LT: "h:mm A"} };
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
return { longDateFormat: {LT: "HH:mm"} };
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return { longDateFormat: {LT: moment.localeData().longDateFormat("LT")} };
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -202,7 +202,6 @@ Module.register("clock",{
|
||||
// If it isn't 'digital', then an 'analog' clock was also requested
|
||||
|
||||
// Calculate the degree offset for each hand of the clock
|
||||
var now = moment();
|
||||
if (this.config.timezone) {
|
||||
now.tz(this.config.timezone);
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ Module.register("currentweather",{
|
||||
showWindDirection: true,
|
||||
showWindDirectionAsArrow: false,
|
||||
useBeaufort: true,
|
||||
appendLocationNameToHeader: false,
|
||||
useKMPHwind: false,
|
||||
lang: config.language,
|
||||
decimalSymbol: ".",
|
||||
@ -150,15 +149,15 @@ Module.register("currentweather",{
|
||||
var humidity = document.createElement("span");
|
||||
humidity.innerHTML = this.humidity;
|
||||
|
||||
var spacer = document.createElement("sup");
|
||||
spacer.innerHTML = " ";
|
||||
var supspacer = document.createElement("sup");
|
||||
supspacer.innerHTML = " ";
|
||||
|
||||
var humidityIcon = document.createElement("sup");
|
||||
humidityIcon.className = "wi wi-humidity humidityIcon";
|
||||
humidityIcon.innerHTML = " ";
|
||||
|
||||
small.appendChild(humidity);
|
||||
small.appendChild(spacer);
|
||||
small.appendChild(supspacer);
|
||||
small.appendChild(humidityIcon);
|
||||
}
|
||||
|
||||
@ -414,8 +413,7 @@ Module.register("currentweather",{
|
||||
case "imperial": tempInF = this.temperature;
|
||||
break;
|
||||
case "default":
|
||||
var tc = this.temperature - 273.15;
|
||||
tempInF = 1.8 * tc + 32;
|
||||
tempInF = 1.8 * (this.temperature - 273.15) + 32;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -431,8 +429,7 @@ Module.register("currentweather",{
|
||||
case "imperial": this.feelsLike = windChillInF.toFixed(0);
|
||||
break;
|
||||
case "default":
|
||||
var tc = windChillInC + 273.15;
|
||||
this.feelsLike = tc.toFixed(0);
|
||||
this.feelsLike = (windChillInC + 273.15).toFixed(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -367,8 +367,8 @@ Module.register("newsfeed",{
|
||||
},
|
||||
|
||||
notificationReceived: function(notification, payload, sender) {
|
||||
if(notification === "ARTICLE_NEXT"){
|
||||
var before = this.activeItem;
|
||||
if(notification === "ARTICLE_NEXT"){
|
||||
this.activeItem++;
|
||||
if (this.activeItem >= this.newsItems.length) {
|
||||
this.activeItem = 0;
|
||||
@ -377,7 +377,6 @@ Module.register("newsfeed",{
|
||||
Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")");
|
||||
this.updateDom(100);
|
||||
} else if(notification === "ARTICLE_PREVIOUS"){
|
||||
var before = this.activeItem;
|
||||
this.activeItem--;
|
||||
if (this.activeItem < 0) {
|
||||
this.activeItem = this.newsItems.length - 1;
|
||||
|
@ -10,7 +10,6 @@
|
||||
Module.register("weather",{
|
||||
// Default module config.
|
||||
defaults: {
|
||||
updateInterval: 10 * 60 * 1000,
|
||||
weatherProvider: "openweathermap",
|
||||
roundTemp: false,
|
||||
type: "current", //current, forecast
|
||||
|
@ -348,7 +348,7 @@ Module.register("weatherforecast",{
|
||||
}
|
||||
|
||||
if (day !== lastDay) {
|
||||
var forecastData = {
|
||||
forecastData = {
|
||||
day: day,
|
||||
icon: this.config.iconTable[forecast.weather[0].icon],
|
||||
maxTemp: this.roundValue(forecast.temp.max),
|
||||
|
Loading…
x
Reference in New Issue
Block a user