This commit is contained in:
Mirco Wittrien 2021-05-29 15:04:58 +02:00
parent 1bc36346ae
commit 55632e1d58
3 changed files with 16 additions and 12 deletions

View File

@ -7877,6 +7877,10 @@ module.exports = (_ => {
}; };
InternalBDFDB._processUserInfoNode = function (user, wrapper) { InternalBDFDB._processUserInfoNode = function (user, wrapper) {
if (!user || !wrapper) return; if (!user || !wrapper) return;
LibraryModules.ImageEditUtils.getPrimaryColorForAvatar(BDFDB.UserUtils.getAvatar(user.id)).then(color => {
const rgb = BDFDB.ColorUtils.convert(color, "RGB");
if (rgb) wrapper.style.setProperty("--user-banner-color", rgb, "important");
});
if (InternalData.UserBackgrounds[user.id]) for (let property in InternalData.UserBackgrounds[user.id]) wrapper.style.setProperty(property, InternalData.UserBackgrounds[user.id][property], "important"); if (InternalData.UserBackgrounds[user.id]) for (let property in InternalData.UserBackgrounds[user.id]) wrapper.style.setProperty(property, InternalData.UserBackgrounds[user.id][property], "important");
}; };
InternalBDFDB.processMessageHeader = function (e) { InternalBDFDB.processMessageHeader = function (e) {

View File

@ -2,7 +2,7 @@
* @name CharCounter * @name CharCounter
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.5.0 * @version 1.5.1
* @description Adds a Character Counter to most Inputs * @description Adds a Character Counter to most Inputs
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": { "info": {
"name": "CharCounter", "name": "CharCounter",
"author": "DevilBro", "author": "DevilBro",
"version": "1.5.0", "version": "1.5.1",
"description": "Adds a Character Counter to most Inputs" "description": "Adds a Character Counter to most Inputs"
}, },
"changeLog": { "changeLog": {
"fixed": { "fixed": {
"Message Input": "Works again for the message textarea" "Change Nick": "Counter gets added again"
} }
} }
}; };
@ -85,7 +85,7 @@ module.exports = (_ => {
after: { after: {
ChannelTextAreaContainer: "render", ChannelTextAreaContainer: "render",
Note: "render", Note: "render",
ChangeNickname: "default", ChangeIdentity: "default",
CustomStatusModal: "render" CustomStatusModal: "render"
} }
}; };
@ -114,7 +114,7 @@ module.exports = (_ => {
bottom: -1.0em; bottom: -1.0em;
} }
${BDFDB.dotCN._charcounternickcounter} { ${BDFDB.dotCN._charcounternickcounter} {
right: 0 !important; right: 8px !important;
top: 0 !important; top: 0 !important;
} }
${BDFDB.dotCN._charcountercustomstatuscounter} { ${BDFDB.dotCN._charcountercustomstatuscounter} {
@ -158,12 +158,12 @@ module.exports = (_ => {
if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.className && e.instance.props.className.indexOf(BDFDB.disCN.usernotepopout) > -1 ? "popoutnote" : "profilenote", "textarea"); if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.className && e.instance.props.className.indexOf(BDFDB.disCN.usernotepopout) > -1 ? "popoutnote" : "profilenote", "textarea");
} }
processChangeNickname (e) { processChangeIdentity (e) {
let formItem = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "FormItem"}); let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: c => c && c.props && c.props.setNickname});
if (formItem) { if (index > -1) children.unshift(BDFDB.ReactUtils.createElement("div", {
let [children, index] = BDFDB.ReactUtils.findParent(formItem, {name: "TextInput"}); className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.charcounter, BDFDB.disCN._charcountercounter, BDFDB.disCN._charcounternickcounter),
if (index > -1) this.injectCounter(formItem, children, "nick", BDFDB.dotCN.input); children: `${(children[index].props.nickname || "").length}/${maxLenghts.nick}`
} }));
} }
processCustomStatusModal (e) { processCustomStatusModal (e) {

View File

@ -85,7 +85,7 @@
content: ""; content: "";
position: relative; position: relative;
display: block; display: block;
background: var(--user-background, var(--background-secondary)) var(--user-popout-position, center)/cover no-repeat; background: var(--user-background, var(--user-banner-color, var(--background-secondary))) var(--user-popout-position, center)/cover no-repeat;
top: 0; top: 0;
width: 100%; width: 100%;
height: 120px; height: 120px;