Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FI Drill keybindings
// ==UserScript==
// @name FI Drill keybindings
// @author David Pavlík
// @match https://kabell.sk/fi_muni_drill/**
// @grant none
// ==/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)',
'q': 'body > div.container.main > div > div.col-sm-9 > div:nth-child(3) a:nth-child(1)',
'w': 'body > div.container.main > div > div.col-sm-9 > div:nth-child(3) a:nth-child(2)',
'e': 'body > div.container.main > div > div.col-sm-9 > div:nth-child(3) a:nth-child(3)',
' ': 'body > div.container.main > div > div.col-sm-9 > div:nth-child(4) > div:nth-child(3) > a'
}
const selector = bindings[event.key]
const element = $(selector)[0]
element.click()
})
@BorysekOndrej
Copy link

BorysekOndrej commented May 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment