diff --git a/contrib/js/backlink.js b/contrib/js/backlink.js index a982cbf..d2f3fb7 100644 --- a/contrib/js/backlink.js +++ b/contrib/js/backlink.js @@ -245,6 +245,7 @@ DynReply.prototype.showError = function(msg) { 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() { @@ -377,6 +378,7 @@ function init(prefix) { var f = document.querySelector("form"); // do ajax request to post data var r = getReplyTo(); + r.showMessage("posting... "); r.post(function(j) { if(j.error) { // an error happened @@ -391,7 +393,6 @@ function init(prefix) { r.showError(err); r.clearSolution(); }); - r.showMessage("posting... "); } e.onclick = postit; var f = document.querySelector("form"); diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index a074d07..25126a2 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -35,7 +35,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.appendChild(document.createTextNode(msg));this.updateCaptcha();} -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);} +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();} var elem=document.getElementById("postform_message");if(elem) {elem.value+=">>"+shorthash.substr(0,10)+"\n";}} @@ -47,7 +47,7 @@ parent.appendChild(wrapper);parent.backlink=false;},function(msg){var wrapper=do parent.backlink=true;}};parent.backlink=true;} function inject_hover_for_element(elem){var elems=elem.getElementsByClassName("backlink");var ls=[];var l=elems.length;for(var idx=0;idx