mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 17:44:52 -04:00
Run prettier over ALL files once
No other changes done in this commit
This commit is contained in:
parent
3a5a29efc0
commit
abb5dc5739
160 changed files with 2369 additions and 2210 deletions
|
@ -6,7 +6,7 @@
|
|||
* By Michael Teeuw https://michaelteeuw.nl
|
||||
* MIT Licensed.
|
||||
*/
|
||||
var MMSocket = function(moduleName) {
|
||||
var MMSocket = function (moduleName) {
|
||||
var self = this;
|
||||
|
||||
if (typeof moduleName !== "string") {
|
||||
|
@ -17,16 +17,16 @@ var MMSocket = function(moduleName) {
|
|||
|
||||
// Private Methods
|
||||
var base = "/";
|
||||
if ((typeof config !== "undefined") && (typeof config.basePath !== "undefined")) {
|
||||
if (typeof config !== "undefined" && typeof config.basePath !== "undefined") {
|
||||
base = config.basePath;
|
||||
}
|
||||
self.socket = io("/" + self.moduleName, {
|
||||
path: base + "socket.io"
|
||||
});
|
||||
var notificationCallback = function() {};
|
||||
var notificationCallback = function () {};
|
||||
|
||||
var onevent = self.socket.onevent;
|
||||
self.socket.onevent = function(packet) {
|
||||
self.socket.onevent = function (packet) {
|
||||
var args = packet.data || [];
|
||||
onevent.call(this, packet); // original call
|
||||
packet.data = ["*"].concat(args);
|
||||
|
@ -34,18 +34,18 @@ var MMSocket = function(moduleName) {
|
|||
};
|
||||
|
||||
// register catch all.
|
||||
self.socket.on("*", function(notification, payload) {
|
||||
self.socket.on("*", function (notification, payload) {
|
||||
if (notification !== "*") {
|
||||
notificationCallback(notification, payload);
|
||||
}
|
||||
});
|
||||
|
||||
// Public Methods
|
||||
this.setNotificationCallback = function(callback) {
|
||||
this.setNotificationCallback = function (callback) {
|
||||
notificationCallback = callback;
|
||||
};
|
||||
|
||||
this.sendNotification = function(notification, payload) {
|
||||
this.sendNotification = function (notification, payload) {
|
||||
if (typeof payload === "undefined") {
|
||||
payload = {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue