Skip to content

Commit

Permalink
added support for nynorsk and added update url
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Aug 19, 2024
1 parent ea28e63 commit 18fcdbb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion yr.user.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// ==UserScript==
// @name YR Hotkeys
// @namespace http://tampermonkey.net/
// @version 1.0
// @version 1.1
// @description Hotkeys 'alt+l', 'alt+r', or 'alt+v' for yr.no
// @author Your Name
// @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
// ==/UserScript==

(function() {
Expand Down Expand Up @@ -44,6 +46,15 @@
} else if (event.key === 'v') {
view = `forecast/daily-table`;
}
} else if ($match[1] === 'nn') {
console.log("This is the Nynorsk site.");
if (event.key === 'l') {
view = `21-dagarsvarsel`;
} else if (event.key === 'r') {
view = `kart/radar`;
} else if (event.key === 'v') {
view = `vêrvarsel/dagleg-tabell`;
}
} else {
console.log("This is another language site.");
}
Expand Down

0 comments on commit 18fcdbb

Please sign in to comment.