mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-29 07:45:33 +00:00
3.5.351. Fix hover pause for real. Fix modifier emote CSS. Fix BTTV + mod emotes.
This commit is contained in:
parent
96cfa89351
commit
1b4ac0bad8
7 changed files with 101 additions and 24 deletions
|
@ -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>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Fixed: Tab completion was not being populated correctly.</li>
|
||||
|
|
|
@ -439,6 +439,7 @@ FFZ.HoverPause = {
|
|||
if ( ! this._ffz_freeze_interval )
|
||||
this._ffz_freeze_interval = setInterval(this.ffzFreezePulse.bind(this), 200);
|
||||
|
||||
this.ffzFreezeUpdateBuffer && this.ffzFreezeUpdateBuffer(false);
|
||||
this.ffzFreezeWarn();
|
||||
}
|
||||
},
|
||||
|
@ -592,15 +593,13 @@ FFZ.HoverPause = {
|
|||
},
|
||||
|
||||
_prepareStickyBottom: function() {
|
||||
var e = this,
|
||||
t = 10;
|
||||
|
||||
var t = this;
|
||||
this._setStuckToBottom(true);
|
||||
this._$chatMessagesScroller.on(this._scrollEvents, function(n) {
|
||||
var a = e._$chatMessagesScroller;
|
||||
a && a[0] && (!e.ffz_frozen && (n.which > 0 || 'mousedown' === n.type || 'mousewheel' === n.type)) && ! function() {
|
||||
var n = a[0].scrollHeight = a[0].scrollTop - a[0].offsetHeight;
|
||||
e._setStuckToBottom(n <= t);
|
||||
this._$chatMessagesScroller.on(this._scrollEvents, function(e) {
|
||||
var a = t._$chatMessagesScroller;
|
||||
if ( a && a[0] && ((!t.ffz_frozen && 'mousedown' === e.type) || 'wheel' === e.type || 'mousewheel' === e.type) ) {
|
||||
var distance = a[0].scrollHeight - a[0].scrollTop - a[0].offsetHeight;
|
||||
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();
|
||||
},
|
||||
|
||||
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() {
|
||||
var room = this.get('room'),
|
||||
el = this.get('element'),
|
||||
|
|
|
@ -6,20 +6,20 @@ var FFZ = window.FrankerFaceZ,
|
|||
|
||||
MODIFIERS = {
|
||||
59847: {
|
||||
margins: '0 10px 10px 0',
|
||||
modifier_offset: '0 15px 15px 0',
|
||||
modifier: true
|
||||
},
|
||||
|
||||
70852: {
|
||||
modifier: true,
|
||||
margins: '0 5px 20px 0',
|
||||
modifier_offset: '0 5px 20px 0',
|
||||
extra_width: 5,
|
||||
shrink_to_fit: true
|
||||
},
|
||||
|
||||
70854: {
|
||||
modifier: true,
|
||||
margins: '30px 0 0'
|
||||
modifier_offset: '30px 0 0'
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -304,8 +304,9 @@ FFZ.prototype.setup_bttv = function(delay) {
|
|||
if ( setting === 0 )
|
||||
output.push([data.raw]);
|
||||
else {
|
||||
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 + '">']);
|
||||
var code = utils.quote_attr(data.raw),
|
||||
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;
|
||||
} else
|
||||
|
@ -320,6 +321,10 @@ FFZ.prototype.setup_bttv = function(delay) {
|
|||
}
|
||||
|
||||
// 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;
|
||||
BC.templates.emoticonize = function(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++) {
|
||||
var token = tokens[i];
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
|
@ -359,15 +376,40 @@ FFZ.prototype.setup_bttv = function(delay) {
|
|||
segment = segments[x];
|
||||
if ( HOP.call(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 ) {
|
||||
var toks = parse_emoji(text.join(' ') + ' ');
|
||||
for(var q=0; q < toks.length; q++)
|
||||
new_tokens.push(toks[q]);
|
||||
for(var q=0; q < toks.length; q++) {
|
||||
var tok = toks[q];
|
||||
/*if ( tok.length > 1 )
|
||||
last_token = tok;
|
||||
else
|
||||
last_token = null;*/
|
||||
|
||||
new_tokens.push(tok);
|
||||
}
|
||||
|
||||
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 )
|
||||
f.add_usage(l_room, emote);
|
||||
|
|
|
@ -61,7 +61,7 @@ FFZ.channel_metadata = {};
|
|||
|
||||
// Version
|
||||
var VER = FFZ.version_info = {
|
||||
major: 3, minor: 5, revision: 349,
|
||||
major: 3, minor: 5, revision: 351,
|
||||
toString: function() {
|
||||
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
||||
}
|
||||
|
|
12
src/utils.js
12
src/utils.js
|
@ -977,8 +977,9 @@ module.exports = FFZ.utils = {
|
|||
if ( ! emote.margins && ! emote.css )
|
||||
return output;
|
||||
|
||||
if ( emote.modifier && emote.margins ) {
|
||||
var margins = _.map(emote.margins.split(/\s+/), function(n) { return parseInt(n) });
|
||||
if ( emote.modifier && (emote.modifier_offset || emote.margins || emote.extra_width || emote.shrink_to_fit) ) {
|
||||
var margins = emote.modifier_offset || emote.margins || '0';
|
||||
margins = _.map(margins.split(/\s+/), function(n) { return parseInt(n) });
|
||||
if ( margins.length === 3 )
|
||||
margins.push(margins[1]);
|
||||
|
||||
|
@ -988,7 +989,7 @@ module.exports = FFZ.utils = {
|
|||
m_top = margins[0 % 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;' +
|
||||
(emote.shrink_to_fit ? 'max-width: calc(100% - ' + (40 - m_left - m_right - (emote.extra_width || 0)) + 'px);' : '') +
|
||||
'margin: 0 !important' +
|
||||
|
@ -996,8 +997,9 @@ module.exports = FFZ.utils = {
|
|||
}
|
||||
|
||||
return output +
|
||||
'img[data-ffz-emote="' + emote.id + '"] {' +
|
||||
(emote.margins && ! emote.modifier ? 'margin:' + emote.margins + ' !important;' : '') +
|
||||
'.activity-body img[data-ffz-emote="' + emote.id + '"],' +
|
||||
'.chat-line img[data-ffz-emote="' + emote.id + '"] {' +
|
||||
(emote.margins && (! emote.modifier || emote.modifier_offset) ? 'margin:' + emote.margins + ' !important;' : '') +
|
||||
(emote.css || '') +
|
||||
'}\n';
|
||||
},
|
||||
|
|
10
style.css
10
style.css
|
@ -3769,12 +3769,18 @@ body:not(.ffz-channel-bar-bottom).ffz-small-player.ffz-minimal-channel-bar #play
|
|||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.ffz-bttv .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 {
|
||||
padding-top: 0;
|
||||
margin-bottom: -3px;
|
||||
vertical-align: bottom;
|
||||
vertical-align: bottom !important;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue