Archived
1
0

fix js id for postform_container

This commit is contained in:
Jeff Becker 2016-04-30 12:56:24 -04:00
parent 3a1a24f6da
commit 048300d6e4
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ var dynreply;
function getReplyTo() {
if(!dynreply) {
var e = document.getElementById("postform-container");
var e = document.getElementById("postform_container");
if (e) {
// use existing postform
dynreply = new DynReply(e);
@ -44,7 +44,7 @@ function DynReply(existingElem) {
// build new post form
var elem = document.createElement("div");
elem.setAttribute("id", "postform-container");
elem.setAttribute("id", "postform_container");
this.elem = elem;
// build post form
this.form = document.createElement("form");

View File

@ -11,12 +11,12 @@ handler(j);}};ajax.open("GET",url);ajax.send();}
function nntpchan_buildpost(parent,j){var post=document.createElement("div");if(j){post.innerHTML=j.PostMarkup;inject_hover_for_element(post);}else{post.setAttribute("class","notfound post");post.appendChild(document.createTextNode("post not found"));}
parent.appendChild(post);}
/* ./contrib/js/backlink.js */
var dynreply;function getReplyTo(){if(!dynreply){var e=document.getElementById("postform-container");if(e){dynreply=new DynReply(e);}else{dynreply=new DynReply();}}
var dynreply;function getReplyTo(){if(!dynreply){var e=document.getElementById("postform_container");if(e){dynreply=new DynReply(e);}else{dynreply=new DynReply();}}
return dynreply;}
function table_insert_row(table,header,items){var tr=document.createElement("tr");var th=document.createElement("th");th.appendChild(header);tr.appendChild(th);for(var idx=0;idx<items.length;idx++){var elem=document.createElement("td");elem.appendChild(items[idx]);tr.appendChild(elem);}
table.appendChild(tr);}
function DynReply(existingElem){if(existingElem){this.elem=existingElem;this.form=this.elem.querySelector("form");return;}
var elem=document.createElement("div");elem.setAttribute("id","postform-container");this.elem=elem;this.form=document.createElement("form");this.form.enctype="multipart/form-data";this.form.name="post";this.form.method="post";elem=document.createElement("input");elem.setAttribute("id","postform_reference");elem.name="reference";elem.type="hidden";this.form.appendChild(elem);var table=document.createElement("table");table.setAttribute("class","postform");var tbody=document.createElement("tbody");elem=document.createElement("input");elem.setAttribute("name","name");elem.setAttribute("value","Anonymous");table_insert_row(tbody,document.createTextNode("Name"),[elem])
var elem=document.createElement("div");elem.setAttribute("id","postform_container");this.elem=elem;this.form=document.createElement("form");this.form.enctype="multipart/form-data";this.form.name="post";this.form.method="post";elem=document.createElement("input");elem.setAttribute("id","postform_reference");elem.name="reference";elem.type="hidden";this.form.appendChild(elem);var table=document.createElement("table");table.setAttribute("class","postform");var tbody=document.createElement("tbody");elem=document.createElement("input");elem.setAttribute("name","name");elem.setAttribute("value","Anonymous");table_insert_row(tbody,document.createTextNode("Name"),[elem])
elem=document.createElement("input");elem.setAttribute("name","subject");elem.setAttribute("value","");var submit=document.createElement("input");submit.setAttribute("type","submit");submit.setAttribute("value","reply");submit.setAttribute("class","button");table_insert_row(tbody,document.createTextNode("Subject"),[elem,submit]);elem=document.createElement("textarea");elem.setAttribute("id","postform_message");elem.setAttribute("name","message");elem.setAttribute("cols","40");elem.setAttribute("rows","5");table_insert_row(tbody,document.createTextNode("Comment"),[elem]);elem=document.createElement("input");elem.setAttribute("class","postform_attachment");elem.setAttribute("id","postform_attachments");elem.setAttribute("type","file");elem.setAttribute("name","attachment_uploaded");elem.setAttribute("multiple","multiple");table_insert_row(tbody,document.createTextNode("Files"),[elem]);elem=document.createElement("input");elem.setAttribute("type","checkbox");elem.setAttribute("name","dubs");table_insert_row(tbody,document.createTextNode("Get Dubs"),[elem]);elem=document.createElement("img");elem.setAttribute("id","captcha_img");elem.alt="captcha";table_insert_row(tbody,document.createTextNode("Captcha"),[elem]);elem=document.createElement("input");elem.name="captcha";elem.autocomplete="off";table_insert_row(tbody,document.createTextNode("Name"),[elem])
table.appendChild(tbody);this.form.appendChild(table);this.elem.appendChild(this.form);document.body.appendChild(this.elem);this.board=null;this.roothash=null;this.prefix=null;}
DynReply.prototype.update=function(){if(this.prefix){this.updateCaptcha();if(this.board&&this.roothash){var ref=document.getElementById("postform_reference");ref.value=this.roothash;this.form.action=this.prefix+"post/"+this.board;}}}