Andy K Image Moderation

Andy K Image Moderation Hits

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name       Andy K Image Moderation
// @version    1.1
// @description  Andy K Image Moderation Hits
// @match      https://s3.amazonaws.com/mturk_bulk/hits*
// @copyright  2012+, You
// @namespace https://greasyfork.org/users/710
// ==/UserScript==

var radios = document.getElementsByTagName("input");

document.onkeydown = showkeycode;
var content = document.getElementById("mturk_form");
content.tabIndex = "0";
content.focus();

var pic = document.getElementsByName("comment")[0];
pic.scrollIntoView(false);

function showkeycode(evt){
        var keycode = evt.keyCode;
        console.log(keycode);
        switch (keycode) {
            case 78: //n
                mark("n");
                break;
            case 89: //y
                mark("y");
                break;
            case 79: //o
                mark("o");
                break;
            case 191: // /
				alert("n, y, o");                    
                break;
            case 13: //enter
                var button = document.getElementById("submitButton");
                if (confirm("Submit?")) button.click();
                break;
            default: break;
        }
}

function mark(ans){
    switch (ans) {
        case "n":
            for (i = 0; i < radios.length; i++) {
                if (radios[i].type == "radio" && radios[i].value == "No"){
                    radios[i].checked = true;
                    break;
                }
            }
            break;
        case "y":
            for (i = 0; i < radios.length; i++) {
                if (radios[i].type == "radio" && radios[i].value == "Yes"){
                    radios[i].checked = true;
                    break;
                }
            }
            break;
        case "o":
            for (i = 0; i < radios.length; i++) {
                if (radios[i].type == "radio" && radios[i].value == "Other"){
                    radios[i].checked = true;
                    break;
                }
            }
            document.getElementsByName("comment")[0].focus();
            document.getElementsByName("comment")[0].value = "";
            break;
        default:
            console.log(ans);
            break;
    }
    var button = document.getElementById("submitButton");
    if (confirm("Submit?")) button.click();
}