This commit is contained in:
Mirco Wittrien 2021-01-20 16:00:29 +01:00
parent c946fdd9b5
commit f52ac0d328
9 changed files with 34 additions and 34 deletions

View File

@ -67,7 +67,7 @@ module.exports = (_ => {
var settings = {}, formats = {}, format = null;
const PreviewMessageComponent = class PreviewMessage extends BdApi.React.Component {
render () {
render() {
let spoofChannel = new BDFDB.DiscordObjects.Channel({
id: "126223823845647771",
guild_id: "850725684241078788",

View File

@ -131,10 +131,10 @@ module.exports = (_ => {
};
const FriendOnlineCounterComponent = class FriendOnlineCounter extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
friendCounter = this;
}
render () {
render() {
return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildouter,
children: BDFDB.ReactUtils.createElement("div", {
@ -149,10 +149,10 @@ module.exports = (_ => {
};
const TimeLogComponent = class TimeLog extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
timeLogList = this;
}
render () {
render() {
return this.props.entries.length ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.PaginatedList, {
items: this.props.entries,
amount: 100,

View File

@ -74,18 +74,18 @@ module.exports = (_ => {
var settings = {}, amounts = {}, zoomSettings = {}, engines = {}, enabledEngines = {}, ownLocations = {}, downloadsFolder;
const ImageDetails = class ImageDetails extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
this.props.attachment = BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(this, `${BDFDB.ReactUtils.instanceKey}.return`), "attachment", {up: true});
BDFDB.ReactUtils.forceUpdate(this);
}
componentDidUpdate () {
componentDidUpdate() {
if ((!this.props.attachment || !this.props.attachment.size) && !this.props.loaded) {
this.props.loaded = true;
this.props.attachment = BDFDB.ReactUtils.findValue(BDFDB.ObjectUtils.get(this, `${BDFDB.ReactUtils.instanceKey}.return`), "attachment", {up: true});
BDFDB.ReactUtils.forceUpdate(this);
}
}
render () {
render() {
return !this.props.attachment ? null : BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN._imageutilitiesimagedetails,
children: [

View File

@ -119,7 +119,7 @@ module.exports = (_ => {
const pluginRepoIcon = `<svg width="34" height="31" viewBox="0 0 400 382"><path d="M0.000 183.023 L 0.000 366.046 46.377 366.046 L 92.754 366.046 92.754 312.629 L 92.754 259.213 127.223 259.213 C 174.433 259.213,187.432 257.146,210.766 245.926 C 311.105 197.681,301.344 41.358,195.859 7.193 C 173.603 -0.015,173.838 0.000,80.846 0.000 L 0.000 0.000 0.000 183.023 M157.615 88.195 C 193.007 97.413,198.827 152.678,166.407 171.674 C 158.993 176.019,155.494 176.398,122.807 176.398 L 92.754 176.398 92.754 131.677 L 92.754 86.957 122.807 86.957 C 146.807 86.957,153.819 87.206,157.615 88.195" stroke="none" fill="COLOR_1" fill-rule="evenodd"></path><path d="M226.647 3.824 C 258.085 21.580,282.721 54.248,291.095 89.281 C 292.183 93.834,293.041 95.659,294.560 96.655 C 310.880 107.348,312.400 140.701,297.286 156.464 C 293.685 160.221,293.134 161.348,291.162 169.006 C 282.026 204.468,259.916 235.185,230.701 253.002 C 229.548 253.705,235.510 262.261,270.237 309.731 L 311.131 365.631 355.565 365.846 L 400.000 366.060 400.000 348.309 L 400.000 330.557 364.338 285.630 L 328.676 240.703 333.494 238.892 C 373.356 223.907,395.248 189.691,399.313 136.020 C 404.504 67.495,372.510 19.710,311.375 4.675 C 294.592 0.548,287.694 -0.000,252.482 0.000 L 219.876 0.000 226.647 3.824 M202.899 265.964 C 183.869 272.635,168.536 274.960,139.752 275.540 L 116.770 276.003 116.770 321.024 L 116.770 366.046 163.975 366.046 L 211.180 366.046 211.180 314.700 C 211.180 286.460,210.901 263.386,210.559 263.425 C 210.217 263.464,206.770 264.607,202.899 265.964" stroke="none" fill="COLOR_2" fill-rule="evenodd"></path></svg>`;
const RepoListComponent = class PluginList extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
list = this;
BDFDB.TimeUtils.timeout(_ => {
forcedSort = null;
@ -157,7 +157,7 @@ module.exports = (_ => {
if (this.props.orderKey == "DESC") plugins.reverse();
return plugins;
}
render () {
render() {
let automaticLoading = BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading);
if (!this.props.tab) this.props.tab = "Plugins";
this.props.entries = (!loading.is && !BDFDB.ObjectUtils.isEmpty(loadedPlugins) ? this.filterPlugins() : []).map(plugin => BDFDB.ReactUtils.createElement(RepoCardComponent, {
@ -234,7 +234,7 @@ module.exports = (_ => {
};
const RepoCardComponent = class PluginCard extends BdApi.React.Component {
render () {
render() {
let buttonConfig = buttonData[(Object.entries(pluginStates).find(n => n[1] == this.props.plugin.state) || [])[0]];
return buttonConfig && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AddonCard, {
icon: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
@ -385,10 +385,10 @@ module.exports = (_ => {
};
const RepoListHeaderComponent = class PluginListHeader extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
header = this;
}
render () {
render() {
if (!this.props.tab) this.props.tab = "Plugins";
return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._repolistheader,

View File

@ -71,14 +71,14 @@ module.exports = (_ => {
super(props);
this.state = {fetchedOwner: false, delayed: false, repositioned: false};
}
componentDidUpdate () {
componentDidUpdate() {
if (amounts.tooltipDelay && this.state.delayed && !this.state.repositioned) {
this.state.repositioned = true;
let tooltip = BDFDB.DOMUtils.getParent(BDFDB.dotCN.tooltip, BDFDB.ObjectUtils.get(this, `${BDFDB.ReactUtils.instanceKey}.return.return.stateNode.containerInfo`));
if (tooltip) tooltip.update();
}
}
render () {
render() {
if (amounts.tooltipDelay && !this.state.delayed) {
BDFDB.TimeUtils.timeout(_ => {
this.state.delayed = true;
@ -144,7 +144,7 @@ module.exports = (_ => {
};
const GuildDetailsRowComponent = class GuildDetailsRow extends BdApi.React.Component {
render () {
render() {
return (this.props.prefix.length + this.props.string.length) > Math.round(34 * (amounts.tooltipWidth/300)) ? [
BDFDB.ReactUtils.createElement("div", {
children: `${this.props.prefix}:`

View File

@ -86,10 +86,10 @@ module.exports = (_ => {
var folderGuildContent = null;
const folderGuildContentComponent = class FolderGuildsContent extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
folderGuildContent = this;
}
render () {
render() {
let closing = this.props.closing;
delete this.props.closing;
let folders = Array.from(BDFDB.LibraryModules.FolderUtils.getExpandedFolders()).map(folderId => BDFDB.LibraryModules.FolderStore.getGuildFolderById(folderId)).filter(folder => folder && folder.guildIds);
@ -201,7 +201,7 @@ module.exports = (_ => {
};
const folderIconPickerComponent = class FolderIconPicker extends BdApi.React.Component {
render () {
render() {
let folderIcons = _this.loadAllIcons();
for (let id in folderIcons) if (!folderIcons[id].customID) {
folderIcons[id].openicon = _this.createBase64SVG(folderIcons[id].openicon);
@ -252,7 +252,7 @@ module.exports = (_ => {
var redCross = `'data:image/svg+xml; base64, PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIj48cGF0aCBkPSJNNDAuNDAwIDE3LjE3OCBDIDM5Ljg1MCAxNy4zNjYsMzguNzkzIDE3LjUzOCwzOC4wNTAgMTcuNTYwIEMgMzMuMzUxIDE3LjY5OSwyMy4zOTcgMjQuNzg4LDIxLjM4MSAyOS40MzIgQyAyMS4wODcgMzAuMTA5LDIwLjU2NiAzMC44OTYsMjAuMjIzIDMxLjE4MSBDIDE5Ljg4MCAzMS40NjUsMTkuNjAwIDMxLjg2NiwxOS42MDAgMzIuMDcxIEMgMTkuNjAwIDMyLjI3NiwxOS4yMzYgMzMuMjQyLDE4Ljc5MiAzNC4yMTggQyAxNi4zNDUgMzkuNTg5LDE2LjM0NSA0OS42MTEsMTguNzkyIDU0Ljk4MiBDIDE5LjIzNiA1NS45NTgsMTkuNjAwIDU2L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LjYyMSwzNzkuMjc3IDMwLjE3MSBDIDM3Ni4xMzYgMjQuNDY5LDM2Ny45MDYgMTguNTM3LDM2MS42NjggMTcuNDc3IEMgMzU0LjY1NiAxNi4yODYsMzQ1LjA5NSAxNy42NjUsMzQxLjg4MyAyMC4zMzEgQyAzNDEuNTY3IDIwLjU5NCwzNDAuNTQ5IDIxLjMxOCwzMzkuNjIyIDIxLjk0MSBDIDMzOC42OTUgMjIuNTYzLDMwNy4wMzEgNTMuOTcyLDI2OS4yNTkgOTEuNzM3IEMgMjMxLjQ4NiAxMjkuNTAxLDIwMC4zMzAgMTYwLjQwMCwyMDAuMDIyIDE2MC40MDAgQyAxOTkuNzE0IDE2MC40MDAsMTY4LjkzOCAxMjkuODY5LDEzMS42MzEgOTIuNTU0IEMgNTYuMjI1IDE3LjEzMSw2MC4yODggMjEuMDQ3LDU1LjIwMCAxOC44ODcgQyA1MS41OTEgMTcuMzU0LDQyLjgzNiAxNi4zNDMsNDAuNDAwIDE3LjE3OHoiIGZpbGw9InJnYigyNDAsIDcxLCA3MSkiPjwvcGF0aD48L3N2Zz4='`;
const folderIconCustomPreviewComponent = class FolderIconCustomPreview extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
this._previewInterval = BDFDB.TimeUtils.interval(_ => {
this.props.tick = !this.props.tick;
BDFDB.ReactUtils.forceUpdate(this);
@ -299,7 +299,7 @@ module.exports = (_ => {
img.src = base64;
}
}
render () {
render() {
return [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, {
title: _this.labels.modal_customopen,

View File

@ -95,7 +95,7 @@ module.exports = (_ => {
};
const userRowComponent = class UserRow extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
if (this.props.user.fetchable) {
this.props.user.fetchable = false;
BDFDB.LibraryModules.UserFetchUtils.getUser(this.props.user.id).then(fetchedUser => {
@ -104,7 +104,7 @@ module.exports = (_ => {
});
}
}
render () {
render() {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, {
prefix: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
className: BDFDB.disCN.listavatar,
@ -128,7 +128,7 @@ module.exports = (_ => {
};
const roleRowComponent = class RoleRow extends BdApi.React.Component {
render () {
render() {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, {
prefix: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.avataricon + BDFDB.disCNS.listavatar + BDFDB.disCNS.avatariconsizemedium + BDFDB.disCN.avatariconinactive,

View File

@ -71,7 +71,7 @@ module.exports = (_ => {
];
const SpotifyControlsComponent = class SpotifyControls extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
controls = this;
}
request(socket, device, type, data) {
@ -110,7 +110,7 @@ module.exports = (_ => {
});
});
}
render () {
render() {
let socketDevice = BDFDB.LibraryModules.SpotifyTrackUtils.getActiveSocketAndDevice();
if (!socketDevice) return null;
if (this.props.song) {
@ -321,7 +321,7 @@ module.exports = (_ => {
}
};
const SpotifyControlsButtonComponent = class SpotifyControlsButton extends BdApi.React.Component {
render () {
render() {
if (!this.props.playerSize || !buttonConfigs[this.props.type] || !buttonConfigs[this.props.type][this.props.playerSize]) return null;
let button = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, BDFDB.ObjectUtils.exclude(Object.assign({}, this.props, {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.accountinfobutton, this.props.disabled ? BDFDB.disCN.accountinfobuttondisabled : BDFDB.disCN.accountinfobuttonenabled, this.props.active && BDFDB.disCN._spotifycontrolsbuttonactive),
@ -343,7 +343,7 @@ module.exports = (_ => {
}
};
const SpotifyControlsTimelineComponent = class SpotifyControlsTimeline extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
BDFDB.TimeUtils.clear(updateInterval);
updateInterval = BDFDB.TimeUtils.interval(_ => {
if (!this.updater || typeof this.updater.isMounted != "function" || !this.updater.isMounted(this)) BDFDB.TimeUtils.clear(updateInterval);
@ -360,7 +360,7 @@ module.exports = (_ => {
let hours = Math.floor((time / (1000 * 60 * 60)) % 24);
return `${hours > 0 ? hours + ":" : ""}${hours > 0 && minutes < 10 ? "0" + minutes : minutes}:${seconds < 10 ? "0" + seconds : seconds}`
}
render () {
render() {
let maxTime = this.props.song.timestamps.end - this.props.song.timestamps.start;
let currentTime = (!playbackState.is_playing && stopTime ? stopTime : new Date()) - this.props.song.timestamps.start;
currentTime = currentTime > maxTime ? maxTime : currentTime;

View File

@ -119,7 +119,7 @@ module.exports = (_ => {
const themeRepoIcon = `<svg width="36" height="31" viewBox="20 0 400 332"><path d="M0.000 39.479 L 0.000 78.957 43.575 78.957 L 87.151 78.957 87.151 204.097 L 87.151 329.236 129.609 329.236 L 172.067 329.236 172.067 204.097 L 172.067 78.957 215.642 78.957 L 259.218 78.957 259.218 39.479 L 259.218 0.000 129.609 0.000 L 0.000 0.000 0.000 39.479" stroke="none" fill="COLOR_1" fill-rule="evenodd"></path><path d="M274.115 38.624 L 274.115 77.248 280.261 77.734 C 309.962 80.083,325.986 106.575,313.378 132.486 C 305.279 149.131,295.114 152.700,255.800 152.700 L 230.168 152.700 230.168 123.277 L 230.168 93.855 208.566 93.855 L 186.965 93.855 186.965 211.546 L 186.965 329.236 208.566 329.236 L 230.168 329.236 230.168 277.068 L 230.168 224.899 237.268 225.113 L 244.368 225.326 282.215 277.095 L 320.062 328.864 360.031 329.057 L 400.000 329.249 400.000 313.283 L 400.000 297.317 367.924 256.908 L 335.848 216.499 340.182 214.869 C 376.035 201.391,395.726 170.616,399.382 122.342 C 405.008 48.071,360.214 0.000,285.379 0.000 L 274.115 0.000 274.115 38.624" stroke="none" fill="COLOR_2" fill-rule="evenodd"></path></svg>`;
const RepoListComponent = class ThemeList extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
list = this;
BDFDB.TimeUtils.timeout(_ => {
forcedSort = null;
@ -224,7 +224,7 @@ module.exports = (_ => {
}
});
}
render () {
render() {
let automaticLoading = BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading);
if (!this.props.tab) this.props.tab = "Themes";
this.props.entries = (!loading.is && !BDFDB.ObjectUtils.isEmpty(loadedThemes) ? this.filterThemes() : []).map(theme => BDFDB.ReactUtils.createElement(RepoCardComponent, {
@ -503,7 +503,7 @@ module.exports = (_ => {
};
const RepoCardComponent = class ThemeCard extends BdApi.React.Component {
render () {
render() {
let buttonConfig = buttonData[(Object.entries(themeStates).find(n => n[1] == this.props.theme.state) || [])[0]];
return buttonConfig && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AddonCard, {
icon: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
@ -677,10 +677,10 @@ module.exports = (_ => {
};
const RepoListHeaderComponent = class ThemeListHeader extends BdApi.React.Component {
componentDidMount () {
componentDidMount() {
header = this;
}
render () {
render() {
if (!this.props.tab) this.props.tab = "Themes";
return BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._repolistheader,