Archived
1
0
This commit is contained in:
Jeff 2016-05-03 14:25:32 -04:00
parent 43bb6e4c5c
commit 2613c57bf8
2 changed files with 5 additions and 5 deletions

View File

@ -393,8 +393,8 @@ function init(prefix) {
e.addEventListener("dragstart", function(ev) { e.addEventListener("dragstart", function(ev) {
console.log(ev); console.log(ev);
mouseDownX = ev.clientX; mouseDownX = ev.screenX;
mouseDownY = ev.clientY; mouseDownY = ev.screenY;
if(!ev.shiftKey) { if(!ev.shiftKey) {
ev.preventDefault(); ev.preventDefault();
} }
@ -402,8 +402,8 @@ function init(prefix) {
e.addEventListener("dragend", function(ev) { e.addEventListener("dragend", function(ev) {
console.log(mouseDownX, mouseDownY); console.log(mouseDownX, mouseDownY);
var dx = ox + ev.clientX - mouseDownX; var dx = ox + ev.screenX - mouseDownX;
var dy = oy + ev.clientY - mouseDownY; var dy = oy + ev.screenY - mouseDownY;
console.log(ox, oy, dx, dy); console.log(ox, oy, dx, dy);
rpl.translate(dx, dy); rpl.translate(dx, dy);

View File

@ -84,7 +84,7 @@ parent.appendChild(wrapper);parent.backlink=false;},function(msg){var wrapper=do
parent.backlink=true;}};parent.backlink=true;} 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);} 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]);}} 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 ox=document.body.clientWidth-50;var oy=10;rpl.moveTo(ox,oy);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){console.log(mouseDownX,mouseDownY);var dx=ox+ev.clientX-mouseDownX;var dy=oy+ev.clientY-mouseDownY;console.log(ox,oy,dx,dy);rpl.translate(dx,dy);console.log(rpl.x,rpl.y);ox=rpl.getX();oy=rpl.getY();},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 ox=document.body.clientWidth-50;var oy=10;rpl.moveTo(ox,oy);e.setAttribute("draggable","true");e.addEventListener("dragstart",function(ev){console.log(ev);mouseDownX=ev.screenX;mouseDownY=ev.screenY;if(!ev.shiftKey){ev.preventDefault();}},false);e.addEventListener("dragend",function(ev){console.log(mouseDownX,mouseDownY);var dx=ox+ev.screenX-mouseDownX;var dy=oy+ev.screenY-mouseDownY;console.log(ox,oy,dx,dy);rpl.translate(dx,dy);console.log(rpl.x,rpl.y);ox=rpl.getX();oy=rpl.getY();},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;}} var f=document.querySelector("form");f.onsubmit=function(){postit();return false;}}
/* ./contrib/js/theme.js */ /* ./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;}}} 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;}}}