Skip to content

Instantly share code, notes, and snippets.

@simonmysun
Last active August 29, 2015 14:17
Show Gist options
  • Save simonmysun/4b5712a69c5602feee1f to your computer and use it in GitHub Desktop.
Save simonmysun/4b5712a69c5602feee1f to your computer and use it in GitHub Desktop.
better keyboard shortcuts used for shanbay.com
// ==UserScript==
// @name sb.js
// @namespace http:/i.makelove.expert/
// @version 0.1.2
// @description better keyboard shortcuts used for shanbay.com
// @author simonmysun
// @match http://www.shanbay.com/bdc/review/*
// @grant none
// ==/UserScript==
sbContinue = function() {
$('.continue').click();
};
sbPos = function() {
$('.known').click();
};
sbNeg = function() {
$('.unknown').click();
$('.btn-forget').click();
};
sbPass = function() {
$('[title="太简单"]').click();
};
$(document).keyup(function(e) {
switch(e.keyCode) {
case 74: //j
sbPos();
break;
case 73: // i
sbNeg();
break;
case 89: // y
sbNeg();
break;
case 55: // 7, and 9 by default
sbPass();
break;
case 82: // r
sbContinue();
break;
case 219: // [{
sbContinue();
break;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment