From 0df3fe43e08dec6b2a963d8af98a3f689e8b9182 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 30 Apr 2016 16:11:20 -0400 Subject: [PATCH] fix undefined error --- contrib/js/backlink.js | 3 ++- contrib/static/nntpchan.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/js/backlink.js b/contrib/js/backlink.js index 83f49fa..b8fd8d3 100644 --- a/contrib/js/backlink.js +++ b/contrib/js/backlink.js @@ -221,9 +221,10 @@ DynReply.prototype.showError = function(msg) { DynReply.prototype.showMessage = function(msg) { this._error.setAttribute("class", "message"); this._error.value = document.createTextNode(msg); + var e = this._error; setTimeout(function() { // clear it - this._error.innerHTML = ""; + e.innerHTML = ""; }, 2000); } diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index 4be1042..9f16e50 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -31,7 +31,7 @@ DynReply.prototype.hide=function(){this.elem.style.display='none';} DynReply.prototype.setBoard=function(boardname){if(boardname){this.board=boardname;}} 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");this._error.value=document.createTextNode(msg);} -DynReply.prototype.showMessage=function(msg){this._error.setAttribute("class","message");this._error.value=document.createTextNode(msg);setTimeout(function(){this._error.innerHTML="";},2000);} +DynReply.prototype.showMessage=function(msg){this._error.setAttribute("class","message");this._error.value=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();} var elem=document.getElementById("postform_message");if(elem) {elem.value+=">>"+shorthash.substr(0,10)+"\n";}}