mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 20:49:54 +00:00
update: spaces -> tabs
This commit is contained in:
parent
205de7233e
commit
a35e8f3315
@ -40,7 +40,7 @@ Module.register("compliments", {
|
|||||||
afternoonEndTime: 17,
|
afternoonEndTime: 17,
|
||||||
random: true,
|
random: true,
|
||||||
mockDate: null,
|
mockDate: null,
|
||||||
advice: false
|
advice: false
|
||||||
},
|
},
|
||||||
lastIndexUsed:-1,
|
lastIndexUsed:-1,
|
||||||
// Set currentweather from module
|
// Set currentweather from module
|
||||||
@ -64,18 +64,18 @@ Module.register("compliments", {
|
|||||||
self.updateDom();
|
self.updateDom();
|
||||||
});
|
});
|
||||||
} else if (this.config.advice) {
|
} else if (this.config.advice) {
|
||||||
var xobj = new XMLHttpRequest();
|
var xobj = new XMLHttpRequest();
|
||||||
xobj.overrideMimeType("application/json");
|
xobj.overrideMimeType("application/json");
|
||||||
xobj.open("GET", "https://api.adviceslip.com/advice", true);
|
xobj.open("GET", "https://api.adviceslip.com/advice", true);
|
||||||
xobj.onreadystatechange = function() {
|
xobj.onreadystatechange = function() {
|
||||||
if (xobj.readyState === 4 && xobj.status === 200) {
|
if (xobj.readyState === 4 && xobj.status === 200) {
|
||||||
const adviceResp = JSON.parse(xobj.responseText);
|
const adviceResp = JSON.parse(xobj.responseText);
|
||||||
self.config.compliments = adviceResp.slip.advice
|
self.config.compliments = adviceResp.slip.advice
|
||||||
self.updateDom();
|
self.updateDom();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xobj.send(null);
|
xobj.send(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Schedule update timer.
|
// Schedule update timer.
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user