Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Machine Learning YN
  3. // @description A is Yes S is No
  4. // @version 0.1
  5. // @include https://www.mturkcontent.com/dynamic/hit?assignmentId*
  6. // @author Cristo
  7. // @copyright 2012+, You
  8. // ==/UserScript==
  9.  
  10. var form = document.getElementById('mturk_form');
  11. var instructions = document.getElementsByClassName('panel panel-primary')[0];
  12. var yesC = form.getElementsByTagName('input')[1];
  13. var noC = form.getElementsByTagName('input')[2];
  14. var sub = form.getElementsByTagName('input')[3];
  15.  
  16. var but = document.createElement("span");
  17. but.style.color = "#1170A0";
  18. but.style.textDecoration = "underline";
  19. but.style.cursor = "pointer";
  20. but.innerHTML = "Instructions";
  21. but.innerHTML = "Instructions"
  22. instructions.parentNode.insertBefore(but,instructions);
  23.  
  24. instructions.style.display = "none";
  25. but.addEventListener("mousedown",function() {
  26. if (instructions.style.display == "none") {
  27. instructions.style.display = "block";
  28. } else if (instructions.style.display == "block") {
  29. instructions.style.display = "none";
  30. }}, false);
  31. document.addEventListener('keydown',function(i) {
  32. if (i.keyCode == 65) {//a
  33. yesC.click();
  34. sub.click();
  35. }
  36. if (i.keyCode == 83) {//s
  37. noC.click();
  38. sub.click();
  39. }}, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement