This commit is contained in:
Mirco Wittrien 2022-01-11 22:56:04 +01:00
parent d24246a2bf
commit 9be75063ac
4 changed files with 46 additions and 59 deletions

View File

@ -2,7 +2,7 @@
* @name BetterFriendList
* @author DevilBro
* @authorId 278543574059057154
* @version 1.3.9
* @version 1.4.0
* @description Adds extra Controls to the Friends Page, for example sort by Name/Status, Search and All/Request/Blocked Amount
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": {
"name": "BetterFriendList",
"author": "DevilBro",
"version": "1.3.9",
"version": "1.4.0",
"description": "Adds extra Controls to the Friends Page, for example sort by Name/Status, Search and All/Request/Blocked Amount"
},
"changeLog": {
"fixed": {
"Count": "No longer says Count = 0 for all categories if hidden is disabled"
}
}
};
@ -286,6 +281,10 @@ module.exports = (_ => {
}
processPeopleListSectionedLazy (e) {
this.processPeopleListSectionedNonLazy(e);
}
processPeopleListSectionedNonLazy (e) {
if (this.settings.general.addFavorizedCategory) {
if (isFavoritesSelected) e.instance.props.statusSections = [].concat(e.instance.props.statusSections).map(section => [].concat(section).filter(entry => entry && entry.user && favorizedFriends.indexOf(entry.user.id) > -1));
}
@ -334,8 +333,8 @@ module.exports = (_ => {
children: this.settings.general.addFavorizedCategory && isFavoritesSelected ? `${this.labels.favorites} - ${users.filter(u => u && u.key != placeHolderId).length}` : this.settings.general.addHiddenCategory && isHiddenSelected ? `${this.labels.hidden} - ${users.filter(u => u && u.key != placeHolderId).length}` : e2.returnValue.replace(users.length, users.filter(u => u && u.key != placeHolderId).length)
}),
this.settings.general.addSortOptions && [
{key: "usernameLower", label: BDFDB.LanguageUtils.LanguageStrings.FRIENDS_COLUMN_NAME},
{key: "statusIndex", label: BDFDB.LanguageUtils.LanguageStrings.FRIENDS_COLUMN_STATUS}
{key: "usernameLower", label: BDFDB.LanguageUtils.LanguageStrings.USER_SETTINGS_LABEL_USERNAME},
{key: "statusIndex", label: BDFDB.LanguageUtils.LibraryStrings.status}
].filter(n => n).map(data => BDFDB.ReactUtils.createElement("div", {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tableheadercellwrapper, BDFDB.disCN.tableheadercell, BDFDB.disCN._betterfriendlistnamecell, sortKey == data.key && BDFDB.disCN.tableheadercellsorted, BDFDB.disCN.tableheadercellclickable),
children: BDFDB.ReactUtils.createElement("div", {
@ -391,10 +390,6 @@ module.exports = (_ => {
});
}
processPeopleListSectionedNonLazy (e) {
this.processPeopleListSectionedLazy(e);
}
processFriendRow (e) {
e.returnvalue.props.mutualGuilds = e.instance.props.mutualGuilds;
}

View File

@ -2,7 +2,7 @@
* @name BetterNsfwTag
* @author DevilBro
* @authorId 278543574059057154
* @version 1.2.7
* @version 1.2.8
* @description Adds a more noticeable Tag to NSFW Channels
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": {
"name": "BetterNsfwTag",
"author": "DevilBro",
"version": "1.2.7",
"version": "1.2.8",
"description": "Adds a more noticeable Tag to NSFW Channels"
},
"changeLog": {
"fixed": {
"Works again": "Yes"
}
}
};
@ -80,33 +75,29 @@ module.exports = (_ => {
ChannelItem: "default"
}
};
this.css = `
${BDFDB.dotCN.channelcontainerdefault}:hover ${BDFDB.dotCN.channeliconitem} + ${BDFDB.dotCN._betternsfwtagtag} {
display: none;
`;
}
onStart () {
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.ChannelUtils.rerenderAll();
}
onStop () {
BDFDB.PatchUtils.forceAllUpdates(this);
BDFDB.ChannelUtils.rerenderAll();
}
processChannelItem (e) {
if (e.instance.props.channel && e.instance.props.channel.nsfw) {
let children = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelchildren]]});
let childrenChilds = children && BDFDB.ArrayUtils.is(children.props.children) ? children.props.children : BDFDB.ObjectUtils.get(children, "props.children.props.children");
if (BDFDB.ArrayUtils.is(childrenChilds)) {
let [oldTagParent, oldTagIndex] = BDFDB.ReactUtils.findParent(childrenChilds, {key: "NSFW-badge"});
if (oldTagIndex > -1) oldTagParent.splice(oldTagIndex, 1);
childrenChilds.push(BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS._betternsfwtagtag + BDFDB.disCN.channelchildiconbase,
key: "NSFW-badge",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.TextBadge, {
style: {borderRadius: "3px"},
text: "NSFW"
})
}));
}
}
if (e.instance.props.channel && e.instance.props.channel.nsfw) e.instance.props.children.push(BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS._betternsfwtagtag + BDFDB.disCN.channelchildiconbase,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.TextBadge, {
style: {borderRadius: "3px"},
text: "NSFW"
})
}));
}
};
})(window.BDFDB_Global.PluginUtils.buildPlugin(config));

View File

@ -2,7 +2,7 @@
* @name CharCounter
* @author DevilBro
* @authorId 278543574059057154
* @version 1.5.7
* @version 1.5.8
* @description Adds a Character Counter to most Inputs
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": {
"name": "CharCounter",
"author": "DevilBro",
"version": "1.5.7",
"version": "1.5.8",
"description": "Adds a Character Counter to most Inputs"
},
"changeLog": {
"added": {
"Percentage": "Added a Percentage Slider that lets you change at which Percentage the Counter is gonna show up"
}
}
};
@ -92,7 +87,7 @@ module.exports = (_ => {
after: {
ChannelTextAreaContainer: "render",
Note: "render",
ChangeIdentity: "default",
NicknameSection: "default",
CustomStatusModal: "render"
}
};
@ -131,9 +126,8 @@ module.exports = (_ => {
bottom: -1.0em;
}
${BDFDB.dotCN._charcounternickcounter} {
position: static !important;
text-align: right !important;
margin-bottom: -16px !important;
right: 0 !important;
top: -1.5em;
}
${BDFDB.dotCN._charcountercustomstatuscounter} {
right: 0 !important;
@ -175,7 +169,6 @@ module.exports = (_ => {
plugin: this,
keys: ["sliders", key],
basis: "30%",
digits: 0,
label: this.defaults.sliders[key].description,
value: this.settings.sliders[key]
}));
@ -205,12 +198,17 @@ 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");
}
processChangeIdentity (e) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: c => c && c.props && c.props.setNickname});
if (index > -1) children.splice(index, 0, BDFDB.ReactUtils.createElement("div", {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.charcounter, BDFDB.disCN._charcountercounter, BDFDB.disCN._charcounternickcounter),
children: `${(children[index].props.nickname || "").length}/${maxLengths.nick}`
}));
processNicknameSection (e) {
e.returnvalue.props.children = BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._charcountercounteradded,
children: [
e.returnvalue.props.children,
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.charcounter, BDFDB.disCN._charcountercounter, BDFDB.disCN._charcounternickcounter),
children: `${(e.instance.props.pendingNick || "").length}/${maxLengths.nick}`
})
].flat(10)
});
}
processCustomStatusModal (e) {

View File

@ -2494,13 +2494,16 @@ a.metadataName-1KMZtB {
background: var(--accentcolor-active);
}
.bd-button {
.bd-button,
.bd-addon-modal-footer .bd-button {
background: var(--bd-blue);
}
.bd-button:hover {
.bd-button:hover,
.bd-addon-modal-footer .bd-button:hover {
background: var(--accentcolor-hover);
}
.bd-button:active {
.bd-button:active,
.bd-addon-modal-footer .bd-button:active {
background: var(--accentcolor-active);
}