Safe Cats

Safe Hotkeys for Categorization Masters HITs (Single Layer)

当前为 2014-10-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Safe Cats
  3. // @description Safe Hotkeys for Categorization Masters HITs (Single Layer)
  4. // @author DCI
  5. // @version 1.2
  6. // @include https://www.mturkcontent.com/dynamic/*
  7. // @include https://s3.amazonaws.com/*
  8. // @require http://code.jquery.com/jquery-latest.min.js
  9. // @namespace DCI
  10. // ==/UserScript==
  11.  
  12. var cat = document.getElementsByTagName("title")[0];
  13. var cat2 = cat.innerHTML
  14. var title = "Categorization";
  15.  
  16. if ( cat2 === title ){document.addEventListener( "keydown", press, false);}
  17.  
  18. function press(i) {
  19.  
  20. if ( i.keyCode == 65 || i.keyCode == 97 ) { //A or npad 1 - Choice 1
  21. $('.choice-button.btn.ng-binding.choice').eq(0).click();
  22. if ($('.choice-button.btn.ng-binding.choice').length > 0) {
  23. setTimeout(function(){$('#submit_button').click();},0750)}}
  24.  
  25. if ( i.keyCode == 83 || i.keyCode == 98 ) { //S or npad 2 - Choice 2
  26. $('.choice-button.btn.ng-binding.choice').eq(1).click();
  27. if ($('.choice-button.btn.ng-binding.choice').length > 0) {
  28. setTimeout(function(){$('#submit_button').click();},0750)}}
  29.  
  30. if ( i.keyCode == 68 || i.keyCode == 99 ) { //D or npad 3 - Choice 3
  31. $('.choice-button.btn.ng-binding.choice').eq(2).click();
  32. if ($('.choice-button.btn.ng-binding.choice').length > 0) {
  33. setTimeout(function(){$('#submit_button').click();},0750)}}
  34.  
  35. if ( i.keyCode == 70 || i.keyCode == 100 ) { //F or npad 4 - Choice 4
  36. $('.choice-button.btn.ng-binding.choice').eq(3).click();
  37. if ($('.choice-button.btn.ng-binding.choice').length > 0) {
  38. setTimeout(function(){$('#submit_button').click();},0750)}}
  39.  
  40. if ( i.keyCode == 71 || i.keyCode == 101 ) { //G or npad 5 - Choice 5
  41. $('.choice-button.btn.ng-binding.choice').eq(4).click();
  42. if ($('.choice-button.btn.ng-binding.choice').length > 0) {
  43. setTimeout(function(){$('#submit_button').click();},0750)}}
  44.  
  45. if ( i.keyCode == 81 || i.keyCode == 102 ) { //Q or npad 6 - Choice 6
  46. $('.choice-button.btn.ng-binding.choice').eq(5).click();
  47. if ($('.choice-button.btn.ng-binding.choice').length > 0) {
  48. setTimeout(function(){$('#submit_button').click();},0750)}}
  49.  
  50. if ( i.keyCode == 87 || i.keyCode == 103 ) { //W or npad 7 - Choice 7
  51. $('.choice-button.btn.ng-binding.choice').eq(6).click();
  52. if ($('.choice-button.btn.ng-binding.choice').length > 0) {
  53. setTimeout(function(){$('#submit_button').click();},0750)}}
  54.  
  55. }
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.