fix emotes and colored text
This commit is contained in:
parent
4aa7884a34
commit
d22860e7c8
|
@ -388,10 +388,12 @@ Core.prototype.injectColoredText = function() {
|
||||||
|
|
||||||
this.cancelColoredText = Utils.monkeyPatch(BDV2.MessageContentComponent.prototype, "render", {after: (data) => {
|
this.cancelColoredText = Utils.monkeyPatch(BDV2.MessageContentComponent.prototype, "render", {after: (data) => {
|
||||||
if (!settingsCookie["bda-gs-7"]) return;
|
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;
|
const roleColor = data.thisObject.props.message.colorString;
|
||||||
if (markup && roleColor) markup.props.style = {color: roleColor};
|
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;
|
if (this.cancelEmoteRender) return;
|
||||||
this.cancelEmoteRender = Utils.monkeyPatch(BDV2.MessageContentComponent.prototype, "render", {after: ({returnValue}) => {
|
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];
|
const markup = returnValue.props.children[1];
|
||||||
if (!markup.props.children) return;
|
if (!markup.props.children) return;
|
||||||
const nodes = markup.props.children[1];
|
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;
|
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() {
|
EmoteModule.prototype.clearEmoteData = async function() {
|
||||||
|
@ -1709,6 +1713,7 @@ devMode.prototype.getSelector = function(element) {
|
||||||
$(document).off("contextmenu.bdDevModeCtx");
|
$(document).off("contextmenu.bdDevModeCtx");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var ClassNormalizer = class ClassNormalizer {
|
var ClassNormalizer = class ClassNormalizer {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.classFormat = new RegExp(`^(?!da-)[A-Za-z]+-([A-Za-z]|[0-9]|-|_){6}$`);
|
this.classFormat = new RegExp(`^(?!da-)[A-Za-z]+-([A-Za-z]|[0-9]|-|_){6}$`);
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue