HIT Area Expander (with compact interface mod)

Adds a button to change the height of the working area for the hit.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          HIT Area Expander (with compact interface mod)
// @author        unknown + clickhappier
// @namespace     clickhappier
// @version       0.1c
// @description   Adds a button to change the height of the working area for the hit.
// @include       https://www.mturk.com/mturk/preview*
// @include       https://www.mturk.com/mturk/continue*
// @include       https://www.mturk.com/mturk/accept*
// @include       https://www.mturk.com/mturk/submit
// @include       https://www.mturk.com/mturk/return*
// ==/UserScript==

// modified by clickhappier to remove line break between input field and button,
// set input field size, and change button text from "Expand" to ">";
// all to make it fit on 1 line within the width of the 'Requester' cell

var Page_Status = document.forms[1].action;

insertButton();
changeHeight();

function insertAfter(referenceNode, newNode) {
    referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}

function changeHeight() {
	var iframes = document.getElementsByTagName('iframe');
	var height = document.getElementById("new_size").value;
	for(var i = 0; i < iframes.length; i++) {
		iframes[i].height = height;
	}
}

function insertButton() {
	var firstElement = document.getElementById("requester.tooltip").parentNode;

	var button = document.createElement("div");
	button.innerHTML = 'New Height: <input type="number" name="new_size" id="new_size" value="1200" size="4"><button id="sizeChange" type="Button">&gt;</button>';
	button.setAttribute('id','buttonContainer');

	firstElement.appendChild(button);

	document.getElementById('sizeChange').addEventListener("click",changeHeight);
}