superfish

Assists with Superfish hits on Amazon Mechanical Turk

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name superfish
// @namespace whatever
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
// @include https://www.mturkcontent.com/dynamic*
// @description Assists with Superfish hits on Amazon Mechanical Turk
// @version 1.3
// @grant none
// ==/UserScript==

$('img').each(function(){
    $(this).click(function(){
        $(this).next().next().click();
    });
}); 

if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) {
    this.GM_getValue=function (key,def) {
        return localStorage[key] || def;
        };
    this.GM_setValue=function (key,value) {
        return localStorage[key]=value;
        };
    this.GM_deleteValue = function(key) {
        return localStorage.removeItem(key);
    };
}

if (GM_getValue("superfish")){
    $('input').each(function(){
        if ($(this).attr("type") == "checkbox" && $(this).attr("id") != "assignmentId" && $(this).attr("value") != "none" && $(this).attr("id") != "submitButton")
            $(this).click();
    });
}

document.onkeydown = showkeycode;
function showkeycode(evt){
    var keycode = evt.keyCode;
    switch (keycode) {
        case 13: //enter
            document.getElementById("mturk_form").submit();
            break;
        case 192: //`
            $('input').each(function(){
                if ($(this).attr("type") == "checkbox" && $(this).attr("id") != "assignmentId" && $(this).attr("value") != "none" && $(this).attr("id") != "submitButton")
                    $(this).click();
            });
            if (GM_getValue("superfish"))
                GM_deleteValue("superfish");
            else
            	GM_setValue("superfish",1);
            break;
    }}