1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-29 15:55:33 +00:00

3.5.351. Fix hover pause for real. Fix modifier emote CSS. Fix BTTV + mod emotes.

This commit is contained in:
SirStendec 2016-10-25 16:26:57 -04:00
parent 96cfa89351
commit 1b4ac0bad8
7 changed files with 101 additions and 24 deletions

View file

@ -1,3 +1,15 @@
<div class="list-header">3.5.351 <time datetime="2016-10-25">(2016-10-25)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Added: Spooks.</li>
<li>Fixed: Modifer emote CSS was still not good.</li>
<li>Fixed: BetterTTV + Modifier Emotes</li>
</ul>
<div class="list-header">3.5.350 <time datetime="2016-10-25">(2016-10-25)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: More tweaks for hover pausing, since that's still glitchy.</li>
</ul>
<div class="list-header">3.5.349 <time datetime="2016-10-25">(2016-10-25)</time></div> <div class="list-header">3.5.349 <time datetime="2016-10-25">(2016-10-25)</time></div>
<ul class="chat-menu-content menu-side-padding"> <ul class="chat-menu-content menu-side-padding">
<li>Fixed: Tab completion was not being populated correctly.</li> <li>Fixed: Tab completion was not being populated correctly.</li>

View file

@ -439,6 +439,7 @@ FFZ.HoverPause = {
if ( ! this._ffz_freeze_interval ) if ( ! this._ffz_freeze_interval )
this._ffz_freeze_interval = setInterval(this.ffzFreezePulse.bind(this), 200); this._ffz_freeze_interval = setInterval(this.ffzFreezePulse.bind(this), 200);
this.ffzFreezeUpdateBuffer && this.ffzFreezeUpdateBuffer(false);
this.ffzFreezeWarn(); this.ffzFreezeWarn();
} }
}, },
@ -592,15 +593,13 @@ FFZ.HoverPause = {
}, },
_prepareStickyBottom: function() { _prepareStickyBottom: function() {
var e = this, var t = this;
t = 10;
this._setStuckToBottom(true); this._setStuckToBottom(true);
this._$chatMessagesScroller.on(this._scrollEvents, function(n) { this._$chatMessagesScroller.on(this._scrollEvents, function(e) {
var a = e._$chatMessagesScroller; var a = t._$chatMessagesScroller;
a && a[0] && (!e.ffz_frozen && (n.which > 0 || 'mousedown' === n.type || 'mousewheel' === n.type)) && ! function() { if ( a && a[0] && ((!t.ffz_frozen && 'mousedown' === e.type) || 'wheel' === e.type || 'mousewheel' === e.type) ) {
var n = a[0].scrollHeight = a[0].scrollTop - a[0].offsetHeight; var distance = a[0].scrollHeight - a[0].scrollTop - a[0].offsetHeight;
e._setStuckToBottom(n <= t); t._setStuckToBottom(distance <= 10);
} }
}); });
}, },
@ -622,6 +621,13 @@ FFZ.HoverPause = {
} }
} }
}); });
},
_setStuckToBottom: function(val) {
this.set('stuckToBottom', val);
this.ffzFreezeUpdateBuffer && this.ffzFreezeUpdateBuffer(val);
if ( ! val )
this.ffzUnfreeze();
} }
} }
@ -652,6 +658,15 @@ FFZ.prototype.modify_room_component = function(component) {
this.ffzRemoveKeyHook(); this.ffzRemoveKeyHook();
}, },
ffzFreezeUpdateBuffer: function(val) {
var room = this.get('room');
if ( val === undefined )
val = this.get('stuckToBottom');
if ( room )
room.messageBufferSize = f.settings.scrollback_length + ( val ? 0 : 150 );
},
ffzUpdateStatus: function() { ffzUpdateStatus: function() {
var room = this.get('room'), var room = this.get('room'),
el = this.get('element'), el = this.get('element'),

View file

@ -6,20 +6,20 @@ var FFZ = window.FrankerFaceZ,
MODIFIERS = { MODIFIERS = {
59847: { 59847: {
margins: '0 10px 10px 0', modifier_offset: '0 15px 15px 0',
modifier: true modifier: true
}, },
70852: { 70852: {
modifier: true, modifier: true,
margins: '0 5px 20px 0', modifier_offset: '0 5px 20px 0',
extra_width: 5, extra_width: 5,
shrink_to_fit: true shrink_to_fit: true
}, },
70854: { 70854: {
modifier: true, modifier: true,
margins: '30px 0 0' modifier_offset: '30px 0 0'
} }
}; };

View file

@ -304,8 +304,9 @@ FFZ.prototype.setup_bttv = function(delay) {
if ( setting === 0 ) if ( setting === 0 )
output.push([data.raw]); output.push([data.raw]);
else { else {
var code = utils.quote_attr(data.raw); var code = utils.quote_attr(data.raw),
output.push(['<img class="emoticon emoji ffz-tooltip" height="18px" data-ffz-emoji="' + eid + '" src="' + utils.quote_attr(src) + '" alt="' + code + '">']); html = '<img class="emoticon emoji ffz-tooltip" height="18px" data-ffz-emoji="' + eid + '" src="' + utils.quote_attr(src) + '" alt="' + code + '">';
output.push([html, html, []]);
} }
text = null; text = null;
} else } else
@ -320,6 +321,10 @@ FFZ.prototype.setup_bttv = function(delay) {
} }
// Emoticonize // Emoticonize
var emote_token = function(emote) {
return '<img class="emoticon ffz-tooltip" data-ffz-set="' + emote.set_id + '" data-ffz-emote="' + emote.id + '" srcset="' + utils.quote_attr(emote.srcSet || "") + '" src="' + utils.quote_attr(emote.urls[1]) + '" alt="' + utils.quote_attr(emote.name) + '">';
};
var original_emoticonize = BC.templates.emoticonize; var original_emoticonize = BC.templates.emoticonize;
BC.templates.emoticonize = function(message, emotes) { BC.templates.emoticonize = function(message, emotes) {
var tokens = original_emoticonize(message, emotes), var tokens = original_emoticonize(message, emotes),
@ -344,9 +349,21 @@ FFZ.prototype.setup_bttv = function(delay) {
} }
} }
//var last_token = null;
for(var i=0, l=tokens.length; i < l; i++) { for(var i=0, l=tokens.length; i < l; i++) {
var token = tokens[i]; var token = tokens[i];
if ( typeof token !== "string" ) { if ( typeof token !== "string" ) {
// Detect emoticons!
/*if ( /class="emoticon/.test(token[0]) ) {
if ( token.length === 1 ) {
token = [token[0], token[0], []];
}
last_token = token;
} else
last_token = null;*/
new_tokens.push(token); new_tokens.push(token);
continue; continue;
} }
@ -359,15 +376,40 @@ FFZ.prototype.setup_bttv = function(delay) {
segment = segments[x]; segment = segments[x];
if ( HOP.call(emotes, segment) ) { if ( HOP.call(emotes, segment) ) {
emote = emotes[segment]; emote = emotes[segment];
/*if ( false && emote.modifier && last_token && last_token.length > 1 ) {
if ( last_token[2].indexOf(emote) === -1 ) {
last_token[2].push(emote);
last_token[0] = '<span class="emoticon modified-emoticon">' + last_token[1] + _.map(last_token[2], function(em) {
return ' <span>' + emote_token(em) + '</span>';
}).join('') + '</span>'
}
if ( mine && l_room )
f.add_usage(l_room, emote);
continue;
}*/
if ( text.length ) { if ( text.length ) {
var toks = parse_emoji(text.join(' ') + ' '); var toks = parse_emoji(text.join(' ') + ' ');
for(var q=0; q < toks.length; q++) for(var q=0; q < toks.length; q++) {
new_tokens.push(toks[q]); var tok = toks[q];
/*if ( tok.length > 1 )
last_token = tok;
else
last_token = null;*/
new_tokens.push(tok);
}
text = []; text = [];
} }
new_tokens.push(['<img class="emoticon ffz-tooltip" data-ffz-set="' + emote.set_id + '" data-ffz-emote="' + emote.id + '" srcset="' + utils.quote_attr(emote.srcSet || "") + '" src="' + utils.quote_attr(emote.urls[1]) + '" alt="' + utils.quote_attr(emote.name) + '">']); var html = emote_token(emote);
new_tokens.push([html, html, []]);
if ( mine && l_room ) if ( mine && l_room )
f.add_usage(l_room, emote); f.add_usage(l_room, emote);

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: 349, major: 3, minor: 5, revision: 351,
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

@ -977,8 +977,9 @@ module.exports = FFZ.utils = {
if ( ! emote.margins && ! emote.css ) if ( ! emote.margins && ! emote.css )
return output; return output;
if ( emote.modifier && emote.margins ) { if ( emote.modifier && (emote.modifier_offset || emote.margins || emote.extra_width || emote.shrink_to_fit) ) {
var margins = _.map(emote.margins.split(/\s+/), function(n) { return parseInt(n) }); var margins = emote.modifier_offset || emote.margins || '0';
margins = _.map(margins.split(/\s+/), function(n) { return parseInt(n) });
if ( margins.length === 3 ) if ( margins.length === 3 )
margins.push(margins[1]); margins.push(margins[1]);
@ -988,7 +989,7 @@ module.exports = FFZ.utils = {
m_top = margins[0 % l], m_top = margins[0 % l],
m_bottom = margins[2 % l]; m_bottom = margins[2 % l];
output += '.modified-emoticon img[data-ffz-emote="' + emote.id + '"] {' + output += '.modified-emoticon span img[data-ffz-emote="' + emote.id + '"] {' +
'padding:' + m_top + 'px ' + m_right + 'px ' + m_bottom + 'px ' + m_left + 'px;' + 'padding:' + m_top + 'px ' + m_right + 'px ' + m_bottom + 'px ' + m_left + 'px;' +
(emote.shrink_to_fit ? 'max-width: calc(100% - ' + (40 - m_left - m_right - (emote.extra_width || 0)) + 'px);' : '') + (emote.shrink_to_fit ? 'max-width: calc(100% - ' + (40 - m_left - m_right - (emote.extra_width || 0)) + 'px);' : '') +
'margin: 0 !important' + 'margin: 0 !important' +
@ -996,8 +997,9 @@ module.exports = FFZ.utils = {
} }
return output + return output +
'img[data-ffz-emote="' + emote.id + '"] {' + '.activity-body img[data-ffz-emote="' + emote.id + '"],' +
(emote.margins && ! emote.modifier ? 'margin:' + emote.margins + ' !important;' : '') + '.chat-line img[data-ffz-emote="' + emote.id + '"] {' +
(emote.margins && (! emote.modifier || emote.modifier_offset) ? 'margin:' + emote.margins + ' !important;' : '') +
(emote.css || '') + (emote.css || '') +
'}\n'; '}\n';
}, },

View file

@ -3769,12 +3769,18 @@ body:not(.ffz-channel-bar-bottom).ffz-small-player.ffz-minimal-channel-bar #play
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.ffz-bttv .modified-emoticon span,
.ffz-baseline-emoticons .modified-emoticon span { .ffz-baseline-emoticons .modified-emoticon span {
top: -105px; top: -25px;
} }
body:not(.ffz-bttv) .modified-emoticon span,
.ffz-bttv .modified-emoticon { pointer-events: none }
.ffz-bttv .modified-emoticon > .emoticon { pointer-events: all }
.ffz-bttv .chat-line .modified-emoticon,
.ffz-baseline-emoticons .chat-line .modified-emoticon { .ffz-baseline-emoticons .chat-line .modified-emoticon {
padding-top: 0; padding-top: 0;
margin-bottom: -3px; margin-bottom: -3px;
vertical-align: bottom; vertical-align: bottom !important;
} }