Run prettier over ALL files once

No other changes done in this commit
This commit is contained in:
Veeck
2020-05-11 22:22:32 +02:00
parent 3a5a29efc0
commit abb5dc5739
160 changed files with 2369 additions and 2210 deletions

View File

@@ -8,16 +8,16 @@ const Class = require("./class.js");
const express = require("express");
var NodeHelper = Class.extend({
init: function() {
init: function () {
console.log("Initializing new module helper ...");
},
loaded: function(callback) {
loaded: function (callback) {
console.log("Module helper loaded: " + this.name);
callback();
},
start: function() {
start: function () {
console.log("Starting module helper: " + this.name);
},
@@ -27,7 +27,7 @@ var NodeHelper = Class.extend({
* gracefully exit the module.
*
*/
stop: function() {
stop: function () {
console.log("Stopping module helper: " + this.name);
},
@@ -37,7 +37,7 @@ var NodeHelper = Class.extend({
* argument notification string - The identifier of the notification.
* argument payload mixed - The payload of the notification.
*/
socketNotificationReceived: function(notification, payload) {
socketNotificationReceived: function (notification, payload) {
console.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload);
},
@@ -46,7 +46,7 @@ var NodeHelper = Class.extend({
*
* argument name string - Module name.
*/
setName: function(name) {
setName: function (name) {
this.name = name;
},
@@ -55,7 +55,7 @@ var NodeHelper = Class.extend({
*
* argument path string - Module path.
*/
setPath: function(path) {
setPath: function (path) {
this.path = path;
},
@@ -65,7 +65,7 @@ var NodeHelper = Class.extend({
* argument notification string - The identifier of the notification.
* argument payload mixed - The payload of the notification.
*/
sendSocketNotification: function(notification, payload) {
sendSocketNotification: function (notification, payload) {
this.io.of(this.name).emit(notification, payload);
},
@@ -75,7 +75,7 @@ var NodeHelper = Class.extend({
*
* argument app Express app - The Express app object.
*/
setExpressApp: function(app) {
setExpressApp: function (app) {
this.expressApp = app;
var publicPath = this.path + "/public";
@@ -88,16 +88,16 @@ var NodeHelper = Class.extend({
*
* argument io Socket.io - The Socket io object.
*/
setSocketIO: function(io) {
setSocketIO: function (io) {
var self = this;
self.io = io;
console.log("Connecting socket for: " + this.name);
var namespace = this.name;
io.of(namespace).on("connection", function(socket) {
io.of(namespace).on("connection", function (socket) {
// add a catch all event.
var onevent = socket.onevent;
socket.onevent = function(packet) {
socket.onevent = function (packet) {
var args = packet.data || [];
onevent.call(this, packet); // original call
packet.data = ["*"].concat(args);
@@ -105,7 +105,7 @@ var NodeHelper = Class.extend({
};
// register catch all.
socket.on("*", function(notification, payload) {
socket.on("*", function (notification, payload) {
if (notification !== "*") {
//console.log('received message in namespace: ' + namespace);
self.socketNotificationReceived(notification, payload);
@@ -115,9 +115,11 @@ var NodeHelper = Class.extend({
}
});
NodeHelper.create = function(moduleDefinition) {
NodeHelper.create = function (moduleDefinition) {
return NodeHelper.extend(moduleDefinition);
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = NodeHelper;}
if (typeof module !== "undefined") {
module.exports = NodeHelper;
}