Approval Time

Displays the auto-approval time

  1. // ==UserScript==
  2. // @name Approval Time
  3. // @description Displays the auto-approval time
  4. // @include https://www.mturk.com/mturk/preview*
  5. // @include https://www.mturk.com/mturk/continue*
  6. // @include https://www.mturk.com/mturk/accept*
  7. // @include https://www.mturk.com/mturk/submit
  8. // @include https://www.mturk.com/mturk/return*
  9. // @version 1.1
  10. // @author Aphit and turkedup
  11. // @namespace Aphit
  12. // ==/UserScript==
  13.  
  14. var Hit = /accept/gi;
  15. var Page_Status = document.forms[1].action;
  16. if(Page_Status.search(Hit) != 1) {
  17. insertID2(findID2());
  18. }
  19. function findID2() {
  20. var inputfields = document.getElementsByTagName("INPUT");
  21. results = "";
  22. for(var i = 0;i < inputfields.length;i++) {
  23. if(inputfields[i].name == "hitAutoAppDelayInSeconds") {
  24. results = inputfields[i].value;
  25. break;
  26. }
  27. }
  28. return results;
  29. }
  30.  
  31. function insertAfter(referenceNode, newNode) {
  32. referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
  33. }
  34.  
  35.  
  36. function insertID2(AutoAppTime) {
  37.  
  38. var title = document.createElement("TD");
  39. title.setAttribute('class','capsule_field_title');
  40. title.appendChild(document.createTextNode("\u00a0Auto-Approval:"))
  41.  
  42. var days = (AutoAppTime/86400).toFixed(2);
  43. var mins = ((AutoAppTime/86400)*1440);
  44.  
  45. var time = document.createElement("TD");
  46.  
  47. time.appendChild(document.createTextNode("\u00a0\u00a0\u00a0\u00a0" + days +" Days (" + mins + " Mins)"))
  48.  
  49. var firstElement = document.getElementById("requester.tooltip");
  50.  
  51. insertAfter(firstElement.parentNode.parentNode, time);
  52. insertAfter(firstElement.parentNode.parentNode, title);
  53.  
  54. }