canvas navigator

navigate left and right using arrow keys in canvas

Verze ze dne 04. 12. 2022. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         canvas navigator
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  navigate left and right using arrow keys in canvas
// @author       icycoldveins
// @icon         none
// @grant        none
// @license     MIT
// @match      *://*.instructure.com/*
// ==/UserScript==
(function () {
  "use strict";

  // detect if text has Previos  or Next
  // if yes, click it
  // if no, do nothing
  //using left and right arrow keys
  //   aria-label="Previous Module Item"
  document.addEventListener("keydown", function (event) {
    if (event.key == "ArrowLeft") {
      if (document.querySelector("[aria-label='Previous Module Item']")) {
        document.querySelector("[aria-label='Previous Module Item']").click();
        // Previous Module Item - opens in new window

      }else if(document.querySelector("[aria-label='Previous Module Item - opens in new window']"))
      {
        document.querySelector("[aria-label='Previous Module Item - opens in new window']").click();
      }
    }
    if (event.key == "ArrowRight") {
      if (document.querySelector("[aria-label='Next Module Item']")) {
        document.querySelector("[aria-label='Next Module Item']").click();
      }
      else if(document.querySelector("[aria-label='Next Module Item - opens in new window']"))
      {
        document.querySelector("[aria-label='Next Module Item - opens in new window']").click();
      }
    }
    if (event.key == "s" && event.metaKey && event.shiftKey) {
      // download the file
      document.querySelector("[download='true']").click();
    }
  });
})();