From 18fcdbb809149908722a1a1541f1dc0671d3f995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Andreas=20Nilsen?= Date: Mon, 19 Aug 2024 09:10:38 +0200 Subject: [PATCH] added support for nynorsk and added update url --- yr.user.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/yr.user.js b/yr.user.js index bcc4dd8..9551cbb 100644 --- a/yr.user.js +++ b/yr.user.js @@ -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() { @@ -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."); }