mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
First round of undef fixes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* MIT Licensed.
|
||||
*/
|
||||
|
||||
|
||||
// Inspired by base2 and Prototype
|
||||
(function () {
|
||||
var initializing = false;
|
||||
|
@@ -6,9 +6,8 @@
|
||||
* By Michael Teeuw https://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
|
||||
var port = 8080;
|
||||
var address = "localhost";
|
||||
var port = 8080;
|
||||
if (typeof(mmPort) !== "undefined") {
|
||||
port = mmPort;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* global vendor, MM, Module */
|
||||
/* global Module, vendor */
|
||||
|
||||
/* Magic Mirror
|
||||
* Module and File loaders.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* global Loader, Module, defaults */
|
||||
/* global Loader, Module, defaults, Translator */
|
||||
|
||||
/* Magic Mirror
|
||||
* Main System
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* exported Module */
|
||||
/* global Class, Loader, MMSocket, nunjucks, Translator */
|
||||
|
||||
/* Magic Mirror
|
||||
* Module Blueprint.
|
||||
@@ -6,7 +6,6 @@
|
||||
* By Michael Teeuw https://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
|
||||
var Module = Class.extend({
|
||||
|
||||
/*********************************************************
|
||||
@@ -237,7 +236,7 @@ var Module = Class.extend({
|
||||
*/
|
||||
socket: function () {
|
||||
if (typeof this._socket === "undefined") {
|
||||
this._socket = this._socket = new MMSocket(this.name);
|
||||
this._socket = new MMSocket(this.name);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
@@ -467,8 +466,8 @@ function cmpVersions(a, b) {
|
||||
Module.register = function (name, moduleDefinition) {
|
||||
|
||||
if (moduleDefinition.requiresVersion) {
|
||||
Log.log("Check MagicMirror version for module '" + name + "' - Minimum version: " + moduleDefinition.requiresVersion + " - Current version: " + version);
|
||||
if (cmpVersions(version, moduleDefinition.requiresVersion) >= 0) {
|
||||
Log.log("Check MagicMirror version for module '" + name + "' - Minimum version: " + moduleDefinition.requiresVersion + " - Current version: " + global.version);
|
||||
if (cmpVersions(global.version, moduleDefinition.requiresVersion) >= 0) {
|
||||
Log.log("Version is ok!");
|
||||
} else {
|
||||
Log.log("Version is incorrect. Skip module: '" + name + "'");
|
||||
|
@@ -4,12 +4,10 @@
|
||||
* By Michael Teeuw https://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
const Class = require("./class.js");
|
||||
const express = require("express");
|
||||
|
||||
var Class = require("./class.js");
|
||||
var express = require("express");
|
||||
var path = require("path");
|
||||
|
||||
NodeHelper = Class.extend({
|
||||
var NodeHelper = Class.extend({
|
||||
init: function() {
|
||||
console.log("Initializing new module helper ...");
|
||||
},
|
||||
@@ -114,7 +112,6 @@ NodeHelper = Class.extend({
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -122,4 +119,5 @@ NodeHelper.create = function(moduleDefinition) {
|
||||
return NodeHelper.extend(moduleDefinition);
|
||||
};
|
||||
|
||||
module.exports = NodeHelper;
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {module.exports = NodeHelper;}
|
||||
|
@@ -71,7 +71,7 @@ var Server = function(config, callback) {
|
||||
var html = fs.readFileSync(path.resolve(global.root_path + "/index.html"), {encoding: "utf8"});
|
||||
html = html.replace("#VERSION#", global.version);
|
||||
|
||||
configFile = "config/config.js";
|
||||
var configFile = "config/config.js";
|
||||
if (typeof(global.configuration_file) !== "undefined") {
|
||||
configFile = global.configuration_file;
|
||||
}
|
||||
|
@@ -1,10 +1,11 @@
|
||||
/* global io */
|
||||
|
||||
/* Magic Mirror
|
||||
* Socket Connection
|
||||
*
|
||||
* By Michael Teeuw https://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
|
||||
var MMSocket = function(moduleName) {
|
||||
|
||||
var self = this;
|
||||
|
@@ -1,3 +1,11 @@
|
||||
/* global io */
|
||||
|
||||
/* Magic Mirror
|
||||
* TODO add description
|
||||
*
|
||||
* By Michael Teeuw https://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
var MMSocket = function(moduleName) {
|
||||
var self = this;
|
||||
|
||||
|
Reference in New Issue
Block a user