фикс 8
This commit is contained in:
@@ -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);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user