Zing on Mturk

Hot keys and hidden Instructions for are these receipts the same

  1. // ==UserScript==
  2. // @name Zing on Mturk
  3. // @version 1.0
  4. // @description Hot keys and hidden Instructions for are these receipts the same
  5. // @author Cristo
  6. // @include https://backend.ibotta.com/duplicate_receipt_moderation*
  7. // @copyright 2012+, You
  8. // @namespace https://greasyfork.org/users/1973
  9. // ==/UserScript==
  10.  
  11. //Key A and 1 on the number pad for No, Key S and 2 on the number pad for Yes, auto submits after answer
  12. var contain = document.getElementsByClassName("container")[0];
  13. contain.tabIndex = "0";
  14. contain.focus();
  15. var inDiv = document.createElement("div");
  16. var h1 = document.getElementsByTagName("h1")[0];
  17. var p1 = document.getElementsByTagName("p")[0];
  18. var p2 = document.getElementsByTagName("p")[1];
  19. var ul = document.getElementsByTagName("ul")[0];
  20. var hr = document.getElementsByTagName("hr")[0];
  21. var no = document.getElementById("duplicatefalse");
  22. var yes = document.getElementById("duplicatetrue");
  23. var sub = document.getElementsByClassName("btn")[0];
  24. contain.insertBefore(inDiv, contain.firstChild);
  25. inDiv.appendChild(h1);
  26. inDiv.appendChild(p1);
  27. inDiv.appendChild(p2);
  28. inDiv.appendChild(ul);
  29. inDiv.appendChild(hr);
  30. var but = document.createElement("button");
  31. but.innerHTML = "Instructions"
  32. contain.parentNode.insertBefore(but,contain);
  33. inDiv.style.display = "none";
  34. but.addEventListener("mousedown",function() {
  35. if (inDiv.style.display == "none") {
  36. inDiv.style.display = "block";
  37. } else if (inDiv.style.display == "block") {
  38. inDiv.style.display = "none";
  39. }}, false);
  40. document.addEventListener("keydown",function(i) {
  41. if (i.keyCode == 65 || i.keyCode == 97) {
  42. no.click();
  43. sub.click();
  44. }
  45. if (i.keyCode == 83 || i.keyCode == 98) {
  46. yes.click();
  47. sub.click();
  48. }}, false);