2023-10-13 02:10:36 +00:00
|
|
|
/*
|
|
|
|
* 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"],
|
2023-10-25 12:47:08 +00:00
|
|
|
patches: [
|
|
|
|
{
|
|
|
|
find: ".oneByTwoLayoutThreeGrid",
|
|
|
|
replacement: [{
|
2023-10-13 02:10:36 +00:00
|
|
|
match: /mediaLayoutType:\i\.\i\.MOSAIC/,
|
2023-10-25 12:47:08 +00:00
|
|
|
replace: 'mediaLayoutType:"RESPONSIVE"'
|
2023-10-13 02:10:36 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,
|
|
|
|
replace: '"INVALID"',
|
2023-10-25 12:47:08 +00:00
|
|
|
},]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
find: "Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT",
|
|
|
|
replacement: {
|
|
|
|
match: /\i===\i\.\i\.MOSAIC/,
|
|
|
|
replace: "true"
|
|
|
|
}
|
|
|
|
}],
|
2023-10-13 02:10:36 +00:00
|
|
|
start() {
|
|
|
|
enableStyle(style);
|
|
|
|
},
|
|
|
|
stop() {
|
|
|
|
disableStyle(style);
|
|
|
|
}
|
|
|
|
});
|