update for ffz emotes

This commit is contained in:
Zack Rauen 2018-03-16 14:18:50 -04:00
parent 261c914cbe
commit 2f71d66535
3 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -733,13 +733,15 @@ EmoteModule.prototype.init = async function () {
});
observer.observe(document.querySelector('.app') || document.querySelector('#app-mount'), {childList: true, subtree: true})
}).then(MessageComponent => {
if (this.cancel1) this.cancel1();
if (this.cancel2) this.cancel2();
this.cancel1 = Utils.monkeyPatch(MessageComponent.prototype, "componentDidMount", {after: (data) => {
let message = BDV2.reactDom.findDOMNode(data.thisObject);
message = message.querySelector('.markup');
if (!message) return;
this.injectEmote(message);
}});
this.cancel2 = Utils.monkeyPatch(MessageComponent.prototype, "componentDidUpdate", {after: (data) => {
let message = BDV2.reactDom.findDOMNode(data.thisObject);
@ -937,7 +939,7 @@ EmoteModule.prototype.injectEmote = async function(node, edited) {
let words = textNodes.map(n => n.data).join(" ").split(/([^\s]+)([\s]|$)/g).filter(function(e) { return e; });//message.innerHTML.split(/([^\s]+)([\s]|$)/g).filter(function(e) { return e; });
let inject = function(message, messageScroller, category, emoteName, emoteModifier) {
let inCategory = bdEmotes[category].hasOwnProperty(emoteName);
let inCategory = Object.hasOwnProperty.call(bdEmotes[category], emoteName);
if (!inCategory || !settingsCookie[bdEmoteSettingIDs[category]]) return false;
let url = bdEmotes[category][emoteName];

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long