declare goodies in window
This commit is contained in:
parent
9e797b3245
commit
2e68b71831
18
plugin.js
18
plugin.js
|
@ -18,24 +18,24 @@ function __epprint(str) {
|
||||||
console.log(`%c[EndPwn]%c ` + str, 'font-weight:bold;color:#0cc', '');
|
console.log(`%c[EndPwn]%c ` + str, 'font-weight:bold;color:#0cc', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// define this with a default value as a fallback
|
|
||||||
var __goodies = {
|
|
||||||
guilds: [],
|
|
||||||
devs: [],
|
|
||||||
bots: [],
|
|
||||||
users: {}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports = {
|
exports = {
|
||||||
|
|
||||||
preload: function () {
|
preload: function () {
|
||||||
|
|
||||||
|
// define this with a default value as a fallback
|
||||||
|
window.__goodies = {
|
||||||
|
guilds: [],
|
||||||
|
devs: [],
|
||||||
|
bots: [],
|
||||||
|
users: {}
|
||||||
|
};
|
||||||
|
|
||||||
function fetchGoodies() {
|
function fetchGoodies() {
|
||||||
// fetch goodies.json
|
// fetch goodies.json
|
||||||
__epprint('fetching endpwn cutomizer data from server...');
|
__epprint('fetching endpwn cutomizer data from server...');
|
||||||
fetch('https://endpwn.cathoderay.tube/goodies.json?_=' + Date.now())
|
fetch('https://endpwn.cathoderay.tube/goodies.json?_=' + Date.now())
|
||||||
.then(x => x.json())
|
.then(x => x.json())
|
||||||
.then(r => __goodies = r);
|
.then(r => window.__goodies = r);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch goodies now and every half hour
|
// Fetch goodies now and every half hour
|
||||||
|
|
Loading…
Reference in New Issue