Safe Cats

Safe Hotkeys for Categorization Masters HITs (Single Layer)

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        Safe Cats
// @description Safe Hotkeys for Categorization Masters HITs (Single Layer)
// @author      DCI
// @version     1.3
// @include     https://www.mturkcontent.com/dynamic/*
// @include     https://s3.amazonaws.com/*
// @require     http://code.jquery.com/jquery-latest.min.js
// @namespace DCI
// ==/UserScript==

var cat = document.getElementsByTagName("title")[0];
var cat2 = cat.innerHTML
var title = "Categorization";

if ( cat2 === title ){document.addEventListener( "keydown", press, false);}

function press(i) {

if ( i.keyCode == 65 || i.keyCode == 97 ) { //A or npad 1 - Choice 1
$('.choice-button.btn.ng-binding.choice').eq(0).click();
if ($('.choice-button.btn.ng-binding.choice').length > 0) { 
setTimeout(function(){$('#submit_button').click();},0750)}}

if ( i.keyCode == 83 || i.keyCode == 98 ) { //S or npad 2 - Choice 2
$('.choice-button.btn.ng-binding.choice').eq(1).click();
if ($('.choice-button.btn.ng-binding.choice').length > 0) { 
setTimeout(function(){$('#submit_button').click();},0750)}}

if ( i.keyCode == 68 || i.keyCode == 99 ) { //D or npad 3 - Choice 3
$('.choice-button.btn.ng-binding.choice').eq(2).click();
if ($('.choice-button.btn.ng-binding.choice').length > 0) { 
setTimeout(function(){$('#submit_button').click();},0750)}}

if ( i.keyCode == 70 || i.keyCode == 100 ) { //F or npad 4 - Choice 4
$('.choice-button.btn.ng-binding.choice').eq(3).click();
if ($('.choice-button.btn.ng-binding.choice').length > 0) { 
setTimeout(function(){$('#submit_button').click();},0750)}}

if ( i.keyCode == 71 || i.keyCode == 101 ) { //G or npad 5 - Choice 5
$('.choice-button.btn.ng-binding.choice').eq(4).click();
if ($('.choice-button.btn.ng-binding.choice').length > 0) { 
setTimeout(function(){$('#submit_button').click();},0750)}}

if ( i.keyCode == 81 || i.keyCode == 102 ) { //Q or npad 6 - Choice 6
$('.choice-button.btn.ng-binding.choice').eq(5).click();
if ($('.choice-button.btn.ng-binding.choice').length > 0) { 
setTimeout(function(){$('#submit_button').click();},0750)}}

if ( i.keyCode == 87 || i.keyCode == 103 ) { //W or npad 7 - Choice 7
$('.choice-button.btn.ng-binding.choice').eq(6).click();
if ($('.choice-button.btn.ng-binding.choice').length > 0) { 
setTimeout(function(){$('#submit_button').click();},0750)}}

}