Requester ID && Auto Approval Time (Formatted)

Displays the Requester ID in case they change their name and the HIT's auto approval time

目前为 2014-10-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Requester ID && Auto Approval Time (Formatted)
  3. // @description Displays the Requester ID in case they change their name and the HIT's 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
  10. // @namespace https://greasyfork.org/users/6438
  11. // ==/UserScript==
  12.  
  13. var Hit = /accept/gi;
  14. var Page_Status = document.forms[1].action;
  15. if(Page_Status.search(Hit) != -1) {
  16. insertID(findID());
  17. insertID2(findID2());
  18. }
  19.  
  20. function insertAfter(referenceNode, newNode) {
  21. referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
  22. }
  23.  
  24. function findID() {
  25. var inputfields = document.getElementsByTagName("INPUT");
  26. results = "";
  27. for(var i = 0;i < inputfields.length;i++) {
  28. if(inputfields[i].name == "requesterId") {
  29. results = inputfields[i].value;
  30. break;
  31. }
  32. }
  33. return results;
  34. }
  35.  
  36. function insertID(requesterID) {
  37. var Tcell = document.createElement("TD");
  38. var Tcell3 = document.createElement("TD");
  39. var firstElement = document.getElementById("requester.tooltip").parentNode;
  40. insertAfter(firstElement.parentNode,Tcell);
  41. insertAfter(Tcell, Tcell3);
  42. Tcell.innerHTML ="<b><p style=\"color:#369;\">&nbsp;RequesterID:&nbsp;&nbsp;</p></b>";
  43. Tcell3.innerHTML = "<p id=\"requester.tooltip\"> " + requesterID + "</p>";
  44. }
  45.  
  46. function findID2() {
  47. var inputfields = document.getElementsByTagName("INPUT");
  48. results = "";
  49. for(var i = 0;i < inputfields.length;i++) {
  50. if(inputfields[i].name == "hitAutoAppDelayInSeconds") {
  51. results = inputfields[i].value;
  52. break;
  53. }
  54. }
  55. return results;
  56. }
  57.  
  58. function insertID2(AutoAppTime) {
  59. var Tcell2 = document.createElement("TD");
  60. var Tcell4 = document.createElement("TD");
  61. var firstElement = document.getElementById("qualifications.tooltip").parentNode.parentNode;
  62. var Trow = firstElement.parentNode;
  63. Trow.insertBefore(Tcell2, firstElement);
  64. insertAfter(Tcell2, Tcell4);
  65. Tcell2.innerHTML="<b><p style=\"color:#369;\">Auto-Approval Time:&nbsp;&nbsp;</p></b>";
  66. Tcell4.innerHTML= (AutoAppTime/86400).toFixed(2) + " Days (" +(AutoAppTime/86400)*1440 + " Mins)";
  67. }