mirror of
https://gitdab.com/cadence/breezewiki.git
synced 2026-03-04 13:30:04 -05:00
show captcha correctly if page unloads
This commit is contained in:
@@ -92,21 +92,21 @@
|
||||
(link (@ (rel "stylesheet") (type "text/css") (href ,(get-static-url "internal.css"))))
|
||||
(link (@ (rel "stylesheet") (type "text/css") (href ,(get-static-url "main.css"))))
|
||||
(link (@ (rel "icon") (href ,(head-data^-icon-url head-data-default))))
|
||||
(script (@ (defer) (src ,(get-static-url "captcha.js"))))
|
||||
(body (@ (class "skin-fandomdesktop theme-fandomdesktop-light internal"))
|
||||
(div (@ (class "main-container"))
|
||||
(div (@ (class "fandom-community-header__background tileBoth header")))
|
||||
(div (@ (class "page"))
|
||||
(main (@ (class "page__main"))
|
||||
(div (@ (class "custom-top"))
|
||||
(h1 (@ (class "page-title"))
|
||||
"Checking you're not a bot..."))
|
||||
(div (@ (id "content") #;(class "page-content"))
|
||||
(div (@ (id "mw-content-text"))
|
||||
(p "To confirm, please click directly in the circle, or hold down the " ,(~a (get-key-solution req)) " key on your keyboard.")
|
||||
(noscript (p "JavaScript is required for the captcha. Sorry!"))
|
||||
(div (@ (id "captcha-area")))))
|
||||
,(application-footer #f)))))))))
|
||||
(script (@ (defer) (src ,(get-static-url "captcha.js")))))
|
||||
(body (@ (class "skin-fandomdesktop theme-fandomdesktop-light internal"))
|
||||
(div (@ (class "main-container"))
|
||||
(div (@ (class "fandom-community-header__background tileBoth header")))
|
||||
(div (@ (class "page"))
|
||||
(main (@ (class "page__main"))
|
||||
(div (@ (class "custom-top"))
|
||||
(h1 (@ (class "page-title"))
|
||||
"Checking you're not a bot..."))
|
||||
(div (@ (id "content") #;(class "page-content"))
|
||||
(div (@ (id "mw-content-text"))
|
||||
(p "To confirm, please click directly in the circle, or hold down the " ,(~a (get-key-solution req)) " key on your keyboard.")
|
||||
(noscript (p "JavaScript is required for the captcha. Sorry!"))
|
||||
(div (@ (id "captcha-area")))))
|
||||
,(application-footer #f))))))))
|
||||
(when (config-true? 'debug)
|
||||
(xexp->html body))
|
||||
(response/output
|
||||
|
||||
@@ -88,7 +88,10 @@ async function cont() {
|
||||
|
||||
xhr.addEventListener("load", () => {
|
||||
console.log(xhr)
|
||||
// check for errors
|
||||
if (xhr.status === 500) return fetch(pkg.url, pkg.init).then(res => res.text()).then(error)
|
||||
// check for captcha screen
|
||||
if (xhr.responseXML.head.querySelector('script[src*="captcha.js"]')) return location.reload()
|
||||
// page -> #content
|
||||
const imported = document.importNode(xhr.responseXML.getElementById("content"), true)
|
||||
document.getElementById("content").replaceWith(imported)
|
||||
|
||||
Reference in New Issue
Block a user