Keybinds for the 5 radios in the a9 HITs
当前为
// ==UserScript==
// @name a9 - 5 radios
// @namespace http://kadauchi.com/
// @version 1.0.0
// @description Keybinds for the 5 radios in the a9 HITs
// @author Kadauchi
// @icon http://i.imgur.com/oGRQwPN.png
// @include /^https://(www|s3)\.(mturkcontent|amazonaws)\.com/
// @grant GM_log
// @require https://code.jquery.com/jquery-3.1.1.min.js
// @hitname Shoe (WARNING: This HIT may contain adult content. Worker discretion is advised.)
// @hitsave https://s3.amazonaws.com/mturk_bulk/hits/235915880/onYNjrCy3S1NRlSfqUcH4Q.html
// ==/UserScript==
var autosubmit = false;
function _rate (i) {
$(':radio').eq(i).click();
if (autosubmit) {
$(':submit').click();
}
}
$(document).keydown(function (e) {
switch (e.which) {
case 49: case 97: // 1, Numpad 1
_rate(0);
break;
case 50: case 98: // 2, Numpad 2
_rate(1);
break;
case 51: case 99: // 3, Numpad 3
_rate(2);
break;
case 52: case 100: // 4, Numpad 4
_rate(3);
break;
case 53: case 101: // 5, Numpad 5
_rate(4);
break;
case 13: // Enter
$(':submit').click();
break;
}
});