фикс 8
This commit is contained in:
@@ -1326,13 +1326,16 @@ data-role="{{ p.position or '' }}"
|
|||||||
return result || String(fallbackName || "").trim();
|
return result || String(fallbackName || "").trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function sendNeutralPersonTitle(name, role, logoUrl) {
|
async function sendNeutralPersonTitle(name, role, side) {
|
||||||
const inputName = "ИГРОК - НЕЙТРАЛЬНЫЙ";
|
const inputName = "ИГРОК - НЕЙТРАЛЬНЫЙ";
|
||||||
|
|
||||||
|
const teamName = TEAM_NAMES?.[side] || "";
|
||||||
|
const logoPath = getVmixTeamLogo(teamName);
|
||||||
|
|
||||||
const commands = [
|
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(name || "")}`,
|
||||||
`/api/?Function=SetText&Input=${encodeURIComponent(inputName)}&SelectedName=${encodeURIComponent("Должность.Text")}&Value=${encodeURIComponent(role || "")}`,
|
`/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)}`
|
`/api/?Function=PreviewInput&Input=${encodeURIComponent(inputName)}`
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -1346,15 +1349,17 @@ data-role="{{ p.position or '' }}"
|
|||||||
},
|
},
|
||||||
credentials: "same-origin",
|
credentials: "same-origin",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
match_id: matchId,
|
match_id: MATCH_ID,
|
||||||
session_token: sessionToken,
|
|
||||||
commands,
|
commands,
|
||||||
|
target_login: CURRENT_USER_LOGIN,
|
||||||
meta: {
|
meta: {
|
||||||
source: "person_click",
|
source: "person_click",
|
||||||
title_input: inputName,
|
title_input: inputName,
|
||||||
person_name: name,
|
person_name: name,
|
||||||
person_role: role,
|
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) {
|
document.addEventListener("click", function (event) {
|
||||||
const trigger = event.target.closest(".vmix-person-trigger");
|
const trigger = event.target.closest(".vmix-person-trigger");
|
||||||
if (!trigger) return;
|
if (!trigger) return;
|
||||||
@@ -1391,7 +1397,7 @@ data-role="{{ p.position or '' }}"
|
|||||||
|
|
||||||
if (!formattedName) return;
|
if (!formattedName) return;
|
||||||
|
|
||||||
sendNeutralPersonTitle(formattedName, role, logoUrl);
|
sendNeutralPersonTitle(formattedName, role, side);
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user