Move Turk Timer

Move the Amazon Mechanical Turk timer to the bottom of the screen

  1. // ==UserScript==
  2. // @name Move Turk Timer
  3. // @namespace http://userscripts.org/users/temporary
  4. // @include https://*.mturk.com/mturk/*
  5. // @version 1
  6. // @description Move the Amazon Mechanical Turk timer to the bottom of the screen
  7. // ==/UserScript==
  8.  
  9. function findPos(obj) {
  10. var curleft = curtop = 0;
  11. if (obj.offsetParent) {
  12. curleft = obj.offsetLeft
  13. curtop = obj.offsetTop
  14. while (obj = obj.offsetParent) {
  15. curleft += obj.offsetLeft
  16. curtop += obj.offsetTop
  17. }
  18. }
  19. return [curleft,curtop];
  20. }
  21.  
  22. var timer = document.getElementById("theTime");
  23. if (timer) {
  24. var timer_div = timer.parentNode;
  25. var all_divs = document.getElementsByTagName("div");
  26. var form_divs = [];
  27. for (var i in all_divs) {
  28. var div = all_divs[i];
  29. if (div.nodeType == 1 && div.getAttribute("class") == "footer") {
  30. form_divs.push(div);
  31. }
  32. }
  33. var bottomControls = form_divs[0];
  34. var pos = findPos(bottomControls);
  35. var top = pos[1] - 90;
  36. timer_div.setAttribute("style","padding-left: 5px; position: absolute; top: " + top + "; left: 0");
  37.  
  38. }
  39.  
  40.