This commit is contained in:
Mirco Wittrien 2019-11-04 22:07:00 +01:00
parent b4babd0957
commit 55803526cf
3 changed files with 25 additions and 12 deletions

View File

@ -5624,6 +5624,10 @@ var BDFDB = {
LibraryComponents.Anchor = BDFDB.ModuleUtils.findByName("Anchor"); LibraryComponents.Anchor = BDFDB.ModuleUtils.findByName("Anchor");
LibraryComponents.BadgeComponents = Object.assign({}, BDFDB.ModuleUtils.findByProperties("IconBadge", "NumberBadge") || {});
LibraryComponents.BlobMask = BDFDB.ModuleUtils.findByName("BlobMask");
LibraryComponents.BotTag = reactInitialized ? class BDFDB_BotTag extends LibraryModules.React.Component { LibraryComponents.BotTag = reactInitialized ? class BDFDB_BotTag extends LibraryModules.React.Component {
render() { render() {
return BDFDB.ReactUtils.createElement("span", { return BDFDB.ReactUtils.createElement("span", {
@ -5998,7 +6002,7 @@ var BDFDB = {
} }
} : LibraryComponents.FormComponents.FormItem; } : LibraryComponents.FormComponents.FormItem;
LibraryComponents.IconBadge = BDFDB.ModuleUtils.findByName("IconBadge"); LibraryComponents.GuildComponents = Object.assign({}, BDFDB.ModuleUtils.findByProperties("Separator", "DragPlaceholder") || {});
LibraryComponents.MessageComponents = Object.assign({}, BDFDB.ModuleUtils.findByProperties("Message", "MessageTimestamp") || {}); LibraryComponents.MessageComponents = Object.assign({}, BDFDB.ModuleUtils.findByProperties("Message", "MessageTimestamp") || {});
@ -6022,7 +6026,7 @@ var BDFDB = {
} }
} : LibraryComponents.ModalComponents.ModalTabContent; } : LibraryComponents.ModalComponents.ModalTabContent;
LibraryComponents.NumberBadge = BDFDB.ModuleUtils.findByName("NumberBadge"); LibraryComponents.NavItem = BDFDB.ModuleUtils.findByName("NavItem");
LibraryComponents.Popout = reactInitialized ? class BDFDB_Popout extends LibraryModules.React.Component { LibraryComponents.Popout = reactInitialized ? class BDFDB_Popout extends LibraryModules.React.Component {
render() { render() {
@ -6295,7 +6299,15 @@ var BDFDB = {
headerCellClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tableheadercell, this.props.headerCellClassName), headerCellClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tableheadercell, this.props.headerCellClassName),
sortedHeaderCellClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tableheadercellsorted, this.props.sortedHeaderCellClassName), sortedHeaderCellClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tableheadercellsorted, this.props.sortedHeaderCellClassName),
bodyCellClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tablebodycell, this.props.bodyCellClassName), bodyCellClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tablebodycell, this.props.bodyCellClassName),
rowClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tablerow, this.props.rowClassName) rowClassName: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.tablerow, this.props.rowClassName),
onSort: (sortKey, sortDirection) => {
this.props.sortDirection = this.props.sortKey != sortKey && sortDirection == LibraryComponents.Table.SortDirection.ASCENDING && this.props.columns.filter(n => n.key == sortKey)[0].reverse ? LibraryComponents.Table.SortDirection.DESCENDING : sortDirection;
this.props.sortKey = sortKey;
this.props.data = BDFDB.ArrayUtils.keySort(this.props.data, this.props.sortKey);
if (this.props.sortDirection == LibraryComponents.Table.SortDirection.DESCENDING) this.props.data.reverse();
BDFDB.ReactUtils.forceUpdate(this);
if (typeof this.props.onSort == "function") this.props.onSort(this.props.sortKey, this.props.sortDirection);
}
})); }));
} }
} : LibraryComponents.Table; } : LibraryComponents.Table;
@ -8348,4 +8360,5 @@ var BDFDB = {
}; };
BDFDB.LibraryComponents.ModalTabContent = LibraryComponents.ModalComponents.ModalTabContent; BDFDB.LibraryComponents.ModalTabContent = LibraryComponents.ModalComponents.ModalTabContent;
BDFDB.LibraryComponents.NumberBadge = LibraryComponents.BadgeComponents.NumberBadge;
})(); })();

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
class BetterFriendCount { class BetterFriendCount {
getName () {return "BetterFriendCount";} getName () {return "BetterFriendCount";}
getVersion () {return "1.1.9";} getVersion () {return "1.2.0";}
getAuthor () {return "DevilBro";} getAuthor () {return "DevilBro";}
@ -15,8 +15,8 @@ class BetterFriendCount {
}; };
this.patchModules = { this.patchModules = {
"TabBar":"render", TabBar: "render",
"FriendRow":["componentWillMount","componentWillUnmount"] FriendRow: ["componentWillMount","componentWillUnmount"]
}; };
} }
@ -80,29 +80,29 @@ class BetterFriendCount {
let newchildren = [Array.isArray(child.props.children) ? child.props.children[0] : child.props.children]; let newchildren = [Array.isArray(child.props.children) ? child.props.children[0] : child.props.children];
switch (child.props.id) { switch (child.props.id) {
case "ALL": case "ALL":
newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.NumberBadge, { newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.BadgeComponents.NumberBadge, {
className: BDFDB.disCN.settingstabbarbadge, className: BDFDB.disCN.settingstabbarbadge,
count: relationshipCount.FRIEND count: relationshipCount.FRIEND
})); }));
break; break;
case "ONLINE": case "ONLINE":
newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.NumberBadge, { newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.BadgeComponents.NumberBadge, {
className: BDFDB.disCN.settingstabbarbadge, className: BDFDB.disCN.settingstabbarbadge,
count: BDFDB.LibraryModules.StatusMetaUtils.getOnlineFriendCount() count: BDFDB.LibraryModules.StatusMetaUtils.getOnlineFriendCount()
})); }));
break; break;
case "PENDING": case "PENDING":
newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.NumberBadge, { newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.BadgeComponents.NumberBadge, {
className: BDFDB.disCN.settingstabbarbadge, className: BDFDB.disCN.settingstabbarbadge,
count: relationshipCount.PENDING_INCOMING count: relationshipCount.PENDING_INCOMING
})); }));
newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.NumberBadge, { newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.BadgeComponents.NumberBadge, {
className: BDFDB.disCN.settingstabbarbadge, className: BDFDB.disCN.settingstabbarbadge,
count: relationshipCount.PENDING_OUTGOING count: relationshipCount.PENDING_OUTGOING
})); }));
break; break;
case "BLOCKED": case "BLOCKED":
newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.NumberBadge, { newchildren.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.BadgeComponents.NumberBadge, {
className: BDFDB.disCN.settingstabbarbadge, className: BDFDB.disCN.settingstabbarbadge,
count: relationshipCount.BLOCKED count: relationshipCount.BLOCKED
})); }));