aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutumnVN <autumnvnchino@gmail.com>2023-10-13 09:10:36 +0700
committerGitHub <noreply@github.com>2023-10-13 04:10:36 +0200
commita522eab40dff096ce6ff80dd9660dd0530e4d480 (patch)
tree62c5cd271be08c88406abed654945c7f58ccbd50
parentc2721f158f8796a0c8a8490e44116a3df5547b71 (diff)
downloadVencord-a522eab40dff096ce6ff80dd9660dd0530e4d480.tar.gz
Vencord-a522eab40dff096ce6ff80dd9660dd0530e4d480.tar.bz2
Vencord-a522eab40dff096ce6ff80dd9660dd0530e4d480.zip
feat(plugin): NoMosaic (#1791)
-rw-r--r--src/plugins/noMosaic/index.ts41
-rw-r--r--src/plugins/noMosaic/styles.css3
2 files changed, 44 insertions, 0 deletions
diff --git a/src/plugins/noMosaic/index.ts b/src/plugins/noMosaic/index.ts
new file mode 100644
index 0000000..60576ba
--- /dev/null
+++ b/src/plugins/noMosaic/index.ts
@@ -0,0 +1,41 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2023 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+import { disableStyle, enableStyle } from "@api/Styles";
+import { Devs } from "@utils/constants";
+import definePlugin from "@utils/types";
+
+import style from "./styles.css?managed";
+
+export default definePlugin({
+ name: "NoMosaic",
+ authors: [Devs.AutumnVN],
+ description: "Removes Discord new image mosaic",
+ tags: ["image", "mosaic", "media"],
+ patches: [{
+ find: "Media Mosaic",
+ replacement: [
+ {
+ match: /mediaLayoutType:\i\.\i\.MOSAIC/,
+ replace: 'mediaLayoutType:"RESPONSIVE"',
+ },
+ {
+ match: /\i===\i\.\i\.MOSAIC/,
+ replace: "true",
+ },
+ {
+ match: /null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,
+ replace: '"INVALID"',
+ },
+ ],
+ }],
+ start() {
+ enableStyle(style);
+ },
+ stop() {
+ disableStyle(style);
+ }
+});
diff --git a/src/plugins/noMosaic/styles.css b/src/plugins/noMosaic/styles.css
new file mode 100644
index 0000000..5461685
--- /dev/null
+++ b/src/plugins/noMosaic/styles.css
@@ -0,0 +1,3 @@
+[class^="nonMediaAttachmentsContainer-"] [class*="messageAttachment-"] {
+ position: relative;
+}