1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

Basic badge stuff. Rendering of extension badges is still disabled for now, but SOON(tm). Fix emotes in locally echoed messages when emoji are present. Cache tokens in chat lines. Include the intl-login element within the username link in chat so it all underlines together.

This commit is contained in:
SirStendec 2017-11-28 02:03:59 -05:00
parent f66069798d
commit cbbe6f3e20
12 changed files with 517 additions and 155 deletions

View file

@ -17,9 +17,6 @@ export default class TooltipProvider extends Module {
this.should_enable = true;
this.inject('i18n');
this.inject('chat');
this.types.json = target => {
const title = target.dataset.title;
return [
@ -33,34 +30,6 @@ export default class TooltipProvider extends Module {
}, target.dataset.data)
]
}
this.types.badge = (target, tip) => {
const container = target.parentElement.parentElement,
badge = target.dataset.badge,
version = target.dataset.version,
room = container.dataset.roomId,
data = this.chat.getBadge(badge, version, room);
if ( ! data )
return;
return [
this.chat.context.get('tooltip.badge-images') && e('img', {
className: 'preview-image',
src: data.image4x,
style: {
height: '72px'
},
onLoad: tip.update
}),
data.title
]
};
}
onEnable() {