mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-19 11:27:02 -04:00
Merge branch 'dev'
This commit is contained in:
commit
a676833606
9 changed files with 113 additions and 2 deletions
5
src/plugins/copyFileContents/README.md
Normal file
5
src/plugins/copyFileContents/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# CopyFileContents
|
||||||
|
|
||||||
|
Adds a button to text file attachments to copy their contents.
|
||||||
|
|
||||||
|

|
60
src/plugins/copyFileContents/index.tsx
Normal file
60
src/plugins/copyFileContents/index.tsx
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2024 Vendicated and contributors
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import "./style.css";
|
||||||
|
|
||||||
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
|
import { CopyIcon, NoEntrySignIcon } from "@components/Icons";
|
||||||
|
import { Devs } from "@utils/constants";
|
||||||
|
import { copyWithToast } from "@utils/misc";
|
||||||
|
import definePlugin from "@utils/types";
|
||||||
|
import { Tooltip, useState } from "@webpack/common";
|
||||||
|
|
||||||
|
const CheckMarkIcon = () => {
|
||||||
|
return <svg width="24" height="24" viewBox="0 0 24 24">
|
||||||
|
<path fill="currentColor" d="M21.7 5.3a1 1 0 0 1 0 1.4l-12 12a1 1 0 0 1-1.4 0l-6-6a1 1 0 1 1 1.4-1.4L9 16.58l11.3-11.3a1 1 0 0 1 1.4 0Z"></path>
|
||||||
|
</svg>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default definePlugin({
|
||||||
|
name: "CopyFileContents",
|
||||||
|
description: "Adds a button to text file attachments to copy their contents",
|
||||||
|
authors: [Devs.Obsidian, Devs.Nuckyz],
|
||||||
|
patches: [
|
||||||
|
{
|
||||||
|
find: ".Messages.PREVIEW_BYTES_LEFT.format(",
|
||||||
|
replacement: {
|
||||||
|
match: /\.footerGap.+?url:\i,fileName:\i,fileSize:\i}\),(?<=fileContents:(\i),bytesLeft:(\i).+?)/g,
|
||||||
|
replace: "$&$self.addCopyButton({fileContents:$1,bytesLeft:$2}),"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
addCopyButton: ErrorBoundary.wrap(({ fileContents, bytesLeft }: { fileContents: string, bytesLeft: number; }) => {
|
||||||
|
const [recentlyCopied, setRecentlyCopied] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip text={recentlyCopied ? "Copied!" : bytesLeft > 0 ? "File too large to copy" : "Copy File Contents"}>
|
||||||
|
{tooltipProps => (
|
||||||
|
<div
|
||||||
|
{...tooltipProps}
|
||||||
|
className="vc-cfc-button"
|
||||||
|
role="button"
|
||||||
|
onClick={() => {
|
||||||
|
if (!recentlyCopied && bytesLeft <= 0) {
|
||||||
|
copyWithToast(fileContents);
|
||||||
|
setRecentlyCopied(true);
|
||||||
|
setTimeout(() => setRecentlyCopied(false), 2000);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{recentlyCopied ? <CheckMarkIcon /> : bytesLeft > 0 ? <NoEntrySignIcon color="var(--channel-icon)" /> : <CopyIcon />}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
}, { noop: true }),
|
||||||
|
});
|
8
src/plugins/copyFileContents/style.css
Normal file
8
src/plugins/copyFileContents/style.css
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
.vc-cfc-button {
|
||||||
|
color: var(--interactive-normal);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-cfc-button:hover {
|
||||||
|
color: var(--interactive-hover);
|
||||||
|
}
|
13
src/plugins/ignoreActivities/README.md
Normal file
13
src/plugins/ignoreActivities/README.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# IgnoreActivities
|
||||||
|
|
||||||
|
Ignore activities from showing up on your status ONLY. You can configure which ones are specifically ignored from the Registered Games and Activities tabs, or use the general settings.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The activity stays showing as a detected game even if ignored, differently from the stock Toggle Detection button from Discord:
|
||||||
|
|
||||||
|

|
|
@ -237,7 +237,7 @@ function isActivityTypeIgnored(type: number, id?: string) {
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "IgnoreActivities",
|
name: "IgnoreActivities",
|
||||||
authors: [Devs.Nuckyz, Devs.Kylie],
|
authors: [Devs.Nuckyz, Devs.Kylie],
|
||||||
description: "Ignore activities from showing up on your status ONLY. You can configure which ones are specifically ignored from the Registered Games and Activities tabs, or use the general settings below.",
|
description: "Ignore activities from showing up on your status ONLY. You can configure which ones are specifically ignored from the Registered Games and Activities tabs, or use the general settings below",
|
||||||
dependencies: ["UserSettingsAPI"],
|
dependencies: ["UserSettingsAPI"],
|
||||||
|
|
||||||
settings,
|
settings,
|
||||||
|
@ -266,6 +266,7 @@ export default definePlugin({
|
||||||
replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),`
|
replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Discord has 3 different components for activities. Currently, the last is the one being used
|
||||||
{
|
{
|
||||||
find: ".activityTitleText,variant",
|
find: ".activityTitleText,variant",
|
||||||
replacement: {
|
replacement: {
|
||||||
|
@ -279,6 +280,13 @@ export default definePlugin({
|
||||||
match: /\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),/,
|
match: /\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),/,
|
||||||
replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),`
|
replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),`
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: ".promotedLabelWrapperNonBanner,children",
|
||||||
|
replacement: {
|
||||||
|
match: /\.appDetailsHeaderContainer.+?children:\i.*?}\),(?<=application:(\i).+?)/,
|
||||||
|
replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
3
src/plugins/stickerPaste/README.md
Normal file
3
src/plugins/stickerPaste/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# StickerPaste
|
||||||
|
|
||||||
|
Makes picking a sticker in the sticker picker insert it into the chatbox instead of instantly sending.
|
5
src/plugins/timeBarAllActivities/README.md
Normal file
5
src/plugins/timeBarAllActivities/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# TimeBarAllActivities
|
||||||
|
|
||||||
|
Adds the Spotify time bar to all activities if they have start and end timestamps.
|
||||||
|
|
||||||
|

|
9
src/plugins/volumeBooster/README.md
Normal file
9
src/plugins/volumeBooster/README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Volume Booster
|
||||||
|
|
||||||
|
Allows you to boost the volume over 200% on desktop and over 100% on other clients.
|
||||||
|
|
||||||
|
Works on users, bots, and streams!
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
|
@ -69,7 +69,7 @@ export default definePlugin({
|
||||||
// Patches needed for web/vesktop
|
// Patches needed for web/vesktop
|
||||||
{
|
{
|
||||||
find: "streamSourceNode",
|
find: "streamSourceNode",
|
||||||
predicate: () => IS_WEB,
|
predicate: () => !IS_DISCORD_DESKTOP,
|
||||||
group: true,
|
group: true,
|
||||||
replacement: [
|
replacement: [
|
||||||
// Remove rounding algorithm
|
// Remove rounding algorithm
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue