Merge branch 'develop' into no_undef

This commit is contained in:
Veeck 2020-05-05 14:20:24 +02:00
commit 5386ca1592

View File

@ -1,34 +0,0 @@
/* global io */
/* Magic Mirror
* Socket Connection
*
* By Michael Teeuw https://michaelteeuw.nl
* MIT Licensed.
*/
var MMSocket = function(moduleName) {
var self = this;
if (typeof moduleName !== "string") {
throw new Error("Please set the module name for the MMSocket.");
}
self.moduleName = moduleName;
self.socket = io("http://localhost:8080");
self.socket.on("notification", function(data) {
MM.sendNotification(data.notification, data.payload, Socket);
});
return {
sendMessage: function(notification, payload, sender) {
Log.log("Send socket message: " + notification);
self.socket.emit("notification", {
notification: notification,
sender: sender,
payload: payload
});
}
};
};