fix limit

This commit is contained in:
thororen1234 2026-02-26 11:35:07 -05:00
parent 7166fdc109
commit 90cde63c15
No known key found for this signature in database
2 changed files with 22 additions and 19 deletions

View file

@ -1436,16 +1436,18 @@
"jumpFailed": "Failed to jump to message. Check console for details."
}
},
"limitMiddleClickPaste": {
"description": "Prevent middle click pasting either always or just when a text area is not focused.",
"middleClickTweaks": {
"description": "Various middle click tweaks, such as with pasting and link opening.",
"settings": {
"scope": "Situations in which to prevent middle click from pasting.",
"threshold": "Milliseconds until pasting is enabled again after a middle click.",
"preventLinkOpen": "Prevent middle-click on links from opening new tabs while preserving autoscroll."
},
"options": {
"alwaysPrevent": "Always Prevent Middle Click Pasting",
"onlyWhenNotFocused": "Only Prevent When Text Area Not Focused"
"openScope": "Prevent middle clicking on these content types from opening them.",
"links": "Links",
"media": "Media",
"both": "Links & Media",
"none": "None",
"pasteScope": "Prevent middle click from pasting during these situations.",
"always": "Always Prevent Middle Click Pasting",
"focus": "Only Prevent When Text Area Not Focused",
"pasteThreshold": "Milliseconds until pasting is enabled again after a middle click."
}
},
"listenBrainzRPC": {

View file

@ -6,6 +6,7 @@
import { definePluginSettings, SettingsStore } from "@api/Settings";
import { EquicordDevs } from "@utils/index";
import { t } from "@utils/translation";
import definePlugin, { OptionType } from "@utils/types";
const MIDDLE_CLICK = 1;
@ -50,26 +51,26 @@ function handleMouseUp(event: MouseEvent) {
const settings = definePluginSettings({
openScope: {
type: OptionType.SELECT,
description: "Prevent middle clicking on these content types from opening them.",
description: t("middleClickTweaks.settings.openScope"),
options: [
{ label: "Links", value: "links" },
{ label: "Media", value: "media" },
{ label: "Links & Media", value: "both" },
{ label: "None", value: "none", default: true },
{ label: t("middleClickTweaks.settings.links"), value: "links" },
{ label: t("middleClickTweaks.settings.media"), value: "media" },
{ label: t("middleClickTweaks.settings.both"), value: "both" },
{ label: t("middleClickTweaks.settings.none"), value: "none", default: true },
],
onChange(newValue) { updateListeners(newValue !== "none"); }
},
pasteScope: {
type: OptionType.SELECT,
description: "Prevent middle click from pasting during these situations.",
description: t("middleClickTweaks.settings.pasteScope"),
options: [
{ label: "Always Prevent Middle Click Pasting", value: "always", default: true },
{ label: "Only Prevent When Text Area Not Focused", value: "focus" },
{ label: t("middleClickTweaks.settings.always"), value: "always", default: true },
{ label: t("middleClickTweaks.settings.focus"), value: "focus" },
]
},
pasteThreshold: {
type: OptionType.NUMBER,
description: "Milliseconds until pasting is enabled again after a middle click.",
description: t("middleClickTweaks.settings.pasteThreshold"),
default: 100,
onChange(newValue) { if (newValue < 1) { settings.store.pasteThreshold = 1; } }
}
@ -97,7 +98,7 @@ migrate();
export default definePlugin({
name: "MiddleClickTweaks",
description: "Various middle click tweaks, such as with pasting and link opening.",
description: t("middleClickTweaks.description"),
authors: [EquicordDevs.Etorix, EquicordDevs.korzi],
settings,