edx helper

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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();
        }

    });
});