summaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-07-12 14:03:15 +0200
committerMartin Fischer <martin@push-f.com>2022-07-12 14:03:21 +0200
commit0a6ef3c70f9e86241a2c55aab8fcf0cf18fcf2fe (patch)
tree4c464466428f6e9dcf602024610d75f66d435e76 /script.js
parent73f331a6ba321a1cb72854d92ca2724c34cb210c (diff)
make ?author filter treat first letter as case-insensitive
Diffstat (limited to 'script.js')
-rw-r--r--script.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/script.js b/script.js
index 7de548c..b8edbb4 100644
--- a/script.js
+++ b/script.js
@@ -41,7 +41,12 @@ function display(proposals) {
const authorFilter = new URLSearchParams(location.search).get('author');
if (authorFilter) {
- display(proposals.filter(p => p.authors && p.authors.includes(authorFilter)));
+ // The first letter of MediaWiki usernames is case-insensitive.
+ const firstChar = authorFilter.charAt(0);
+ const rest = authorFilter.slice(1);
+ const lowercase = firstChar.toLowerCase() + rest;
+ const uppercase = firstChar.toUpperCase() + rest;
+ display(proposals.filter(p => p.authors && (p.authors.includes(lowercase) || p.authors.includes(uppercase))));
} else {
display(proposals);
}