Skip to content

Instantly share code, notes, and snippets.

@xxdavid
Last active June 7, 2018 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxdavid/9f88f4d249349b91b38dc16636823e88 to your computer and use it in GitHub Desktop.
Save xxdavid/9f88f4d249349b91b38dc16636823e88 to your computer and use it in GitHub Desktop.
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

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