From 946e461fc023a23086ea063c05a62e86ae0f4e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Thu, 23 Apr 2026 15:37:58 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/match_workspace.html | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/templates/match_workspace.html b/templates/match_workspace.html index e7c3864..3604172 100644 --- a/templates/match_workspace.html +++ b/templates/match_workspace.html @@ -1326,13 +1326,16 @@ data-role="{{ p.position or '' }}" return result || String(fallbackName || "").trim(); } - async function sendNeutralPersonTitle(name, role, logoUrl) { + async function sendNeutralPersonTitle(name, role, side) { const inputName = "ИГРОК - НЕЙТРАЛЬНЫЙ"; + const teamName = TEAM_NAMES?.[side] || ""; + const logoPath = getVmixTeamLogo(teamName); + const commands = [ `/api/?Function=SetText&Input=${encodeURIComponent(inputName)}&SelectedName=${encodeURIComponent("Тренер.Text")}&Value=${encodeURIComponent(name || "")}`, `/api/?Function=SetText&Input=${encodeURIComponent(inputName)}&SelectedName=${encodeURIComponent("Должность.Text")}&Value=${encodeURIComponent(role || "")}`, - `/api/?Function=SetImage&Input=${encodeURIComponent(inputName)}&SelectedName=${encodeURIComponent("Лого.Source")}&Value=${encodeURIComponent(logoUrl || "")}`, + `/api/?Function=SetImage&Input=${encodeURIComponent(inputName)}&SelectedName=${encodeURIComponent("Лого.Source")}&Value=${encodeURIComponent(logoPath || "")}`, `/api/?Function=PreviewInput&Input=${encodeURIComponent(inputName)}` ]; @@ -1346,15 +1349,17 @@ data-role="{{ p.position or '' }}" }, credentials: "same-origin", body: JSON.stringify({ - match_id: matchId, - session_token: sessionToken, + match_id: MATCH_ID, commands, + target_login: CURRENT_USER_LOGIN, meta: { source: "person_click", title_input: inputName, person_name: name, person_role: role, - logo_url: logoUrl + side, + team_name: teamName, + logo_path: logoPath } }) }); @@ -1367,6 +1372,7 @@ data-role="{{ p.position or '' }}" } } + document.addEventListener("click", function (event) { const trigger = event.target.closest(".vmix-person-trigger"); if (!trigger) return; @@ -1391,7 +1397,7 @@ data-role="{{ p.position or '' }}" if (!formattedName) return; - sendNeutralPersonTitle(formattedName, role, logoUrl); + sendNeutralPersonTitle(formattedName, role, side); }); })();