OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="resources/file-drag-common.js"></script> |
2 <html> | 3 <html> |
3 <head> | 4 <head> |
4 </head> | 5 </head> |
5 <body> | 6 <body> |
6 <form id="form"> | 7 <form id="form"> |
7 <input id="file" type="file" /> | 8 <input id="file" type="file" /> |
8 <input id="reset" type="reset" /> | 9 <input id="reset" type="reset" /> |
9 </form> | 10 </form> |
10 <div id="console"></div> | 11 <div id="console"></div> |
11 <p> | 12 <p> |
(...skipping 11 matching lines...) Expand all Loading... |
23 click(reset.offsetLeft + reset.offsetWidth / 2, reset.offsetTop + reset.offs
etHeight / 2); | 24 click(reset.offsetLeft + reset.offsetWidth / 2, reset.offsetTop + reset.offs
etHeight / 2); |
24 click(reset.offsetLeft + reset.offsetWidth + 10, reset.offsetTop + reset.off
setHeight + 10); // Move a cursor out of the reset button. | 25 click(reset.offsetLeft + reset.offsetWidth + 10, reset.offsetTop + reset.off
setHeight + 10); // Move a cursor out of the reset button. |
25 } | 26 } |
26 | 27 |
27 function click(x, y) { | 28 function click(x, y) { |
28 eventSender.mouseMoveTo(x, y); | 29 eventSender.mouseMoveTo(x, y); |
29 eventSender.mouseDown(); | 30 eventSender.mouseDown(); |
30 eventSender.mouseMoveTo(x, y); | 31 eventSender.mouseMoveTo(x, y); |
31 eventSender.mouseUp(); | 32 eventSender.mouseUp(); |
32 } | 33 } |
33 | |
34 function dragFilesOntoElement(element, files) { | |
35 eventSender.beginDragWithFiles(files); | |
36 var centerX = element.offsetLeft + element.offsetWidth / 2; | |
37 var centerY = element.offsetTop + element.offsetHeight / 2; | |
38 eventSender.mouseMoveTo(centerX, centerY); | |
39 eventSender.mouseUp(); | |
40 } | |
41 </script> | 34 </script> |
42 </body> | 35 </body> |
43 </html> | 36 </html> |
OLD | NEW |