1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-18 03:50:54 +00:00

3.5.37 to 3.5.40. Added Twitch emote mirror. Fixed emote sorting in My Emoticons. Fixed failure to leave chat rooms. Added /ffz reload chat command. Fixed Stream Latency again. Added new API methods. Made settings.get try to load unloaded settings.

This commit is contained in:
SirStendec 2015-10-27 14:25:13 -04:00
parent d934508b04
commit acc0010247
15 changed files with 295 additions and 73 deletions

View file

@ -430,38 +430,38 @@ FFZ.prototype._legacy_add_donors = function() {
this._legacy_load_donors();
}
FFZ.prototype._legacy_load_bots = function(tries) {
FFZ.prototype._legacy_load_bots = function(callback, tries) {
jQuery.ajax(constants.SERVER + "script/bots.txt", {context: this})
.done(function(data) {
this._legacy_parse_badges(data, 0, 2, "Bot (By: {})");
this._legacy_parse_badges(callback, data, 0, 2, "Bot (By: {})");
}).fail(function(data) {
if ( data.status == 404 )
return;
return typeof callback === "function" && callback(false, 0);
tries = (tries || 0) + 1;
if ( tries < 10 )
this._legacy_load_bots(tries);
this._legacy_load_bots(callback, tries);
});
}
FFZ.prototype._legacy_load_donors = function(tries) {
FFZ.prototype._legacy_load_donors = function(callback, tries) {
jQuery.ajax(constants.SERVER + "script/donors.txt", {context: this})
.done(function(data) {
this._legacy_parse_badges(data, 1, 1);
this._legacy_parse_badges(callback, data, 1, 1);
}).fail(function(data) {
if ( data.status == 404 )
return;
return typeof callback === "function" && callback(false, 0);
tries = (tries || 0) + 1;
if ( tries < 10 )
return this._legacy_load_donors(tries);
return this._legacy_load_donors(callback, tries);
});
}
FFZ.prototype._legacy_parse_badges = function(data, slot, badge_id, title_template) {
FFZ.prototype._legacy_parse_badges = function(callback, data, slot, badge_id, title_template) {
var title = this.badges[badge_id].title,
count = 0;
ds = null;
@ -491,4 +491,8 @@ FFZ.prototype._legacy_parse_badges = function(data, slot, badge_id, title_templa
}
this.log('Added "' + title + '" badge to ' + utils.number_commas(count) + " users.");
if ( callback )
callback(true, count);
return count;
}