fix emotes and colored text

This commit is contained in:
Zack Rauen 2018-10-04 17:57:55 -04:00
parent 4aa7884a34
commit d22860e7c8
2 changed files with 70 additions and 65 deletions

View File

@ -388,10 +388,12 @@ Core.prototype.injectColoredText = function() {
this.cancelColoredText = Utils.monkeyPatch(BDV2.MessageContentComponent.prototype, "render", {after: (data) => {
if (!settingsCookie["bda-gs-7"]) return;
const markup = data.returnValue.props.children[1];
Utils.monkeyPatch(data.returnValue.props, "children", {silent: true, after: ({returnValue}) => {
const markup = returnValue.props.children[1];
const roleColor = data.thisObject.props.message.colorString;
if (markup && roleColor) markup.props.style = {color: roleColor};
return data.returnValue;
return returnValue;
}});
}});
};
@ -656,6 +658,7 @@ EmoteModule.prototype.init = async function () {
if (this.cancelEmoteRender) return;
this.cancelEmoteRender = Utils.monkeyPatch(BDV2.MessageContentComponent.prototype, "render", {after: ({returnValue}) => {
Utils.monkeyPatch(returnValue.props, "children", {silent: true, after: ({returnValue}) => {
const markup = returnValue.props.children[1];
if (!markup.props.children) return;
const nodes = markup.props.children[1];
@ -717,6 +720,7 @@ EmoteModule.prototype.init = async function () {
else if (node.props && node.props.children && node.props.children.props && node.props.children.props.emojiName) node.props.children.props.jumboable = true;
}
}});
}});
};
EmoteModule.prototype.clearEmoteData = async function() {
@ -1709,6 +1713,7 @@ devMode.prototype.getSelector = function(element) {
$(document).off("contextmenu.bdDevModeCtx");
};
var ClassNormalizer = class ClassNormalizer {
constructor() {
this.classFormat = new RegExp(`^(?!da-)[A-Za-z]+-([A-Za-z]|[0-9]|-|_){6}$`);

4
js/main.min.js vendored

File diff suppressed because one or more lines are too long