From fb2b80335e7bc704033054f012fbb02853e44133 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 4 May 2016 13:14:57 -0400 Subject: [PATCH] don't show reply box if not created --- contrib/js/reply.js | 2 +- contrib/static/nntpchan.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/js/reply.js b/contrib/js/reply.js index 68252b0..04423a6 100644 --- a/contrib/js/reply.js +++ b/contrib/js/reply.js @@ -270,7 +270,7 @@ DynReply.prototype.showMessage = function(msg) { // reply box function function nntpchan_reply(parent, shorthash) { - if (parent) { + if (parent && document.dynreply) { var boardname = parent.getAttribute("boardname"); var roothash = parent.getAttribute("root"); var replyto = getReplyTo(); diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index a7964f4..bf1b7fc 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -678,7 +678,7 @@ DynReply.prototype.setBoard=function(boardname){if(boardname){this.board=boardna DynReply.prototype.setRoot=function(roothash){if(roothash){this.roothash=roothash;}} DynReply.prototype.showError=function(msg){console.log("error in dynreply: "+msg);this._error.setAttribute("class","error message");this._error.appendChild(document.createTextNode(msg));this.updateCaptcha();} DynReply.prototype.showMessage=function(msg){this._error.setAttribute("class","message");this._error.innerHTML="";this._error.appendChild(document.createTextNode(msg));var e=this._error;setTimeout(function(){e.innerHTML="";},2000);} -function nntpchan_reply(parent,shorthash){if(parent){var boardname=parent.getAttribute("boardname");var roothash=parent.getAttribute("root");var replyto=getReplyTo();replyto.setBoard(boardname);replyto.setRoot(roothash);replyto.show();} +function nntpchan_reply(parent,shorthash){if(parent&&document.dynreply){var boardname=parent.getAttribute("boardname");var roothash=parent.getAttribute("root");var replyto=getReplyTo();replyto.setBoard(boardname);replyto.setRoot(roothash);replyto.show();} var elem=document.getElementById("postform_message");if(elem) {elem.value+=">>"+shorthash.substr(0,10)+"\n";}} function inject_hover(prefix,el,parent){if(!prefix){throw"prefix is not defined";}