1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-17 10:16:57 +00:00

3.5.425. Fix whisper button visibility on mod cards. Fix log message colors. Reduce logging when not running a development build. Fix ban notices rendering HTML.

This commit is contained in:
SirStendec 2017-02-03 02:01:18 -05:00
parent b84bd1d4a2
commit 87e7a7fb29
9 changed files with 39 additions and 22 deletions

View file

@ -1534,7 +1534,8 @@ FFZ.prototype._build_mod_card_history = function(msg, modcard, show_from, ts_cli
colored = '';
}
var tokens = this.tokenize_chat_line(msg, true, false, true),
// Use cached tokens on the off chance we have them, but don't count on them.
var tokens = msg.cachedTokens || this.tokenize_chat_line(msg, true, false, true),
message = '<span class="message' + colored + '" style="' + style + (colors ? '" data-color="' + raw_color : '') + '">' +
(msg.style === 'action' && ! show_from ? '*' + name + ' ' : '') + this.render_tokens(tokens, true, false, msg.tags && msg.tags.bits) + '</span>';

View file

@ -1479,11 +1479,11 @@ FFZ.prototype._modify_room = function(room) {
if ( show_notice )
this.addMessage(message);
this.addUserHistory(message);
this.addUserHistory(message, true);
}
},
addUserHistory: function(message) {
addUserHistory: function(message, dont_copy) {
var room_id = this.get('id'),
is_group = this.get('isGroupRoom'),
setting = f.settings.mod_card_history,
@ -1514,6 +1514,9 @@ FFZ.prototype._modify_room = function(room) {
}
};
if ( dont_copy )
cache_object = message;
if ( historical ) {
if ( user_history.length >= 20 )
return;

View file

@ -63,7 +63,8 @@ FFZ.prototype._update_views = function(klasses) {
try {
klasses[i][1].create().destroy()
} catch(err) {
this.log("There was an error creating and destroying an instance of the Ember class \"" + klasses[i][0] + "\" to clear its cache.", err);
if ( constants.DEBUG )
this.log("There was an error creating and destroying an instance of the Ember class \"" + klasses[i][0] + "\" to clear its cache.", err);
}
}

View file

@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
// Version
var VER = FFZ.version_info = {
major: 3, minor: 5, revision: 423,
major: 3, minor: 5, revision: 425,
toString: function() {
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
}
@ -77,15 +77,15 @@ FFZ.prototype.log = function(msg, data, to_json, log_json) {
this._log_data.push(msg + ((!to_json && log_json) ? " -- " + JSON.stringify(data) : ""));
if ( data !== undefined && console.groupCollapsed && console.dir ) {
console.groupCollapsed("%cFFZ:%c " + msg, "color:#755000; font-weight: bold", "color:black; font-weight: normal");
console.groupCollapsed("%cFFZ:%c " + msg, "color:#755000; font-weight: bold", "color:auto; font-weight: normal");
if ( typeof data === "string" || navigator.userAgent.indexOf("Firefox/") !== -1 )
console.log(data);
else
console.dir(data);
console.groupEnd("%cFFZ:%c " + msg, "color:#755000; font-weight: bold", "color:black; font-weight: normal");
console.groupEnd("%cFFZ:%c " + msg, "color:#755000; font-weight: bold", "color:auto; font-weight: normal");
} else
console.log("%cFFZ:%c " + msg, "color:#755000; font-weight: bold", "color:black; font-weight: normal");
console.log("%cFFZ:%c " + msg, "color:#755000; font-weight: bold", "color:auto; font-weight: normal");
}

View file

@ -362,7 +362,7 @@ var is_android = navigator.userAgent.indexOf('Android') !== -1,
if ( e.target.classList.contains('heading') ) {
t.classList.add('collapsed');
if ( collapsed_key )
f[collapsed_key] = true;
f[collapsed_key] = true;
} else
return;

View file

@ -307,7 +307,7 @@ FFZ.prototype.ws_create = function() {
var success = cmd === 'ok',
has_callback = typeof f._ws_callbacks[request] === "function";
if ( ! has_callback )
if ( ! has_callback && (!success || constants.DEBUG) )
f.log("Socket Reply to " + request + " - " + (success ? "SUCCESS" : "FAIL"), data, false, true);
else {