From 9d7eceb927ff88cf0456f14a26797cc85c965d3c Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 30 Apr 2016 16:14:47 -0400 Subject: [PATCH] use appendChild --- contrib/js/backlink.js | 4 ++-- contrib/static/nntpchan.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/js/backlink.js b/contrib/js/backlink.js index fc87836..f415ae2 100644 --- a/contrib/js/backlink.js +++ b/contrib/js/backlink.js @@ -215,12 +215,12 @@ DynReply.prototype.setRoot = function(roothash) { DynReply.prototype.showError = function(msg) { console.log("error in dynreply: "+msg); this._error.setAttribute("class", "error"); - this._error.value = document.createTextNode(msg); + this._error.appendChild(document.createTextNode(msg)); } DynReply.prototype.showMessage = function(msg) { this._error.setAttribute("class", "message"); - this._error.value = document.createTextNode(msg); + this._error.appendChild(document.createTextNode(msg)); var e = this._error; setTimeout(function() { // clear it diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index 2148848..6c1309c 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -30,8 +30,8 @@ DynReply.prototype.setPrefix=function(prefix){this.prefix=prefix;} 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);var e=this._error;setTimeout(function(){e.innerHTML="";},2000);} +DynReply.prototype.showError=function(msg){console.log("error in dynreply: "+msg);this._error.setAttribute("class","error");this._error.appendChild(document.createTextNode(msg));} +DynReply.prototype.showMessage=function(msg){this._error.setAttribute("class","message");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();} var elem=document.getElementById("postform_message");if(elem) {elem.value+=">>"+shorthash.substr(0,10)+"\n";}}