Archived
1
0

try using ctl drag

This commit is contained in:
Jeff Becker 2016-04-30 16:32:10 -04:00
parent fa27cc64ef
commit a6f418d3a9
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
2 changed files with 2 additions and 19 deletions

View File

@ -329,24 +329,10 @@ function init(prefix) {
var originalY = 10; var originalY = 10;
rpl.moveTo(originalX, originalY); rpl.moveTo(originalX, originalY);
var keyDown = false;
e.addEventListener("keydown", function(ev) {
if (ev.shiftKey) {
keyDown = true;
}
});
e.addEventListener("keyup", function(ev) {
if (ev.shiftKey) {
keyDown = false;
}
});
e.addEventListener("dragstart", function(ev) { e.addEventListener("dragstart", function(ev) {
mouseDownX = ev.clientX; mouseDownX = ev.clientX;
mouseDownY = ev.clientY; mouseDownY = ev.clientY;
if (keyDown) { if (!ev.ctrlKey) {
ev.preventDefault(); ev.preventDefault();
} }
}, false); }, false);
@ -359,9 +345,6 @@ function init(prefix) {
rpl.moveTo(x, y); rpl.moveTo(x, y);
originalX = x; originalX = x;
originalY = y; originalY = y;
if (keyDown) {
ev.preventDefault();
}
}, false); }, false);
// add replyto post handlers // add replyto post handlers

View File

@ -43,7 +43,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;e.setAttribute("draggable","true");var mouseDownX,mouseDownY;var originalX=window.screenX-150;var originalY=10;rpl.moveTo(originalX,originalY);var keyDown=false;e.addEventListener("keydown",function(ev){if(ev.shiftKey){keyDown=true;}});e.addEventListener("keyup",function(ev){if(ev.shiftKey){keyDown=false;}});e.addEventListener("dragstart",function(ev){mouseDownX=ev.clientX;mouseDownY=ev.clientY;if(keyDown){ev.preventDefault();}},false);e.addEventListener("dragend",function(ev){var x=originalX+ev.clientX-mouseDownX;var y=originalY+ev.clientY-mouseDownY;x-=window.screenLeft;y-=window.screenTop;rpl.moveTo(x,y);originalX=x;originalY=y;if(keyDown){ev.preventDefault();}},false);e=document.getElementById("postform_submit");e.onclick=function(){var f=document.querySelector("form");var r=getReplyTo();r.post(function(j){if(j.error){r.showError(j.error);}else{r.showMessage("posted as "+j.message_id);r.updateCaptcha();}},function(err){r.showError(err);});r.showMessage("posting... ");}} function init(prefix){inject_hover_for_element(document);var rpl=getReplyTo();rpl.setPrefix(prefix);var e=rpl.elem;e.setAttribute("draggable","true");var mouseDownX,mouseDownY;var originalX=window.screenX-150;var originalY=10;rpl.moveTo(originalX,originalY);e.addEventListener("dragstart",function(ev){mouseDownX=ev.clientX;mouseDownY=ev.clientY;if(!ev.ctrlKey){ev.preventDefault();}},false);e.addEventListener("dragend",function(ev){var x=originalX+ev.clientX-mouseDownX;var y=originalY+ev.clientY-mouseDownY;x-=window.screenLeft;y-=window.screenTop;rpl.moveTo(x,y);originalX=x;originalY=y;},false);e=document.getElementById("postform_submit");e.onclick=function(){var f=document.querySelector("form");var r=getReplyTo();r.post(function(j){if(j.error){r.showError(j.error);}else{r.showMessage("posted as "+j.message_id);r.updateCaptcha();}},function(err){r.showError(err);});r.showMessage("posting... ");}}
/* ./contrib/js/banner.js */ /* ./contrib/js/banner.js */
var banner_count=3;function nntpchan_inject_banners(elem,prefix){var n=Math.floor(Math.random()*banner_count);var banner=prefix+"static/banner_"+n+".jpg";var e=document.createElement("img");e.src=banner;e.id="nntpchan_banner";elem.appendChild(e);} var banner_count=3;function nntpchan_inject_banners(elem,prefix){var n=Math.floor(Math.random()*banner_count);var banner=prefix+"static/banner_"+n+".jpg";var e=document.createElement("img");e.src=banner;e.id="nntpchan_banner";elem.appendChild(e);}
/* ./contrib/js/expand-image.js */ /* ./contrib/js/expand-image.js */