mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-14 04:28:49 +00:00
fix(challenges/xeact): add noscript warning
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -115,6 +115,15 @@ const d = (ms) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the contents of a given HTML page element as JSON and
|
||||||
|
* return the results.
|
||||||
|
*
|
||||||
|
* This is useful when using templ to pass complicated data from
|
||||||
|
* the server to the client via HTML[1].
|
||||||
|
*
|
||||||
|
* [1]: https://templ.guide/syntax-and-usage/script-templates/#pass-server-side-data-to-the-client-in-a-html-attribute
|
||||||
|
*/
|
||||||
const j = (id) => JSON.parse(g(id).textContent);
|
const j = (id) => JSON.parse(g(id).textContent);
|
||||||
|
|
||||||
export { h, t, x, g, j, c, n, u, s, r, useState, d };
|
export { h, t, x, g, j, c, n, u, s, r, useState, d };
|
||||||
|
|||||||
@@ -17,5 +17,8 @@ templ page(redir, challenge string, difficulty int, loc *localization.SimpleLoca
|
|||||||
"pensive_url": anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" + anubis.Version,
|
"pensive_url": anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" + anubis.Version,
|
||||||
})
|
})
|
||||||
@templ.ComponentFunc(renderAppJS)
|
@templ.ComponentFunc(renderAppJS)
|
||||||
|
<noscript>
|
||||||
|
{ loc.T("javascript_required") }
|
||||||
|
</noscript>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
15
lib/challenge/preact/preact_templ.go
generated
15
lib/challenge/preact/preact_templ.go
generated
@@ -53,7 +53,20 @@ func page(redir, challenge string, difficulty int, loc *localization.SimpleLocal
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<noscript>")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
var templ_7745c5c3_Var2 string
|
||||||
|
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(loc.T("javascript_required"))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `preact.templ`, Line: 21, Col: 33}
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</noscript></div>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user