From 274190e6bb845a8d745a36f03284806ef054bc0a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 13 Dec 2014 08:22:06 -0800 Subject: [PATCH] Detect when Javascript is disabled on the page and use the noscript captcha. --- src/Posting/QR.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index ce99c775f..cf23533c0 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -7,7 +7,9 @@ QR = @db = new DataBoard 'yourPosts' @posts = [] - @captcha = Captcha[if Conf['Force Noscript Captcha'] then 'noscript' else 'v2'] + $.globalEval 'document.documentElement.dataset.jsEnabled = true;' + noscript = Conf['Force Noscript Captcha'] or !doc.dataset.jsEnabled + @captcha = Captcha[if noscript then 'noscript' else 'v2'] if Conf['QR Shortcut'] sc = $.el 'a',