Zing on Mturk

Are these receipts the same Hot keys

当前为 2014-07-12 提交的版本,查看 最新版本

// ==UserScript==
// @name           Zing on Mturk
// @version        0.1
// @description    Are these receipts the same Hot keys
// @author         Cristo
// @include        https://backend.ibotta.com/duplicate_receipt_moderation*
// @copyright      2012+, You
// @namespace https://greasyfork.org/users/1973
// ==/UserScript==

//Key A and 1 on the number pad for No, Key S and 2 on the number pad for Yes, auto submits after answer
var contain = document.getElementsByClassName("container")[0];
contain.tabIndex = "0";
contain.focus();
var no = document.getElementById("duplicatefalse");
var yes = document.getElementById("duplicatetrue");
var sub = document.getElementsByClassName("btn")[0];
document.addEventListener( "keydown", kas, false);
function kas(i) {
    if (i.keyCode == 65 || i.keyCode == 97) { //A or #1
        no.click();
        sub.click();
    }
    if (i.keyCode == 83 || i.keyCode == 98) { //S or #2
        yes.click();
        sub.click();
    }
}