Skip to content

Commit

Permalink
more vod chat bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
night committed Sep 26, 2017
1 parent 32f4e52 commit acb56f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "BetterTTV",
"author": "Night",
"version": "7.0.28",
"version": "7.0.29",
"description": "BetterTTV enhances Twitch with new features, bug fixes, and reduced clutter.",
"main": "betterttv.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/chat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ class ChatModule {
const tokens = $message.contents();
for (let i = 0; i < tokens.length; i++) {
const node = tokens[i];
if (node.nodeType === window.Node.ELEMENT_NODE && node.classList.contains('balloon-wrapper')) {
if (node.nodeType === window.Node.ELEMENT_NODE && (node.classList.contains('balloon-wrapper') || node.classList.contains('tw-tooltip-wrapper'))) {
const $emote = $(node);
const $image = $emote.find('img');
if (!$image.length) continue;
const code = $image.attr('alt');
const id = ($image.attr('src').split('emoticons/v1/')[1] || '').split('/')[0];
const emote = channelEmotesTip.getEmote(id, code);
if (emote) {
$emote.find('.balloon').css('text-align', 'center').html(emote.balloon);
$emote.find('.balloon,.tw-tooltip').css('text-align', 'center').html(emote.balloon);
if (!currentChannel || emote.channel.name === currentChannel.name) continue;
$emote.on('click', () => window.open(emote.channel.url, '_blank'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/vod_chat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const $ = require('jquery');
const chat = require('../chat');
const watcher = require('../../watcher');

const CHAT_MESSAGE_SELECTOR = '.vod-message__message,.qa-mod-message span';
const CHAT_MESSAGE_SELECTOR = '.vod-message__message,.qa-mod-message';
const CHAT_USERNAME_SELECTOR = '.vod-message__author,.video-chat__message-author';
const SCROLL_INDICATOR_SELECTOR = '.vod-chat__sync-button,.video-chat__sync-button';
const SCROLL_CONTAINER_SELECTOR = '.vod-chat__scroll-wrapper,.video-chat__message-list-wrapper';
Expand Down
2 changes: 1 addition & 1 deletion src/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class Watcher extends SafeEventEmitter {
for (const el of mutation.addedNodes) {
const $el = $(el);

const $chatContents = $el.find('.vod-message__content,.video-chat__message');
const $chatContents = $el.find('.vod-message__content,.vod-message');

for (const chatContent of $chatContents) {
this.emit('vod.message', $(chatContent));
Expand Down

0 comments on commit acb56f9

Please sign in to comment.