[.01 Nova] Flag images - Undesirable content

1-9 to select images, 0 to select none of the above. Hide instructions and autosubmit optional.

  1. // ==UserScript==
  2. // @name [.01 Nova] Flag images - Undesirable content
  3. // @author robert
  4. // @namespace https://greasyfork.org/en/users/13168-robert
  5. // @include https://www.mturkcontent.com/dynamic/hit*
  6. // @description:en 1-9 to select images, 0 to select none of the above. Hide instructions and autosubmit optional. Works best with 10-key.
  7. // @version 1.2
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
  9. // @grant none
  10. // @description 1-9 to select images, 0 to select none of the above. Hide instructions and autosubmit optional.
  11. // ==/UserScript==
  12.  
  13. // Based heavily on Kadauchi's Nova Compare two products
  14. // https://greasyfork.org/en/scripts/10843-nova-compare-two-products/code
  15. // THANK YOU to kadauchi and ikarma for getting this to work
  16.  
  17. var hideInstructions=true;
  18. var autoSubmit=false;
  19.  
  20. //if ($("p:contains('Please mark the images')").length)
  21. if ($("p:contains('Please mark the images')").length)
  22. runScript();
  23.  
  24. function runScript()
  25. {
  26. if (hideInstructions)
  27. {
  28. $(".panel-body").hide();
  29. $(".panel-heading").click
  30. (
  31. function()
  32. {
  33. $(".panel-body").toggle();
  34. }
  35. );
  36. }
  37. var cb1 = document.getElementById('checkbox1');
  38. var cb2 = document.getElementById('checkbox2');
  39. var cb3 = document.getElementById('checkbox3');
  40. var cb4 = document.getElementById('checkbox4');
  41. var cb5 = document.getElementById('checkbox5');
  42. var cb6 = document.getElementById('checkbox6');
  43. var cb7 = document.getElementById('checkbox7');
  44. var cb8 = document.getElementById('checkbox8');
  45. var cb9 = document.getElementById('checkbox9');
  46. var cb10 = document.getElementById('checkbox10'); //none of the above
  47. cb4.focus();
  48.  
  49. window.onkeydown = function(e)
  50. {
  51. if (e.keyCode === 97 || e.keyCode === 49) //1 key
  52. cb7.click();
  53. if (e.keyCode === 98 || e.keyCode === 50) //2 key
  54. cb8.click();
  55. if (e.keyCode === 99 || e.keyCode === 51) //3 key
  56. cb9.click();
  57. if (e.keyCode === 100 || e.keyCode === 52) //4 key
  58. cb4.click();
  59. if (e.keyCode === 101 || e.keyCode === 53) //5 key
  60. cb5.click();
  61. if (e.keyCode === 102 || e.keyCode === 54) //6 key
  62. cb6.click();
  63. if (e.keyCode === 103 || e.keyCode === 55) //7 key
  64. cb1.click();
  65. if (e.keyCode === 104 || e.keyCode === 56) //8 key
  66. cb2.click();
  67. if (e.keyCode === 105 || e.keyCode === 57) //9 key
  68. cb3.click();
  69. if (e.keyCode === 96 || e.keyCode === 58) //0
  70. {
  71. cb10.click();
  72. if(autoSubmit)
  73. $("input[id='submitButton']" ).click();
  74. }
  75. if (e.keyCode === 13 ) //enter
  76. $("input[id='submitButton']" ).click();
  77. };
  78. } //end runscript ()