mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
- Converted indentation to tabs.
This commit is contained in:
parent
5ca3fbeaea
commit
1a97107b2d
@ -2,28 +2,28 @@ var http = require("http");
|
||||
var NodeHelper = require("node_helper");
|
||||
|
||||
module.exports = NodeHelper.create({
|
||||
start: function () {
|
||||
},
|
||||
start: function () {
|
||||
},
|
||||
|
||||
socketNotificationReceived: function (notification, payload) {
|
||||
var self = this;
|
||||
socketNotificationReceived: function (notification, payload) {
|
||||
var self = this;
|
||||
|
||||
if (notification === "AUTO_LOCATION") {
|
||||
console.log("Loading timezone...");
|
||||
http.get("http://ip-api.com/json", function (req) {
|
||||
var data = "";
|
||||
req.on("data", function (d) {
|
||||
data += d;
|
||||
});
|
||||
req.on("end", function () {
|
||||
var body = JSON.parse(data);
|
||||
payload.location = body.city + ", " + body.regionName;
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
}).on("error", function () {
|
||||
payload.error = "Could not figure out the timezone.";
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
console.log("Loading timezone...");
|
||||
http.get("http://ip-api.com/json", function (req) {
|
||||
var data = "";
|
||||
req.on("data", function (d) {
|
||||
data += d;
|
||||
});
|
||||
req.on("end", function () {
|
||||
var body = JSON.parse(data);
|
||||
payload.location = body.city + ", " + body.regionName;
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
}).on("error", function () {
|
||||
payload.error = "Could not figure out the timezone.";
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -2,28 +2,28 @@ var http = require("http");
|
||||
var NodeHelper = require("node_helper");
|
||||
|
||||
module.exports = NodeHelper.create({
|
||||
start: function () {
|
||||
},
|
||||
start: function () {
|
||||
},
|
||||
|
||||
socketNotificationReceived: function (notification, payload) {
|
||||
var self = this;
|
||||
socketNotificationReceived: function (notification, payload) {
|
||||
var self = this;
|
||||
|
||||
if (notification === "AUTO_LOCATION") {
|
||||
console.log("Loading timezone...");
|
||||
http.get("http://ip-api.com/json", function (req) {
|
||||
var data = "";
|
||||
req.on("data", function (d) {
|
||||
data += d;
|
||||
});
|
||||
req.on("end", function () {
|
||||
var body = JSON.parse(data);
|
||||
payload.location = body.city + ", " + body.regionName;
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
}).on("error", function () {
|
||||
payload.error = "Could not figure out the timezone.";
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
console.log("Loading timezone...");
|
||||
http.get("http://ip-api.com/json", function (req) {
|
||||
var data = "";
|
||||
req.on("data", function (d) {
|
||||
data += d;
|
||||
});
|
||||
req.on("end", function () {
|
||||
var body = JSON.parse(data);
|
||||
payload.location = body.city + ", " + body.regionName;
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
}).on("error", function () {
|
||||
payload.error = "Could not figure out the timezone.";
|
||||
self.sendSocketNotification("UPDATE_LOCATION", payload);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user