mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Invite a friend: WebSpeak3 join link, whisper history cleanup as spin box, German typing attenuation label
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
5b61def4b2
commit
9e4ff35e8e
6 files changed
+42
-22
No files matched your search
+31
-11
@@ -3667,19 +3667,30 @@ function CollectedUrlsDialog({
|
||||
function InviteFriendDialog({
|
||||
host,
|
||||
channelId,
|
||||
channelPath,
|
||||
onClose,
|
||||
}: {
|
||||
host: string;
|
||||
channelId: number | null;
|
||||
/** "Parent/Child" names, what ?channel= of a WebSpeak3 link expects. */
|
||||
channelPath: string | null;
|
||||
onClose: () => void;
|
||||
}) {
|
||||
const t = useT();
|
||||
const [type, setType] = useState<"webspeak3" | "ts3server">("webspeak3");
|
||||
const [includeChannel, setIncludeChannel] = useState(false);
|
||||
const [copied, setCopied] = useState(false);
|
||||
const linkInputRef = useRef<HTMLInputElement>(null);
|
||||
const backdrop = useBackdropDismiss(onClose);
|
||||
|
||||
const link = `ts3server://${host}${includeChannel && channelId !== null ? `?channel=${channelId}` : ""}`;
|
||||
const withChannel = includeChannel && channelId !== null;
|
||||
// Opens this same WebSpeak3 instance and joins right away (see AUTO_CONNECT_FROM_URL).
|
||||
const webspeak3Link = () => {
|
||||
const params = new URLSearchParams({ connect: host });
|
||||
if (withChannel && channelPath) params.set("channel", channelPath);
|
||||
return `${window.location.origin}${window.location.pathname}?${params}`;
|
||||
};
|
||||
const link = type === "webspeak3" ? webspeak3Link() : `ts3server://${host}${withChannel ? `?channel=${channelId}` : ""}`;
|
||||
|
||||
return (
|
||||
<div className="ts-dialog-backdrop" {...backdrop}>
|
||||
@@ -3694,7 +3705,8 @@ function InviteFriendDialog({
|
||||
<div className="ts-dialog-row">
|
||||
<label className="ts-dialog-field ts-dialog-field-grow">
|
||||
{t("inviteFriend.type")}
|
||||
<select disabled value="ts3server">
|
||||
<select value={type} onChange={(e) => setType(e.target.value as typeof type)}>
|
||||
<option value="webspeak3">{t("inviteFriend.webspeak3Link")}</option>
|
||||
<option value="ts3server">ts3server link</option>
|
||||
</select>
|
||||
</label>
|
||||
@@ -6743,8 +6755,6 @@ function ActionIcon({ children }: { children: ReactNode }) {
|
||||
);
|
||||
}
|
||||
|
||||
const WHISPER_CLEAR_OPTIONS = [1, 5, 10, 30, 60, 0];
|
||||
|
||||
function WhisperPanel({ onOpenWhisperLists }: { onOpenWhisperLists: () => void }) {
|
||||
const t = useT();
|
||||
const { whisper, setWhisper } = useContext(DisplayPrefsContext);
|
||||
@@ -6779,13 +6789,17 @@ function WhisperPanel({ onOpenWhisperLists }: { onOpenWhisperLists: () => void }
|
||||
</label>
|
||||
<label className="ts-options-field">
|
||||
{t("whisperSettings.clearAfter")}
|
||||
<select value={whisper.clearAfterMin} onChange={(e) => set({ clearAfterMin: Number(e.target.value) })}>
|
||||
{WHISPER_CLEAR_OPTIONS.map((min) => (
|
||||
<option key={min} value={min}>
|
||||
{min === 0 ? t("whisperSettings.never") : t("whisperSettings.minutes", { count: String(min) })}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<span>
|
||||
<input
|
||||
type="number"
|
||||
min={1}
|
||||
max={999}
|
||||
className="ts-download-number"
|
||||
value={whisper.clearAfterMin}
|
||||
onChange={(e) => set({ clearAfterMin: Math.min(999, Math.max(1, Number(e.target.value) || 1)) })}
|
||||
/>{" "}
|
||||
{t("whisperSettings.minutes")}
|
||||
</span>
|
||||
</label>
|
||||
</fieldset>
|
||||
<div>
|
||||
@@ -13470,6 +13484,12 @@ function AppInner() {
|
||||
<InviteFriendDialog
|
||||
host={host}
|
||||
channelId={selected?.type === "channel" ? selected.id : null}
|
||||
channelPath={(() => {
|
||||
if (selected?.type !== "channel") return null;
|
||||
const names: string[] = [];
|
||||
for (let ch = channels.find((c) => c.id === selected.id); ch && names.length < 50; ch = channels.find((c) => c.id === ch!.parent)) names.unshift(ch.name);
|
||||
return names.join("/");
|
||||
})()}
|
||||
onClose={() => setInviteFriendOpen(false)}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"inviteFriend.type": "Typ pozvánky",
|
||||
"inviteFriend.includeChannel": "Vložit aktuální kanál",
|
||||
"inviteFriend.link": "Odkaz",
|
||||
"inviteFriend.webspeak3Link": "Odkaz WebSpeak3",
|
||||
"inviteFriend.addPermissionKey": "Přidat klíč oprávnění",
|
||||
"inviteFriend.copyToClipboard": "Kopírovat do schránky",
|
||||
"inviteFriend.copied": "Zkopírováno!",
|
||||
@@ -174,8 +175,7 @@
|
||||
"whisperSettings.sound": "Přehrát zvuk, když vám někdo šeptá",
|
||||
"whisperSettings.openHistory": "Vždy otevřít historii šeptání, když vám někdo šeptá",
|
||||
"whisperSettings.clearAfter": "Odebrat klienty z historie šeptání po",
|
||||
"whisperSettings.never": "Nikdy",
|
||||
"whisperSettings.minutes": "{count} min",
|
||||
"whisperSettings.minutes": "minut",
|
||||
"whisperHistory.received": "{name} vám šeptal(a)",
|
||||
"whisperHistory.stopped": "Šeptání zastaveno",
|
||||
"whisperHistory.clear": "Vymazat",
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"inviteFriend.type": "Art der Einladung",
|
||||
"inviteFriend.includeChannel": "Aktuellen Channel einfügen",
|
||||
"inviteFriend.link": "Link",
|
||||
"inviteFriend.webspeak3Link": "WebSpeak3-Link",
|
||||
"inviteFriend.addPermissionKey": "Berechtigungsschlüssel hinzufügen",
|
||||
"inviteFriend.copyToClipboard": "In Zwischenablage kopieren",
|
||||
"inviteFriend.copied": "Kopiert!",
|
||||
@@ -174,8 +175,7 @@
|
||||
"whisperSettings.sound": "Sound abspielen, wenn Sie angewhispert werden",
|
||||
"whisperSettings.openHistory": "Whisper Verlauf immer öffnen, wenn Sie angewhispert werden",
|
||||
"whisperSettings.clearAfter": "Clients in Whisper Verlauf löschen nach",
|
||||
"whisperSettings.never": "Nie",
|
||||
"whisperSettings.minutes": "{count} Min.",
|
||||
"whisperSettings.minutes": "Minuten",
|
||||
"whisperHistory.received": "{name} hat dir zugewhispert",
|
||||
"whisperHistory.stopped": "Whispern beendet",
|
||||
"whisperHistory.clear": "Löschen",
|
||||
@@ -448,7 +448,7 @@
|
||||
"recording.hangoverDelay": "Abschaltverzögerung:",
|
||||
"recording.secondsUnit": "Sek",
|
||||
"recording.dsp": "Digital Signal Processing",
|
||||
"recording.typingAttenuation": "Typing attenuation",
|
||||
"recording.typingAttenuation": "Tippgeräusche dämpfen",
|
||||
"recording.echoCancellation": "Echo Dämpfung",
|
||||
"recording.noiseSuppression": "Hintergrundgeräusche entfernen",
|
||||
"recording.autoGainControl": "Automatische Verstärkung",
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"inviteFriend.type": "Invitation type",
|
||||
"inviteFriend.includeChannel": "Insert current channel",
|
||||
"inviteFriend.link": "Link",
|
||||
"inviteFriend.webspeak3Link": "WebSpeak3 link",
|
||||
"inviteFriend.addPermissionKey": "Add permission key",
|
||||
"inviteFriend.copyToClipboard": "Copy to clipboard",
|
||||
"inviteFriend.copied": "Copied!",
|
||||
@@ -174,8 +175,7 @@
|
||||
"whisperSettings.sound": "Play a sound when someone whispers to you",
|
||||
"whisperSettings.openHistory": "Always open the whisper history when someone whispers to you",
|
||||
"whisperSettings.clearAfter": "Remove clients from the whisper history after",
|
||||
"whisperSettings.never": "Never",
|
||||
"whisperSettings.minutes": "{count} min",
|
||||
"whisperSettings.minutes": "minutes",
|
||||
"whisperHistory.received": "{name} whispered to you",
|
||||
"whisperHistory.stopped": "Stopped whispering",
|
||||
"whisperHistory.clear": "Clear",
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"inviteFriend.type": "نوع دعوت",
|
||||
"inviteFriend.includeChannel": "افزودن کانال فعلی",
|
||||
"inviteFriend.link": "لینک",
|
||||
"inviteFriend.webspeak3Link": "لینک WebSpeak3",
|
||||
"inviteFriend.addPermissionKey": "افزودن کلید مجوز",
|
||||
"inviteFriend.copyToClipboard": "کپی در کلیپبورد",
|
||||
"inviteFriend.copied": "کپی شد!",
|
||||
@@ -174,8 +175,7 @@
|
||||
"whisperSettings.sound": "پخش صدا هنگام دریافت نجوا",
|
||||
"whisperSettings.openHistory": "باز کردن تاریخچهٔ نجوا هنگام دریافت نجوا",
|
||||
"whisperSettings.clearAfter": "حذف کاربران از تاریخچهٔ نجوا پس از",
|
||||
"whisperSettings.never": "هرگز",
|
||||
"whisperSettings.minutes": "{count} دقیقه",
|
||||
"whisperSettings.minutes": "دقیقه",
|
||||
"whisperHistory.received": "{name} با شما نجوا کرد",
|
||||
"whisperHistory.stopped": "نجوا متوقف شد",
|
||||
"whisperHistory.clear": "پاک کردن",
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
"inviteFriend.type": "邀请类型",
|
||||
"inviteFriend.includeChannel": "包含当前频道",
|
||||
"inviteFriend.link": "链接",
|
||||
"inviteFriend.webspeak3Link": "WebSpeak3 链接",
|
||||
"inviteFriend.addPermissionKey": "添加权限密钥",
|
||||
"inviteFriend.copyToClipboard": "复制到剪贴板",
|
||||
"inviteFriend.copied": "已复制!",
|
||||
@@ -113,8 +114,7 @@
|
||||
"whisperSettings.sound": "有人对你悄悄话时播放声音",
|
||||
"whisperSettings.openHistory": "有人对你悄悄话时总是打开悄悄话记录",
|
||||
"whisperSettings.clearAfter": "从悄悄话记录中移除客户端的时间",
|
||||
"whisperSettings.never": "从不",
|
||||
"whisperSettings.minutes": "{count} 分钟",
|
||||
"whisperSettings.minutes": "分钟",
|
||||
"whisperHistory.received": "{name} 对你说了悄悄话",
|
||||
"whisperHistory.stopped": "已停止悄悄话",
|
||||
"whisperHistory.clear": "清除",
|
||||
|
||||
Reference in new issue
Block a user