Archived
1
0
This commit is contained in:
Jeff 2016-05-03 13:16:18 -04:00
parent ce8180c804
commit f6576aa899
2 changed files with 3 additions and 3 deletions

View File

@ -372,8 +372,8 @@ function init(prefix) {
}, false);
e.addEventListener("dragend", function(ev) {
var x = originalX + ( ev.clientX - mouseDownX ) - ev.offsetX;
var y = originalY + ( ev.clientY - mouseDownY ) - ev.offsetY;
var x = originalX + ev.clientX - ( mouseDownX - ev.offsetX );
var y = originalY + ev.clientY - ( mouseDownY - ev.offsetY );
//x -= window.screenLeft;
//y -= window.screenTop;
rpl.moveTo(x, y);

View File

@ -81,7 +81,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<l;idx++){var e=elems[idx];ls.push(e);}
for(var elem in ls){inject_hover(prefix,ls[elem]);}}
function init(prefix){inject_hover_for_element(document);var rpl=getReplyTo();rpl.setPrefix(prefix);var e=rpl.elem;var mouseDownX,mouseDownY;var originalX=window.screenX-50;var originalY=10;rpl.moveTo(originalX,originalY);e.setAttribute("draggable","true");e.addEventListener("dragstart",function(ev){console.log(ev);mouseDownX=ev.clientX;mouseDownY=ev.clientY;if(!ev.shiftKey){ev.preventDefault();}},false);e.addEventListener("dragend",function(ev){var x=originalX+(ev.clientX-mouseDownX)-ev.offsetX;var y=originalY+(ev.clientY-mouseDownY)-ev.offsetY;rpl.moveTo(x,y);originalX=x;originalY=y;},false);e=document.getElementById("postform_submit");var postit=function(){var f=document.querySelector("form");var r=getReplyTo();r.showMessage("posting... ");r.post(function(j){if(j.error){r.showError(j.error);}else{r.showMessage("posted :^)");r.updateCaptcha();r.clear();}},function(err){r.showError(err);r.clearSolution();});}
function init(prefix){inject_hover_for_element(document);var rpl=getReplyTo();rpl.setPrefix(prefix);var e=rpl.elem;var mouseDownX,mouseDownY;var originalX=window.screenX-50;var originalY=10;rpl.moveTo(originalX,originalY);e.setAttribute("draggable","true");e.addEventListener("dragstart",function(ev){console.log(ev);mouseDownX=ev.clientX;mouseDownY=ev.clientY;if(!ev.shiftKey){ev.preventDefault();}},false);e.addEventListener("dragend",function(ev){var x=originalX+ev.clientX-(mouseDownX-ev.offsetX);var y=originalY+ev.clientY-(mouseDownY-ev.offsetY);rpl.moveTo(x,y);originalX=x;originalY=y;},false);e=document.getElementById("postform_submit");var postit=function(){var f=document.querySelector("form");var r=getReplyTo();r.showMessage("posting... ");r.post(function(j){if(j.error){r.showError(j.error);}else{r.showMessage("posted :^)");r.updateCaptcha();r.clear();}},function(err){r.showError(err);r.clearSolution();});}
var f=document.querySelector("form");f.onsubmit=function(){postit();return false;}}
/* ./contrib/js/theme.js */
function enable_theme(prefix,name){if(prefix&&name){var theme=document.getElementById("current_theme");if(theme){theme.href=prefix+"static/"+name+".css";var st=get_storage();st.nntpchan_prefix=prefix;st.nntpchan_theme=name;}}}