Move Turk Timer

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Move Turk Timer
// @namespace   http://userscripts.org/users/temporary
// @include     https://*.mturk.com/mturk/*
// @version     1
// @description Move the Amazon Mechanical Turk timer to the bottom of the screen
// ==/UserScript==

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

var timer = document.getElementById("theTime");
if (timer) {
   var timer_div = timer.parentNode;
   var all_divs = document.getElementsByTagName("div");
   var form_divs = [];
   for (var i in all_divs) {
      var div = all_divs[i];
      if (div.nodeType == 1 && div.getAttribute("class") == "footer") {
         form_divs.push(div);
      }
   }
   var bottomControls = form_divs[0];
   var pos = findPos(bottomControls);
   var top = pos[1] - 90;
   timer_div.setAttribute("style","padding-left: 5px; position: absolute; top: " + top + "; left: 0");

}