From 479a682c969126ad344221a9991a989219701ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Andreas=20Nilsen?= Date: Wed, 6 Aug 2025 12:09:24 +0200 Subject: [PATCH 1/3] edited silly description --- bas-search.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bas-search.user.js b/bas-search.user.js index 90382d2..595b3b0 100644 --- a/bas-search.user.js +++ b/bas-search.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name BAS Quick Search // @namespace http://tampermonkey.net/ -// @version 1.7.1 -// @description Enhanced search with Ctrl+Shift+F hotkey, auto-sizing dropdown tab menu, and keyboard navigation. Supports group search with "g:" prefix and accounts with no prefix or "a:" prefix. Navigate tabs with Ctrl+Arrow keys. Navigate search results with arrow keys. Improved focus management with Escape key. +// @version 1.7.2 +// @description Quick search using `Ctrl` + `Shift` + `F` hotkey, group search with "g:" prefix. Navigate tabs with Ctrl+ Left/Right keys. Navigate search results with up and down keys. // @author Øyvind Nilsen (on@ntnu.no) // @match https://bas.ntnu.no/* // @grant none From a3bbff8ffcdcd29a87d563d846e03253427ac0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Andreas=20Nilsen?= Date: Wed, 6 Aug 2025 12:53:12 +0200 Subject: [PATCH 2/3] testing for mac --- bas-search.user.js | 10 +++++----- doc/bas-search.md | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bas-search.user.js b/bas-search.user.js index 595b3b0..7538000 100644 --- a/bas-search.user.js +++ b/bas-search.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name BAS Quick Search // @namespace http://tampermonkey.net/ -// @version 1.7.2 -// @description Quick search using `Ctrl` + `Shift` + `F` hotkey, group search with "g:" prefix. Navigate tabs with Ctrl+ Left/Right keys. Navigate search results with up and down keys. +// @version 1.7.3 +// @description Quick search using `Ctrl` + `Shift` + `F` hotkey, group search with "g:" prefix. Navigate tabs with Ctrl + Left/Right keys. Navigate search results with up and down keys. On Mac, use MetaKey instead of Ctrl. // @author Øyvind Nilsen (on@ntnu.no) // @match https://bas.ntnu.no/* // @grant none @@ -267,9 +267,9 @@ }, 500); // Global keyboard event handlers - document.addEventListener('keydown', function(event) { + document.addEventListener('keydown', function(event) { // Show search box on Ctrl+Shift+F - if (event.ctrlKey && event.shiftKey && event.code === 'KeyF') { + if (((event.ctrlKey) || (event.metaKey)) && event.shiftKey && event.code === 'KeyF') { event.preventDefault(); showSearchInterface(); return; @@ -308,7 +308,7 @@ } // Tab navigation with Ctrl + Arrow keys (when search is not visible) - if (event.ctrlKey && !event.altKey && !event.shiftKey && searchContainer.style.display === 'none') { + if (((event.ctrlKey) || (event.metaKey)) && !event.altKey && !event.shiftKey && searchContainer.style.display === 'none') { if (event.code === 'ArrowRight') { event.preventDefault(); navigateTab('next'); diff --git a/doc/bas-search.md b/doc/bas-search.md index 1937bf9..5d036e5 100644 --- a/doc/bas-search.md +++ b/doc/bas-search.md @@ -1,7 +1,9 @@ #### Feaures: - Press `Ctrl` + `Alt` + `F` to open the search box/menu. Use `↑` and `↓` to navigate. And press `Enter` to select. + - For group search, use the prefix `g:` followed by the group name (e.g., `g:groupname`) - In the search result pages, use `↑` and `↓` to navigate through the results. And press `Enter` to open the selected result. - Press `Ctrl` + `←` / `→` to navigate to the next/previous tab. - -#### Video -![Search0 GIF](bas-search-lowres.gif) \ No newline at end of file + - On the login page, the username field is automatically focused. + +#### Video: +![Search GIF](bas-search-lowres.gif) \ No newline at end of file From e2d286de4eb785070934a72180627c1f9d4891e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Andreas=20Nilsen?= Date: Thu, 7 Aug 2025 07:32:07 +0200 Subject: [PATCH 3/3] rollback --- bas-search.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bas-search.user.js b/bas-search.user.js index 7538000..738f984 100644 --- a/bas-search.user.js +++ b/bas-search.user.js @@ -2,7 +2,7 @@ // @name BAS Quick Search // @namespace http://tampermonkey.net/ // @version 1.7.3 -// @description Quick search using `Ctrl` + `Shift` + `F` hotkey, group search with "g:" prefix. Navigate tabs with Ctrl + Left/Right keys. Navigate search results with up and down keys. On Mac, use MetaKey instead of Ctrl. +// @description Quick search using `Ctrl` + `Shift` + `F` hotkey, group search with "g:" prefix. Navigate tabs with Ctrl + Left/Right keys. Navigate search results with up and down keys. // @author Øyvind Nilsen (on@ntnu.no) // @match https://bas.ntnu.no/* // @grant none @@ -269,7 +269,7 @@ // Global keyboard event handlers document.addEventListener('keydown', function(event) { // Show search box on Ctrl+Shift+F - if (((event.ctrlKey) || (event.metaKey)) && event.shiftKey && event.code === 'KeyF') { + if (event.ctrlKey && event.shiftKey && event.code === 'KeyF') { event.preventDefault(); showSearchInterface(); return; @@ -308,7 +308,7 @@ } // Tab navigation with Ctrl + Arrow keys (when search is not visible) - if (((event.ctrlKey) || (event.metaKey)) && !event.altKey && !event.shiftKey && searchContainer.style.display === 'none') { + if (event.ctrlKey && !event.altKey && !event.shiftKey && searchContainer.style.display === 'none') { if (event.code === 'ArrowRight') { event.preventDefault(); navigateTab('next');