diff --git a/contrib/js/nntpchan/report.js b/contrib/js/nntpchan/report.js index ac5b0bd..cb60462 100644 --- a/contrib/js/nntpchan/report.js +++ b/contrib/js/nntpchan/report.js @@ -4,6 +4,7 @@ function show_censortools() { var e = document.getElementById("censor-tools"); if(e) e.checked = true; + else throw "censor tools element not found wtfug?"; } function nntpchan_report_thread(posthash) { @@ -58,10 +59,13 @@ function nntpchan_submit_censor(form, regular_url) { var url = parts.join('/'); url += '/json'; console.log(url); - var captcha = form.captcha.value; - if(!captcha) { - show_result("no captcha solution provided"); - return; + var captcha = null; + if(form.captcha) { + captcha = form.captcha.value; + if(!captcha) { + show_result("no captcha solution provided"); + return; + } } var secret = document.getElementById("nntp_censor_secret").value; if(!secret) { @@ -88,8 +92,9 @@ function nntpchan_submit_censor(form, regular_url) { formdata.append("name", "mod#"+secret); formdata.append("subject", "censor"); formdata.append("message", msg); - formdata.append("captcha", captcha); + if(captcha) { + formdata.append("captcha", captcha); + } formdata.append("reference", ""); nntpchan_apicall(url, handle_result, null, "POST", formdata); } - diff --git a/contrib/templates/default/post.mustache b/contrib/templates/default/post.mustache index 0c34826..be33629 100644 --- a/contrib/templates/default/post.mustache +++ b/contrib/templates/default/post.mustache @@ -41,11 +41,11 @@ - diff --git a/contrib/templates/default/postform.mustache b/contrib/templates/default/postform.mustache index 5181d09..1823e5d 100644 --- a/contrib/templates/default/postform.mustache +++ b/contrib/templates/default/postform.mustache @@ -53,6 +53,8 @@ {{/files}} + {{#DisableCaptcha}} + {{^DisableCaptcha}}