Image moderation speeder-upper

Lots of optimizations to speed up image moderation HITs

当前为 2015-11-29 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Image moderation speeder-upper
// @namespace    mobiusevalon.tibbius.com
// @version      0.3
// @description  Lots of optimizations to speed up image moderation HITs
// @author       Mobius Evalon
// @match        https://www.mturkcontent.com/dynamic/hit*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
// @grant        none
// ==/UserScript==

function hide_instructions()
{
    $('.panel-heading').first().append(
        $('<span/>')
        .text(" [Show/Hide]")
        .css("cursor","pointer")
        .click(function() {
            var $p = $(".panel-body").first();
            if($p.css("display") === "none") $p.show();
            else $p.hide();
        })
    );
    $(".panel-body").first().hide();
}

$(document).ready(function() {
    var matches = /What is (\d*)\+(\d*)\?/i.exec($("label").last().text());

    if(matches !== null) // vessel turk
    {
        $("input:radio[value=no]").prop('checked',true);
        $("input:text[name=captcha]").val((matches[matches.length-1]*1)+(matches[matches.length-2]*1));
        $("#submitButton").focus();
        $(document).keydown(function(event) {if(event.which === 13) $("#submitButton").click();})
    }
    
    else if($("input:radio[name=shouldBan]").length) // mixerbox
    {
        hide_instructions();
        $("input:radio[name=shouldBan][value=0]").prop('checked',true);
        $("#submitButton").focus();
        $(document).keydown(function(event) {
            switch(event.which)
            {
                case 13:
                    $("#submitButton").click();
                    break;
                case 97: case 49: // numpad numlock on, horizontal num keys respectively
                    $("input:radio[name=shouldBan][value=1]").prop('checked',true);
                    break;
                case 98: case 50:
                    $("input:radio[name=shouldBan][value=-2]").prop('checked',true);
                    break;
                case 99: case 51:
                    $("input:radio[name=shouldBan][value=0]").prop('checked',true);
                    break;
            }
        })
    }

    else if($("img").first().attr("src").indexOf("cuteornot.buzzfed.com") > -1) // buzzfeed
    {
        hide_instructions();
        $("#submitButton").focus();
        $(document).keydown(function(event) {
            switch(event.which)
            {
                case 13:
                    $("#submitButton").click();
                    break;
                case 100: case 49:
                    $("#checkbox1").click();
                    break;
                case 101: case 50:
                    $("#checkbox2").click();
                    break;
                case 102: case 51:
                    $("#checkbox3").click();
                    break;
                case 97: case 52:
                    $("#checkbox4").click();
                    break;
                case 98: case 53:
                    $("#checkbox5").click();
                    break;
                case 99: case 54:
                    $("#checkbox6").click();
                    break;
                case 96: case 48:
                    $("#checkbox8").click();
                    break;
            }
        })
    }
});