JR Noblis Image Finder Helper

Makes it easier to select answer for images of people.

当前为 2016-02-18 提交的版本,查看 最新版本

// ==UserScript==
// @name        JR Noblis Image Finder Helper
// @namespace   https://gf.qytechs.cn/users/6406
// @description Makes it easier to select answer for images of people.
// @version     0.2
// @require     http://code.jquery.com/jquery-1.10.2.min.js
// @include     http*://s3.amazonaws.com/TurkAnnotator*
// @grant       none
// ==/UserScript==

var gQuestions = [];
var gQuestionIndex = 0;

function isNoblisIMages() { return $('#instructions_subject_present:contains("Determine whether the person represented by this google image link")').length; }

$(function() {
    if ( isNoblisIMages() ) {
        setTimeout( function() {
            console.log("Found Noblis Images");
            if ($("#img_boundary")) {
                $("#img_boundary > div").each( function(i,theObject) {
                    if (i>0) {
                        $(theObject).find("div:first").width("140px");
                        $(theObject).find("img:first").css( {marginLeft : "130px"} );
                        $(theObject).find(":radio:eq(0)")[0].nextSibling.nodeValue = "Present (1)";
                        $(theObject).find(":radio:eq(1)")[0].nextSibling.nodeValue = "Not Present (2)";
                        $(theObject).find(":radio:eq(1)").click();
                        $(theObject).find(":radio:eq(2)")[0].nextSibling.nodeValue = "Can't tell (3)";
                        $(theObject).find(":radio:eq(3)")[0].nextSibling.nodeValue = "no Image (0)";
                        gQuestions.push(theObject);
                    }
                });
                $(gQuestions[gQuestionIndex]).css( "background-color", "#66CCCC" );
                $(document).keydown(function(event) {
                    console.log(gQuestions.length);
                    if (gQuestionIndex<gQuestions.length) {
                        var goToNext = false;
                        if (event.which == 49 || event.which == 97) { // 1 - Present
                            $(gQuestions[gQuestionIndex]).find(":radio:eq(0)").click();
                            goToNext=true;
                        }
                        if (event.which == 50 || event.which == 98) { // 2 - Not Present
                            $(gQuestions[gQuestionIndex]).find(":radio:eq(1)").click();
                            goToNext=true;
                        }
                        if (event.which == 51 || event.which == 99) { // 3 - Can't Tell
                            $(gQuestions[gQuestionIndex]).find(":radio:eq(2)").click();
                            goToNext=true;
                        }
                        if (event.which == 48 || event.which == 96) { // 0 - Image Not Loaded
                            $(gQuestions[gQuestionIndex]).find(":radio:eq(3)").click();
                            goToNext=true;
                        }
                        if (goToNext) {
                            $(gQuestions[gQuestionIndex]).css( "background-color", "" );
                            gQuestionIndex++;
                            $('html, body').animate({
                                scrollTop: $(gQuestions[gQuestionIndex]).offset().top-21
                            }, 1000);
                            $(gQuestions[gQuestionIndex]).css( "background-color", "#66CCCC" );
                        }
                    } else if (	event.which == 13) {
                        $("#submitbutton").click();
                    }
                });
            }
        }, 2103);
    }
});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址