").css({"margin-top":"400px"}));
var theCanvas = ($("#thecanvas").length) ? $("#thecanvas") : $("#img_boundary");
$('html, body').animate({
scrollTop: $(theCanvas).offset().top-25
}, 700);
$("input[value='OK in all regards']:first").prop( "checked", true );
$("input[value='bad box or boxes']:first")[0].nextSibling.nodeValue = "bad box or boxes (1)";
$("input[value='missing box or boxes']:first")[0].nextSibling.nodeValue = "missing box or boxes (2)";
$("input[value='extra box or boxes']:first")[0].nextSibling.nodeValue = "extra box or boxes (3)";
$("input[value='OK in all regards']:first")[0].nextSibling.nodeValue = "OK in all regards (4)";
$("#button_div").append($('
').html("Press 0 or n for next picture after bad, missing or extra boxes").css("margin-top","20px"));
$("#image").on("load", function() {
$("#button_div").css({"opacity":1.0});
var theCanvas = ($("#thecanvas").length) ? $("#thecanvas") : $("#img_boundary");
$('html, body').animate({
scrollTop: $(theCanvas).offset().top-25
}, 700);
$("input[value='OK in all regards']:first").prop( "checked", true );
});
$(document).keydown(function(event) {
var goToNext = false;
if (event.which == 78 || event.which == 48 || event.which == 96) {
var submitButtonHidden = $("#submitbutton").css("display") == "none";
if ( (event.which == 48 || event.which == 96) && submitButtonHidden) $("#nextbutton").click();
$("#button_div").css({"opacity":0.3});
if (!submitButtonHidden) {
if (gSubmitGo) $("#button_div").css({"opacity":0.3,"background-color":"red"});
$("#submitbutton").focus();
gSubmitGo = true;
}
}
if (event.which == 49 || event.which == 97) { // 1 - bad box or boxes
$("input[value='bad box or boxes']:first").prop( "checked", true );
$("input[value='OK in all regards']:first").prop( "checked", false );
}
if (event.which == 50 || event.which == 98) { // 2 - missing box or boxes
$("input[value='missing box or boxes']:first").prop( "checked", true );
$("input[value='OK in all regards']:first").prop( "checked", false );
}
if (event.which == 51 || event.which == 99) { // 3 - extra box or boxes
$("input[value='extra box or boxes']:first").prop( "checked", true );
$("input[value='OK in all regards']:first").prop( "checked", false );
}
if (event.which == 52 || event.which == 100) { // 4 - OK in all regards
$("input[value='bad box or boxes']:first").prop( "checked", false );
$("input[value='missing box or boxes']:first").prop( "checked", false );
$("input[value='extra box or boxes']:first").prop( "checked", false );
$("input[value='OK in all regards']:first").prop( "checked", true );
goToNext=true;
}
if (goToNext) {
if ($("#submitbutton").css("display") == "none") {
$("#nextbutton").click(); $("#nextbutton").focus();
$("#button_div").css({"opacity":0.3});
}
else { $("#button_div").css({"opacity":0.3,"background-color":"red"}); $("#submitbutton").focus(); gSubmitGo = true; }
}
if (event.which == 13 && !gSubmitGo) { // enter is disabled unless submit button is displayed.
return false;
}
});
} else if ( isNoblisEyeIMages() || isNoblisMouthIMages() || isNoblisForeheadIMages() || isNoblisFacialHairIMages() || isNoblisIndoorOutdoorIMages() || isNoblisAgeImages() || isNoblisFindSubject() ) {
var facialHairHit = isNoblisFacialHairIMages();
var indoorOutdoorHit = isNoblisIndoorOutdoorIMages();
var ageHit = isNoblisAgeImages();
var findSubject = isNoblisFindSubject();
$("#nextbutton").focus();
$("#annotator_div").append($("
").css({"margin-top":"300px"}));
$("#annotator_div input:radio").each( function(index,value) {
$("#annotator_div").find(":radio:eq(" + index + ")")[0].nextSibling.nodeValue = "(" + (index+1) + ") " + $("#annotator_div").find(":radio:eq(" + index + ")")[0].nextSibling.nodeValue;
});
var theCanvas = ($("#thecanvas").length) ? $("#thecanvas") : $("#img_boundary");
$('html, body').animate({
scrollTop: $(theCanvas).offset().top-25
}, 700);
$("#image").on("load", function() {
$("#button_div").css({"opacity":1.0});
var theCanvas = ($("#thecanvas").length) ? $("#thecanvas") : $("#img_boundary");
$('html, body').animate({
scrollTop: $(theCanvas).offset().top-25
}, 700);
});
$(document).keydown(function(event) {
var goToNext = false;
if (event.which == 49 || event.which == 97) { // 1 - Covered Or Beard or indoor or (0-19)
if (indoorOutdoorHit) $("input[value='indoor']:first").click();
else if (facialHairHit) $("input[value='beard']:first").click();
else if (ageHit) $("input[value='0-19']:first").click();
else if (findSubject) $("input[value='Present']:first").click();
else $("input[value='covered or partially covered']:first").click();
goToNext=true;
}
if (event.which == 50 || event.which == 98) { // 2 - Not Covered or Moustache or outdoor or (20-34)
if (indoorOutdoorHit) $("input[value='outdoor']:first").click();
else if (facialHairHit) $("input[value='moustache']:first").click();
else if (ageHit) $("input[value='20-34']:first").click();
else if (findSubject) $("input[value='Not present']:first").click();
else $("input[value='not covered']:first").click();
goToNext=true;
}
if (event.which == 51 || event.which == 99) { // 3 - bad box or Goatee or (35-49)
if (facialHairHit) $("input[value='goatee']:first").click();
else if (ageHit) $("input[value='35-49']:first").click();
else if (findSubject) $("input[value='Can't tell']:first").click();
else $("input[value='bad box']:first").click();
goToNext=true;
}
if (event.which == 52 || event.which == 100 && (facialHairHit || ageHit || findSubject)) { // 4 - none or (50-64)
if (ageHit) $("input[value='50-64']:first").click();
else if (findSubject) $("input[value='Search results unclear']:first").click();
else $("input[value='none']:first").click();
goToNext=true;
}
if (event.which == 53 || event.which == 101 && (facialHairHit || ageHit || findSubject)) { // 5 - not visible or (65+)
if (ageHit) $("input[value='65+']:first").click();
else if (findSubject) $("input[value='Image not loaded']:first").click();
else $("input[value='not visible']:first").click();
goToNext=true;
}
if (event.which == 54 || event.which == 102 && (facialHairHit || ageHit)) { // 6 - bad box
$("input[value='bad box']:first").click();
goToNext=true;
}
if (goToNext) {
if ($("#submitbutton").css("display") == "none") setTimeout( function() {
$("#nextbutton").click(); $("#nextbutton").focus();
$("#button_div").css({"opacity":0.3});
}, 400);
else { $("#submitbutton").focus(); gSubmitGo = true; }
}
if (event.which == 13 && !gSubmitGo) { // enter
return false;
}
});
}
}, 1303);
});