A9 Validation

Category Validation and Logo Validation

目前為 2015-12-09 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name A9 Validation
  3. // @namespace https://greasyfork.org/users/11580
  4. // @version 1.2.1
  5. // @description Category Validation and Logo Validation
  6. // @description Validate an image.
  7. // @author Kadauchi
  8. // @include https://www.mturkcontent.com/dynamic/*
  9. // @include https://s3.amazonaws.com/*
  10. // @grant GM_log
  11. // @require http://code.jquery.com/jquery-2.1.0.min.js
  12. // ==/UserScript==
  13.  
  14. var autosubmit = false;
  15.  
  16. // Variable to check for the type of HIT.
  17. var Category_Validation = $('u:contains("Select the first option that applies to the image on the ")');
  18.  
  19. if (Category_Validation.length) {
  20. $("#truth").click(function(){
  21. $("input[value='Valid_Object']").click().focus();
  22. });
  23.  
  24. $("input[value='Missing_Object']").focus();
  25. $("input[value='Missing_Object']").click();
  26.  
  27. // Keybinds
  28. window.onkeydown = function(e) {
  29.  
  30. // Only one.
  31. if ((e.keyCode === 49) || (e.keyCode === 97) || (e.altKey && e.keyCode === 97)) { // 1 or Numpad1 or Alt+Numpad1
  32. $("input[value='Valid_Object']").click();
  33. $("input[value='Partial_Object']").prop('checked', false);
  34. if (autosubmit) {
  35. $("input[id='submitButton']").click();
  36. }
  37. }
  38.  
  39. // Only one, blocked or out.
  40. if ((e.keyCode === 50) || (e.keyCode === 98) || (e.altKey && e.keyCode === 98)) { // 2 or Numpad2 or Alt+Numpad2
  41. $("input[value='Valid_Object']").click();
  42. $("input[value='Partial_Object']").click();
  43. if (autosubmit) {
  44. $("input[id='submitButton']").click();
  45. }
  46. }
  47.  
  48. // More than one.
  49. if ((e.keyCode === 51) || (e.keyCode === 99) || (e.altKey && e.keyCode === 99)) { // 3 or Numpad3 or Alt+Numpad3
  50. $("input[value='Multiple_Objects']").click();
  51. $("input[value='Partial_Object']").prop('checked', false);
  52. if (autosubmit) {
  53. $("input[id='submitButton']").click();
  54. }
  55. }
  56.  
  57. // The image contains adult content and/or obscenity and/or financial and/or residential addresses.
  58. if ((e.keyCode === 52) || (e.keyCode === 100) || (e.altKey && e.keyCode === 100)) { // 4 or Numpad4 or Alt+Numpad4
  59. $("input[value='Obscene_Finance']").click();
  60. $("input[value='Partial_Object']").prop('checked', false);
  61. if (autosubmit) {
  62. $("input[id='submitButton']").click();
  63. }
  64. }
  65.  
  66. // No.
  67. if ((e.keyCode === 53) || (e.keyCode === 101) || (e.altKey && e.keyCode === 101)) { // 5 or Numpad5 or Alt+Numpad5
  68. $("input[value='Missing_Object']").click();
  69. $("input[value='Partial_Object']").prop('checked', false);
  70. if (autosubmit) {
  71. $("input[id='submitButton']").click();
  72. }
  73. }
  74.  
  75. //Submit
  76. if (e.keyCode === 13) { // Enter or NumpadEnter
  77. $("input[id='submitButton']").click();
  78. }
  79. };
  80. }
  81.  
  82. // Makes radio and checkboxes bigger.
  83. $("input[type='radio']").css({ width: '1.25em', height: '1.25em'});
  84. $("input[type='checkbox']").css({ width: '1.25em', height: '1.25em'});