Skip to content

Commit

Permalink
yr.user.js is moving to a new home at github.com since it is not a sc…
Browse files Browse the repository at this point in the history
…ript for a ntnu page
  • Loading branch information
Øyvind Nilsen committed Aug 29, 2024
1 parent 08ff677 commit 9178a40
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions yr.user.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// ==UserScript==
// @name YR.no - Hotkeys
// @namespace https://git.ntnu.no/M365-Drift/MonkeyMagic/
// @version 1.3.5
// @version 1.3.7
// @description Navigate the yr.no navbar using `Ctrl` + `←`/`→`. Navigate to 21-day forecast, radar map or daily table view using `Alt` + `L`, `Alt` + `R` or `Alt` + `V`. Show a menu to navigate through favorite locations with `Ctrl` + `Shift` + `F`.
// @author Øyvind Nilsen (on@ntnu.no)
// @match https://www.yr.no/*
// @grant none
// @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/yr.user.js
// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/yr.user.js
// @updateURL https://raw.githubusercontent.com/turbosnute/yr-plus/main/yr.user.js
// @downloadURL https://raw.githubusercontent.com/turbosnute/yr-plus/main/yr.user.js
// ==/UserScript==

(function() {
Expand Down Expand Up @@ -122,6 +122,7 @@
selectedIndex = (selectedIndex < items.length - 1) ? selectedIndex + 1 : 0;
highlightSelected();
} else if (event.key === 'Enter') {
event.preventDefault(); // Prevent default scrolling behavior
const selectedItem = items[selectedIndex];
const locationId = selectedItem.getAttribute('data-id');
var tablePath = translations['daily-table'][lang_code];
Expand Down

0 comments on commit 9178a40

Please sign in to comment.