A9 Tops Script

Hotkeys for Amazon Tops HITs

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         A9 Tops Script
// @version      0.1
// @description  Hotkeys for Amazon Tops HITs
// @author       Arthanos
// @include      https://s3.amazonaws.com/*
// @include      https://www.mturkcontent.com/*
// @grant        GM_log
// @require      https://code.jquery.com/jquery-2.2.4.min.js
// @namespace https://greasyfork.org/users/105763
// ==/UserScript==

var tops = $('center:contains(On a scale of 1 to 5, rate how similar the tops in the two images are.)');

if (tops.length){
    var mturk_iframe = document.querySelector("iframe")

    if (mturk_iframe){mturk_iframe.focus()}

    $(document).keydown(function(e){
        switch(e.which){
            case 49: // 1
            case 97: // Numpad1
                $('#result1').click();
                break;
            case 50: //2
            case 98:// Numpad2
                $('#result2').click();
                break;
            case 51: //3
            case 99:// Numpad3
                $('#result3').click();
                break;
            case 52: //4
            case 100: // Numpad4
                $('#result4').click();
                break;
            case 53: //5
            case 101:// Numpad2
                $('#result5').click();
                break;
            case 13: // Enter
                $('input[value="Submit"]').click();
                break;
            default: return;
        }
    });
}