Skip to content

Instantly share code, notes, and snippets.

@prednaz
Created August 2, 2021 19:59
Show Gist options
  • Save prednaz/fdbb1e156b53986fe9c1725b38b3a786 to your computer and use it in GitHub Desktop.
Save prednaz/fdbb1e156b53986fe9c1725b38b3a786 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name htwk_english
// @match https://webcourses.htwk-leipzig.de/tt/index.php?*
// @require https://code.jquery.com/jquery-3.5.1.min.js
// @grant none
// ==/UserScript==
$("input[type='radio']").eq(0).trigger("focus");
// https://api.jquery.com/on
// https://api.jquery.com/category/events/event-object
$(document).on(
"keydown",
(event) =>
{
if (event.which === 13) { // enter
$(".term #input[type='text']").val($("#trainer_head").text());
$("input.button[name='solve'], #button_next").trigger("click");
}
}
);
// $(document).on(
// "keydown",
// (event) =>
// {
// if (event.which === 80) { // p
// $("div.mejs-playpause-button > button").trigger("click");
// }
// }
// );
$(document).on("keydown", (event) => {console.log(event.which);});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment