refactor: finish UX refactor and move events storage

This commit is contained in:
Andy Burke 2025-09-12 09:24:22 -07:00
parent 4347d20263
commit f760156651
10 changed files with 269 additions and 27 deletions

24
public/js/external/fuzzysearch.js vendored Normal file
View file

@ -0,0 +1,24 @@
"use strict";
function fuzzysearch(needle, haystack) {
var hlen = haystack.length;
var nlen = needle.length;
if (nlen > hlen) {
return false;
}
if (nlen === hlen) {
return needle === haystack;
}
outer: for (var i = 0, j = 0; i < nlen; i++) {
var nch = needle.charCodeAt(i);
while (j < hlen) {
if (haystack.charCodeAt(j++) === nch) {
continue outer;
}
}
return false;
}
return true;
}
module.exports = fuzzysearch;

View file

@ -0,0 +1,18 @@
const NOTIFICATIONS = {
send: function (message, options = {}) {
if (!Notification || Notification.permission !== "granted") {
return;
}
const notification = new Notification(message, options);
return notification;
},
request_permissions: function () {
if (Notification && Notification.permission === "granted") {
return;
}
Notification.requestPermission();
},
};