Move balcklist function to hashget
This commit is contained in:
parent
afe26090e5
commit
473c73229d
12
js/main.js
12
js/main.js
|
@ -183,19 +183,10 @@ function EmoteModule() {
|
||||||
}
|
}
|
||||||
|
|
||||||
EmoteModule.prototype.init = function() {
|
EmoteModule.prototype.init = function() {
|
||||||
this.getBlacklist();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
EmoteModule.prototype.getBlacklist = function() {
|
EmoteModule.prototype.getBlacklist = function() {
|
||||||
var self = this;
|
$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/emotefilter.json", function(data) { bemotes = data.blacklist; });
|
||||||
console.log("getting blacklist");
|
|
||||||
if(typeof(_hash) == "undefined") {
|
|
||||||
console.log("hash undefined");
|
|
||||||
setTimeout(self.getBlacklist, 100);
|
|
||||||
} else {
|
|
||||||
console.log("hash: " + _hash);
|
|
||||||
$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/emotefilter.json", function(data) { bemotes = data.blacklist; });
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
EmoteModule.prototype.obsCallback = function(mutation) {
|
EmoteModule.prototype.obsCallback = function(mutation) {
|
||||||
|
@ -727,6 +718,7 @@ Utils.prototype.jqDefer = function(fnc) {
|
||||||
Utils.prototype.getHash = function() {
|
Utils.prototype.getHash = function() {
|
||||||
$.getJSON("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master", function(data) {
|
$.getJSON("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master", function(data) {
|
||||||
_hash = data.sha;
|
_hash = data.sha;
|
||||||
|
emoteModule.getBlaclist();
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue