-
-
Save BorysekOndrej/26cd56d63f562ca46eadf489e46f3994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FI Drill keybindings | |
// @author David Pavlík | |
// @match https://kabell.sk/fi_muni_drill/** | |
// @grant none | |
// @require https://code.jquery.com/jquery-3.3.1.slim.min.js | |
// ==/UserScript== | |
document.addEventListener('keypress', event => { | |
const bindings = { | |
'd': 'body > div.container.main > div > div.col-sm-9 > div:nth-child(3) > div div:contains(ne)', | |
'k': 'body > div.container.main > div > div.col-sm-9 > div:nth-child(3) > div div:contains(ano)', | |
' ': 'body > div.container.main > div > div.col-sm-9 > div:nth-child(4) > div:nth-child(3) > a' | |
} | |
const selector = bindings[event.key]; | |
if(typeof selector !== "undefined"){ | |
const element = $(selector)[0]; | |
element.click(); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment