A9 Tops Script

Hotkeys for Amazon Tops HITs

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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;
        }
    });
}