edx helper

some keybindings for edx: next, previous, play/pause

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name       edx helper
// @namespace  http://andreabisognin.it
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version    0.37
// @description  some keybindings for edx: next, previous, play/pause
// @match      https://courses.edx.org/courses/*
// @copyright  2014+, Andrea Bisognin
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function()
{
    jQuery(document).keydown(function(e){
        if(e.keyCode == 78) { 
            unsafeWindow.$("li[class='next']")[1].children[0].click();
			
        }
        if(e.keyCode == 80) {
            unsafeWindow.$("li[class='prev']")[1].children[0].click();
        }
        if (e.keyCode == 84) {
            unsafeWindow.$("a[class^='video_control']").click();
        }
        if (e.keyCode == 72) {
            unsafeWindow.$("a[class^='quality-control']").click();
        }
        if (e.keyCode == 67) {
            unsafeWindow.$("a[class$='subtitles']").click();
        }
        if (e.keyCode == 77) {
            unsafeWindow.$("a[class$='fullscreen']").click();
        }

    });
});