A9

Category Validation / Logo Validation / Bounding Box

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         A9
// @namespace    http://kadauchi.com/
// @version      2.0.0
// @description  Category Validation / Logo Validation / Bounding Box
// @author       Kadauchi
// @icon         http://kadauchi.com/avatar3.gif
// @include      https://s3.amazonaws.com/*
// @include      https://www.mturkcontent.com/*
// @grant        GM_log
// @require      https://code.jquery.com/jquery-2.2.4.min.js
// ==/UserScript==

var autosubmit = false;

var Category_Validation = $('u:contains(Select the first option that applies to the image on the)');
var Image_Survey = $('span:contains(Does the photo on the far left obviously contain...)');
var bounding_box = $('p:contains(partially blocked or out of the image?)');

if (bounding_box.length){
    document.body.focus();

    $(document).keydown(function(e){
        switch(e.which){
            case 49: // 1
            case 97: // Numpad1
                $('input[value="Partial_Object"]').click();
                break;
            case 13: // Enter
                $('input[value="Submit"]').click();
                break;
            default: return;
        }
    });
}

if (Image_Survey.length){
    document.body.focus();

    $('input[value="No"]').click();
}

if (Category_Validation.length){
    document.body.focus();

    $('#truth').click(function(){
        $('input[value="Valid_Object"]').click()();
    });

    $('input[value="Missing_Object"]').click();

    $(document).keydown(function(e){
        switch(e.which){
            case 49: // 1
            case 97: // Numpad1
                $('input[value="Valid_Object"]').click();
                $('input[value="Partial_Object"]').prop('checked', false);
                if (autosubmit){
                    $('input[value="Submit"]').click();
                }
                break;
            case 50: // 2
            case 98: // Numpad2
                $('input[value="Valid_Object"]').click();
                $('input[value="Partial_Object"]').click();
                if (autosubmit){
                    $('input[value="Submit"]').click();
                }
                break;
            case 51: // 3
            case 99: // Numpad3
                $('input[value="Multiple_Objects"]').click();
                $('input[value="Partial_Object"]').prop('checked', false);
                if (autosubmit){
                    $('input[value="Submit"]').click();
                }
                break;
            case 52: // 4
            case 100: // Numpad4
                $('input[value="Obscene_Finance"]').click();
                $('input[value="Partial_Object"]').prop('checked', false);
                if (autosubmit){
                    $('input[value="Submit"]').click();
                }
                break;
            case 53: // 5
            case 101: // Numpad6
                $('input[value="Missing_Object"]').click();
                $('input[value="Partial_Object"]').prop('checked', false);
                if (autosubmit) {
                    $('input[value="Submit"]').click();
                }
                break;
            case 13: // Enter
                $('input[value="Submit"]').click();
                break;
            default: return;
        }
    });
}

$('input:radio:checkbox').css({ width: '1.25em', height: '1.25em'});