Skip to content

Commit

Permalink
added person search with prefix p:
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Sep 4, 2025
1 parent 8cb9c38 commit 36a1819
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bas-search.user.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// ==UserScript==
// @name BAS Quick Search
// @namespace http://tampermonkey.net/
// @version 1.7.6
// @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.7
// @description Quick search using `Ctrl` + `Shift` + `F` hotkey, group search with "g:" and person search with "p:" 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
Expand Down Expand Up @@ -446,6 +446,9 @@
if (searchQuery.toLowerCase().startsWith('g:')) {
const groupName = searchQuery.substring(2).trim();
url = `https://bas.ntnu.no/group/search/?name=${encodeURIComponent(groupName)}`;
} else if (searchQuery.toLowerCase().startsWith('p:')) {
const personName = searchQuery.substring(2).trim();
url = `https://bas.ntnu.no/person/search/?name=${encodeURIComponent(personName)}`;
} else {
const accountName = searchQuery.toLowerCase().startsWith('a:') ? searchQuery.substring(2).trim() : searchQuery;
url = `https://bas.ntnu.no/account/search/?name=${encodeURIComponent(accountName)}`;
Expand Down

0 comments on commit 36a1819

Please sign in to comment.