···4646 const salt = Math.random().toString(36).substring(2, 8);
4747 const token = SparkMD5.hash(validPassword + salt);
48484949- // test
5049 state.api = new SubsonicAPI(validServerUrl, validUsername, token, salt);
5150 await state.api.ping();
5251···126125 creds.token,
127126 creds.salt,
128127 );
129129- // test credentials are still valid
130128 await state.api.ping();
131129 await initializeApp();
132130 } catch (error) {
-3
src/js/contextmenu.js
···48484949// display context menu with given items at position
5050function showContextMenu(x, y, items) {
5151- // close existing menu
5251 removeContextMenuDisplay();
53525453 contextMenuEl = createElement("div", {
···8483 // NOTE: if we ever add context menus to library items, we'll want to make this dynamic but i think this is ok for now
8584 getMainEl().appendChild(contextMenuEl);
86858787- // position menu
8886 const rect = contextMenuEl.getBoundingClientRect();
8987 contextMenuEl.style.left = `${Math.max(0, Math.min(x, window.innerWidth - rect.width))}px`;
9088 contextMenuEl.style.top = `${Math.max(0, Math.min(y, window.innerHeight - rect.height))}px`;
···138136 };
139137 document.addEventListener("click", currentClickHandler, { capture: true });
140138141141- // prevent default browser context menu
142139 currentSystemContextmenuEventHandler = (e) => {
143140 if (
144141 !contextMenuEl?.contains(e.target) &&
-7
src/js/input.js
···11// most keyboard and input control
22// TODO: kinda a monolith file, maybe should split into separate modules later? idk :p
3344-// tab order
55-64// selector for all interactive elements that should be non-tabbable
75const INTERACTIVE_SELECTOR =
86 "button, a, input, select, textarea, [role='button'], tr, li, ul, .section-toggle";
···5957}
60586159let tabOrderObserver;
6262-6363-// queue navigation
64606561// navigate queue selection with arrow keys
6662const navigateSelection = (offset, extend = false) => {
···157153 },
158154};
159155160160-// keyboard shortcuts
161161-162162-// setup keyboard shortcuts
163156function setupKeyboardShortcuts() {
164157 // setup keyboard help close button
165158 const closeKeyboardHelpBtn = document.getElementById(