|
78 | 78 | // @include http*://sleazyfork.org/*/scripts/* |
79 | 79 | // @include http*://greasyfork.org/*/scripts/* |
80 | 80 | // @include http*://*yfork.org/*/forum/*discussion* |
81 | | -// @version 3.22.06 |
| 81 | +// @version 3.22.07 |
82 | 82 | // @grant GM_notification |
83 | 83 | // @grant GM_xmlhttpRequest |
84 | 84 | // @grant GM_setClipboard |
|
1445 | 1445 | const minLength=256,tg=0.5; |
1446 | 1446 | var lastX, lastY, signs, lastSign; |
1447 | 1447 | function tracer(e) { |
1448 | | - let curX=e.clientX,curY=e.clientY; |
| 1448 | + let curX=e.changedTouches[0].clientX,curY=e.changedTouches[0].clientY; |
1449 | 1449 | let distanceX=curX-lastX,distanceY=curY-lastY; |
1450 | 1450 | let distance=distanceX*distanceX+distanceY*distanceY; |
1451 | 1451 | if (distance>minLength) { |
|
1472 | 1472 | } |
1473 | 1473 | } |
1474 | 1474 | }; |
1475 | | - document.addEventListener("mousedown", function(e) { |
1476 | | - lastX=e.clientX; |
1477 | | - lastY=e.clientY; |
| 1475 | + document.addEventListener("touchstart", function(e) { |
| 1476 | + lastX=e.changedTouches[0].clientX; |
| 1477 | + lastY=e.changedTouches[0].clientY; |
1478 | 1478 | lastSign=signs=""; |
1479 | | - document.addEventListener("mousemove", tracer, false); |
| 1479 | + document.addEventListener("touchmove", tracer, false); |
1480 | 1480 | }, false); |
1481 | | - document.addEventListener("mouseup", function(e) { |
1482 | | - document.removeEventListener("mousemove", tracer, false); |
| 1481 | + document.addEventListener("touchend", function(e) { |
| 1482 | + document.removeEventListener("touchmove", tracer, false); |
1483 | 1483 | if(signs=="↓→↑←"){ |
1484 | 1484 | e.stopPropagation(); |
1485 | 1485 | e.preventDefault(); |
|
0 commit comments