Show widget language debug info
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<strong>${escapeHtml(copy.title)}</strong>
|
<strong>${escapeHtml(copy.title)}</strong>
|
||||||
<small>${escapeHtml(site.isOnline ? copy.intro : copy.offlineIntro)}</small>
|
<small>${escapeHtml(site.isOnline ? copy.intro : copy.offlineIntro)}</small>
|
||||||
|
<small class="mf-lang-debug">jazyk: sent=${escapeHtml(lang || "default")} / requested=${escapeHtml(config.requestedLanguage || "default")} / used=${escapeHtml(config.language || "default")}</small>
|
||||||
<button class="mf-close" type="button" aria-label="Close">×</button>
|
<button class="mf-close" type="button" aria-label="Close">×</button>
|
||||||
</header>
|
</header>
|
||||||
<div class="mf-messages"></div>
|
<div class="mf-messages"></div>
|
||||||
@@ -598,6 +599,7 @@
|
|||||||
header { position: relative; display: grid; gap: 3px; background: ${c.brand}; color: ${c.brandText}; padding: 15px 122px 15px 16px; }
|
header { position: relative; display: grid; gap: 3px; background: ${c.brand}; color: ${c.brandText}; padding: 15px 122px 15px 16px; }
|
||||||
header strong { font-size: 16px; }
|
header strong { font-size: 16px; }
|
||||||
header small { opacity: .92; font-size: 13px; line-height: 1.35; }
|
header small { opacity: .92; font-size: 13px; line-height: 1.35; }
|
||||||
|
.mf-lang-debug { opacity: .78; font-size: 11px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
|
||||||
.mf-header-actions { position: absolute; top: 9px; right: 9px; display: flex; gap: 6px; }
|
.mf-header-actions { position: absolute; top: 9px; right: 9px; display: flex; gap: 6px; }
|
||||||
.mf-close, .mf-info { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgb(255 255 255 / 16%); color: ${c.brandText}; cursor: pointer; padding: 0; }
|
.mf-close, .mf-info { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgb(255 255 255 / 16%); color: ${c.brandText}; cursor: pointer; padding: 0; }
|
||||||
.mf-close svg, .mf-info svg { width: 19px; height: 19px; fill: currentColor; }
|
.mf-close svg, .mf-info svg { width: 19px; height: 19px; fill: currentColor; }
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ async function widgetConfig(res, url) {
|
|||||||
if (!site) return json(res, 404, { error: "site_not_found" });
|
if (!site) return json(res, 404, { error: "site_not_found" });
|
||||||
const language = widgetLanguageForRequest(site, url);
|
const language = widgetLanguageForRequest(site, url);
|
||||||
const copy = await widgetCopyForLanguage(site, language);
|
const copy = await widgetCopyForLanguage(site, language);
|
||||||
return json(res, 200, { site: formatSite(getSiteById(site.id)), publicBaseUrl: PUBLIC_BASE_URL, language: copy.language, copy: copy.copy });
|
return json(res, 200, { site: formatSite(getSiteById(site.id)), publicBaseUrl: PUBLIC_BASE_URL, requestedLanguage: language, language: copy.language, copy: copy.copy });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function visitorPing(req, res) {
|
async function visitorPing(req, res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user