Safe Cats

Safe Hotkeys for Categorization Masters HITs (Single Layer)

当前为 2014-10-23 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==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)}}

}