From ed5be31c2225cc2e2b8ec75a72f22d8d2c943fcd Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 30 Apr 2016 15:02:09 -0400 Subject: [PATCH] try fixing movement --- 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 342b66f..08af407 100644 --- a/contrib/js/backlink.js +++ b/contrib/js/backlink.js @@ -124,7 +124,7 @@ function DynReply(existingElem) { } DynReply.prototype.moveTo = function(x,y) { - this.elem.setAttribute("style", "top: "+y+"px; left: "+x+"px;"); + this.elem.setAttribute("style", "top: "+y+"px; right: "+x+"px;"); } DynReply.prototype.update = function() { @@ -277,7 +277,7 @@ function init(prefix) { }, false); e.addEventListener("dragend", function(ev) { - var x = originalX + ev.clientX - mouseDownX; + var x = originalX - ev.clientX + mouseDownX; var y = originalY + ev.clientY - mouseDownY; rpl.moveTo(x, y); originalX = x; diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index c4a76d2..e6b82a5 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -19,7 +19,7 @@ function DynReply(existingElem){if(existingElem){this.elem=existingElem;this.for 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.moveTo=function(x,y){this.elem.setAttribute("style","top: "+y+"px; left: "+x+"px;");} +DynReply.prototype.moveTo=function(x,y){this.elem.setAttribute("style","top: "+y+"px; right: "+x+"px;");} DynReply.prototype.update=function(){if(this.prefix){this.updateCaptcha();if(this.board&&this.roothash){var ref=document.getElementById("postform_reference");ref.setAttribute("value",this.roothash);this.form.action=this.prefix+"post/"+this.board;}}} DynReply.prototype.show=function(){console.log("show dynreply");this.update();this.elem.style.display='inline';} DynReply.prototype.updateCaptcha=function(){if(this.prefix){var captcha_img=document.getElementById("captcha_img");captcha_img.src=this.prefix+"captcha/img";}} @@ -38,7 +38,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