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

3.5.357. Fix chat replay darkening. Tab-completion bugfixes for emotes without prefixes. Split changelog into two files to avoid a big download when fetching just the recent changes.

This commit is contained in:
SirStendec 2016-10-27 21:50:56 -04:00
parent 142da87383
commit 0784813047
7 changed files with 2246 additions and 2212 deletions

File diff suppressed because it is too large Load diff

2175
old_changes.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -740,7 +740,8 @@ FFZ.prototype.modify_chat_input = function(component) {
ffz_emoticons: function() { ffz_emoticons: function() {
var emotes = {}, var emotes = [],
used_ids = [],
in_conversation = ConvoInput && this.parentView instanceof ConvoInput, in_conversation = ConvoInput && this.parentView instanceof ConvoInput,
room = ! in_conversation && this.get('parentView.room'), room = ! in_conversation && this.get('parentView.room'),
@ -748,7 +749,7 @@ FFZ.prototype.modify_chat_input = function(component) {
tmi = in_conversation ? window.TMI && TMI._sessions && TMI._sessions[0] : room && room.tmiSession, tmi = in_conversation ? window.TMI && TMI._sessions && TMI._sessions[0] : room && room.tmiSession,
set_name, replacement, url, is_sub_set, fav_list, set_name, replacement, url, is_sub_set, fav_list,
emote_set, emote, emote_id, code, emote_set, emote, emote_id, code, sort_factor,
user = f.get_user(), user = f.get_user(),
ffz_sets = f.getEmotes(user && user.login, room_id), ffz_sets = f.getEmotes(user && user.login, room_id),
@ -788,8 +789,13 @@ FFZ.prototype.modify_chat_input = function(component) {
if ( setting === 1 && ! is_sub_set ) if ( setting === 1 && ! is_sub_set )
continue; continue;
sort_factor = is_sub_set ? 1 : 9;
for(var i = 0; i < emote_set.length; i++) { for(var i = 0; i < emote_set.length; i++) {
emote = emote_set[i]; emote = emote_set[i];
if ( used_ids.indexOf(emote.id) !== -1 )
continue;
code = emote && emote.code; code = emote && emote.code;
code = code && (constants.KNOWN_CODES[code] || code); code = code && (constants.KNOWN_CODES[code] || code);
replacement = f.settings.replace_bad_emotes && constants.EMOTE_REPLACEMENTS[emote.id]; replacement = f.settings.replace_bad_emotes && constants.EMOTE_REPLACEMENTS[emote.id];
@ -797,23 +803,44 @@ FFZ.prototype.modify_chat_input = function(component) {
(constants.EMOTE_REPLACEMENT_BASE + replacement) : (constants.EMOTE_REPLACEMENT_BASE + replacement) :
(constants.TWITCH_BASE + emote.id + "/1.0"); (constants.TWITCH_BASE + emote.id + "/1.0");
if ( ! emotes[code] || ! emotes[code][0] ) emotes.push({
emotes[code] = [true, code, true, is_sub_set, set_name, url, null, fav_list.indexOf(emote.id) !== -1]; type: 'emoticon',
label: code,
info: set_name,
sort: sort_factor,
image: url,
width: null,
favorite: fav_list.indexOf(emote.id) !== -1
});
used_ids.push(emote.id);
if ( f.settings.input_complete_without_prefix && is_sub_set ) { if ( f.settings.input_complete_without_prefix && is_sub_set ) {
// It's a sub emote, so try splitting off the end of the code. // It's a sub emote, so try splitting off the end of the code.
// It's a bit weird, but people might like it. Also, make sure // It's a bit weird, but people might like it. Also, make sure
// we aren't just grabbing an initial capital. // we aren't just grabbing an initial capital.
var unprefixed = code.substr(1).match(/[A-Z].+$/); var unprefixed = code.substr(1).match(/[A-Z](?:.+)?$/);
unprefixed = unprefixed ? unprefixed[0] : null; unprefixed = unprefixed ? unprefixed[0] : null;
if ( unprefixed && ! emotes[unprefixed] ) if ( unprefixed )
emotes[unprefixed] = [false, code, true, is_sub_set, set_name, url, null, fav_list.indexOf(emote.id) !== -1]; emotes.push({
type: 'emoticon',
label: '<i>' + code.substr(0, code.length - unprefixed.length) + '</i>' + unprefixed,
match: unprefixed,
content: code,
info: set_name,
sort: sort_factor,
image: url,
width: null,
favorite: fav_list.indexOf(emote.id) !== -1
});
} }
} }
} }
} }
} }
used_ids = [];
for(var i=0; i < ffz_sets.length; i++) { for(var i=0; i < ffz_sets.length; i++) {
emote_set = f.emote_sets[ffz_sets[i]]; emote_set = f.emote_sets[ffz_sets[i]];
if ( ! emote_set ) if ( ! emote_set )
@ -825,10 +852,22 @@ FFZ.prototype.modify_chat_input = function(component) {
set_name = (emote_set.source || "FFZ") + " " + (emote_set.title || "Global"); set_name = (emote_set.source || "FFZ") + " " + (emote_set.title || "Global");
fav_list = f.settings.favorite_emotes[emote_set.hasOwnProperty('source_ext') ? 'ffz-ext-' + emote_set.source_ext + '-' + emote_set.source_id : 'ffz-' + emote_set.id] || []; fav_list = f.settings.favorite_emotes[emote_set.hasOwnProperty('source_ext') ? 'ffz-ext-' + emote_set.source_ext + '-' + emote_set.source_id : 'ffz-' + emote_set.id] || [];
sort_factor = emote_set._type === 1 ? 3 : f.default_sets.indexOf(emote_set.id) === -1 ? 2 : 6;
for(emote_id in emote_set.emoticons) { for(emote_id in emote_set.emoticons) {
emote = emote_set.emoticons[emote_id]; emote = emote_set.emoticons[emote_id];
if ( ! emote.hidden && emote.name && (! emotes[emote.name] || ! emotes[emote.name][0]) ) if ( emote.hidden || ! emote.name || used_ids.indexOf(emote_id) !== -1 )
emotes[emote.name] = [true, emote.name, false, emote_set.id, set_name, emote.urls[1], emote.width, fav_list.indexOf(emote.id) !== -1]; continue;
emotes.push({
type: "emoticon",
label: emote.name,
info: set_name,
sort: sort_factor,
image: emote.urls[1],
width: emote.width,
favorite: fav_list.indexOf(emote.id) !== -1
});
} }
} }
@ -862,10 +901,13 @@ FFZ.prototype.modify_chat_input = function(component) {
if ( f.settings.input_complete_emotes ) { if ( f.settings.input_complete_emotes ) {
// Include Emoticons // Include Emoticons
for(var emote_name in emotes) { for(var i=0; i < emotes.length; i++)
var emote = emotes[emote_name], output.push(emotes[i]);
/*var emote = emotes[i],
sort_factor = 9, sort_factor = 9,
label = emote[1] === emote_name ? emote[1] : ('<i>' + emote[1].substr(0, emote[1].length - emote_name.length) + '</i>' + emote_name); label = emote[1] === emote_name ?
emote[1] :
('<i>' + emote[1].substr(0, emote[1].length - emote_name.length) + '</i>' + emote_name);
if ( emote[2] ) { if ( emote[2] ) {
if ( emote[3] ) if ( emote[3] )
@ -891,7 +933,7 @@ FFZ.prototype.modify_chat_input = function(component) {
width: emote[6], width: emote[6],
favorite: emote[7] || false favorite: emote[7] || false
}); });
} }*/
if ( f.settings.parse_emoji ) { if ( f.settings.parse_emoji ) {

View file

@ -137,7 +137,6 @@ FFZ.settings_info.disable_friend_notices = {
category: 'Chat Filtering', category: 'Chat Filtering',
no_mobile: true, no_mobile: true,
no_bttv: true,
name: 'Disable Watching Friends Notices', name: 'Disable Watching Friends Notices',
help: 'Do not display notices in chat when your friends are watching the same stream.' help: 'Do not display notices in chat when your friends are watching the same stream.'

View file

@ -44,28 +44,10 @@ FFZ.prototype.setup_vod_chat = function() {
else else
f.error("Unable to locate VOD Chat Service."); f.error("Unable to locate VOD Chat Service.");
this.update_views('component:vod-right-column', this.modify_vod_right_column);
//this.update_views('view:vod', this.modify_vod_view);
this.update_views('component:vod-chat-display', this.modify_vod_chat_display); this.update_views('component:vod-chat-display', this.modify_vod_chat_display);
} }
FFZ.prototype.modify_vod_right_column = function(component) {
var f = this;
utils.ember_reopen_view(component, {
ffz_init: function() {
if ( f.settings.dark_twitch ) {
var el = this.get('element'),
cont = el && el.querySelector('.chat-container');
if ( cont )
cont.classList.add('dark');
}
}
});
}
FFZ.prototype.modify_vod_chat_display = function(component) { FFZ.prototype.modify_vod_chat_display = function(component) {
var f = this, var f = this,
VODService = utils.ember_lookup('service:vod-chat-service'); VODService = utils.ember_lookup('service:vod-chat-service');
@ -74,6 +56,9 @@ FFZ.prototype.modify_vod_chat_display = function(component) {
ffz_init: function() { ffz_init: function() {
f._vodc = this; f._vodc = this;
if ( f.settings.dark_twitch )
this.$().parents('.chat-container').addClass('dark');
this.ffzUpdateBadges(); this.ffzUpdateBadges();
// Load the room, if nencessary. // Load the room, if nencessary.

View file

@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
// Version // Version
var VER = FFZ.version_info = { var VER = FFZ.version_info = {
major: 3, minor: 5, revision: 356, major: 3, minor: 5, revision: 357,
toString: function() { toString: function() {
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || ""); return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
} }

View file

@ -412,7 +412,10 @@ var include_html = function(heading_text, filename, callback) {
jQuery('#ffz-old-news-button', container).on('click', function() { jQuery('#ffz-old-news-button', container).on('click', function() {
jQuery(this).remove(); jQuery(this).remove();
jQuery('#ffz-old-news', container).css('display', 'block'); var onc = jQuery('#ffz-old-news', container);
onc.load(constants.SERVER + "script/old_changes.html", function() {
onc.css('display', 'block');
});
}); });
typeof callback === "function" && callback(view, container); typeof callback === "function" && callback(view, container);